ImageGear for C and C++ on Windows v19.7 - Updated
LPAFT_IG_METAD_ITEM_SET_CB
API Reference Guide > Core Component API Reference > Core Component Callback Functions Reference > LPAFT_IG_METAD_ITEM_SET_CB

If this callback function is defined in the format filter, then during a filter WRITE operation it is called every time some data is ready to be written.

Declaration:

 
Copy Code
typedef AT_BOOL (LPACCUAPI LPAFT_IG_METAD_ITEM_SET_CB)(
        LPVOID lpPrivate, 
        AT_MODE FormatID, 
        LPCHAR ItemName,  
        DWORD ItemID, 
        AT_MODE ItemType, 
        LPVOID ItemValue, 
        AT_MODE ValueType,
        DWORD ValueLength,
        AT_BOOL ReadOnlyValue, 
        LPVOID* NewItemValue,
        LPAT_MODE* NewValueType,
        LPDWORD* NewValueLength
);

Arguments:

Name Type Description
lpPrivate LPVOID Private callback data associated with the metadata callback function.
FormatID AT_MODE The ID of the format filter that will send or get the item (IG_FORMAT_... constant).
ItemName LPCHAR Text name of the item.
ItemID DWORD Numerical ID of the item.
ItemType AT_MODE Specifies the type of the item and reflects the status of a given record. Possible values are:
  • IG_METAD_VALUE_ITEM - this value specifies that the current item is a value of the simplest type, and the field Value contains the actual value of the item, and the ValueType contains the identifier of the type of this item. ReadOnly can be either TRUE (read-only) or FALSE (read/write). The Name and/or Id contains the textual and numerical identification of item.
  • IG_METAD_LEVEL_START - this value specifies that the current item opens a sublevel of items, and all the next items up to the corresponding item with a LEVEL_END value belong to this sublevel.
  • IG_METAD_LEVEL_END - this value closes the current sublevel and indicates that the next item belongs to a higher level.
ItemValue LPVOID If ItemType = IG_METAD_VALUE_ITEM then this argument contains the actual value of the item of the type specified by the ValueType parameter. Value is stored as an array of elements where each element contains values of type ValueType. The Length of array is provided in the parameter ValueLength.
ValueType AT_MODE If ItemType = IG_METAD_VALUE_ITEM then ValueType contains the actual type of value stored in the ItemValue pointer. See Manipulating Image Data for the exact list of possible types.
ValueLength DWORD If ItemType = IG_METAD_VALUE_ITEM then ValueLength contains the number of elements in array ValueItem of the type specified by ValueType.
ReadOnlyValue AT_BOOL If this argument is TRUE, then the actual value of the item cannot be changed by the callback function, and the value is passed for informational purposes only. If FALSE, then the value of item can be changed, and the application can provide the new value through the next three parameters.
NewItemValue LPVOID* Pointer to the new item value that the application may request to set as a replacement of the data passed in the ItemValue parameter. If it is not NULL, then the next two parameters contain the type of the value and the length of the array of elements.
NewValueType LPAT_MODE* Specifies the type of the new item value passed through the NewItemValue parameter.
NewValueLength LPDWORD* Specifies the size of the array passed through the NewItemValue pointer.

Return Value:

Returns TRUE if ImageGear should overwrite the default item data with your data, or FALSE if ImageGear should ignore your data.

Supported Raster Image Formats:

This function does not process image pixels.

Sample:

JPEG

Example:

See example for IG_fltr_metad_callback_set() function.

Remarks:

The application can change/provide a new value for the given item using NewItemValue, NewValueType, and NewValueLength parameters. This new value is to be used as a replacement for the default data passed through the ItemValue parameter if ReadOnlyValue is FALSE. The callback function should return TRUE if the callback function has changed value, and FALSE if it has not changed.

See also IG_fltr_metad_callback_get(), IG_fltr_metad_callback_set(), LPAFT_IG_METAD_ITEM_ADD_CB, LPAFT_IG_METAD_ITEM_GET_CB functions and the section Manipulating Image Data.