Some functions that are handy but are not specific of canvas or objects. More...
Functions | |
EVAS_API const char * | evas_load_error_str (Evas_Load_Error error) |
Converts the given Evas image load error code into a string describing it in human-readable text. More... | |
EVAS_API void | evas_color_hsv_to_rgb (float h, float s, float v, int *r, int *g, int *b) |
Convert a given color from HSV to RGB format. More... | |
EVAS_API void | evas_color_rgb_to_hsv (int r, int g, int b, float *h, float *s, float *v) |
Convert a given color from RGB to HSV format. More... | |
EVAS_API void | evas_color_argb_premul (int a, int *r, int *g, int *b) |
Pre-multiplies a rgb triplet by an alpha factor. More... | |
EVAS_API void | evas_color_argb_unpremul (int a, int *r, int *g, int *b) |
Undo pre-multiplication of a rgb triplet by an alpha factor. More... | |
EVAS_API void | evas_data_argb_premul (unsigned int *data, unsigned int len) |
Pre-multiplies data by an alpha factor. More... | |
EVAS_API void | evas_data_argb_unpremul (unsigned int *data, unsigned int len) |
Undo pre-multiplication data by an alpha factor. More... | |
EVAS_API int | evas_string_char_next_get (const char *str, int pos, int *decoded) |
Gets the next character in the string. More... | |
EVAS_API int | evas_string_char_prev_get (const char *str, int pos, int *decoded) |
Gets the previous character in the string. More... | |
EVAS_API int | evas_string_char_len_get (const char *str) |
Get the length in characters of the string. More... | |
EVAS_API Evas_BiDi_Direction | evas_language_direction_get (void) |
Get language direction. More... | |
EVAS_API void | evas_language_reinit (void) |
Reinitialize language from the environment. More... | |
Some functions that are handy but are not specific of canvas or objects.
EVAS_API const char * evas_load_error_str | ( | Evas_Load_Error | error | ) |
Converts the given Evas image load error code into a string describing it in human-readable text.
error | the error code, a value in Evas_Load_Error. |
error
is not supported, "Unknown error"
is returned.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:
Example code:
Here, being valid_path
the path to a valid image and bogus_path
a path to a file that 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. See the full example.
References EVAS_LOAD_ERROR_CORRUPT_FILE, EVAS_LOAD_ERROR_DOES_NOT_EXIST, EVAS_LOAD_ERROR_GENERIC, EVAS_LOAD_ERROR_NONE, EVAS_LOAD_ERROR_PERMISSION_DENIED, EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED, and EVAS_LOAD_ERROR_UNKNOWN_FORMAT.
Referenced by elm_image_memfile_set().
EVAS_API void evas_color_hsv_to_rgb | ( | float | h, |
float | s, | ||
float | v, | ||
int * | r, | ||
int * | g, | ||
int * | b | ||
) |
Convert a given color from HSV to RGB format.
h | The Hue component of the color. |
s | The Saturation component of the color. |
v | The Value component of the color. |
r | The Red component of the color. |
g | The Green component of the color. |
b | The Blue component of the color. |
This function converts a given color in HSV color format to RGB color format.
EVAS_API void evas_color_rgb_to_hsv | ( | int | r, |
int | g, | ||
int | b, | ||
float * | h, | ||
float * | s, | ||
float * | v | ||
) |
Convert a given color from RGB to HSV format.
r | The Red component of the color. |
g | The Green component of the color. |
b | The Blue component of the color. |
h | The Hue component of the color. |
s | The Saturation component of the color. |
v | The Value component of the color. |
This function converts a given color in RGB color format to HSV color format.
EVAS_API void evas_color_argb_premul | ( | int | a, |
int * | r, | ||
int * | g, | ||
int * | b | ||
) |
Pre-multiplies a rgb triplet by an alpha factor.
a | The alpha factor. |
r | The Red component of the color. |
g | The Green component of the color. |
b | The Blue component of the color. |
This function pre-multiplies a given rgb triplet by an alpha factor. Alpha factor is used to define transparency.
EVAS_API void evas_color_argb_unpremul | ( | int | a, |
int * | r, | ||
int * | g, | ||
int * | b | ||
) |
Undo pre-multiplication of a rgb triplet by an alpha factor.
a | The alpha factor. |
r | The Red component of the color. |
g | The Green component of the color. |
b | The Blue component of the color. |
This function undoes pre-multiplication a given rbg triplet by an alpha factor. Alpha factor is used to define transparency.
EVAS_API void evas_data_argb_premul | ( | unsigned int * | data, |
unsigned int | len | ||
) |
Pre-multiplies data by an alpha factor.
data | The data value. |
len | The length value. |
This function pre-multiplies a given data by an alpha factor. Alpha factor is used to define transparency.
EVAS_API void evas_data_argb_unpremul | ( | unsigned int * | data, |
unsigned int | len | ||
) |
Undo pre-multiplication data by an alpha factor.
data | The data value. |
len | The length value. |
This function undoes pre-multiplication of a given data by an alpha factor. Alpha factor is used to define transparency.
EVAS_API int evas_string_char_next_get | ( | const char * | str, |
int | pos, | ||
int * | decoded | ||
) |
Gets the next character in the string.
Given the UTF-8 string in str
, and starting byte position in pos
, this function will place 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's not within the length of the string will result in undefined behavior.
str | The UTF-8 string |
pos | The byte index where to start |
decoded | Address where to store the decoded code point. Optional. |
References eina_unicode_utf8_next_get().
Referenced by elm_entry_filter_accept_set().
EVAS_API int evas_string_char_prev_get | ( | const char * | str, |
int | pos, | ||
int * | decoded | ||
) |
Gets the previous character in the string.
Given the UTF-8 string in str
, and starting byte position in pos
, this function will place 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's not within the length of the string will result in undefined behavior.
str | The UTF-8 string |
pos | The byte index where to start |
decoded | Address where to store the decoded code point. Optional. |
References eina_unicode_utf8_get_prev().
EVAS_API int evas_string_char_len_get | ( | const char * | str | ) |
Get the length in characters of the string.
str | The string to get the length of. |
References eina_unicode_utf8_get_len().
Referenced by elm_entry_filter_limit_size().
EVAS_API Evas_BiDi_Direction evas_language_direction_get | ( | void | ) |
Get language direction.
EVAS_API void evas_language_reinit | ( | void | ) |
Reinitialize language from the environment.
The locale can change while a process is running. This call tells evas to reload the locale from the environment like it does on start.
Referenced by elm_language_set().