enesim  0.0.23.1
Drawinglibrary
Modules | Typedefs | Functions
Buffer

Target device pixel data holder. More...

Modules

 Buffer format
 Buffer definitions

Typedefs

typedef void(* Enesim_Buffer_Free )(void *buffer_data, void *data)
 Free function callback.
typedef struct _Enesim_Buffer Enesim_Buffer

Functions

EAPI Enesim_Bufferenesim_buffer_new (Enesim_Buffer_Format f, uint32_t w, uint32_t h)
 Create a new buffer using the default memory pool.
EAPI Enesim_Bufferenesim_buffer_new_data_from (Enesim_Buffer_Format f, uint32_t w, uint32_t h, Eina_Bool copy, Enesim_Buffer_Sw_Data *sw_data, Enesim_Buffer_Free free_func, void *free_func_data)
 Create a new buffer using an user provided data.
EAPI Enesim_Bufferenesim_buffer_new_pool_from (Enesim_Buffer_Format f, uint32_t w, uint32_t h, Enesim_Pool *p)
 Create a new buffer using a pool.
EAPI Enesim_Bufferenesim_buffer_new_pool_and_data_from (Enesim_Buffer_Format f, uint32_t w, uint32_t h, Enesim_Pool *p, Eina_Bool copy, Enesim_Buffer_Sw_Data *sw_data, Enesim_Buffer_Free free_func, void *free_func_data)
 Create a new buffer using a pool and an user provided data.
EAPI Enesim_Bufferenesim_buffer_ref (Enesim_Buffer *b)
 Increase the reference counter of a buffer.
EAPI void enesim_buffer_unref (Enesim_Buffer *b)
 Decrease the reference counter of a buffer.
EAPI void enesim_buffer_size_get (const Enesim_Buffer *b, int *w, int *h)
 Gets the size of a buffer.
EAPI Enesim_Buffer_Format enesim_buffer_format_get (const Enesim_Buffer *b)
 Gets the format of a buffer.
EAPI Enesim_Backend enesim_buffer_backend_get (const Enesim_Buffer *b)
 Gets the backend of a buffer.
EAPI Enesim_Poolenesim_buffer_pool_get (Enesim_Buffer *b)
 Gets the pool of a buffer.
EAPI void enesim_buffer_private_set (Enesim_Buffer *b, void *data)
 Store a private data pointer into the buffer.
EAPI void * enesim_buffer_private_get (Enesim_Buffer *b)
 Retrieve the private data pointer from the buffer.
EAPI Eina_Bool enesim_buffer_sw_data_get (const Enesim_Buffer *b, Enesim_Buffer_Sw_Data *data)
 Gets the data of a buffer.
EAPI Eina_Bool enesim_buffer_map (const Enesim_Buffer *b, Enesim_Buffer_Sw_Data *data)
EAPI Eina_Bool enesim_buffer_unmap (const Enesim_Buffer *b, Enesim_Buffer_Sw_Data *data, Eina_Bool written)
 Unmaps the buffer Call this function when the mapped data of a buffer is no longer needed.
EAPI void enesim_buffer_lock (Enesim_Buffer *b, Eina_Bool write)
 Locks a buffer.
EAPI void enesim_buffer_unlock (Enesim_Buffer *b)
 Unlocks a buffer.
EAPI void enesim_buffer_alpha_hint_set (Enesim_Buffer *thiz, Enesim_Alpha_Hint hint)
EAPI Enesim_Alpha_Hint enesim_buffer_alpha_hint_get (Enesim_Buffer *thiz)
EAPI Eina_Bool enesim_buffer_convert (Enesim_Buffer *thiz, Enesim_Buffer *dst)
EAPI Eina_Bool enesim_buffer_convert_list (Enesim_Buffer *thiz, Enesim_Buffer *dst, Eina_List *clips)

Detailed Description

Target device pixel data holder.


Typedef Documentation

typedef void(* Enesim_Buffer_Free)(void *buffer_data, void *data)

Free function callback.

Parameters:
buffer_dataThe buffer data provided by the user
dataThe user private data This function is used to free the data provided for the creation
See also:
enesim_buffer_new_pool_and_data_from()
enesim_buffer_new_data_from()
enesim_surface_new_data_from()
typedef struct _Enesim_Buffer Enesim_Buffer

Buffer Handle


Function Documentation

EAPI Enesim_Buffer* enesim_buffer_new ( Enesim_Buffer_Format  f,
uint32_t  w,
uint32_t  h 
)

Create a new buffer using the default memory pool.

Parameters:
[in]fThe format of the buffer
[in]wThe width of the buffer
[in]hThe height of the buffer
Returns:
The newly created buffer
See also:
enesim_pool_default_get()
enesim_pool_default_set()
EAPI Enesim_Buffer* enesim_buffer_new_data_from ( Enesim_Buffer_Format  f,
uint32_t  w,
uint32_t  h,
Eina_Bool  copy,
Enesim_Buffer_Sw_Data sw_data,
Enesim_Buffer_Free  free_func,
void *  user_data 
)

Create a new buffer using an user provided data.

Parameters:
[in]fThe format of the buffer
[in]wThe width of the buffer
[in]hThe height of the buffer
[in]copyIn case the data needs to be copied to create the buffer or used directly
[in]sw_dataThe data of the buffer pixels
[in]free_funcThe function to be called whenever the data of the buffer needs to be freed
[in]user_dataThe private data for the free_func callback
Returns:
The newly created buffer
EAPI Enesim_Buffer* enesim_buffer_new_pool_from ( Enesim_Buffer_Format  f,
uint32_t  w,
uint32_t  h,
Enesim_Pool p 
)

Create a new buffer using a pool.

Parameters:
[in]fThe format of the buffer
[in]wThe width of the buffer
[in]hThe height of the buffer
[in]pThe pool to use
Returns:
The newly created buffer
EAPI Enesim_Buffer* enesim_buffer_new_pool_and_data_from ( Enesim_Buffer_Format  f,
uint32_t  w,
uint32_t  h,
Enesim_Pool p,
Eina_Bool  copy,
Enesim_Buffer_Sw_Data sw_data,
Enesim_Buffer_Free  free_func,
void *  free_func_data 
)

Create a new buffer using a pool and an user provided data.

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

Increase the reference counter of a buffer.

Parameters:
[in]bThe buffer
Returns:
The input parameter b for programming convenience
EAPI void enesim_buffer_unref ( Enesim_Buffer b)

Decrease the reference counter of a buffer.

Parameters:
[in]bThe buffer
EAPI void enesim_buffer_size_get ( const Enesim_Buffer b,
int *  w,
int *  h 
)

Gets the size of a buffer.

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

Gets the format of a buffer.

Parameters:
[in]bThe buffer to get the format from
Returns:
The format of the buffer

Gets the backend of a buffer.

Parameters:
[in]bThe buffer to get the backend from
Returns:
The backend of the buffer

Gets the pool of a buffer.

Parameters:
[in]bThe buffer to get the pool from
Returns:
The pool of the buffer
EAPI void enesim_buffer_private_set ( Enesim_Buffer b,
void *  data 
)

Store a private data pointer into the buffer.

Parameters:
[in]bThe buffer to store the data in
[in]dataThe user provided data

Retrieve the private data pointer from the buffer.

Parameters:
[in]bThe buffer to retrieve the data from
EAPI Eina_Bool enesim_buffer_sw_data_get ( const Enesim_Buffer b,
Enesim_Buffer_Sw_Data data 
)

Gets the data of a buffer.

Parameters:
[in]bThe buffer to get the data from
[out]dataThe data of the buffer
Returns:
Eina_True if it is possible to get the data, Eina_False otherwise
EAPI Eina_Bool enesim_buffer_map ( const Enesim_Buffer b,
Enesim_Buffer_Sw_Data data 
)

Maps the buffer into user space memory

Parameters:
[in]bThe buffer to map
[out]dataThe pointer to store the buffer data
Returns:
EINA_TRUE if sucessfull, EINA_FALSE otherwise
EAPI Eina_Bool enesim_buffer_unmap ( const Enesim_Buffer b,
Enesim_Buffer_Sw_Data data,
Eina_Bool  written 
)

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

Parameters:
[in]bThe buffer to unmap
[in]dataThe pointer where the buffer 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_buffer_lock ( Enesim_Buffer b,
Eina_Bool  write 
)

Locks a buffer.

Parameters:
[in]bThe buffer to lock
[in]writeLock for writing
EAPI void enesim_buffer_unlock ( Enesim_Buffer b)

Unlocks a buffer.

Parameters:
[in]bThe buffer to unlock

Set the alpha hint on a buffer

Parameters:
[in]thizThe buffer to set the alpha hint
[in]hintThe alpha hint to set

Get the alpha hint on a buffer

Parameters:
[in]thizThe buffer to get the alpha hint from
Returns:
The buffer alpha hint
EAPI Eina_Bool enesim_buffer_convert ( Enesim_Buffer thiz,
Enesim_Buffer dst 
)

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

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

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

Parameters:
[in]thizThe buffer 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