Utility APIS
sgui_time_delay_hmsm
Defined in <sparklet_api.h> |
Version |
---|---|
void sgui_time_delay_hmsm (int hours, int minutes, int seconds, int milli) |
Since 1.1 |
This function is used internally in the SGUI library to delay execution for given hours/mins/seconds/milli seconds.
PARAMETERS
Hours |
Hours to be delayed |
Minutes |
Minutes to be delayed |
Seconds |
Seconds to be delayed |
Milli |
Milliseconds to be delayed |
RETURN VALUE
This function returns none.
Example
The below code sleeps on the current execution context for 1 seconds and 10 millisends.
sgui_time_delay_hmsm (0, 0, 1, 10); |
sgui_decode_jpeg_to_memory
Defined in <sparklet_api.h> |
Version |
---|---|
int sgui_decode_jpeg_to_memory (void *ptr_dest, void *ptr_jpeg_data, INT32U u32_jpeg_size, INT16U u16_width, INT16U u16_height, int non_blocking) |
Since 3.1 |
This function decodes the given JPEG image data to the provided destination address.
PARAMETERS:
ptr_dest |
Address where the JPEG image is to be decoded |
ptr_jpeg_data |
Address where the JPEG image data is available |
u32_jpeg_size |
Size of JPEG image in bytes |
u16_width |
Width of JPEG image in pixels |
u16_height |
Height of JPEG image in pixels |
non_blocking |
Mode of decoding |
RETURN VALUE:
#define JPEG_LAST_DECODE_SUCCESS 0
#define JPEG_LAST_DECODE_ERROR -1
#define JPEG_SUCCESFULLY_ACCEPTED_FOR_DECODING 1
#define JPEG_ANOTHER_OPERATION_IN_PROGRESS 2
Example:
The function below decodes the given JPEG image data at jpeg_img_data to the destination jpeg_img_dest in blocking mode. The image size is 2048 bytes of dimensions 800*480.
sgui_decode_jpeg_to_memory (&jpeg_img_dest, &jpeg_img_data, 2048, 800, 480, 0); |
sgui_validate_image
Defined in <sparklet_api.h> |
Version |
---|---|
sgui_validate_image (void *start_addr, int img_type, int validation_type) |
Since 3.1 |
This function validates the image data originally generated by Flint tool based on the given image type and validation type.
PARAMETERS:
start_addr |
Start address of the image data to be validated. |
img_type |
Image data type (0 - meta data, 1 - auxiliary data). |
validation_type |
Validation type 0 - End to end validation checking only the important signatures 1 – CRC. Full image is validated and is time consuming |
RETURN VALUE:
Success 1
Failure 0
Example:
The function below validates the given image data at img_data only as meta data with cyclic redundancy check (CRC) validation.
sgui_validate_image (&img_data, 0, 1); |
sgui_get_image_version
Defined in <sparklet_api.h> |
Version |
---|---|
sgui_get_image_version (INT32U *ptr_major, INT32U *ptr_minor, INT32U *ptr_level) |
Since 3.1 |
This function gets the image version.
PARAMETERS:
ptr_major |
Address to store the Major Release version. |
ptr_minor |
Address to store the Minor Release version. |
ptr_level |
Address to store the Level Release version. |
RETURN VALUE:
This function returns none.
Example:
The below code gets the image version.
sgui_get_image_version (&u32_major, &u32_minor, &u32_level); |
sgui_get_sparklet_version
Defined in <sparklet_api.h> |
Version |
---|---|
void sgui_get_sparklet_version (INT32U *ptr_major, INT32U *ptr_minor, INT32U *ptr_level) |
Since 3.1 |
This function fetches the Sparklet library version.
PARAMETERS:
ptr_major |
Address to store the Major Release version. |
ptr_minor |
Address to store the Minor Release version. |
ptr_level |
Address to store the Level Release version. |
RETURN VALUE:
This function returns none.
Example:
The code below gets the sparklet library version.
sgui_get_sparklet_version (&u32_major, &u32_minor, &u32_level); |
sgui_debug_enable
Defined in <sparklet_api.h> |
Version |
---|---|
int sgui_debug_enable (INT32U u32_type); |
Since 3.3.3 |
This function can be used to enable debug information from Sparklet engine to understand the internal flow.
For more information visit the Support for debugging page.
PARAMETERS:
u32_type |
ORed Bit Fields of hte debug feature to be enabled |
RETURN VALUE:
0 - Success
Example:
The below code enables debug information with respect to draw requests and memory pool management.
1sgui_debug_enable (SGUI_DEBUG_DRAW_REQUESTS | SGUI_DEBUG_POOL_ALLOCATION);