CicmWrapper
Beta 0.4
A wrapper for Pure Data
|
Data Structures | |
struct | t_pt |
A point structure. More... | |
struct | t_rect |
A rectangle structure. More... | |
struct | t_matrix |
A matrix structure. More... | |
struct | t_rgb |
A rgb color structure. More... | |
struct | t_rgba |
A rgba color structure. More... | |
struct | t_hsl |
A hsl color structure. More... | |
struct | t_hsla |
A hsla color structure. More... | |
struct | t_efont |
The font structure. More... | |
struct | t_etext |
The text structure. More... | |
struct | t_egobj |
The drawing object. More... | |
struct | t_elayer |
The drawing layer. More... | |
Macros | |
#define | EPD_PI (3.141592653589793238462643383279502884f) |
Macros that define the a pi. | |
#define | EPD_2PI (6.283185307179586476925286766559005f) |
Macros that define the a 2pi. | |
#define | EPD_PI2 (1.57079632679489661923132169163975144f) |
Macros that define the a pi over 2. | |
#define | EPD_PI4 (0.785398163397448309615660845819875721f) |
Macros that define the a pi over 4. | |
Enumerations | |
enum | elayer_flags { EGRAPHICS_OPEN = 0, EGRAPHICS_CLOSE = -1, EGRAPHICS_INVALID = -2, EGRAPHICS_TODRAW = -3 } |
The flags that defines the status of a layer. More... | |
enum | etextanchor_flags { ETEXT_UP = 0, ETEXT_UP_LEFT = 1, ETEXT_UP_RIGHT = 2, ETEXT_DOWN = 3, ETEXT_DOWN_LEFT = 4, ETEXT_DOWN_RIGHT = 5, ETEXT_LEFT = 6, ETEXT_RIGHT = 7, ETEXT_CENTER = 8 } |
The flags that defines the text anchor. More... | |
enum | etextwrap_flags { ETEXT_NOWRAP = 0, ETEXT_WRAP = 1 } |
The flags that defines if the text should be wrapped. More... | |
enum | etextjustify_flags { ETEXT_JLEFT = 0, ETEXT_JRIGHT = 1, ETEXT_JCENTER = 2 } |
The flags that define the text justification. More... | |
enum | egraphics_types { E_GOBJ_INVALID = 0, E_GOBJ_PATH, E_GOBJ_RECT, E_GOBJ_ARC, E_GOBJ_OVAL, E_GOBJ_TEXT, E_GOBJ_IMAG } |
The types of graphical object. More... | |
enum | epath_types { E_PATH_MOVE = 0, E_PATH_CURVE = 1 } |
The types of path. More... | |
Functions | |
void | egraphics_set_line_width (t_elayer *g, float width) |
Sets the line width that will be used by the t_elayer. More... | |
void | egraphics_set_color_rgba (t_elayer *g, const t_rgba *rgba) |
Sets the color in rgba that will be used by the t_elayer. More... | |
void | egraphics_set_color_rgb (t_elayer *g, const t_rgb *rgb) |
Sets the color in rgb that will be used by the t_elayer. More... | |
void | egraphics_set_color_hex (t_elayer *g, t_symbol *hex) |
Sets the color in hexadecimal that will be used by the t_elayer. More... | |
void | egraphics_set_color_hsla (t_elayer *g, const t_hsla *hsla) |
Sets the color in hsla that will be used by the t_elayer. More... | |
void | egraphics_set_color_hsl (t_elayer *g, const t_hsl *hsl) |
Sets the color in hsl that will be used by the t_elayer. More... | |
void | egraphics_matrix_init (t_matrix *x, float xx, float yx, float xy, float yy, float x0, float y0) |
Initializes a matrix. More... | |
void | egraphics_set_matrix (t_elayer *g, const t_matrix *matrix) |
Initializes the t_matrix of a t_elayer. More... | |
void | egraphics_rotate (t_elayer *g, float angle) |
Adds a rotation to the t_matrix of a t_elayer. More... | |
void | egraphics_move_to (t_elayer *g, float x, float y) |
Starts a new path in a t_elayer. More... | |
void | egraphics_line_to (t_elayer *g, float x, float y) |
Adds a line in the current path of a t_elayer. More... | |
void | egraphics_curve_to (t_elayer *g, float ctrl1x, float ctrl1y, float ctrl2x, float ctrl2y, float endx, float endy) |
Adds a bezier curve in the current path of a t_elayer. More... | |
void | egraphics_arc_to (t_elayer *g, float cx, float cy, float extend) |
Adds an arc to the current path of a t_elayer. More... | |
void | egraphics_arc_oval_to (t_elayer *g, float cx, float cy, float radius, float extend) |
Adds an oval arc to the current path of a t_elayer. More... | |
void | egraphics_line (t_elayer *g, float x0, float y0, float x1, float y1) |
Adds a new path at specific point and link it linearly to another. More... | |
void | egraphics_curve (t_elayer *g, float startx, float starty, float ctrl1x, float ctrl1y, float ctrl2x, float ctrl2y, float endx, float endy) |
Adds a new path at specific point and continue the path with a curve. More... | |
void | egraphics_line_fast (t_elayer *g, float x0, float y0, float x1, float y1) |
Adds a new path at specific point and link it linearly to another then draw directly the line. More... | |
void | egraphics_close_path (t_elayer *g) |
Marks the current path as closed. More... | |
void | egraphics_rectangle (t_elayer *g, float x, float y, float width, float height) |
Adds a rectangle in the t_elayer. More... | |
void | egraphics_rectangle_rounded (t_elayer *g, float x, float y, float width, float height, float roundness) |
Adds a rounded rectangle in the t_elayer. More... | |
void | egraphics_circle (t_elayer *g, float xc, float yc, float radius) |
Adds a circle in the t_elayer. More... | |
void | egraphics_oval (t_elayer *g, float xc, float yc, float radiusx, float radiusy) |
Adds a oval in the t_elayer. More... | |
void | egraphics_arc (t_elayer *g, float xc, float yc, float radius, float angle1, float angle2) |
Adds an arc in the t_elayer. More... | |
void | egraphics_arc_oval (t_elayer *g, float xc, float yc, float radiusx, float radiusy, float angle1, float angle2) |
Adds an oval arc in the t_elayer. More... | |
t_etext * | etext_layout_create (void) |
Allocates a new t_etext layout. More... | |
void | etext_layout_destroy (t_etext *textlayout) |
Frees a t_etext layout. More... | |
void | etext_layout_set (t_etext *textlayout, const char *text, t_efont *font, float x, float y, float width, float height, etextanchor_flags anchor, etextjustify_flags justify, etextwrap_flags wrap) |
Initializes a t_etext. More... | |
void | etext_layout_settextcolor (t_etext *textlayout, t_rgba *color) |
Sets the color of a t_etext layout. More... | |
t_efont * | efont_create (t_symbol *family, t_symbol *slant, t_symbol *weight, float size) |
Allocates a new t_efont. More... | |
void | efont_destroy (t_efont *font) |
Frees a t_efont. More... | |
void | egraphics_fill (t_elayer *g) |
Fills the t_elayer with the current path. More... | |
void | egraphics_fill_preserve (t_elayer *g) |
Fills the t_elayer with the current path and preserves the current path. More... | |
void | egraphics_stroke (t_elayer *g) |
Strokes the t_elayer with the current path. More... | |
void | egraphics_stroke_preserve (t_elayer *g) |
Strokes the t_elayer with the current path and preserves the current path. More... | |
void | etext_layout_draw (t_etext *textlayout, t_elayer *g) |
Draws the t_etext in a t_elayer. More... | |
void | rgba_set (t_rgba *color, float red, float green, float blue, float alpha) |
Intialize a t_rgba color. More... | |
void | rgb_set (t_rgb *color, float red, float green, float blue) |
Intialize a t_rgb color. More... | |
void | hsla_set (t_hsla *color, float hue, float saturation, float lightness, float alpha) |
Intialize a t_hsla color. More... | |
void | hsl_set (t_hsl *color, float hue, float saturation, float lightness) |
Intialize a t_hsl color. More... | |
char * | rgba_to_hex (t_rgba color) |
Converts a t_rgba color to an hexadecimal color. More... | |
char * | rgb_to_hex (t_rgb color) |
Converts a t_rgb color to an hexadecimal color. More... | |
char * | hsla_to_hex (t_hsla color) |
Converts a t_hsla color to an hexadecimal color. More... | |
char * | hsl_to_hex (t_hsl color) |
Converts a t_hsl color to an hexadecimal color. More... | |
t_hsla | rgba_to_hsla (t_rgba color) |
Converts a t_rgba color to a t_hsla color. More... | |
t_hsl | rgb_to_hsl (t_rgb color) |
Converts a t_rgb color to a t_hsl color. More... | |
t_rgba | hex_to_rgba (char *color) |
Converts an hexadecimal color to a t_rgba color. More... | |
t_rgb | hex_to_rgb (char *color) |
Converts an hexadecimal color to a t_rgb color. More... | |
t_rgba | hsla_to_rgba (t_hsla color) |
Converts a t_hsla color to a t_rgba color. More... | |
t_rgb | hsl_to_rgb (t_hsl color) |
Converts a t_hsl color to a t_rgb color. More... | |
t_rgba | rgba_addContrast (t_rgba color, float contrast) |
Adds some constrast to a t_rgba color. More... | |
t_rgb | rgb_addContrast (t_rgb color, float contrast) |
Adds some constrast to a t_rgb color. More... | |
Variables | |
const t_rgba | rgba_black |
The pre-defined black t_rgba. | |
const t_rgba | rgba_greydark |
The pre-defined grey dark t_rgba. | |
const t_rgba | rgba_grey |
The pre-defined grey t_rgba. | |
const t_rgba | rgba_greylight |
The pre-defined grey light t_rgba. | |
const t_rgba | rgba_white |
The pre-defined white t_rgba. | |
const t_rgba | rgba_blue |
The pre-defined blue t_rgba. | |
const t_rgba | rgba_green |
The pre-defined green t_rgba. | |
const t_rgba | rgba_red |
The pre-defined red t_rgba. | |
The t_elayer part.
This part refers to the methods and structures used to paint.
struct t_rect |
A rectangle structure.
It contains the members x, y, width and height for abscissa and ordinate and size.
Data Fields | ||
---|---|---|
float | x |
The abscissa coordiante. |
float | y |
The ordiante coordiante. |
float | width |
The width of the rectangle |
float | height |
The height of the rectangle |
struct t_matrix |
A matrix structure.
It contains the members xx, yx, xy, yy, x0 and y0
struct t_rgb |
struct t_rgba |
struct t_hsl |
struct t_hsla |
struct t_efont |
The font structure.
It contains the informations of a font.
Data Fields | ||
---|---|---|
float | c_size |
The size of the font. |
long | c_sizereal |
The plateform's size of the font. |
t_symbol * | c_family |
The family of the font (times, helvetica, ect.). |
t_symbol * | c_slant |
The slant of the font (regular, italic, etc.). |
t_symbol * | c_weight |
The weight of the font (normal, bold). |
struct t_etext |
The text structure.
It contains the all the informations to be drawn.
Data Fields | ||
---|---|---|
t_symbol * | c_text |
The text. |
t_rgba | c_color |
The color of the text. |
t_efont | c_font |
The font of the text. |
t_rect | c_rect |
The rectangle of the text. |
t_symbol * | c_anchor |
The anchor of the text. |
t_symbol * | c_justify |
The justification of the text. |
struct t_egobj |
The drawing object.
It contains the all the informations to be drawn.
Data Fields | ||
---|---|---|
egraphics_types | e_type |
The type of the graphical object. |
int | e_filled |
The filled state of the graphical object. |
t_symbol * | e_color |
The color of the graphical object. |
float | e_width |
The line width of the graphical object. |
t_pt * | e_points |
The points of the graphical object. |
long | e_npoints |
The number of points of the graphical object. |
float | e_roundness |
The roundness of the graphical object. |
t_efont | e_font |
The font of the graphical object. |
t_symbol * | e_anchor |
The anchor of the graphical object. |
t_symbol * | e_justify |
The justification of the graphical object. |
t_symbol * | e_text |
The text of the graphical object. |
struct t_elayer |
The drawing layer.
It contains the all the informations and the graphical objects to be drawn.
Data Fields | ||
---|---|---|
t_object * | e_owner |
The layer owner. |
t_symbol * | e_name |
The layer name. |
t_symbol * | e_id |
The layer canvas ID. |
int | e_state |
The layer state. |
t_rect | e_rect |
The layer size. |
t_symbol * | e_color |
The layer color. |
int | e_line_width |
The layer line width. |
t_matrix | e_matrix |
The layer matrix. |
t_egobj | e_new_objects |
The layer new object. |
t_egobj * | e_objects |
The layer objects. |
long | e_number_objects |
The number of layer objects. |
enum elayer_flags |
enum etextanchor_flags |
The flags that defines the text anchor.
It define all text anchor.
enum etextwrap_flags |
enum etextjustify_flags |
enum egraphics_types |
enum epath_types |
void egraphics_set_line_width | ( | t_elayer * | g, |
float | width | ||
) |
void egraphics_matrix_init | ( | t_matrix * | x, |
float | xx, | ||
float | yx, | ||
float | xy, | ||
float | yy, | ||
float | x0, | ||
float | y0 | ||
) |
Initializes a matrix.
x | The t_matrix pointer. |
xx | The xx coefficient. |
yx | The yx coefficient. |
xy | The xy coefficient. |
yy | The yy coefficient. |
x0 | The abscissa offset. |
y0 | The ordiante offset. |
void egraphics_rotate | ( | t_elayer * | g, |
float | angle | ||
) |
void egraphics_move_to | ( | t_elayer * | g, |
float | x, | ||
float | y | ||
) |
void egraphics_line_to | ( | t_elayer * | g, |
float | x, | ||
float | y | ||
) |
void egraphics_curve_to | ( | t_elayer * | g, |
float | ctrl1x, | ||
float | ctrl1y, | ||
float | ctrl2x, | ||
float | ctrl2y, | ||
float | endx, | ||
float | endy | ||
) |
Adds a bezier curve in the current path of a t_elayer.
The first point of the curve is the previous point in the path.
g | The t_elayer pointer. |
ctrl1x | The abscissa of the first control point. |
ctrl1y | The ordiante of the first control point. |
ctrl2x | The abscissa of the second control point. |
ctrl2y | The ordiante of the second control point. |
endx | The abscissa of the end point. |
endy | The ordiante of the end point. |
void egraphics_arc_to | ( | t_elayer * | g, |
float | cx, | ||
float | cy, | ||
float | extend | ||
) |
void egraphics_arc_oval_to | ( | t_elayer * | g, |
float | cx, | ||
float | cy, | ||
float | radius, | ||
float | extend | ||
) |
Adds an oval arc to the current path of a t_elayer.
The start point of the oval arc is the previous point in the path and the first radius of the oval is compute with the center of the oval arc.
g | The t_elayer pointer. |
cx | The abscissa of the center of the oval arc. |
cy | The ordiante of the center of the oval arc. |
radius | The second radius of the oval arc. |
extend | The extend angle in radian. |
void egraphics_line | ( | t_elayer * | g, |
float | x0, | ||
float | y0, | ||
float | x1, | ||
float | y1 | ||
) |
Adds a new path at specific point and link it linearly to another.
This function just call egraphics_move_to and egraphics_line_to.
g | The t_elayer pointer. |
x0 | The abscissa of the first point. |
y0 | The ordiante of the first point. |
x1 | The abscissa of the second point. |
y1 | The ordiante of the second point. |
void egraphics_curve | ( | t_elayer * | g, |
float | startx, | ||
float | starty, | ||
float | ctrl1x, | ||
float | ctrl1y, | ||
float | ctrl2x, | ||
float | ctrl2y, | ||
float | endx, | ||
float | endy | ||
) |
Adds a new path at specific point and continue the path with a curve.
This function just call egraphics_move_to and egraphics_curve_to.
g | The t_elayer pointer. |
startx | The abscissa of the first point. |
starty | The ordiante of the first point. |
ctrl1x | The abscissa of the first control point. |
ctrl1y | The ordiante of the first control point. |
ctrl2x | The abscissa of the second control point. |
ctrl2y | The ordiante of the second control point. |
endx | The abscissa of the end point. |
endy | The ordiante of the end point. |
void egraphics_line_fast | ( | t_elayer * | g, |
float | x0, | ||
float | y0, | ||
float | x1, | ||
float | y1 | ||
) |
Adds a new path at specific point and link it linearly to another then draw directly the line.
This function just call egraphics_move_to, egraphics_line_to and egraphics_stroke.
g | The t_elayer pointer. |
x0 | The abscissa of the first point. |
y0 | The ordiante of the first point. |
x1 | The abscissa of the second point. |
y1 | The ordiante of the second point. |
void egraphics_close_path | ( | t_elayer * | g | ) |
Marks the current path as closed.
g | The t_elayer pointer. |
void egraphics_rectangle | ( | t_elayer * | g, |
float | x, | ||
float | y, | ||
float | width, | ||
float | height | ||
) |
void egraphics_rectangle_rounded | ( | t_elayer * | g, |
float | x, | ||
float | y, | ||
float | width, | ||
float | height, | ||
float | roundness | ||
) |
void egraphics_circle | ( | t_elayer * | g, |
float | xc, | ||
float | yc, | ||
float | radius | ||
) |
void egraphics_oval | ( | t_elayer * | g, |
float | xc, | ||
float | yc, | ||
float | radiusx, | ||
float | radiusy | ||
) |
void egraphics_arc | ( | t_elayer * | g, |
float | xc, | ||
float | yc, | ||
float | radius, | ||
float | angle1, | ||
float | angle2 | ||
) |
void egraphics_arc_oval | ( | t_elayer * | g, |
float | xc, | ||
float | yc, | ||
float | radiusx, | ||
float | radiusy, | ||
float | angle1, | ||
float | angle2 | ||
) |
Adds an oval arc in the t_elayer.
g | The t_elayer pointer. |
xc | The abscissa of the center of the oval arc. |
yc | The ordiante of the center of the oval arc. |
radiusx | The horizontal radius of the oval arc. |
radiusy | The vertical radius of the oval arc. |
angle1 | The first angle of the oval arc in radian. |
angle2 | The second angle of the oval arc in radian. |
t_etext* etext_layout_create | ( | void | ) |
void etext_layout_destroy | ( | t_etext * | textlayout | ) |
void etext_layout_set | ( | t_etext * | textlayout, |
const char * | text, | ||
t_efont * | font, | ||
float | x, | ||
float | y, | ||
float | width, | ||
float | height, | ||
etextanchor_flags | anchor, | ||
etextjustify_flags | justify, | ||
etextwrap_flags | wrap | ||
) |
Initializes a t_etext.
textlayout | The t_etext pointer. |
text | The text to draw. |
font | The t_efont to use. |
x | The absicssa position of the t_etext. |
y | The ordinate position of the t_etext. |
width | The width of the t_etext. |
height | The height of the t_etext. |
anchor | The anchor of the text. |
justify | The justification of the text. |
wrap | if the text should be wrap or not. |
void egraphics_fill | ( | t_elayer * | g | ) |
void egraphics_fill_preserve | ( | t_elayer * | g | ) |
void egraphics_stroke | ( | t_elayer * | g | ) |
void egraphics_stroke_preserve | ( | t_elayer * | g | ) |
void rgba_set | ( | t_rgba * | color, |
float | red, | ||
float | green, | ||
float | blue, | ||
float | alpha | ||
) |
void rgb_set | ( | t_rgb * | color, |
float | red, | ||
float | green, | ||
float | blue | ||
) |
void hsla_set | ( | t_hsla * | color, |
float | hue, | ||
float | saturation, | ||
float | lightness, | ||
float | alpha | ||
) |
void hsl_set | ( | t_hsl * | color, |
float | hue, | ||
float | saturation, | ||
float | lightness | ||
) |
char* rgba_to_hex | ( | t_rgba | color | ) |
char* rgb_to_hex | ( | t_rgb | color | ) |
char* hsla_to_hex | ( | t_hsla | color | ) |
char* hsl_to_hex | ( | t_hsl | color | ) |
t_rgba hex_to_rgba | ( | char * | color | ) |
t_rgb hex_to_rgb | ( | char * | color | ) |