FDL Core Library
ASC Framing Decision List — C/C++ Reference Implementation
Loading...
Searching...
No Matches
Functions
fdl_template_api.cpp File Reference

C ABI wrapper for canvas template application and result management. More...

#include "fdl/fdl_core.h"
#include "fdl_template.h"
#include <cstdlib>

Functions

fdl_template_result_t fdl_apply_canvas_template (const fdl_canvas_template_t *tmpl, const fdl_canvas_t *source_canvas, const fdl_framing_decision_t *source_framing, const char *new_canvas_id, const char *new_fd_name, const char *source_context_label, const char *context_creator)
 Apply a canvas template to a source canvas/framing.
 
void fdl_template_result_free (fdl_template_result_t *result)
 Free a template result (doc + all allocated strings).
 

Detailed Description

C ABI wrapper for canvas template application and result management.

Function Documentation

◆ fdl_apply_canvas_template()

fdl_template_result_t fdl_apply_canvas_template ( const fdl_canvas_template_t tmpl,
const fdl_canvas_t source_canvas,
const fdl_framing_decision_t source_framing,
const char *  new_canvas_id,
const char *  new_fd_name,
const char *  source_context_label,
const char *  context_creator 
)

Apply a canvas template to a source canvas/framing.

Runs the full template pipeline: normalize, scale, round, offset, crop. Produces a new FDL document with the transformed canvas and framing decision.

Parameters
tmplCanvas template to apply.
source_canvasSource canvas to transform.
source_framingSource framing decision to transform.
new_canvas_idID for the output canvas (caller provides).
new_fd_nameName/label for the output framing decision.
source_context_labelLabel from source context (for label generation, may be NULL).
context_creatorCreator string for the output context.
Returns
Result with output_fdl on success, error on failure. Caller must free with fdl_template_result_free().

◆ fdl_template_result_free()

void fdl_template_result_free ( fdl_template_result_t result)

Free a template result (doc + all allocated strings).

Safe to call with NULL.

Parameters
resultTemplate result to free.