Isle
|
[AI] Represents an 8bpp or high color device-independent bitmap (DIB) and provides operations for bitmap loading, manipulation, and palette management. More...
#include <mxbitmap.h>
Public Member Functions | |
MxBitmap () | |
[AI] Constructs an empty MxBitmap instance, initializing all data pointers to NULL. More... | |
~MxBitmap () override | |
[AI] Frees allocated memory for bitmap info, pixel data, and palette. More... | |
virtual MxResult | ImportBitmap (MxBitmap *p_bitmap) |
[AI] Imports the contents of another bitmap into this bitmap, allocating new storage and copying metadata and pixel data. More... | |
virtual MxResult | ImportBitmapInfo (MxBITMAPINFO *p_info) |
[AI] Imports bitmap header/palette info (but not pixel data) from the given info block. More... | |
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 depth. More... | |
virtual MxResult | LoadFile (HANDLE p_handle) |
[AI] Loads a bitmap from a file handle, populating header, palette data and pixel data. More... | |
virtual MxLong | Read (const char *p_filename) |
[AI] Loads a bitmap from a file given its filename. More... | |
virtual MxS32 | VTable0x28 (MxS32) |
[AI] Placeholder or unused virtual; always returns -1. More... | |
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). More... | |
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 0) pixels. More... | |
virtual MxPalette * | CreatePalette () |
[AI] Allocates or clones the current palette for the bitmap. More... | |
virtual void | ImportPalette (MxPalette *p_palette) |
[AI] Attaches or clones a palette for the bitmap and updates color data as needed. More... | |
virtual MxResult | SetBitDepth (MxBool) |
[AI] Changes the bit depth mode for the bitmap (palettized or high color). More... | |
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. More... | |
MxLong | AlignToFourByte (MxLong p_value) const |
[AI] Aligns a value up to the nearest multiple of four (stride alignment for DIBs). More... | |
BITMAPINFOHEADER * | GetBmiHeader () const |
[AI] Returns a pointer to the underlying BITMAPINFOHEADER. More... | |
MxLong | GetBmiWidth () const |
[AI] Fetches the width (in pixels) encoded in this bitmap's header. More... | |
MxLong | GetBmiStride () const |
[AI] Computes the stride (bytes per scanline, aligned to 4 bytes). More... | |
MxLong | GetBmiHeight () const |
[AI] Fetches the height (could be negative if top-down) of the bitmap. More... | |
MxLong | GetBmiHeightAbs () const |
[AI] Returns the absolute value of the bitmap's height. More... | |
MxU8 * | GetImage () const |
[AI] Retrieves the pointer to the image pixel data. More... | |
MxBITMAPINFO * | GetBitmapInfo () const |
[AI] Retrieves the pointer to the underlying MxBITMAPINFO struct (header and palette). More... | |
MxLong | GetDataSize () const |
[AI] Computes the total size in bytes for the bitmap's pixel data buffer. More... | |
MxBool | IsTopDown () const |
[AI] Checks if the bitmap is stored in top-down scanline order. More... | |
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. More... | |
![]() | |
MxCore () | |
[AI] Constructs a new MxCore object and assigns it a unique id. More... | |
virtual | ~MxCore () |
[AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More... | |
virtual MxLong | Notify (MxParam &p_param) |
[AI] Virtual callback notification mechanism. More... | |
virtual MxResult | Tickle () |
[AI] Called by tickle managers to allow the object to update itself. More... | |
virtual const char * | ClassName () const |
[AI] Returns the runtime class name of this object. More... | |
virtual MxBool | IsA (const char *p_name) const |
[AI] Checks whether this object's class type or parents match the given name. More... | |
MxU32 | GetId () |
[AI] Gets the unique (per-process) id assigned to this object instance. More... | |
Static Public Member Functions | |
static MxLong | HeightAbs (MxLong p_value) |
[AI] Returns the absolute value of the input height (for DIBs). More... | |
[AI] Represents an 8bpp or high color device-independent bitmap (DIB) and provides operations for bitmap loading, manipulation, and palette management.
[AI] This class manages both the metadata (header and palette) and raw pixel data for a bitmap, supporting direct blitting, transparency, and palette operations for the LEGO Island engine.
The bitmap can be managed in either palettized or "high color" (truecolor) modes. It is primarily used for image resource management and 2D rendering, such as GUI assets or video frames.
Definition at line 55 of file mxbitmap.h.
MxBitmap::MxBitmap | ( | ) |
[AI] Constructs an empty MxBitmap instance, initializing all data pointers to NULL.
Definition at line 16 of file mxbitmap.cpp.
|
override |
[AI] Frees allocated memory for bitmap info, pixel data, and palette.
Definition at line 28 of file mxbitmap.cpp.
[AI] Aligns a value up to the nearest multiple of four (stride alignment for DIBs).
p_value | [AI] The input value to align (pixels/bytes). |
[AI] Used for scanline stride calculations in Win32 DIB format.
Definition at line 204 of file mxbitmap.h.
|
virtual |
[AI] Copies a rectangular area from a source bitmap into this bitmap (BitBlt).
p_src | [AI] Source bitmap. |
p_left | [AI] Source left pixel X position. |
p_top | [AI] Source top pixel Y position. |
p_right | [AI] Destination left pixel X position. |
p_bottom | [AI] Destination top pixel Y position. |
p_width | [AI] Width of rectangle to copy. |
p_height | [AI] Height of rectangle to copy. |
[AI] Performs a memory copy for each scanline, including proper stride handling and clipping.
Definition at line 267 of file mxbitmap.cpp.
|
virtual |
[AI] Copies a rectangular region from a source bitmap to this bitmap, but skips "transparent" (index 0) pixels.
p_src | [AI] Source bitmap. |
p_left | [AI] Source left pixel X position. |
p_top | [AI] Source top pixel Y position. |
p_right | [AI] Destination left pixel X position. |
p_bottom | [AI] Destination top pixel Y position. |
p_width | [AI] Width of rectangle to copy. |
p_height | [AI] Height of rectangle to copy. |
[AI] Used for drawing sprites/images with transparency by ignoring palette index 0.
Definition at line 306 of file mxbitmap.cpp.
|
virtual |
[AI] Allocates or clones the current palette for the bitmap.
[AI] Returns a palette copy depending on current color depth mode.
Definition at line 352 of file mxbitmap.cpp.
|
inline |
[AI] Retrieves the pointer to the underlying MxBITMAPINFO struct (header and palette).
Definition at line 254 of file mxbitmap.h.
|
inline |
[AI] Returns a pointer to the underlying BITMAPINFOHEADER.
Definition at line 218 of file mxbitmap.h.
|
inline |
[AI] Fetches the height (could be negative if top-down) of the bitmap.
Definition at line 236 of file mxbitmap.h.
|
inline |
[AI] Returns the absolute value of the bitmap's height.
Definition at line 242 of file mxbitmap.h.
|
inline |
[AI] Computes the stride (bytes per scanline, aligned to 4 bytes).
Definition at line 230 of file mxbitmap.h.
|
inline |
[AI] Fetches the width (in pixels) encoded in this bitmap's header.
Definition at line 224 of file mxbitmap.h.
|
inline |
[AI] Computes the total size in bytes for the bitmap's pixel data buffer.
Definition at line 260 of file mxbitmap.h.
|
inline |
[AI] Retrieves the pointer to the image pixel data.
Definition at line 248 of file mxbitmap.h.
[AI] Returns a pointer to the starting address of the pixel data at the specified coordinates.
p_left | [AI] X coordinate (column). |
p_top | [AI] Y coordinate (row). |
[AI] Takes into account DIB storage format (top-down or bottom-up).
Definition at line 288 of file mxbitmap.h.
[AI] Returns the absolute value of the input height (for DIBs).
p_value | [AI] The value (may be negative or positive). |
[AI] Used for supporting negative heights (top-down flag) in DIBs.
Definition at line 212 of file mxbitmap.h.
[AI] Imports the contents of another bitmap into this bitmap, allocating new storage and copying metadata and pixel data.
p_bitmap | [AI] Source bitmap to copy from. |
Definition at line 136 of file mxbitmap.cpp.
|
virtual |
[AI] Imports bitmap header/palette info (but not pixel data) from the given info block.
p_info | [AI] Source MxBITMAPINFO structure to import. |
Definition at line 98 of file mxbitmap.cpp.
|
virtual |
[AI] Attaches or clones a palette for the bitmap and updates color data as needed.
p_palette | [AI] Palette to import (will clone if high color). |
[AI] Behavior depends on current color depth mode (palettized or high color).
Definition at line 387 of file mxbitmap.cpp.
|
inline |
[AI] Checks if the bitmap is stored in top-down scanline order.
[AI] Uses the custom BI_RGB_TOPDOWN or negative height.
Definition at line 267 of file mxbitmap.h.
|
virtual |
[AI] Loads a bitmap from a file handle, populating header, palette data and pixel data.
p_handle | [AI] File handle (must be positioned at the start of a valid BMP file). |
Definition at line 202 of file mxbitmap.cpp.
|
virtual |
[AI] Loads a bitmap from a file given its filename.
p_filename | [AI] Path to the bitmap file. |
Definition at line 175 of file mxbitmap.cpp.
[AI] Changes the bit depth mode for the bitmap (palettized or high color).
[AI] | TRUE for high color, FALSE for palette mode. |
[AI] May allocate/reallocate a new palette if switching to high color.
Definition at line 404 of file mxbitmap.cpp.
|
virtual |
[AI] Allocates the bitmap to a specified width and height, attaches a palette, and configures bit depth.
p_width | [AI] Image width in pixels. |
p_height | [AI] Image height in pixels. |
p_palette | [AI] Palette to assign to this bitmap, or NULL for a default. |
[AI] | p_isHighColor Whether to use high color/truecolor (TRUE) or palettized (FALSE) format. |
Definition at line 43 of file mxbitmap.cpp.
|
virtual |
[AI] Draws (blits) a scaled region of the bitmap to a Windows device context.
p_hdc | [AI] Target device context handle. |
p_xSrc | [AI] Source X origin. |
p_ySrc | [AI] Source Y origin. |
p_xDest | [AI] Destination X origin. |
p_yDest | [AI] Destination Y origin. |
p_destWidth | [AI] Destination width (in pixels). |
p_destHeight | [AI] Destination height (in pixels). |
[AI] Handles flipping for bottom-up DIBs.
Definition at line 454 of file mxbitmap.cpp.
[AI] Placeholder or unused virtual; always returns -1.
[AI] | Unknown / unused argument. |
Definition at line 110 of file mxbitmap.h.