enesim  0.0.23.1
Drawinglibrary
Typedefs | Functions
Surface

Native pixel data holder. More...

Typedefs

typedef struct _Enesim_Surface Enesim_Surface

Functions

EAPI Enesim_Surfaceenesim_surface_new (Enesim_Format f, uint32_t w, uint32_t h)
 Create a new surface using the default memory pool.
EAPI Enesim_Surfaceenesim_surface_new_data_from (Enesim_Format f, uint32_t w, uint32_t h, Eina_Bool copy, void *sw_data, size_t stride, Enesim_Buffer_Free free_func, void *free_func_data)
 Create a new surface using an user provided data.
EAPI Enesim_Surfaceenesim_surface_new_pool_from (Enesim_Format f, uint32_t w, uint32_t h, Enesim_Pool *p)
 Create a new surface using a pool.
EAPI Enesim_Surfaceenesim_surface_new_pool_and_data_from (Enesim_Format fmt, uint32_t w, uint32_t h, Enesim_Pool *p, Eina_Bool copy, void *sw_data, size_t stride, Enesim_Buffer_Free free_func, void *free_func_data)
 Create a new surface using a pool an user provided data.
EAPI Enesim_Surfaceenesim_surface_new_buffer_from (Enesim_Buffer *buffer)
 Create a new surface from a buffer.
EAPI Enesim_Surfaceenesim_surface_ref (Enesim_Surface *s)
 Increase the reference counter of a surface.
EAPI void enesim_surface_unref (Enesim_Surface *s)
 Decrease the reference counter of a surface.
EAPI Enesim_Bufferenesim_surface_buffer_get (Enesim_Surface *s)
 Gets the buffer associated with a surface.
EAPI void enesim_surface_size_get (const Enesim_Surface *s, int *w, int *h)
 Gets the size of a surface.
EAPI Enesim_Format enesim_surface_format_get (const Enesim_Surface *s)
 Gets the format of a surface.
EAPI Enesim_Backend enesim_surface_backend_get (const Enesim_Surface *s)
 Gets the backend of a surface.
EAPI Enesim_Poolenesim_surface_pool_get (Enesim_Surface *s)
 Gets the pool of a surface.
EAPI void enesim_surface_private_set (Enesim_Surface *s, void *data)
EAPI void * enesim_surface_private_get (Enesim_Surface *s)
EAPI Eina_Bool enesim_surface_sw_data_get (Enesim_Surface *s, void **data, size_t *stride)
EAPI Eina_Bool enesim_surface_map (const Enesim_Surface *s, void **data, size_t *stride)
EAPI Eina_Bool enesim_surface_unmap (const Enesim_Surface *s, void *data, Eina_Bool written)
 Unmaps the surface Call this function when the mapped data of a surface is no longer needed.
EAPI void enesim_surface_lock (Enesim_Surface *s, Eina_Bool write)
 Locks a surface.
EAPI void enesim_surface_unlock (Enesim_Surface *s)
 Unlocks a surface.
EAPI void enesim_surface_alpha_hint_set (Enesim_Surface *s, Enesim_Alpha_Hint hint)
EAPI Enesim_Alpha_Hint enesim_surface_alpha_hint_get (Enesim_Surface *s)
EAPI Eina_Bool enesim_surface_convert (Enesim_Surface *thiz, Enesim_Buffer *dst)
EAPI Eina_Bool enesim_surface_convert_list (Enesim_Surface *thiz, Enesim_Buffer *dst, Eina_List *clips)

Detailed Description

Native pixel data holder.

All the rendering process of an Renderer is done into a surface. A surface is the library's internal way to store pixel data. It is a specification of an Buffer but handled with it's own type Surface and functions. To get the buffer associated with a surface you can use enesim_surface_buffer_get().

A surface can be created by using enesim_surface_new() and all it's variants depending on the need. You can use your own memory to store the pixel data, a specific Pool or from an Buffer if using enesim_surface_new_buffer_from()


Typedef Documentation

typedef struct _Enesim_Surface Enesim_Surface

Surface Handle


Function Documentation

EAPI Enesim_Surface* enesim_surface_new ( Enesim_Format  f,
uint32_t  w,
uint32_t  h 
)

Create a new surface using the default memory pool.

Parameters:
[in]fThe format of the surface
[in]wThe width of the surface
[in]hThe height of the surface
Returns:
The newly created surface
See also:
enesim_pool_default_get()
enesim_pool_default_set()
EAPI Enesim_Surface* enesim_surface_new_data_from ( Enesim_Format  fmt,
uint32_t  w,
uint32_t  h,
Eina_Bool  copy,
void *  pixels,
size_t  stride,
Enesim_Buffer_Free  free_func,
void *  free_func_data 
)

Create a new surface using an user provided data.

Parameters:
[in]fmtThe format of the surface
[in]wThe width of the surface
[in]hThe height of the surface
[in]copyIn case the data needs to be copied to create the surface or used directly
[in]strideThe stride of the surface
[in]pixelsThe data of the surface pixels
[in]free_funcThe function to be called whenever the data of the surface needs to be freed
[in]free_func_dataThe private data for the free_func callback
Returns:
The newly created surface
EAPI Enesim_Surface* enesim_surface_new_pool_from ( Enesim_Format  f,
uint32_t  w,
uint32_t  h,
Enesim_Pool p 
)

Create a new surface using a pool.

Parameters:
[in]fThe format of the surface
[in]wThe width of the surface
[in]hThe height of the surface
[in]pThe pool to use
Returns:
The newly created surface
EAPI Enesim_Surface* enesim_surface_new_pool_and_data_from ( Enesim_Format  fmt,
uint32_t  w,
uint32_t  h,
Enesim_Pool p,
Eina_Bool  copy,
void *  pixels,
size_t  stride,
Enesim_Buffer_Free  free_func,
void *  free_func_data 
)

Create a new surface using a pool an user provided data.

Parameters:
[in]fmtThe format of the surface
[in]wThe width of the surface
[in]hThe height of the surface
[in]pThe pool to use
[in]copyIn case the data needs to be copied to create the surface or used directly
[in]strideThe stride of the surface
[in]pixelsThe data of the surface pixels
[in]free_funcThe function to be called whenever the data of the surface needs to be freed
[in]free_func_dataThe private data for the free_func callback
Returns:
The newly created surface

Create a new surface from a buffer.

Parameters:
[in]bufferThe buffer to create a surface from
Returns:
The newly created surface

This function creates a surface only if the buffer format is of type ENESIM_BUFFER_FORMAT_ARGB8888_PRE or ENESIM_FORMAT_ARGB8888

Increase the reference counter of a surface.

Parameters:
[in]sThe surface
Returns:
The input parameter s for programming convenience

Decrease the reference counter of a surface.

Parameters:
[in]sThe surface

Gets the buffer associated with a surface.

Parameters:
[in]sThe surface to get the buffer from
Returns:
The buffer associated with the surface. Call enesim_buffer_unref() after usage.
EAPI void enesim_surface_size_get ( const Enesim_Surface s,
int *  w,
int *  h 
)

Gets the size of a surface.

Parameters:
[in]sThe surface to get the size from
[out]wThe width of the surface
[out]hThe height of the surface

Gets the format of a surface.

Parameters:
[in]sThe surface to get the format from
Returns:
The format of the surface

Gets the backend of a surface.

Parameters:
[in]sThe surface to get the backend from
Returns:
The backend of the surface

Gets the pool of a surface.

Parameters:
[in]sThe surface to get the pool from
Returns:
The pool of the surface
EAPI void enesim_surface_private_set ( Enesim_Surface s,
void *  data 
)

Store a private data pointer into the surface

Retrieve the private data pointer from the surface

EAPI Eina_Bool enesim_surface_sw_data_get ( Enesim_Surface s,
void **  data,
size_t *  stride 
)

Gets the data associated with a software based surface

Parameters:
[in]sThe surface to get the data from
[out]dataThe pointer to store the surface data
[out]strideThe stride of the surface
Returns:
EINA_TRUE if sucessfull, EINA_FALSE otherwise
EAPI Eina_Bool enesim_surface_map ( const Enesim_Surface s,
void **  data,
size_t *  stride 
)

Maps the surface into user space memory

Parameters:
[in]sThe surface to map
[out]dataThe pointer to store the surface data
[out]strideThe stride of the surface
Returns:
EINA_TRUE if sucessfull, EINA_FALSE otherwise
EAPI Eina_Bool enesim_surface_unmap ( const Enesim_Surface s,
void *  data,
Eina_Bool  written 
)

Unmaps the surface Call this function when the mapped data of a surface is no longer needed.

Parameters:
[in]sThe surface to unmap
[in]dataThe pointer where the surface data is mapped
[in]writtenEINA_TRUE in case the mapped data has been written, EINA_FALSE otherwise
Returns:
EINA_TRUE if sucessfull, EINA_FALSE otherwise
EAPI void enesim_surface_lock ( Enesim_Surface s,
Eina_Bool  write 
)

Locks a surface.

Parameters:
[in]sThe surface to lock
[in]writeLock for writing

Unlocks a surface.

Parameters:
[in]sThe surface to unlock

Set the alpha hint on a surface

Parameters:
[in]sThe surface to set the alpha hint
[in]hintThe alpha hint to set

Get the alpha hint on a surface

Parameters:
[in]sThe surface to get the alpha hint from
Returns:
The surface alpha hint
EAPI Eina_Bool enesim_surface_convert ( Enesim_Surface thiz,
Enesim_Buffer dst 
)

Converts a surface into a buffer. Basically it will do a color space conversion.

Parameters:
[in]thizThe surface to convert
[in]dstThe destination buffer
Returns:
EINA_TRUE if the conversion was correct, EINA_FALSE otherwise
EAPI Eina_Bool enesim_surface_convert_list ( Enesim_Surface thiz,
Enesim_Buffer dst,
Eina_List *  clips 
)

Converts a surface into another buffer. Basically it will do a color space conversion.

Parameters:
[in]thizThe surface to convert
[in]dstThe destination buffer
[in]clipsA list of clipping areas on the destination surface to limit the conversion. [Nullable]
Returns:
EINA_TRUE if the conversion was correct, EINA_FALSE otherwise
 All Data Structures Variables