enesim  0.0.23.1
Drawinglibrary
Modules | Typedefs | Functions
Renderer

Vector and raster drawing primitives. More...

Modules

 Renderer definitions
 Background
 

Generic color renderer inherits from \1.


 Blur Filter
 

Blur filter renderer inherits from \1.


 Checker
 

Checked pattern renderer inherits from \1.


 Clipper
 

Renderer that clips a source renderer inherits from \1.


 Compound
 

Renderer that contains other renderers inherits from \1.


 Displacement Map
 

Renderer that displays source pixels using a map image inherits from \1.


 Gradient
 

Gradient renderer inherits from \1.


 Grid
 

Grid pattern renderer inherits from \1.


 Image
 

Image based renderer inherits from \1.


 Importer
 

Renderer that imports pixels from a buffer inherits from \1.


 Map_Quad
 

Map_Quad based renderer inherits from \1.


 Pattern
 

Renderer that repeats an area of another renderer to form a pattern inherits from \1.


 Perlin
 

Perlin noise renderer inherits from \1.


 Proxy
 

Renderer that renders another renderer inherits from \1.


 Radial Distortion
 

Filters a source image using a barrel distortion inherits from \1.


 Shapes
 

Geometric shape renderer inherits from \1.


 Stripes
 

Stripe pattern renderer inherits from \1.


 Text Span
 

Text span renderer inherits from \1.


 Transition
 

Rederer that blends two renderers inherits from \1.


Typedefs

typedef struct _Enesim_Renderer Enesim_Renderer

Functions

EAPI void enesim_renderer_private_set (Enesim_Renderer *r, const char *name, void *data)
EAPI void * enesim_renderer_private_get (Enesim_Renderer *r, const char *name)
EAPI Enesim_Rendererenesim_renderer_ref (Enesim_Renderer *r)
 Increase the reference counter of a renderer.
EAPI void enesim_renderer_unref (Enesim_Renderer *r)
 Decrease the reference counter of a renderer.
EAPI int enesim_renderer_ref_count (Enesim_Renderer *r)
 Gets the reference counter value of a renderer.
EAPI void enesim_renderer_lock (Enesim_Renderer *r)
 Locks a renderer.
EAPI void enesim_renderer_unlock (Enesim_Renderer *r)
 Unlocks a renderer.
EAPI void enesim_renderer_name_set (Enesim_Renderer *r, const char *name)
 Sets the name of a renderer .
EAPI const char * enesim_renderer_name_get (Enesim_Renderer *r)
 Gets the name of a renderer .
EAPI void enesim_renderer_transformation_set (Enesim_Renderer *r, const Enesim_Matrix *m)
 Sets the transformation matrix of a renderer .
EAPI void enesim_renderer_transformation_get (Enesim_Renderer *r, Enesim_Matrix *m)
 Gets the transformation matrix of a renderer .
EAPI Enesim_Matrix_Type enesim_renderer_transformation_type_get (Enesim_Renderer *r)
 Gets the transformation type of the transformation attribute of a renderer.
EAPI void enesim_renderer_origin_set (Enesim_Renderer *r, double x, double y)
 Sets the origin of a renderer.
EAPI void enesim_renderer_origin_get (Enesim_Renderer *r, double *x, double *y)
 Gets the origin of a renderer.
EAPI void enesim_renderer_x_origin_set (Enesim_Renderer *r, double x)
 Sets the origin X coordinate of a renderer .
EAPI double enesim_renderer_x_origin_get (Enesim_Renderer *r)
 Gets the origin X coordinate of a renderer .
EAPI void enesim_renderer_y_origin_set (Enesim_Renderer *r, double y)
 Sets the origin Y coordinate of a renderer .
EAPI double enesim_renderer_y_origin_get (Enesim_Renderer *r)
 Gets the origin Y coordinate of a renderer .
EAPI void enesim_renderer_visibility_set (Enesim_Renderer *r, Eina_Bool visibility)
 Sets the visibility of a renderer .
EAPI Eina_Bool enesim_renderer_visibility_get (Enesim_Renderer *r)
 Gets the visibility of a renderer .
