Tizen Native API
5.0
|
The Media Face Information API provides functions to manage the face information in the image files.
#include <media_content.h>
The Face Information API provides functions to manage the face information such as face id, face coordinates in the image files.
Functions | |
int | media_face_clone (media_face_h *dst, media_face_h src) |
Clones the media face handle. | |
int | media_face_destroy (media_face_h face) |
Destroys the media face handle. | |
int | media_face_get_face_id (media_face_h face, char **face_id) |
Gets the face id from the media face handle. | |
int | media_face_get_media_id (media_face_h face, char **media_id) |
Gets the media id from the media face handle. | |
int | media_face_get_face_rect (media_face_h face, unsigned int *rect_x, unsigned int *rect_y, unsigned int *rect_w, unsigned int *rect_h) |
Gets the face's rectangle from the media face handle. | |
int | media_face_get_orientation (media_face_h face, media_content_orientation_e *orientation) |
Gets the orientation from the media face handle. | |
int | media_face_get_tag (media_face_h face, char **tag) |
Gets the tag from the media face handle. | |
int | media_face_create (const char *media_id, media_face_h *face) |
Creates the media face handle. | |
int | media_face_set_face_rect (media_face_h face, unsigned int rect_x, unsigned int rect_y, unsigned int rect_w, unsigned int rect_h) |
Sets the face rectangle of the media face handle. | |
int | media_face_set_orientation (media_face_h face, media_content_orientation_e orientation) |
Sets the orientation of the media face handle. | |
int | media_face_set_tag (media_face_h face, const char *tag) |
Sets the tag of the media face handle. | |
int | media_face_insert_to_db (media_face_h face) |
Inserts a new face in the media database. | |
int | media_face_update_to_db (media_face_h face) |
Updates the face details to the media database. | |
int | media_face_delete_from_db (const char *face_id) |
Deletes the face with given face id from the media database. | |
int | media_face_get_face_count_from_db (filter_h filter, int *face_count) |
Gets the number of media faces with an optional filter from the media database. | |
int | media_face_foreach_face_from_db (filter_h filter, media_face_cb callback, void *user_data) |
Iterates through the faces with an optional filter from the media database. | |
Typedefs | |
typedef void * | media_face_h |
The structure type for the Media face handle. | |
typedef bool(* | media_face_cb )(media_face_h face, void *user_data) |
Called for every face in the obtained list of face. |
typedef bool(* media_face_cb)(media_face_h face, void *user_data) |
Called for every face in the obtained list of face.
Iterates over a media face list.
[in] | face | The handle of the media face |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the looptypedef void* media_face_h |
The structure type for the Media face handle.
int media_face_clone | ( | media_face_h * | dst, |
media_face_h | src | ||
) |
Clones the media face handle.
This function copies the media face handle from a source to destination. There is no media_face_create() function. The media_face_h is created internally and available through media face foreach function such as media_face_foreach_face_from_db(). To use this handle outside of these foreach functions, use this function.
[out] | dst | The destination handle to the media face |
[in] | src | The source handle to the media face |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int media_face_create | ( | const char * | media_id, |
media_face_h * | face | ||
) |
Creates the media face handle.
[in] | media_id | The media ID |
[out] | face | The media face handle |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_face_delete_from_db | ( | const char * | face_id | ) |
Deletes the face with given face id from the media database.
[in] | face_id | The ID of the media face |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
MEDIA_CONTENT_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
MEDIA_CONTENT_ERROR_NETWORK | Network fail |
int media_face_destroy | ( | media_face_h | face | ) |
Destroys the media face handle.
Function frees all resources related to media face handle. This handle no longer can be used to perform any operations. New handle has to be created before next usage.
[in] | face | The media face handle |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_face_foreach_face_from_db | ( | filter_h | filter, |
media_face_cb | callback, | ||
void * | user_data | ||
) |
Iterates through the faces with an optional filter from the media database.
This function gets all faces associated with the given filter and calls callback for every retrieved media face. If NULL
is passed to the filter, then no filtering is applied.
[in] | filter | The handle to the media filter |
[in] | callback | The callback function to be invoked |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
int media_face_get_face_count_from_db | ( | filter_h | filter, |
int * | face_count | ||
) |
Gets the number of media faces with an optional filter from the media database.
[in] | filter | The handle to the media filter |
[out] | face_count | The count of the media faces |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
int media_face_get_face_id | ( | media_face_h | face, |
char ** | face_id | ||
) |
Gets the face id from the media face handle.
[in] | face | The media face handle |
[out] | face_id | The ID of the media face |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_face_get_face_rect | ( | media_face_h | face, |
unsigned int * | rect_x, | ||
unsigned int * | rect_y, | ||
unsigned int * | rect_w, | ||
unsigned int * | rect_h | ||
) |
Gets the face's rectangle from the media face handle.
This function can get the face's rectangle information. returned rectangle information includes the orientation value.
[in] | face | The media face handle |
[out] | rect_x | The x position of the media face |
[out] | rect_y | The y position of the media face |
[out] | rect_w | The width of the media face |
[out] | rect_h | The height of the media face |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_face_get_media_id | ( | media_face_h | face, |
char ** | media_id | ||
) |
Gets the media id from the media face handle.
[in] | face | The media face handle |
[out] | media_id | The media ID |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_face_get_orientation | ( | media_face_h | face, |
media_content_orientation_e * | orientation | ||
) |
Gets the orientation from the media face handle.
This function can get the orientation value from the original image.
[in] | face | The media face handle |
[out] | orientation | The orientation of the media face |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_face_get_tag | ( | media_face_h | face, |
char ** | tag | ||
) |
Gets the tag from the media face handle.
[in] | face | The media face handle |
[out] | tag | The tag of the media face |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_face_insert_to_db | ( | media_face_h | face | ) |
Inserts a new face in the media database.
[in] | face | The media face handle |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
MEDIA_CONTENT_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
MEDIA_CONTENT_ERROR_NETWORK | Network fail |
int media_face_set_face_rect | ( | media_face_h | face, |
unsigned int | rect_x, | ||
unsigned int | rect_y, | ||
unsigned int | rect_w, | ||
unsigned int | rect_h | ||
) |
Sets the face rectangle of the media face handle.
[in] | face | The media face handle |
[in] | rect_x | The integer to set as a position x of face rectangle |
[in] | rect_y | The integer to set as a position y of face rectangle |
[in] | rect_w | The integer to set as a width of face rectangle |
[in] | rect_h | The integer to set as a height of face rectangle |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_face_set_orientation | ( | media_face_h | face, |
media_content_orientation_e | orientation | ||
) |
Sets the orientation of the media face handle.
This function may set the value of the original image orientation.
[in] | face | The media face handle |
[in] | orientation | The integer to set as an orientation |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_face_set_tag | ( | media_face_h | face, |
const char * | tag | ||
) |
Sets the tag of the media face handle.
[in] | face | The media face handle |
[in] | tag | The tag of the media face |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int media_face_update_to_db | ( | media_face_h | face | ) |
Updates the face details to the media database.
The function updates the given media face in the media database. The function should be called after any change in face, to be updated to the media database. For example, after using media_face_set_orientation() for setting the orientation of the face, media_face_update_to_db() function should be called so as to update the given face attributes in the media database.
[in] | face | The media face handle to update |
MEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
MEDIA_CONTENT_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
MEDIA_CONTENT_ERROR_NETWORK | Network fail |