In depth knowledge of Meta-Structures and variables #41
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
Good job @sabyasachi07 it will be really helpful for us while writing code in |
Beta Was this translation helpful? Give feedback.
-
Actual calculation for bfOffBits = sizeof (BITMAPFILEHEADER) + NumberOfRGBTRIPLE * sizeof (RGBTRIPLE) + sizeof (BITMAPINFOHEADER); So looking into our 24bit image, it looks like this: bfOffBits = 14 + 0 * 4 + 40;
// Prints 54
std::cout << bfOffBits;
SOURCE: https://chowdera.com/2022/04/202204170049352833.html |
Beta Was this translation helpful? Give feedback.
Actual calculation for
bfOffBits
ofBITMAPFILEHEADER
,So looking into our 24bit image, it looks like this:
RGBTRIPLE
variable is acolor table
. It is commonly either16 colors or 256 colors
, depending on how the file is specified inBITMAPINFOHEADER’s biBitCount
.In our case, it does not exist in the file because we are using a
24-bit bitmap
which is2^24 = 16777216
colors and doesn't fit inRGBTRIPLE
and thebmiColors
member of BITMAPINFO is NULL.Each
3-byte triplet
in the bitmap array represents the relativ…