EAPI void enesim_renderer_color_set (Enesim_Renderer *r, Enesim_Color color)
 Sets the color of a renderer .
EAPI Enesim_Color enesim_renderer_color_get (Enesim_Renderer *r)
 Gets the color of a renderer .
EAPI void enesim_renderer_mask_set (Enesim_Renderer *r, Enesim_Renderer *mask)
 Sets the mask renderer for a renderer .
EAPI Enesim_Rendererenesim_renderer_mask_get (Enesim_Renderer *r)
 Gets the mask renderer from a renderer .
EAPI void enesim_renderer_mask_channel_set (Enesim_Renderer *r, Enesim_Channel channel)
 Sets the channel to use for masking .
EAPI Enesim_Channel enesim_renderer_mask_channel_get (Enesim_Renderer *r)
 Gets the mask channel from a renderer .
EAPI void enesim_renderer_quality_set (Enesim_Renderer *r, Enesim_Quality quality)
 Sets the quality of a renderer .
EAPI Enesim_Quality enesim_renderer_quality_get (Enesim_Renderer *r)
 Gets the quality of a renderer .
EAPI Enesim_Alpha_Hint enesim_renderer_alpha_hints_get (Enesim_Renderer *thiz)
EAPI Eina_Bool enesim_renderer_is_supported (Enesim_Renderer *r, Enesim_Surface *s)
 Checks if a renderer supports the current state of properties.
EAPI Eina_Bool enesim_renderer_bounds_get (Enesim_Renderer *r, Enesim_Rectangle *rect, Enesim_Log **log)
EAPI Eina_Bool enesim_renderer_bounds_get_extended (Enesim_Renderer *r, Enesim_Rectangle *prev, Enesim_Rectangle *curr, Enesim_Log **log)
 Gets the bounding box of the renderer on its own coordinate space.
EAPI Eina_Bool enesim_renderer_destination_bounds_get (Enesim_Renderer *r, Eina_Rectangle *rect, int x, int y, Enesim_Log **log)
EAPI Eina_Bool enesim_renderer_destination_bounds_get_extended (Enesim_Renderer *r, Eina_Rectangle *prev, Eina_Rectangle *curr, int x, int y, Enesim_Log **log)
 Gets the bounding box of the renderer on the destination coordinate space.
EAPI int enesim_renderer_features_get (Enesim_Renderer *r)
 Get the features a renderer support.
EAPI Eina_Bool enesim_renderer_is_inside (Enesim_Renderer *r, double x, double y)
EAPI Eina_Bool enesim_renderer_has_changed (Enesim_Renderer *r)
 Check if a renderer has changed.
EAPI Eina_Bool enesim_renderer_damages_get (Enesim_Renderer *r, Enesim_Renderer_Damage cb, void *user_data)
 Get the damaged areas of a renderer.
EAPI Eina_Bool enesim_renderer_draw (Enesim_Renderer *r, Enesim_Surface *s, Enesim_Rop rop, Eina_Rectangle *clip, int x, int y, Enesim_Log **log)
EAPI Eina_Bool enesim_renderer_draw_list (Enesim_Renderer *r, Enesim_Surface *s, Enesim_Rop rop, Eina_List *clips, int x, int y, Enesim_Log **log)
EAPI void enesim_renderer_default_quality_set (Enesim_Quality quality)
EAPI Eina_Bool enesim_renderer_type_get (Enesim_Renderer *r, const char **lib, char **name)
 Get the type of a renderer .

Detailed Description

Vector and raster drawing primitives.


Typedef Documentation

typedef struct _Enesim_Renderer Enesim_Renderer

Renderer Handle


Function Documentation

EAPI void enesim_renderer_private_set ( Enesim_Renderer r,
const char *  name,
void *  data 
)

Set a user defined private data on a renderer

Parameters:
[in]rThe enesim renderer to set the private data in
[in]nameThe string identifier of the private data
[in]dataThe user defined private data
EAPI void* enesim_renderer_private_get ( Enesim_Renderer r,
const char *  name 
)

