|
FDL Core Library
ASC Framing Decision List — C/C++ Reference Implementation
|
C ABI wrappers for pipeline helper functions. More...
Functions | |
| double | fdl_calculate_scale_factor (fdl_dimensions_f64_t fit_norm, fdl_dimensions_f64_t target_norm, fdl_fit_method_t fit_method) |
| Calculate scale factor based on fit method. | |
| double | fdl_output_size_for_axis (double canvas_size, double max_size, int has_max, int pad_to_max) |
| Determine output canvas size for a single axis. | |
| double | fdl_alignment_shift (double fit_size, double fit_anchor, double output_size, double canvas_size, double target_size, int is_center, double align_factor, int pad_to_max) |
| Calculate content translation shift for a single axis. | |
| fdl_dimensions_f64_t | fdl_dimensions_clamp_to_dims (fdl_dimensions_f64_t dims, fdl_dimensions_f64_t clamp_dims, fdl_point_f64_t *out_delta) |
| Clamp dimensions to maximum bounds. | |
C ABI wrappers for pipeline helper functions.
| double fdl_calculate_scale_factor | ( | fdl_dimensions_f64_t | fit_norm, |
| fdl_dimensions_f64_t | target_norm, | ||
| fdl_fit_method_t | fit_method | ||
| ) |
Calculate scale factor based on fit method.
Computes the ratio needed to scale source (fit_norm) into target (target_norm) using the specified fit method.
| fit_norm | Normalized source dimensions. |
| target_norm | Normalized target dimensions. |
| fit_method | Fit method (WIDTH, HEIGHT, FIT_ALL, or FILL). |
| double fdl_output_size_for_axis | ( | double | canvas_size, |
| double | max_size, | ||
| int | has_max, | ||
| int | pad_to_max | ||
| ) |
Determine output canvas size for a single axis.
Handles three regimes: PAD (pad_to_max -> max_size), CROP (canvas > max -> max_size), FIT (canvas_size unchanged).
| canvas_size | Computed canvas size for this axis. |
| max_size | Maximum allowed size for this axis. |
| has_max | FDL_TRUE if max_size constraint is active, FDL_FALSE if unconstrained. |
| pad_to_max | FDL_TRUE to pad output to max_size, FDL_FALSE otherwise. |
| double fdl_alignment_shift | ( | double | fit_size, |
| double | fit_anchor, | ||
| double | output_size, | ||
| double | canvas_size, | ||
| double | target_size, | ||
| int | is_center, | ||
| double | align_factor, | ||
| int | pad_to_max | ||
| ) |
Calculate content translation shift for a single axis.
Handles three regimes: FIT (no shift), PAD (center/align content in padded area), CROP (clip/align content that exceeds canvas).
| fit_size | Size of the content in this axis. |
| fit_anchor | Anchor position of the content. |
| output_size | Final output canvas size. |
| canvas_size | Computed canvas size before clamping. |
| target_size | Target template size. |
| is_center | FDL_TRUE if alignment is center, FDL_FALSE for edge alignment. |
| align_factor | Alignment factor (0.0 = left/top, 1.0 = right/bottom). |
| pad_to_max | FDL_TRUE if padding to maximum, FDL_FALSE otherwise. |
| fdl_dimensions_f64_t fdl_dimensions_clamp_to_dims | ( | fdl_dimensions_f64_t | dims, |
| fdl_dimensions_f64_t | clamp_dims, | ||
| fdl_point_f64_t * | out_delta | ||
| ) |
Clamp dimensions to maximum bounds.
| dims | Dimensions to clamp. |
| clamp_dims | Maximum allowed dimensions. |
| out_delta | [out] Amount clamped per axis (dims - result), as a point. |