|
FDL Core Library
ASC Framing Decision List — C/C++ Reference Implementation
|
C ABI wrappers for geometry operations. More...
Functions | |
| fdl_geometry_t | fdl_geometry_fill_hierarchy_gaps (fdl_geometry_t geo, fdl_point_f64_t anchor_offset) |
| Fill gaps in the geometry hierarchy by propagating populated dimensions upward. | |
| fdl_geometry_t | fdl_geometry_normalize_and_scale (fdl_geometry_t geo, double source_squeeze, double scale_factor, double target_squeeze) |
| Normalize and scale all 7 fields of the geometry. | |
| fdl_geometry_t | fdl_geometry_round (fdl_geometry_t geo, fdl_round_strategy_t strategy) |
| Round all 7 fields of the geometry. | |
| fdl_geometry_t | fdl_geometry_apply_offset (fdl_geometry_t geo, fdl_point_f64_t offset, fdl_point_f64_t *theo_eff, fdl_point_f64_t *theo_prot, fdl_point_f64_t *theo_fram) |
| Apply offset to all anchors, clamping to canvas bounds. | |
| fdl_geometry_t | fdl_geometry_crop (fdl_geometry_t geo, fdl_point_f64_t theo_eff, fdl_point_f64_t theo_prot, fdl_point_f64_t theo_fram) |
| Crop all dimensions to visible portion within canvas. | |
| int | fdl_geometry_get_dims_anchor_from_path (const fdl_geometry_t *geo, fdl_geometry_path_t path, fdl_dimensions_f64_t *out_dims, fdl_point_f64_t *out_anchor) |
| Extract dimensions and anchor from geometry by path. | |
| int | fdl_resolve_geometry_layer (const fdl_canvas_t *canvas, const fdl_framing_decision_t *framing, fdl_geometry_path_t path, fdl_dimensions_f64_t *out_dims, fdl_point_f64_t *out_anchor) |
| Resolve dimensions and anchor directly from canvas/framing handles for a path. | |
| fdl_rect_t | fdl_make_rect (double x, double y, double width, double height) |
| Construct a rect from raw coordinates. | |
| fdl_rect_t | fdl_canvas_get_rect (const fdl_canvas_t *canvas) |
| Get the full canvas rect: (0, 0, dims.width, dims.height). | |
| int | fdl_canvas_get_effective_rect (const fdl_canvas_t *canvas, fdl_rect_t *out_rect) |
| Get the effective (active image) rect of a canvas. | |
| fdl_rect_t | fdl_framing_decision_get_rect (const fdl_framing_decision_t *fd) |
| Get the framing decision rect: (anchor.x, anchor.y, dims.width, dims.height). | |
| int | fdl_framing_decision_get_protection_rect (const fdl_framing_decision_t *fd, fdl_rect_t *out_rect) |
| Get the framing decision protection rect. | |
C ABI wrappers for geometry operations.
| fdl_geometry_t fdl_geometry_fill_hierarchy_gaps | ( | fdl_geometry_t | geo, |
| fdl_point_f64_t | anchor_offset | ||
| ) |
Fill gaps in the geometry hierarchy by propagating populated dimensions upward.
If a higher-level dimension is zero but a lower level is set, the gap is filled by copying from the populated layer. Protection is NEVER filled from framing. Anchor points are offset by anchor_offset and clamped to >= 0.
| geo | Geometry with potentially sparse dimension layers. |
| anchor_offset | Offset applied to anchors during gap-filling. |
| fdl_geometry_t fdl_geometry_normalize_and_scale | ( | fdl_geometry_t | geo, |
| double | source_squeeze, | ||
| double | scale_factor, | ||
| double | target_squeeze | ||
| ) |
Normalize and scale all 7 fields of the geometry.
Applies anamorphic normalization and scaling to all dimension and anchor fields.
| geo | Geometry to transform. |
| source_squeeze | Source anamorphic squeeze factor. |
| scale_factor | Scale multiplier. |
| target_squeeze | Target anamorphic squeeze factor. |
| fdl_geometry_t fdl_geometry_round | ( | fdl_geometry_t | geo, |
| fdl_round_strategy_t | strategy | ||
| ) |
Round all 7 fields of the geometry.
| geo | Geometry to round. |
| strategy | Rounding strategy (even + mode). |
| fdl_geometry_t fdl_geometry_apply_offset | ( | fdl_geometry_t | geo, |
| fdl_point_f64_t | offset, | ||
| fdl_point_f64_t * | theo_eff, | ||
| fdl_point_f64_t * | theo_prot, | ||
| fdl_point_f64_t * | theo_fram | ||
| ) |
Apply offset to all anchors, clamping to canvas bounds.
The theoretical (unclamped) anchor values are written to the output pointers for use in subsequent cropping.
| geo | Geometry to offset. |
| offset | Translation to apply to all anchor points. |
| theo_eff | [out] Unclamped effective anchor (may be NULL). |
| theo_prot | [out] Unclamped protection anchor (may be NULL). |
| theo_fram | [out] Unclamped framing anchor (may be NULL). |
| fdl_geometry_t fdl_geometry_crop | ( | fdl_geometry_t | geo, |
| fdl_point_f64_t | theo_eff, | ||
| fdl_point_f64_t | theo_prot, | ||
| fdl_point_f64_t | theo_fram | ||
| ) |
Crop all dimensions to visible portion within canvas.
Enforces the hierarchy invariant: canvas >= effective >= protection >= framing. Uses theoretical (unclamped) anchors to compute visible extents.
| geo | Geometry to crop. |
| theo_eff | Theoretical effective anchor (from fdl_geometry_apply_offset). |
| theo_prot | Theoretical protection anchor. |
| theo_fram | Theoretical framing anchor. |
| int fdl_geometry_get_dims_anchor_from_path | ( | const fdl_geometry_t * | geo, |
| fdl_geometry_path_t | path, | ||
| fdl_dimensions_f64_t * | out_dims, | ||
| fdl_point_f64_t * | out_anchor | ||
| ) |
Extract dimensions and anchor from geometry by path.
| geo | Geometry to query. |
| path | Which dimension layer to extract (canvas, effective, protection, or framing). |
| out_dims | [out] Extracted dimensions. |
| out_anchor | [out] Extracted anchor point ({0,0} for canvas path). |
| int fdl_resolve_geometry_layer | ( | const fdl_canvas_t * | canvas, |
| const fdl_framing_decision_t * | framing, | ||
| fdl_geometry_path_t | path, | ||
| fdl_dimensions_f64_t * | out_dims, | ||
| fdl_point_f64_t * | out_anchor | ||
| ) |
Resolve dimensions and anchor directly from canvas/framing handles for a path.
| canvas | Canvas handle. |
| framing | Framing decision handle. |
| path | Geometry path to resolve. |
| out_dims | [out] Resolved dimensions. |
| out_anchor | [out] Resolved anchor point. |
| fdl_rect_t fdl_make_rect | ( | double | x, |
| double | y, | ||
| double | width, | ||
| double | height | ||
| ) |
Construct a rect from raw coordinates.
| x | Left edge x-coordinate. |
| y | Top edge y-coordinate. |
| width | Rectangle width. |
| height | Rectangle height. |
| fdl_rect_t fdl_canvas_get_rect | ( | const fdl_canvas_t * | canvas | ) |
Get the full canvas rect: (0, 0, dims.width, dims.height).
| canvas | Canvas handle. |
| int fdl_canvas_get_effective_rect | ( | const fdl_canvas_t * | canvas, |
| fdl_rect_t * | out_rect | ||
| ) |
Get the effective (active image) rect of a canvas.
| canvas | Canvas handle. |
| out_rect | [out] Effective rect if present. |
| fdl_rect_t fdl_framing_decision_get_rect | ( | const fdl_framing_decision_t * | fd | ) |
Get the framing decision rect: (anchor.x, anchor.y, dims.width, dims.height).
| fd | Framing decision handle. |
| int fdl_framing_decision_get_protection_rect | ( | const fdl_framing_decision_t * | fd, |
| fdl_rect_t * | out_rect | ||
| ) |
Get the framing decision protection rect.
| fd | Framing decision handle. |
| out_rect | [out] Protection rect if present. |