Get the user defined private data from a renderer

Parameters:
[in]rThe enesim renderer to get the private data from
[in]nameThe name that identifies the private data
Returns:
The user defined private data or NULL if the private data is not found for the name

Increase the reference counter of a renderer.

Todo:
  • Add a way to get/set such description
  • We have some overlfow on the coordinates whenever we want to trasnlate or transform bounds, we need to fix the maximum and minimum for a coordinate and length
Parameters:
[in]rThe renderer
Returns:
The input parameter r for programming convenience

Decrease the reference counter of a renderer.

Parameters:
[in]rThe renderer

Gets the reference counter value of a renderer.

Parameters:
[in]rThe renedrer to get the reference counter from
Returns:
The reference counter value

Locks a renderer.

Parameters:
[in]rThe renderer to lock
Note:
The renderer is automatically locked before a drawing operation

Unlocks a renderer.

Parameters:
[in]rThe renderer to unlock
Note:
The renderer is automatically unlocked after a drawing operation
EAPI void enesim_renderer_name_set ( Enesim_Renderer r,
const char *  name 
)

Sets the name of a renderer .

Parameters:
[in]rThe renderer to set the name to
[in]nameThe name to set
EAPI const char* enesim_renderer_name_get ( Enesim_Renderer r)

Gets the name of a renderer .

Parameters:
[in]rThe renderer to get the name from
Returns:
The renderer name

Sets the transformation matrix of a renderer .

Parameters:
[in]rThe renderer to set the transformation matrix on
[in]mThe transformation matrix to set
Note:
The transformation will only take effect if the renderer supports the ENESIM_RENDERER_FEATURE_PROJECTIVE or the ENESIM_RENDERER_FEATURE_PROJECTIVE feature. Otherwise it will be ignored

Gets the transformation matrix of a renderer .

Parameters:
[in]rThe renderer to get the transformation matrix from
[out]mThe transformation matrix

Gets the transformation type of the transformation attribute of a renderer.

Parameters:
[in]rThe renderer to get the transformation type from
Returns:
The transformation type
EAPI void enesim_renderer_origin_set ( Enesim_Renderer r,
double  x,
double  y 
)

Sets the origin of a renderer.

Parameters:
[in]rThe renderer to set the origin on
[in]xThe origin X coordinate
[in]yThe origin Y coordinate
Note:
The origin will only take effect if the renderer supports the ENESIM_RENDERER_FEATURE_TRANSLATE
EAPI void enesim_renderer_origin_get ( Enesim_Renderer r,
double *  x,
double *  y 
)

Gets the origin of a renderer.

Parameters:
[in]rThe renderer to get the origin from
[out]xThe origin X coordinate
[out]yThe origin Y coordinate
EAPI void enesim_renderer_x_origin_set ( Enesim_Renderer r,
double  x 
)

Sets the origin X coordinate of a renderer .

Parameters:
[in]rThe renderer to set the origin X coordinate to
[in]xThe origin X coordinate
Note:
The origin will only take effect if the renderer supports the ENESIM_RENDERER_FEATURE_TRANSLATE

Gets the origin X coordinate of a renderer .

Parameters:
[in]rThe renderer to get the origin X coordinate from
Returns:
The origin X coordinate
EAPI void enesim_renderer_y_origin_set ( Enesim_Renderer r,
double  y 
)

Sets the origin Y coordinate of a renderer .

Parameters:
[in]rThe renderer to set the origin Y coordinate to
[in]yThe origin Y coordinate
Note:
The origin will only take effect if the renderer supports the ENESIM_RENDERER_FEATURE_TRANSLATE

Gets the origin Y coordinate of a renderer .

Parameters:
[in]rThe renderer to get the origin Y coordinate from
Returns:
The origin Y coordinate
EAPI void enesim_renderer_visibility_set ( Enesim_Renderer r,
Eina_Bool  visible 
)

Sets the visibility of a renderer .

Parameters:
[in]rThe renderer to set the visibility to
[in]visibleSet EINA_TRUE to make it visible or EINA_FALSE to make it invisible

