enesim  0.0.23.1
Drawinglibrary
Defines | Enumerations | Functions
Format

Defines

#define ENESIM_FORMAT_LAST   (ENESIM_FORMAT_A8 + 1)

Enumerations

enum  Enesim_Format {
  ENESIM_FORMAT_NONE,
  ENESIM_FORMAT_ARGB8888,
  ENESIM_FORMAT_A8
}

Functions

EAPI const char * enesim_format_name_get (Enesim_Format f)
 Get the string based name of a format.
EAPI size_t enesim_format_size_get (Enesim_Format f, uint32_t w, uint32_t h)
 Get the total size of bytes for a given a format and a size.
EAPI size_t enesim_format_stride_get (Enesim_Format fmt, uint32_t w)
 Return the stride for a given format and width.

Enumeration Type Documentation

Surface formats

Enumerator:
ENESIM_FORMAT_ARGB8888 

argb32

ENESIM_FORMAT_A8 

a8


Function Documentation

EAPI const char* enesim_format_name_get ( Enesim_Format  f)

Get the string based name of a format.

Parameters:
[in]fThe format to get the name from.
Returns:
The name of the format.

This function returns a string associated to the format f, for convenience display of the format. If f is not a valid format or an unsupported one, NULL is returned.

EAPI size_t enesim_format_size_get ( Enesim_Format  f,
uint32_t  w,
uint32_t  h 
)

Get the total size of bytes for a given a format and a size.

Parameters:
[in]fThe format.
[in]wThe width.
[in]hThe height.
Returns:
The size in bytes of a bitmap.

This function returns the size in bytes of a bitmap of format f, width w and height h. If the format is not valid or is not supported, 0 is returned.

EAPI size_t enesim_format_stride_get ( Enesim_Format  fmt,
uint32_t  w 
)

Return the stride for a given format and width.

Parameters:
[in]fmtThe format.
[in]wThe width.
Returns:
The stride in bytes.

This function returns the stride in bytes of a bitmap of format fmt and width w. If the format is not valid or is not supported, 0 is returned.

Note:
This function calls enesim_format_size_get() with 1 as height.
 All Data Structures Variables