Blender
V3.3
|
Go to the source code of this file.
Typedefs | |
typedef void(* | IMBMetadataForeachCb) (const char *field, const char *value, void *userdata) |
Functions | |
void | IMB_metadata_ensure (struct IDProperty **metadata) |
void | IMB_metadata_free (struct IDProperty *metadata) |
bool | IMB_metadata_get_field (struct IDProperty *metadata, const char *key, char *value, size_t len) |
void | IMB_metadata_set_field (struct IDProperty *metadata, const char *key, const char *value) |
void | IMB_metadata_copy (struct ImBuf *dimb, struct ImBuf *simb) |
struct IDProperty * | IMB_anim_load_metadata (struct anim *anim) |
void | IMB_metadata_foreach (struct ImBuf *ibuf, IMBMetadataForeachCb callback, void *userdata) |
Definition at line 61 of file IMB_metadata.h.
struct IDProperty* IMB_anim_load_metadata | ( | struct anim * | anim | ) |
Definition at line 233 of file anim_movie.c.
References ANIM_AVI, ANIM_FFMPEG, ANIM_MOVIE, ANIM_NONE, ANIM_SEQUENCE, BLI_assert, anim::curtype, IMB_metadata_ensure(), IMB_metadata_set_field(), anim::metadata, and NULL.
Referenced by SEQ_add_movie_strip(), and SEQ_add_reload_new_file().
Definition at line 64 of file metadata.c.
References BLI_assert, IDP_CopyProperty(), IMB_metadata_free(), and ImBuf::metadata.
Referenced by do_render_sequencer(), IMB_makeSingleUser(), imbuf_ensure_editable(), input_preprocess(), prepare_effect_imbufs(), and seq_proxy_build_frame().
void IMB_metadata_ensure | ( | struct IDProperty ** | metadata | ) |
The metadata is a list of key/value pairs (both char *) that can me saved in the header of several image formats. Apart from some common keys like 'Software' and 'Description' (PNG standard) we'll use keys within the Blender namespace, so should be called 'Blender::StampInfo' or 'Blender::FrameNum' etc...
The keys & values are stored in ID properties, in the group "metadata". Ensure that the metadata property is a valid IDProperty object. This is a no-op when *metadata != NULL.
Definition at line 25 of file metadata.c.
References IDP_GROUP, IDP_New(), and NULL.
Referenced by BKE_imbuf_stamp_info(), BKE_stamp_info_from_imbuf(), ibJpegImageFromCinfo(), IMB_anim_load_metadata(), imb_load_openexr(), imb_loadpng(), IMB_thumb_load_image(), and thumb_create_ex().
void IMB_metadata_foreach | ( | struct ImBuf * | ibuf, |
IMBMetadataForeachCb | callback, | ||
void * | userdata | ||
) |
Definition at line 91 of file metadata.c.
References callback, IDProperty::data, ListBase::first, IDPropertyData::group, IDP_String, ImBuf::metadata, and NULL.
Referenced by BKE_stamp_info_from_imbuf(), ED_region_image_metadata_panel_draw(), metadata_box_height_get(), and metadata_draw_imbuf().
void IMB_metadata_free | ( | struct IDProperty * | metadata | ) |
Definition at line 35 of file metadata.c.
References IDP_FreeProperty(), and NULL.
Referenced by image_get_render_result(), IMB_free_anim(), IMB_freeImBuf(), and IMB_metadata_copy().
bool IMB_metadata_get_field | ( | struct IDProperty * | metadata, |
const char * | key, | ||
char * | value, | ||
size_t | len | ||
) |
Read the field from the image info into the field.
metadata | the IDProperty that contains the metadata |
key | the key of the field |
value | the data in the field, first one found with key is returned, memory has to be allocated by user. |
len | length of value buffer allocated by user. |
Definition at line 44 of file metadata.c.
References BLI_strncpy(), IDP_GetPropertyFromGroup(), IDP_String, IDP_STRING, len, NULL, and IDProperty::type.
Referenced by IMB_thumb_manage(), metadata_get_field(), and metadata_is_valid().
void IMB_metadata_set_field | ( | struct IDProperty * | metadata, |
const char * | key, | ||
const char * | value | ||
) |
Set user data in the metadata. If the field already exists its value is overwritten, otherwise the field will be added with the given value.
metadata | the IDProperty that contains the metadata |
key | the key of the field |
value | the data to be written to the field. zero terminated string |
Definition at line 73 of file metadata.c.
References BLI_assert, IDP_AddToGroup(), IDP_AssignString(), IDP_FreeFromGroup(), IDP_GetPropertyFromGroup(), IDP_NewString(), IDP_STRING, NULL, and IDProperty::type.
Referenced by ibJpegImageFromCinfo(), IMB_anim_load_metadata(), imb_load_openexr(), imb_loadpng(), IMB_thumb_load_image(), metadata_set_field(), and thumb_create_ex().