![]() |
tinyimg 1.0.0
Lightweight image manipulation library for Cloudflare Workers
|
What the planner decided, before any pixel is touched. More...
#include <plan.h>
Public Attributes | |
| TinyDecodeOpts | decode |
| uint32_t | decode_width |
| uint32_t | decode_height |
| double | source_x |
| The window of the decoded image the resample reads, in decoded pixels. | |
| double | source_y |
| double | source_width |
| double | source_height |
| uint32_t | sample_width |
| uint32_t | sample_height |
| TinyResampleFilter | filter_x |
| TinyResampleFilter | filter_y |
| int8_t | orientation [4] |
| The composed flip and quarter turn, as a signed permutation. | |
| uint32_t | width |
| uint32_t | height |
| uint8_t | channels |
| uint32_t | offset_x |
| uint32_t | offset_y |
| uint32_t | ops |
| TinyPlanOp | op [TINYIMG_PLAN_MAX_OPS] |
| uint32_t | eliminated |
| uint32_t | collapsed |
| uint32_t | color_stages |
| uint32_t | color_stages_before |
| How many of those run on the source samples rather than the output ones. | |
| uint32_t | consumed |
| uint32_t | passes |
| uint32_t | kernels |
What the planner decided, before any pixel is touched.
Reported by tiny_plan_resolve so a caller can see the saving, and so a test can assert the decision rather than infer it from the output. The by-hand check in the plan prints decode and kernels from here.
| uint8_t TinyPlanResolution::channels |
Channels of the final image.
| uint32_t TinyPlanResolution::collapsed |
Operations a pair rule merged into another.
| uint32_t TinyPlanResolution::color_stages |
Color stages the operations collapsed into.
| uint32_t TinyPlanResolution::color_stages_before |
How many of those run on the source samples rather than the output ones.
Which is decided by where the caller put them: a color operation written before a resize runs before the resample. Moving one to the output side would be cheaper on a reduction and is not the same image, because the clamp that follows an affine function does not survive being averaged.
| uint32_t TinyPlanResolution::consumed |
Operations of op this pass consumes; the rest run after it.
| TinyDecodeOpts TinyPlanResolution::decode |
Region, scale and channel count the decoder is asked for.
| uint32_t TinyPlanResolution::decode_height |
Height the decode produces.
| uint32_t TinyPlanResolution::decode_width |
Width the decode produces.
| uint32_t TinyPlanResolution::eliminated |
Operations an identity or annihilation rule removed.
| TinyResampleFilter TinyPlanResolution::filter_x |
Filter chosen for the horizontal axis, never TINYIMG_FILTER_AUTO.
| TinyResampleFilter TinyPlanResolution::filter_y |
Filter chosen for the vertical axis.
| uint32_t TinyPlanResolution::height |
Height of the final image.
| uint32_t TinyPlanResolution::kernels |
A bitmask of TinyPlanKernel.
| uint32_t TinyPlanResolution::offset_x |
Where the oriented result sits in the final image.
| uint32_t TinyPlanResolution::offset_y |
Where the oriented result sits in the final image.
| TinyPlanOp TinyPlanResolution::op[TINYIMG_PLAN_MAX_OPS] |
Those operations, which is what the rewrite tests assert on.
| uint32_t TinyPlanResolution::ops |
Operations left after the rewrites.
| int8_t TinyPlanResolution::orientation[4] |
The composed flip and quarter turn, as a signed permutation.
Row major, mapping output coordinates to sample coordinates about each axis' center. Composition of any number of flips and turns is one matrix multiply, so the eight orientations cost one pass between them.
| uint32_t TinyPlanResolution::passes |
Fused passes tiny_plan_run will make.
| uint32_t TinyPlanResolution::sample_height |
Height the resample produces, before orientation.
| uint32_t TinyPlanResolution::sample_width |
Width the resample produces, before orientation.
| double TinyPlanResolution::source_height |
Height of that window.
| double TinyPlanResolution::source_width |
Width of that window.
| double TinyPlanResolution::source_x |
The window of the decoded image the resample reads, in decoded pixels.
Fractional, and that is the point: a crop applied after a resize adjusts this window and the extent below, so the sample positions stay exactly where the uncropped resize would have put them. Deriving a fresh resize from the integer crop instead moves every sample by the fractional part.
| double TinyPlanResolution::source_y |
Top edge of that window.
| uint32_t TinyPlanResolution::width |
Width of the final image.