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

Bodychunk.mui

MUIA_Bodychunk_Body

Function

Supply or retrieve the encoded BODY bytes.

Inputs

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

Notes

The buffer is borrowed, never copied or freed. Keep complete readable
data available for every Setup; changing it while a decoded bitmap
exists does not update that image. Get returns the original pointer. No
length is stored or checked. Provide readable padding for the planar
converter prefetch as described in the class entry.

MUIA_Bodychunk_Compression

Function

Select raw or ByteRun1 decoding.

Inputs

Initialize, set and get, UBYTE. Default 0. Stored 0 means raw; 1 means
ByteRun1; larger stored values make Setup fail.

Notes

Tag data is converted to UBYTE before validation, so values outside that
type are truncated. Set does not decode again. ByteRun1 uses nonnegative
control bytes for literal runs, -1..-127 for repeated-byte runs and -128
as a no-op, without checking encoded input bounds.

MUIA_Bodychunk_Depth

Function

Set or retrieve the number of color bitplanes.

Inputs

Initialize, set and get, LONG. Default zero; Setup accepts 1 through 8.

Notes

The decoded bitmap uses this color depth. Masking 1 adds a separate
consumed plane to the input row but does not increase decoded color
depth. Set performs no immediate validation or regeneration. Supply
dimensions, plane data and optional palette consistent with this value.

MUIA_Bodychunk_Masking

Function

Indicate whether each source row includes an extra mask plane.

Inputs

Initialize, set and get, UBYTE. Default 0.

Notes

Only value 1 has special handling: one extra plane is consumed after the
color planes. It is discarded, not converted to a drawing mask. Other
stored values are treated as no extra plane and are not rejected. Set
does not regenerate decoded data. This attribute does not itself select
a transparent color or enable Bitmap alpha drawing.

MUIC_Bodychunk

Superclass

Bitmap.mui

Description

Decode borrowed ILBM-style BODY data into an owned bitmap during Setup,
then display it through Bitmap. This class does not read an IFF file,
parse chunk headers or infer dimensions. Supply Bitmap_Width,
Bitmap_Height, Bodychunk_Depth and Bodychunk_Body consistently;
dimensions and depth default to zero, Body to NULL. Compression and
Masking default to zero.
Rows contain word-aligned plane bytes: bytes per plane row equal ((width
+ 15) & ~15) / 8. Color planes are interleaved by row, followed by one
extra plane only when Masking equals 1. Compression 0 reads that layout
directly; compression 1 expands ByteRun1 data for the combined planes of
each row. The extra mask plane is consumed but not used for drawing
transparency. Use Bitmap's separate transparency mechanism if needed.

Methods

Setup rejects NULL Body, nonpositive dimensions, depth outside 1..8, or
stored Compression above 1. It returns FALSE on those checks or required
allocation failure. It creates the source bitmap before calling Bitmap
Setup, supplies it through Bitmap_Bitmap, and frees it if superclass
setup fails. Temporary scanline bitmap allocation can fall back to
per-pixel writes.
Cleanup first invokes Bitmap Cleanup, clears Bitmap_Bitmap and then
frees the decoded bitmap after WaitBlit. Dispose frees any remaining
decoded bitmap, but does not replace the complete superclass cleanup
lifecycle. Body is never freed. Setters update stored fields only; they
do not decode again, request redraw or relayout. Width/Height tags
update both this class and Bitmap, so live changes can disagree with the
old decoded bitmap.

Bugs

There is no encoded-data length parameter or decoder input bound.
ByteRun1 -128 is a no-op and malformed streams can read indefinitely
beyond input; a run ending beyond the requested output is cut short
without structural validation. Caller-provided data must be complete and
correctly encoded.
The decompression workspace has width + 16 bytes available, but a
decoded row needs bytes-per-plane-row times total plane count. That
requirement is not checked and can exceed the buffer, including depth
eight plus a mask at some widths. Planar conversion also prefetches the
next source byte at eight-pixel boundaries, so it can read one byte past
the final required plane data. Dimensions use WORD iteration and
unchecked arithmetic. This implementation is not a bounds-checked
decoder for arbitrary BODY data.