<--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../../aros.css' --->

ChunkyImage.mui

MUIA_ChunkyImage_Modulo

Function

Specify the source row stride in bytes.

Inputs

Initialize, set and get; LONG in the header, stored as UWORD. At
construction, omitted or stored 0xFFFF is replaced with the final stored
Width.

Notes

Modulo is the distance between row starts, not just the padding after a
row. Supply at least Width bytes and enough readable source storage for
all rows. Setup passes the stored stride directly to WriteChunkyPixels
without validating it.
The 0xFFFF sentinel is resolved only once at construction. Later Set of
0xFFFF stores 65535 literally, and changing Width does not update
Modulo. Get returns the effective stored value with TRUE. Negative or
larger inputs truncate to UWORD; Set does not rebuild the image.

MUIA_ChunkyImage_NumColors

Function

Specify the number of source palette entries and the conversion depth.

Inputs

Initialize, set and get; LONG in the header, stored as UWORD. Default
zero. Setup requires a stored count from one through 256.

Notes

There is no setter-time validation: input is converted to the 16-bit
field before Setup checks it. Get returns that stored value with TRUE.
The bitmap uses at least one plane and enough planes for the count; a
non-power-of-two count does not allocate extra palette entries for
unused indices. Provide three palette bytes per declared color and keep
all pixels within the declared count. Set does not rebuild the image.

MUIA_ChunkyImage_Palette

Function

Supply or read the optional byte RGB palette for conversion.

Inputs

Initialize, set and get, borrowed UBYTE pointer. Default NULL.

Notes

Provide at least NumColors consecutive red/green/blue byte triplets,
with no count word or terminator. Setup expands each byte to a 32-bit
channel by multiplying by 0x01010101, allocates its own ULONG array and
passes that array as Bitmap_SourceColors. Get returns the original byte
pointer with TRUE, not the expanded array.
Keep source storage readable for future Setup calls. NULL skips
expansion and does not clear source colors supplied independently to
Bitmap. Set merely stores the pointer; it does not change an existing
conversion. Cleanup frees the expanded array, never the caller palette.

MUIA_ChunkyImage_Pixels

Function

Supply or read the source array of eight-bit palette indices.

Inputs

Initialize, set and get, borrowed UBYTE pointer. Default NULL; Setup
requires a non-NULL pointer.

Notes

Provide Width bytes per row at offsets separated by Modulo. The readable
span must cover at least (Height - 1) * Modulo + Width bytes for
positive dimensions, with Modulo at least Width. The class does not
check buffer length or each index. Each index must be less than
NumColors when using its palette; invalid indices can exceed the
generated color table during Bitmap remapping.
The object never frees the source. Keep it readable for every Setup that
uses it, until replacement or disposal. Get returns the stored pointer
with TRUE, not a pointer to the converted bitmap. Set does not rebuild
or refresh an already converted image.

MUIC_ChunkyImage

Superclass

Bitmap.mui

Description

Display an eight-bit indexed image by converting chunky pixel rows into
an owned BitMap during Setup. Supply Pixels, NumColors and inherited
Bitmap_Width/Bitmap_Height. Palette is optional; omitted palette data
leaves color interpretation to Bitmap and any separately supplied source
colors or mapping table.
The object retains borrowed pixel and palette pointers. Setup reads them
again on each setup cycle, allocates an intermediate bitmap and
optionally expands the byte palette to ULONG RGB channels. The bitmap
depth is the smallest value from one through eight that can hold
NumColors entries; even one color uses depth one. Pixel values must be
valid indices for the supplied color data.
Setup fails for NULL pixels, zero dimensions, a color count outside
1..256, or detected local allocation failure. It installs the bitmap and
optional expanded colors in Bitmap before calling superclass Setup. On
superclass failure it clears those installed pointers and frees the
local allocations. Bitmap remapping has its own failure behavior: TRUE
is not a guarantee that every remapping allocation succeeded.
Cleanup delegates first, then clears the installed bitmap pointer, waits
for blits, frees the owned bitmap and expanded palette, and clears their
fields. Use the normal Setup/Cleanup lifecycle. Dispose frees a
remaining owned bitmap but does not independently free palette32;
skipping Cleanup can leak the expanded palette and bypass superclass
resource cleanup.

Notes

The four ChunkyImage setters only store values and delegate their tags.
They neither rebuild the bitmap nor request redraw or relayout. Changing
source bytes has no automatic display effect. Apply changes outside the
active setup interval and let the next Setup perform conversion.
Bitmap_Width and Bitmap_Height are also stored locally as UWORD and
passed to Bitmap. Avoid negative or out-of-range dimensions: truncation
can make conversion dimensions differ from the superclass dimensions.
The default local dimensions and color count are zero. Do not overwrite
the internal Bitmap_Bitmap or generated SourceColors while they are in
use.
Without a byte palette, Setup does not clear an independently supplied
Bitmap_SourceColors value. An explicit Bitmap_MappingTable follows the
superclass mapping path. The other Bitmap restrictions, including its
alpha and transparency behavior, still apply; this subclass does not add
alpha support or validate all source-buffer bounds.