-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
png render problem #155
Comments
Given the code you provided, I have no problem with that image. The first rendered image you provide seems to be clipped. Can you provide the code which clip the drawing? Here is an example of an image painted in a circle with a stroked border:
|
with the following code, I can reproduce the same result:
I'll make further analysis and come back to you with more info... |
|
all code here from the file: vkvg/tests/img_surf.c, the problem still exists. `#include "test.h" const char* imgPath = "E:/vkvg/tests/data/miroir.png"; void paint () {
}
}
}
}
} static float angle = 0;
}
} void paint_pattern () { void test(){
} int main(int argc, char *argv[]) {
} |
Trying with compilation option -DVKVG_PREMULT_ALPHA=false (disabling alpha pre-multiplication, the white border disappears. It would surely be a good improvement to provide alpha premult handling for image loading api. The quick solution for now is to load an image with pre multiplied alpha encoding. |
Usually, when image has alpha-premultiplied pixels, there is a loss of information. So when writing images to disk, it is better to have it without alpha premultiplication. |
@ #156 task created. |
I want to draw multiple pictures. I've enabled the VK_BLEND_FACTOR_SRC_ALPHA & VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA. These pictures together form an image. Later, I want to draw some text or circles at certain positions on this image. However, after I finish drawing the text, the image part disappears. How can I achieve the desired effect using your functions?
} //-------------------------------------- void paint () {
} |
Below is my OpenGL code. I want to migrate the functionality of this code to Vulkan. #include class GLWidget : public QOpenGLWidget, protected QOpenGLFunctions
protected:
private:
}; #endif // ` |
I'm deeply focused on another project of mine, sorry but I will take some time to reply, I will try to give you the big picture before Tuesday. |
code:
const char* imgPath = "E:/vkvg/tests/data/miroir.png";
const char* imgPath2 = "E:/vkvg/tests/data/filled.png";
void paint () {
VkvgContext ctx = vkvg_create(surf);
vkvg_set_line_width(ctx, 1.0); // 设置线宽
vkvg_set_line_cap(ctx, VKVG_LINE_CAP_ROUND); // 设置线条端点样式
vkvg_set_line_join(ctx, VKVG_LINE_JOIN_ROUND); // 设置线条连接样式
}
//----------
sample project: img_surf
configure code:
//-------------------------------
static bool paused = false;
static bool offscreen = false;
static bool threadAware = false;
static VkSampleCountFlags samples = VK_SAMPLE_COUNT_64_BIT;
static VkPhysicalDeviceType preferedPhysicalDeviceType = VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU;
static vk_engine_t* e;
static char* saveToPng = NULL;
The text was updated successfully, but these errors were encountered: