|
Eina_Tiler * | eina_tiler_new (int w, int h) |
| Creates a new tiler with w width and h height. More...
|
|
void | eina_tiler_free (Eina_Tiler *t) |
| Frees a tiler. More...
|
|
void | eina_tiler_tile_size_set (Eina_Tiler *t, int w, int h) |
| Sets the size of tiles for a tiler. More...
|
|
void | eina_tiler_area_size_set (Eina_Tiler *t, int w, int h) |
| Change the size of the area covered by the tiler. More...
|
|
void | eina_tiler_area_size_get (const Eina_Tiler *t, int *w, int *h) |
| Get the size of the area covered by the tiler. More...
|
|
void | eina_tiler_strict_set (Eina_Tiler *t, Eina_Bool strict) |
| Define if we need to follow a strict grid of tile or a loosy one. More...
|
|
Eina_Bool | eina_tiler_empty (Eina_Tiler *t) |
| Tell if a tiler is empty or not. More...
|
|
Eina_Bool | eina_tiler_rect_add (Eina_Tiler *t, const Eina_Rectangle *r) |
| Adds a rectangle to a tiler. More...
|
|
void | eina_tiler_rect_del (Eina_Tiler *t, const Eina_Rectangle *r) |
| Removes a rectangle from a tiler. More...
|
|
void | eina_tiler_clear (Eina_Tiler *t) |
| Removes all rectangles from tiles. More...
|
|
Eina_Iterator * | eina_tiler_iterator_new (const Eina_Tiler *t) |
| Create a iterator to access the tilers calculated rectangles. More...
|
|
Eina_Iterator * | eina_tile_grid_slicer_iterator_new (int x, int y, int w, int h, int tile_w, int tile_h) |
| Creates a new Eina_Iterator that iterates over a list of tiles. More...
|
|
static Eina_Bool | eina_tile_grid_slicer_next (Eina_Tile_Grid_Slicer *slc, const Eina_Tile_Grid_Info **rect) |
| Iterates over the tiles set by eina_tile_grid_slicer_setup(). More...
|
|
static Eina_Bool | eina_tile_grid_slicer_setup (Eina_Tile_Grid_Slicer *slc, int x, int y, int w, int h, int tile_w, int tile_h) |
| Setup an Eina_Tile_Grid_Slicer struct. More...
|
|
- Warning
- This is a very low level tool, in most situations(for example if you're using evas) you won't need this.
Basic usage
Eina_Tiler is a tool to facilitate calculations of which areas are damaged and thus need to be re-rendered. The basic usage of Eina_Tiler is to give it the size of your canvas and a set of rectangular areas that need re-rendering, from that and using heuristics it'll tell you an efficient way to re-render in the form of a set of non-overlapping rectangles that covers the whole area that needs re-rendering.
The following is pseudo-code showing some simple use of Eina_Tiler:
eina_tiler_add(tiler, rect);
my_function_that_repaints_areas_of_the_canvas(rect);
- See Also
- eina_tiler_new()
-
eina_tiler_rect_add()
-
eina_tiler_iterator_new()
- Warning
- There are no guarantees that this will be the most efficient way to re-render for any particular case.
Grid Slicer
Grid slicer and Eina_Tiler are usually used together, that is however not necessary, they can be used independently. Grid slicer provides an easy API to divide an area in tiles which is useful in certain applications to divide the area that will be rendered into tiles. It's customary to, then create one Eina_Tiler for each tile.
The following is pseudo-code showing a very simplified use of grid slicer together with Eina_Tiler:
{
eina_tiler_add(tiler, rect);
my_function_that_repaints_areas_of_the_canvas(rect);
}
- See Also
- eina_tiler_new()
-
eina_tiler_rect_add()
-
eina_tile_grid_slicer_setup()
-
eina_tile_grid_slicer_next()
-
eina_tile_grid_slicer_iterator_new()
Frees a tiler.
- Parameters
-
This function frees t
. It does not free the memory allocated for the elements of t
.
void eina_tiler_tile_size_set |
( |
Eina_Tiler * |
t, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
Sets the size of tiles for a tiler.
- Parameters
-
t | The tiler whose tile size will be set. |
w | Width of the tiles. |
h | Height of the tiles. |
- Warning
w
and h
must be greater than zero, otherwise tile size won't be changed.
-
Tile size is not used!
References EINA_FALSE.
void eina_tiler_area_size_set |
( |
Eina_Tiler * |
t, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
Change the size of the area covered by the tiler.
- Parameters
-
t | The tiler whose area size will be set. |
w | Width of the area. |
h | Height of the area. |
- Since
- 1.8
- Warning
- Must clear the tiler before changing its size.
void eina_tiler_area_size_get |
( |
const Eina_Tiler * |
t, |
|
|
int * |
w, |
|
|
int * |
h |
|
) |
| |
Get the size of the area covered by the tiler.
- Parameters
-
t | The tiler whose area size will be fetched. |
w | Width of the area. |
h | Height of the area. |
- Since
- 1.8
Define if we need to follow a strict grid of tile or a loosy one.
- Parameters
-
t | The tiler to apply the strict rules to. |
strict | Define if it will be strict or loosy |
By default it will be loosy.
- Since
- 1.8
Tell if a tiler is empty or not.
- Parameters
-
t | The tiler to apply the strict rules to. |
- Returns
- EINA_TRUE when empty, EINA_FALSE when not.
- Since
- 1.8
References EINA_TRUE.
Eina_Iterator* eina_tile_grid_slicer_iterator_new |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
int |
tile_w, |
|
|
int |
tile_h |
|
) |
| |
static Eina_Bool eina_tile_grid_slicer_setup |
( |
Eina_Tile_Grid_Slicer * |
slc, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
int |
tile_w, |
|
|
int |
tile_h |
|
) |
| |
|
inlinestatic |
Setup an Eina_Tile_Grid_Slicer struct.
- Parameters
-
slc | Pointer to an Eina_Tile_Grid_Slicer struct. |
x | X axis coordinate. |
y | Y axis coordinate. |
w | width. |
h | height. |
tile_w | tile width. |
tile_h | tile height. |
- Returns
- A pointer to the Eina_Iterator.
NULL
on failure.
The region defined by x, y, w, h will be divided in to a grid of tiles of width tile_w and height tile_h
, slc
can then be used with eina_tile_grid_slicer_next() to access each tile.
- Note
- Consider using eina_tile_grid_slicer_iterator_new() instead.
Referenced by eina_tile_grid_slicer_iterator_new().