Gets the visibility of a renderer .

Parameters:
[in]rThe renderer to get the visibility from
Returns:
EINA_TRUE if it is visible, EINA_FALSE otherwise
EAPI void enesim_renderer_color_set ( Enesim_Renderer r,
Enesim_Color  color 
)

Sets the color of a renderer .

Parameters:
[in]rThe renderer to set the color to
[in]colorThe color

Every renderer beside it's own specific attributes has a common color attribute which is used to colorize the final drawing of the renderer. This functions sets such color.

Gets the color of a renderer .

Parameters:
[in]rThe renderer to get the color from
Returns:
The color
EAPI void enesim_renderer_mask_set ( Enesim_Renderer r,
Enesim_Renderer mask 
)

Sets the mask renderer for a renderer .

Parameters:
[in]rThe renderer to set the mask renderer to
[in]maskThe mask renderer to use [Transfer full]

A renderer can be masked by the pixels generated by another renderer. This functions sets such renderer

Gets the mask renderer from a renderer .

Parameters:
[in]rThe renderer to get the mask renderer from
Returns:
The mask renderer [Transfer none]

Sets the channel to use for masking .

Parameters:
[in]rThe renderer to set the mask channel to
[in]channelThe channel to use

When using a mask renderer for masking a renderer the channel defines how to manage the mask pixels to mask

Gets the mask channel from a renderer .

Parameters:
[in]rThe renderer to get the mask channel from
Returns:
The mask channel

Sets the quality of a renderer .

Parameters:
[in]rThe renderer to set the quality to
[in]qualityThe quality to set
Note:
The quality will only take effect if the renderer supports the ENESIM_RENDERER_FEATURE_QUALITY

Gets the quality of a renderer .

Parameters:
[in]rThe renderer to get the quality from
Returns:
The quality

Gets the alpha hints of a renderer

Parameters:
[in]thizThe renderer to get the alpha hints from
Returns:
The alpha hints
EAPI Eina_Bool enesim_renderer_is_supported ( Enesim_Renderer r,
Enesim_Surface s 
)

Checks if a renderer supports the current state of properties.

Parameters:
[in]rThe renderer to check
[in]sThe possible destination surface of the drawing operation
Returns:
EINA_TRUE if the renderer supports the current state of properties EINA_FALSE otherwise
EAPI Eina_Bool enesim_renderer_bounds_get ( Enesim_Renderer r,
Enesim_Rectangle rect,
Enesim_Log **  log 
)

Gets the bounding box of the renderer on its own coordinate space

Parameters:
[in]rThe renderer to get the bounds from
[out]rectThe rectangle to store the bounds
[out]logIn case the functions fails, the log to put messages on. [Nullable]
Returns:
EINA_TRUE if the renderer defines a valid bounds, EINA_FALSE otherwise
EAPI Eina_Bool enesim_renderer_bounds_get_extended ( Enesim_Renderer r,
Enesim_Rectangle prev,
Enesim_Rectangle curr,
Enesim_Log **  log 
)

Gets the bounding box of the renderer on its own coordinate space.

Parameters:
[in]rThe renderer to get the bounds from
[out]prevThe rectangle to store the previous bounds
[out]currThe rectangle to store the current bounds
[out]logIn case the functions fails, the log to put messages on. [Nullable]
Returns:
EINA_TRUE if the renderer defines a valid bounds, EINA_FALSE otherwise

This function is similar to enesim_renderer_bounds_get but it also returns the bounds used for the previous drawing.

EAPI Eina_Bool enesim_renderer_destination_bounds_get ( Enesim_Renderer r,
Eina_Rectangle *  rect,
int  x,
int  y,
Enesim_Log **  log 
)

Gets the bounding box of the renderer on the destination coordinate space

