1#ifndef __SF3_VECTOR_GRAPHIC__
2#define __SF3_VECTOR_GRAPHIC__
6#define SF3_FORMAT_ID_VECTOR_GRAPHIC 0x09
66#define SF3_SKIP_OUTLINE(OUTLINE) ((OUTLINE).edges+(OUTLINE).count)
197 const char *base = (
char*)instruction;
198 switch(instruction->
type){
240 default:
return "Unknown";
247 for(uint32_t i=0; i<vector_graphic->
count; ++i){
250 const void *start = (
const void *)vector_graphic;
251 const void *end = (
const void *)inst;
#define SF3_SKIP_STR(STR)
Macro to retrieve a pointer past the variable size of an SF3 string.
#define SF3_SKIP_STRP(STR)
sf3_vector_instruction_type
@ SF3_INSTRUCTION_LINE
The instruction is a sf3_line_instruction.
@ SF3_INSTRUCTION_TEXT
The instruction is a sf3_text_instruction.
@ SF3_INSTRUCTION_POLYGON
The instruction is a sf3_polygon_instruction.
@ SF3_INSTRUCTION_CIRCLE
The instruction is a sf3_circle_instruction.
@ SF3_INSTRUCTION_MATRIX
The instruction is a sf3_matrix_instruction.
@ SF3_INSTRUCTION_CURVE
The instruction is a sf3_curve_instruction.
@ SF3_INSTRUCTION_IDENTITY
The instruction is a sf3_identity_instruction.
@ SF3_INSTRUCTION_RECTANGLE
The instruction is a sf3_rectangle_instruction.
#define SF3_SKIP_OUTLINE(OUTLINE)
Macro to obtain a pointer past the outline structure.
SF3_INLINE const struct sf3_vector_instruction * sf3_vector_graphic_next_instruction(const struct sf3_vector_instruction *instruction)
SF3_EXPORT size_t sf3_vector_graphic_size(const struct sf3_vector_graphic *vector_graphic)
Computes the size of the vector graphic file in bytes.
SF3_INLINE const char * sf3_text_instruction_string(const struct sf3_text_instruction *instruction)
Returns the string to draw of a text instruction.
An instruction to draw a circle.
Description of a colour of a shape.
float b
The blue channel, in the range of [0,1].
float g
The green channel, in the range of [0,1].
float r
The red channel, in the range of [0,1].
float a
The alpha channel, in the range of [0,1].
An instruction to draw a Bezier curve.
The basic header structure of every SF3 file.
An instruction to draw a segmented line.
float thickness
The thickness of the stroke of the line.
Description of a point on the canvas.
An instruction to draw a closed polygon.
An instruction to draw a rectangle.
Description of a shape's bounds or extent on the canvas.
float h
The height in Y of the shape.
float x
The X coordinate of the lower left corner.
float y
The Y coordinate of the lower left corner.
float w
The width in X of the shape.
Description of the fill parameters of a shape.
float outline_thickness
The thickness of the outline stroke of the shape.
Description of a shape's outline.
uint16_t count
The number of edges stored in the outline.
Description of an extent on the canvas.
sf3_str16 font
The name of the font-family to use for the text.
float font_size
The size of the font in em units.
uint32_t width
The width of the canvas in pixels.
struct sf3_vector_instruction instructions[]
The instructions to execute in order to draw the graphic.
uint32_t count
The number of vector instructions stored.
uint32_t height
The height of the canvas in pixels.