width property
The structure of a Bitmap Buffer is defined below:
Reference Documentation: https://en.wikipedia.org/wiki/BMP_file_format
bitmap file header : (14 bytes)
WORD bfType; // 0-1 'B' 'M'
DWORD bfSize; // 2-5 Size of File (headers + data) - little endian
WORD bfReserved1; // 6-7 0 , 0
WORD bfReserved2; // 8-9 0 , 0
DWORD bfOffBits; // 10-13 54
bitmap info header : (40 bytes)
DWORD biSize; // 14-17 40
LONG biWidth; // 18-21 width of image
LONG biHeight; // 22-25 height of image
WORD biPlanes; // 26-27 # of planes = 1
WORD biBitCount; // 28-29 # of bits per pixel
DWORD biCompression; // 30-33
DWORD biSizeImage; // 34-37 size of bitmap image (# of pixels * bytes per pixel)
LONG biXPelsPerMeter; // 38-41 the horizontal resolution of the image. (pixel per metre, signed integer) (200 dpi = 7874)
LONG biYPelsPerMeter; // 42-45 the vertical resolution of the image. (pixel per metre, signed integer) (200 dpi = 7874)
DWORD biClrUsed; // 46-49 the number of colors in the color palette, or 0 to default to 2n
DWORD biClrImportant; // 50-53 the number of important colors used, or 0 when every color is important; generally ignored
bitmap data : (size of bitmap image)
BYTE bdData // ...
data for image is ordered from bottom of image to top of image.
Row N
Row N-1
...
...
Row 2
Row 1
Width of bitmap image in pixels
Implementation
/// Width of bitmap image in pixels
final int width;