Parameters:
[in]rThe renderer to get the bounds from
[out]rectThe rectangle to store the bounds
[in]xThe x destination origin
[in]yThe y destination origin
[out]logIn case the functions fails, the log to put messages on. [Nullable]
Returns:
EINA_TRUE if the renderer defines a valid bounds, EINA_FALSE otherwise
EAPI Eina_Bool enesim_renderer_destination_bounds_get_extended ( Enesim_Renderer r,
Eina_Rectangle *  prev,
Eina_Rectangle *  curr,
int  x,
int  y,
Enesim_Log **  log 
)

Gets the bounding box of the renderer on the destination coordinate space.

Parameters:
[in]rThe renderer to get the bounds from
[out]prevThe rectangle to store the previous bounds. [Nullable]
[out]currThe rectangle to store the current bounds. [Nullable]
[in]xThe x destination origin
[in]yThe y destination origin
[out]logIn case the functions fails, the log to put messages on. [Nullable]
Returns:
EINA_TRUE if the renderer defines a valid bounds, EINA_FALSE otherwise

This function is similar to enesim_renderer_destination_bounds_get but it also returns the bounds used for the previous drawing.

Get the features a renderer support.

Parameters:
[in]rThe renderer to get the features from
Returns:
The renderer features

Check if a renderer has changed.

Parameters:
[in]rThe renderer to check for changes
Returns:
EINA_TRUE in case the renderer has changed after the last draw, EINA_FALSE otherwise.
EAPI Eina_Bool enesim_renderer_damages_get ( Enesim_Renderer r,
Enesim_Renderer_Damage  cb,
void *  user_data 
)

Get the damaged areas of a renderer.

Parameters:
[in]rThe renderer to get the damages from
[in]cbThe function to call on every damaged area
[in]user_dataThe user provided data that is passed in on the cb function
Returns:
EINA_TRUE if there is at least one damaged area, EINA_FALSE otherwise

This function gets the damaged area of a renderer. Whenever a renderer changes by setting some attributes on it, it might need to redraw on some areas. Those areas to redraw are called damaged areas. The damaged areas are cleared whenever a renderer is drawn again.

EAPI Eina_Bool enesim_renderer_draw ( Enesim_Renderer r,
Enesim_Surface s,
Enesim_Rop  rop,
Eina_Rectangle *  clip,
int  x,
int  y,
Enesim_Log **  log 
)

Draw a renderer into a surface

Parameters:
[in]rThe renderer to draw
[in]sThe surface to draw the renderer into
[in]ropThe raster operation to use for drawing
[in]clipThe area on the destination surface to limit the drawing. [Nullable]
[in]xThe x origin of the destination surface
[in]yThe y origin of the destination surface
[out]logIn case the drawing fails, the log to put messages on. [Nullable]
Returns:
EINA_TRUE if the the drawing was successfull, EINA_FALSE otherwise. In case the drawing fails the log is filled with the failed message
EAPI Eina_Bool enesim_renderer_draw_list ( Enesim_Renderer r,
Enesim_Surface s,
Enesim_Rop  rop,
Eina_List *  clips,
int  x,
int  y,
Enesim_Log **  log 
)

Draw a renderer into a surface

Parameters:
[in]rThe renderer to draw
[in]sThe surface to draw the renderer into
[in]ropThe raster operation to use for drawing
[in]clipsA list of clipping areas on the destination surface to limit the drawing. [Nullable]
[in]xThe x origin of the destination surface
[in]yThe y origin of the destination surface
[out]logIn case the drawing fails, the log to put messages on. [Nullable]
Returns:
EINA_TRUE if the the drawing was successfull, EINA_FALSE otherwise. In case the drawing fails the log is filled with the failed message

Sets the default quality used whenever a renderer is created

Parameters:
[in]qualityThe new default quality
EAPI Eina_Bool enesim_renderer_type_get ( Enesim_Renderer r,
const char **  lib,
char **  name 
)

Get the type of a renderer .

Parameters:
[in]rThe renderer to get the type from
[out]libThe ender library associated with this renderer
[out]nameThe ender item name of the renderer [Transfer full]
Returns:
EINA_TRUE if the function succeeds, EINA_FALSE otherwise

This function is needed for ender in order to downcast a renderer

 All Data Structures Variables