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

Embed alpha value to gif->canvas #20

Open
sam20908 opened this issue Dec 25, 2021 · 0 comments
Open

Embed alpha value to gif->canvas #20

sam20908 opened this issue Dec 25, 2021 · 0 comments

Comments

@sam20908
Copy link

Hello, I am using this library to load GIFs to pass frames to SFML. As the title says, if the alpha value exists in gif->canvas, then I can just directly make SFML use the data within gif->canvas and avoid this intermediate step:

          auto color = gif->canvas;
          auto buf = frame_buf;
          for (int i = 0; i < gif->height; ++i) {
            for (int j = 0; j < gif->width; ++j, color += 3, buf += 4) {
              buf[0] = color[0];
              buf[1] = color[1];
              buf[2] = color[2];
              buf[3] = 255 * !gd_is_bgcolor(gif, color);
            }
          }
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

1 participant