Tizen Native API
|
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) |
Convert 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) |
Convert 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) |
Undo 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) |
Undo 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) |
Get the length in characters of the string. |
Some functions that are handy but are not specific of canvas or objects.
Function Documentation
void evas_color_argb_premul | ( | int | a, |
int * | r, | ||
int * | g, | ||
int * | b | ||
) |
Pre-multiplies a rgb triplet by an alpha factor.
- Since :
- 2.3
- 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.
- Remarks:
- This function pre-multiplies a given rgb triplet by an alpha factor. Alpha factor is used to define transparency.
void evas_color_argb_unpremul | ( | int | a, |
int * | r, | ||
int * | g, | ||
int * | b | ||
) |
Undo pre-multiplication of a rgb triplet by an alpha factor.
- Since :
- 2.3
- 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.
- Remarks:
- This function undoes pre-multiplication a given rbg triplet by an alpha factor. Alpha factor is used to define transparency.
- See also:
- evas_color_argb_premul().
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.
- Since :
- 2.3
- 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.
- Remarks:
- This function converts a given color in HSV color format to RGB color format.
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.
- Since :
- 2.3
- 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.
- Remarks:
- This function converts a given color in RGB color format to HSV color format.
void evas_data_argb_premul | ( | unsigned int * | data, |
unsigned int | len | ||
) |
Pre-multiplies data by an alpha factor.
- Since :
- 2.3
- Parameters:
-
[in] data The data value. [in] len The length value.
- Remarks:
- This function pre-multiplies a given data by an alpha factor. Alpha factor is used to define transparency.
void evas_data_argb_unpremul | ( | unsigned int * | data, |
unsigned int | len | ||
) |
Undo pre-multiplication data by an alpha factor.
- Since :
- 2.3
- Parameters:
-
[in] data The data value. [in] len The length value.
- Remarks:
- This function undoes pre-multiplication of a given data by an alpha factor. Alpha factor is used to define transparency.
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
- Parameters:
-
[in] error the error code, a value in ::Evas_Load_Error.
- Returns:
- Always returns a valid string. If the given
error
is not supported,Unknown error
is returned.
- 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:
-
Example code:
-
Here, being
valid_path
the path to a valid image andbogus_path
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
andFile (or file path) does not exist
, respectively. See the full Some image object functions examples example.
int evas_string_char_len_get | ( | const char * | str | ) |
Get the length in characters of the string.
- Parameters:
-
[in] str The string to get the length of.
- Since :
- 2.3
- 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.
- Since :
- 2.3
- Remarks:
- Given the UTF-8 string in
str
, and starting byte position inpos
, this function will place indecoded
the decoded code point atpos
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.
- Parameters:
-
[in] str The UTF-8 string [in] pos The byte index where to start [out] decoded Address where to store the decoded code point. 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
- Remarks:
- Given the UTF-8 string in
str
, and starting byte position inpos
, this function will place indecoded
the decoded code point atpos
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.
- Parameters:
-
[in] str The UTF-8 string [in] pos The byte index where to start [out] decoded Address where to store the decoded code point. Optional.
- Returns:
- The byte index of the previous character