tinyimg 1.0.0
Lightweight image manipulation library for Cloudflare Workers
Loading...
Searching...
No Matches
TinyPlanOp::[struct].__unnamed0__.fit Struct Reference

Public Attributes

uint32_t width
uint32_t height
TinyImageFit mode
TinyImageGravity gravity
float focus_x
 Where the interesting part is, 0 through 1 across each axis.
float focus_y
uint8_t focused
TinyResampleFilter filter

Member Data Documentation

◆ filter

TinyResampleFilter TinyPlanOp::[struct].__unnamed0__.fit filter

Weights the fit's scale samples through.

◆ focus_x

Where the interesting part is, 0 through 1 across each axis.

Only read when focused is set, and only meaningful for the two computed gravities. It exists so tiny_plan_resolve stays a function of the plan alone: the question "where are the faces" needs pixels, and resolution happens before any pixel is read, so tiny_plan_run answers it first and writes the answer here. A fit op that reaches resolution without one falls back to the center.

◆ focus_y

The vertical position; see focus_x.

◆ focused

Non-zero when focus_x and focus_y have been resolved.

◆ gravity

TinyImageGravity TinyPlanOp::[struct].__unnamed0__.fit gravity

Which part a crop keeps, or where a pad puts the image.

◆ height

Target height.

◆ mode

How the aspect mismatch is absorbed and the scale clamped.

◆ width

Target width.


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