tinyimg 1.0.0
Lightweight image manipulation library for Cloudflare Workers
Loading...
Searching...
No Matches
TinyPlan Struct Reference

A sequence of operations over one source, and the source itself. More...

#include <plan.h>

Public Attributes

const uint8_t * buffer
size_t size
const TinyImageimage
uint32_t source_width
uint32_t source_height
uint8_t source_channels
TinyImageFormat source_format
uint8_t fusion
uint8_t effort
uint8_t background [4]
uint32_t count
TinyPlanOp ops [TINYIMG_PLAN_MAX_OPS]

Detailed Description

A sequence of operations over one source, and the source itself.

Operations do not run when they are appended. The plan runs once, when tiny_plan_run asks for the output, and the planner decides on the way what to decode and how much of it. That is the whole reason the type exists: a chain that ends at a 100x100 thumbnail of a 16 megapixel photograph should never have 16 megapixels in memory, and it cannot make that decision after the first operation has already run.

Keep one on the stack. The layout is not part of the ABI.

Member Data Documentation

◆ background

uint8_t TinyPlan::background[4]

What padding is filled with, as many channels as the output has.

◆ buffer

const uint8_t* TinyPlan::buffer

Encoded source bytes, or NULL when the source is already decoded.

◆ count

uint32_t TinyPlan::count

How many operations have been appended.

◆ effort

uint8_t TinyPlan::effort

How much work the decode may spend; see tiny_plan_set_effort.

◆ fusion

uint8_t TinyPlan::fusion

Zero to run one operation per pass; see tiny_plan_set_fusion.

◆ image

const TinyImage* TinyPlan::image

Decoded source, or NULL when the source is encoded. Borrowed.

◆ ops

The operations, in the order they were appended.

◆ size

size_t TinyPlan::size

Length of buffer.

◆ source_channels

uint8_t TinyPlan::source_channels

Channels the source decodes to.

◆ source_format

TinyImageFormat TinyPlan::source_format

The source's container format.

◆ source_height

uint32_t TinyPlan::source_height

Height of the source in pixels.

◆ source_width

uint32_t TinyPlan::source_width

Width of the source in pixels.


The documentation for this struct was generated from the following file: