layer_canvas_bindings_generated
library
Classes
-
LcGradientStop
-
A single color stop within a gradient's ramp.
offset is 0..1 along the
gradient (mirrors lib/src/model/gradient.dart's GradientStop).
-
LcImage
-
-
LcLayerDesc
-
-
LcPaintDesc
-
Describes what to paint a shape's fill/stroke with - a solid color or a
gradient - independent of the shape's own geometry (mirrors
lib/src/model/paint.dart's LayerPaint/Gradient split). Embedded by value
inside a shape's fields below (e.g. LcLayerDesc.rect_paint).
Enums
-
LcExtendMode
-
How a gradient behaves outside its defined 0..1 offset range. Only
meaningful when LcPaintDesc.kind is one of the *_GRADIENT kinds above.
-
LcFillRule
-
How overlapping/self-intersecting regions of a PathLayer are filled
(mirrors lib/src/model/path.dart's FillRule). Only meaningful for fills;
ignored for a stroke-only paint.
-
LcLayerKind
-
Wire format for a single layer, shared between the public FFI surface
(engine.h) and every backend implementation (backend.h). This is our
generic scene description, not tied to any graphics library.
-
LcOutputFormat
-
Encoded output formats a rendered canvas can be requested as (mirrors
lib/src/renderer/renderer.dart's OutputFormat, same declared order).
Deliberately no JPEG: this vendored Blend2D's JPEG codec only implements
decoding - encode_create_encoder returns BL_ERROR_IMAGE_ENCODER_NOT_PROVIDED
(see codec/jpegcodec.cpp), so it's not a usable output format today.
-
LcPaintKind
-
Paint (fill/stroke source) kinds a shape can request. Kept as its own
type - decoupled from any specific shape's fields below - so future
geometry kinds (circles, paths...) can reuse LcPaintDesc verbatim instead
of growing per-shape color fields, and so this enum can later grow e.g.
LC_PAINT_KIND_PATTERN without touching existing call sites.
-
LcPathCommand
-
A single step of a PathLayer's geometry (mirrors lib/src/model/path.dart's
PathCommand). Each command consumes a fixed number of doubles from the
parallel LcLayerDesc.path_coords array below:
MOVE_TO/LINE_TO: 1 point (2 doubles: x, y)
QUAD_TO: 2 points (4 doubles: control, end)
CUBIC_TO: 3 points (6 doubles: control1, control2, end)
ARC_TO: 7 doubles: rx, ry, x_axis_rotation (radians),
large_arc (0.0/1.0), sweep (0.0/1.0), end x, end y -
same endpoint parameterization as SVG's
A/a path
command. The flags are packed as doubles (rather than
giving ARC_TO a different stride/type in path_coords)
so every command can be walked the same way: read N
doubles, where N depends only on the command byte.
CLOSE: 0 doubles.
-
LcStrokeCap
-
Shape of a stroke's open ends (mirrors lib/src/model/paint.dart's
StrokeCap, same declared order). Only meaningful for a stroked paint.
-
LcStrokeJoin
-
Shape drawn where two stroked segments meet (mirrors
lib/src/model/paint.dart's StrokeJoin, same declared order). Only
meaningful for a stroked paint.
Functions
-
lc_buffer_free(Pointer<Uint8> data)
→ void
-
Releases a buffer produced by lc_image_encode_png. Passing NULL is a
no-op.
-
lc_font_register(Pointer<Char> name, int weight, Pointer<Uint8> data, int data_size)
→ int
-
Registers
data_size bytes of font data (TTF/OTF) under name and
weight (100..900, CSS/OpenType scale), so any TextLayer whose
fontFamily equals name renders with whichever registered weight is
closest to its own fontWeight. A family may have several weights
registered under the same name; registering the same name+weight
again replaces only that variant. Registration is global and persists
for the lifetime of the process (or until lc_font_unregister is called)
— it is not tied to any single Scene or render call. data is copied;
the caller may free it as soon as this function returns. Returns 0 on
success.
-
lc_font_unregister(Pointer<Char> name, int weight)
→ int
-
Removes the font previously registered under
name+weight. Returns 0
if found and removed, 1 if no font was registered under that exact
name+weight pair. Other weights registered under the same name are
unaffected.
-
lc_image_clear(Pointer<LcImage> image, int argb)
→ void
-
Fills the whole canvas with a solid ARGB color (0xAARRGGBB).
-
lc_image_create(int width, int height)
→ Pointer<LcImage>
-
Creates a blank, fully transparent canvas of
width x height pixels.
Returns NULL if width/height are not positive or on allocation failure.
-
lc_image_destroy(Pointer<LcImage> image)
→ void
-
Releases a canvas created by lc_image_create. Passing NULL is a no-op.
-
lc_image_encode_png(Pointer<LcImage> image, Pointer<Pointer<Uint8>> out_data, Pointer<Size> out_len)
→ int
-
Encodes the canvas as PNG into a newly allocated buffer, written to
*out_data/*out_len. Returns 0 on success, non-zero on failure. On
success, the caller must release the buffer with lc_buffer_free.
-
lc_render_scene(int width, int height, Pointer<LcLayerDesc> layers, int layer_count, int format, Pointer<Pointer<Uint8>> out_data, Pointer<Size> out_len)
→ int
-
Composes a whole scene in one call: creates a
width x height canvas,
paints layers onto it in array order, and encodes the result as
format (LcOutputFormat) into *out_data/*out_len. Returns 0 on
success. On success, the caller must release the buffer with
lc_buffer_free.