46#define BI_RGB_TOPDOWN 0x10
273 return m_bmiHeader->biHeight < 0;
277#define GetAdjustedStride(p_bitmap) \
278 (p_bitmap->IsTopDown() ? p_bitmap->AlignToFourByte(p_bitmap->GetBmiWidth()) \
279 : -p_bitmap->AlignToFourByte(p_bitmap->GetBmiWidth()))
290 if (m_bmiHeader->biCompression == BI_RGB) {
291 return m_data + p_left +
323 return m_bmiHeader->biHeight > 0;
336 BITMAPINFOHEADER* m_bmiHeader;
337 RGBQUAD* m_paletteData;
[AI] Represents an 8bpp or high color device-independent bitmap (DIB) and provides operations for bit...
MxBool IsTopDown() const
[AI] Checks if the bitmap is stored in top-down scanline order.
virtual MxResult StretchBits(HDC p_hdc, MxS32 p_xSrc, MxS32 p_ySrc, MxS32 p_xDest, MxS32 p_yDest, MxS32 p_destWidth, MxS32 p_destHeight)
[AI] Draws (blits) a scaled region of the bitmap to a Windows device context.
MxLong GetBmiStride() const
[AI] Computes the stride (bytes per scanline, aligned to 4 bytes).
MxBITMAPINFO * GetBitmapInfo() const
[AI] Retrieves the pointer to the underlying MxBITMAPINFO struct (header and palette).
virtual MxS32 VTable0x28(MxS32)
[AI] Placeholder or unused virtual; always returns -1.
virtual MxResult SetBitDepth(MxBool)
[AI] Changes the bit depth mode for the bitmap (palettized or high color).
virtual MxPalette * CreatePalette()
[AI] Allocates or clones the current palette for the bitmap.
MxLong AlignToFourByte(MxLong p_value) const
[AI] Aligns a value up to the nearest multiple of four (stride alignment for DIBs).
MxBitmap()
[AI] Constructs an empty MxBitmap instance, initializing all data pointers to NULL.
static MxLong HeightAbs(MxLong p_value)
[AI] Returns the absolute value of the input height (for DIBs).
virtual MxResult ImportBitmap(MxBitmap *p_bitmap)
[AI] Imports the contents of another bitmap into this bitmap, allocating new storage and copying meta...
MxLong GetBmiHeightAbs() const
[AI] Returns the absolute value of the bitmap's height.
virtual void BitBltTransparent(MxBitmap *p_src, MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom, MxS32 p_width, MxS32 p_height)
[AI] Copies a rectangular region from a source bitmap to this bitmap, but skips "transparent" (index ...
~MxBitmap() override
[AI] Frees allocated memory for bitmap info, pixel data, and palette.
MxLong GetBmiHeight() const
[AI] Fetches the height (could be negative if top-down) of the bitmap.
virtual MxResult SetSize(MxS32 p_width, MxS32 p_height, MxPalette *p_palette, MxBool)
[AI] Allocates the bitmap to a specified width and height, attaches a palette, and configures bit dep...
virtual MxLong Read(const char *p_filename)
[AI] Loads a bitmap from a file given its filename.
virtual MxResult LoadFile(HANDLE p_handle)
[AI] Loads a bitmap from a file handle, populating header, palette data and pixel data.
MxU8 * GetStart(MxS32 p_left, MxS32 p_top) const
[AI] Returns a pointer to the starting address of the pixel data at the specified coordinates.
virtual void ImportPalette(MxPalette *p_palette)
[AI] Attaches or clones a palette for the bitmap and updates color data as needed.
MxLong GetDataSize() const
[AI] Computes the total size in bytes for the bitmap's pixel data buffer.
BITMAPINFOHEADER * GetBmiHeader() const
[AI] Returns a pointer to the underlying BITMAPINFOHEADER.
virtual void BitBlt(MxBitmap *p_src, MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom, MxS32 p_width, MxS32 p_height)
[AI] Copies a rectangular area from a source bitmap into this bitmap (BitBlt).
MxLong GetBmiWidth() const
[AI] Fetches the width (in pixels) encoded in this bitmap's header.
virtual MxResult ImportBitmapInfo(MxBITMAPINFO *p_info)
[AI] Imports bitmap header/palette info (but not pixel data) from the given info block.
MxU8 * GetImage() const
[AI] Retrieves the pointer to the image pixel data.
[AI] Base virtual class for all Mindscape engine (Mx) objects.
[AI] Encapsulates a DirectDraw 8-bit (256 color) palette for use with DirectX rendering.
#define BI_RGB_TOPDOWN
[AI] Non-standard biCompression value indicating top-down row order for uncompressed bitmaps.
[AI] Represents a bitmap information header plus a 256-color palette, matching the layout for 8-bit D...
static MxU32 Size()
[AI] Returns the size of this structure in bytes (0x428 for 256 colors).
RGBQUAD m_bmiColors[256]
[AI] 256-entry color palette for 8bpp images.
BITMAPINFOHEADER m_bmiHeader
[AI] Standard DIB bitmap header (size 0x28 bytes).