Skip to content
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

Image not drawn correctly. #4

Open
THZthz opened this issue Oct 27, 2023 · 2 comments
Open

Image not drawn correctly. #4

THZthz opened this issue Oct 27, 2023 · 2 comments
Assignees

Comments

@THZthz
Copy link

THZthz commented Oct 27, 2023

I write a simple program in c++ to quickly dive into Blaze. But the image I got is broken.

Here is how it looks like:

Tiger_out

I guess something was wrong with the multi-threading, but I can't figure out why.

Further information:

Cmakelists:

image

Load vectorimage:

// static VectorImage g_vectorImage;
g_vectorImage.Parse(reinterpret_cast<const uint8 *>(buffer), size);

Update image:

int fw, fh;
glfwGetFramebufferSize(window, &fw, &fh); // Fill the window.
g_image.UpdateSize({fw, fh});
g_image.ClearImage();
g_image.DrawImage(g_vectorImage, Matrix::Identity);

I use stbi_write_png to save the output:

// static DestinationImage<TileDescriptor_16x8> g_image;
const int imgw = g_image.GetImageWidth();
const int imgh = g_image.GetImageHeight();
const uint8_t *data = g_image.GetImageData();

stbi_write_png("Tiger_out.png", imgw, imgh, 4, data, 4 * imgw);
@aurimasg aurimasg self-assigned this Oct 27, 2023
@aurimasg
Copy link
Owner

@THZthz Which compiler and OS do you use?

@THZthz
Copy link
Author

THZthz commented Nov 26, 2023

gcc 13.1.0 windows
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants