Expand description
Image and image-mask rendering — replaces Splash::fillImageMask,
Splash::drawImage, and the four scaleImage* / scaleMask* helpers.
§Scope
Only axis-aligned scaling (matrix[1] == 0 && matrix[2] == 0) with optional
vertical flip (negative Y scale) is implemented. Rotated or skewed transforms
return ImageResult::ArbitraryTransformSkipped so the caller can fall back
to a general path.
§Scaling strategy
Four Bresenham variants mirror the C++ scaleMask* / scaleImage* family:
| Y axis | X axis | Method |
|---|---|---|
| down ↓ | down ↓ | Box-filter (average) in both axes |
| down ↓ | up ↑ | Box-filter in Y, nearest-neighbour in X |
| up ↑ | down ↓ | Nearest-neighbour in Y, box-filter in X |
| up ↑ | up ↑ | Nearest-neighbour in both axes |
All four variants process source rows exactly once, allocating no extra heap
per row. “Down” means scaled < src; “up” means scaled ≥ src.
§Pixel-count contract
draw_image derives the component count directly from P::BYTES,
eliminating any possibility of a caller passing a mismatched value.
§C++ equivalents
Splash::fillImageMaskSplash::drawImageSplash::scaleMask{YdownXdown,YdownXup,YupXdown,YupXup}Splash::scaleImage{YdownXdown,YdownXup,YupXdown,YupXup}Splash::blitMask
Enums§
- Image
Result - Return value from
fill_image_maskanddraw_image.
Traits§
- Image
Source - Caller-supplied source for a colour image: one row at a time.
- Mask
Source - Caller-supplied source for a 1-bit image mask: one row at a time.
Functions§
- draw_
image - Render a colour image with transformation.
- fill_
image_ mask - Fill a 1-bit image mask using the current fill pattern.