Skip to content

Commit

Permalink
Explain the n vs. req_n vs. alpha shenanigans in draw_image
Browse files Browse the repository at this point in the history
So I don't have to figure it out again later ;p.
  • Loading branch information
NiLuJe committed May 2, 2024
1 parent 8924cf2 commit 39a5071
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fbink.c
Original file line number Diff line number Diff line change
Expand Up @@ -10395,6 +10395,10 @@ static int
w,
h);
// Warn if there's an alpha channel, because it's usually a bit more expensive to handle...
// NOTE: We look at the *original* pixel format, not whatever we ended up passing to draw_image,
// because we know that when we had to add an alpha layer for compatibility with the framebuffer
// pixel format (i.e., a 24bpp RGB image to a 32bpp RGBA fb), it's actually fully opaque,
// so we don't actually care about that component, it's just essentially padding for addressing purposes.
if (n == 2 || n == 4) {
img_has_alpha = true;
if (fbink_cfg->ignore_alpha) {
Expand Down

0 comments on commit 39a5071

Please sign in to comment.