Tizen Native API
|
This group provides general utilities functions.
- Remarks:
- Some functions that are handy but are not specific to canvas or objects.
Functions | |
const char * | evas_load_error_str (Evas_Load_Error error) |
Converts the given Evas image load error code into a string describing it in English. | |
void | evas_color_hsv_to_rgb (float h, float s, float v, int *r, int *g, int *b) |
Converts a given color from HSV to RGB format. | |
void | evas_color_rgb_to_hsv (int r, int g, int b, float *h, float *s, float *v) |
Converts a given color from RGB to HSV format. | |
void | evas_color_argb_premul (int a, int *r, int *g, int *b) |
Pre-multiplies a rgb triplet by an alpha factor. | |
void | evas_color_argb_unpremul (int a, int *r, int *g, int *b) |
Undoes pre-multiplication of a rgb triplet by an alpha factor. | |
void | evas_data_argb_premul (unsigned int *data, unsigned int len) |
Pre-multiplies data by an alpha factor. | |
void | evas_data_argb_unpremul (unsigned int *data, unsigned int len) |
Undoes pre-multiplication data by an alpha factor. | |
int | evas_string_char_next_get (const char *str, int pos, int *decoded) |
Gets the next character in the string. | |
int | evas_string_char_prev_get (const char *str, int pos, int *decoded) |
Gets the previous character in the string. | |
int | evas_string_char_len_get (const char *str) |
Gets the length in characters of the string. |
Function Documentation
void evas_color_argb_premul | ( | int | a, |
int * | r, | ||
int * | g, | ||
int * | b | ||
) |
Pre-multiplies a rgb triplet by an alpha factor.
This function pre-multiplies a given rgb triplet by an alpha factor. Alpha factor is used to define transparency.
- Since :
- 2.3.1
- Parameters:
-
[in] a The alpha factor [out] r The Red component of the color [out] g The Green component of the color [out] b The Blue component of the color
void evas_color_argb_unpremul | ( | int | a, |
int * | r, | ||
int * | g, | ||
int * | b | ||
) |
Undoes pre-multiplication of a rgb triplet by an alpha factor.
This function undoes pre-multiplication a given rbg triplet by an alpha factor. Alpha factor is used to define transparency.
- Since :
- 2.3.1
- Parameters:
-
[in] a The alpha factor [out] r The Red component of the color [out] g The Green component of the color [out] b The Blue component of the color
- See also:
- evas_color_argb_premul().
void evas_color_hsv_to_rgb | ( | float | h, |
float | s, | ||
float | v, | ||
int * | r, | ||
int * | g, | ||
int * | b | ||
) |
Converts a given color from HSV to RGB format.
This function converts a given color in HSV color format to RGB color format.
- Since :
- 2.3.1
- Parameters:
-
[in] h The Hue component of the color [in] s The Saturation component of the color [in] v The Value component of the color [out] r The Red component of the color [out] g The Green component of the color [out] b The Blue component of the color
void evas_color_rgb_to_hsv | ( | int | r, |
int | g, | ||
int | b, | ||
float * | h, | ||
float * | s, | ||
float * | v | ||
) |
Converts a given color from RGB to HSV format.
This function converts a given color in RGB color format to HSV color format.
- Since :
- 2.3.1
- Parameters:
-
[in] r The Red component of the color [in] g The Green component of the color [in] b The Blue component of the color [out] h The Hue component of the color [out] s The Saturation component of the color [out] v The Value component of the color
void evas_data_argb_premul | ( | unsigned int * | data, |
unsigned int | len | ||
) |
Pre-multiplies data by an alpha factor.
This function pre-multiplies a given data by an alpha factor. Alpha factor is used to define transparency.
- Since :
- 2.3.1
- Parameters:
-
[in] data The data value [in] len The length value
void evas_data_argb_unpremul | ( | unsigned int * | data, |
unsigned int | len | ||
) |
Undoes pre-multiplication data by an alpha factor.
This function undoes the pre-multiplication of a given data by an alpha factor. Alpha factor is used to define transparency.
- Since :
- 2.3.1
- Parameters:
-
[in] data The data value [in] len The length value
const char* evas_load_error_str | ( | Evas_Load_Error | error | ) |
Converts the given Evas image load error code into a string describing it in English.
- Since :
- 2.3.1
- Remarks:
- Mostly evas_object_image_file_set() would be the function setting that error value afterwards, but also evas_object_image_load(), evas_object_image_save(), evas_object_image_data_get(), evas_object_image_data_convert(), evas_object_image_pixels_import() and evas_object_image_is_inside(). This function is meant to be used in conjunction with evas_object_image_load_error_get(), as in:
-
The following is an example code:
-
Here,
valid_path
is the path to a valid image andbogus_path
is a path to a file which does not exist. The two outputs of evas_load_error_str() would be (if no other errors occur):"No error on load"
and"File (or file path) does not exist"
, respectively.
- Parameters:
-
[in] error The error code
A value in Evas_Load_Error.
- Returns:
- A valid string
If the given error is not supported,"Unknown error"
is returned.
int evas_string_char_len_get | ( | const char * | str | ) |
Gets the length in characters of the string.
- Since :
- 2.3.1
- Parameters:
-
[in] str The string to get the length of
- Returns:
- The length in characters (not bytes)
int evas_string_char_next_get | ( | const char * | str, |
int | pos, | ||
int * | decoded | ||
) |
Gets the next character in the string.
- Remarks:
- Given the UTF-8 string in str, and starting byte position in pos, this function places in decoded the decoded code point at pos and return the byte index for the next character in the string. The only boundary check done is that pos must be >= 0. Other than that, no checks are performed, so passing an index value that is not within the length of the string results in undefined behavior.
- Since :
- 2.3.1
- Parameters:
-
[in] str The UTF-8 string [in] pos The byte index where to start [out] decoded The address to store the decoded code point
This is optional.
- Returns:
- The byte index of the next character
int evas_string_char_prev_get | ( | const char * | str, |
int | pos, | ||
int * | decoded | ||
) |
Gets the previous character in the string.
- Since :
- 2.3.1
- Remarks:
- Given the UTF-8 string in str, and starting byte position in pos, this function places in decoded the decoded code point at pos and return the byte index for the previous character in the string.
- The only boundary check done is that pos must be >= 1. Other than that, no checks are performed, so passing an index value that is not within the length of the string results in undefined behavior.
- Parameters:
-
[in] str The UTF-8 string [in] pos The byte index where to start [out] decoded The address where to store the decoded code point
This is optional.
- Returns:
- The byte index of the previous character