ImageGear for C and C++ on Linux v18.8 - Updated
LPAFT_IG_METAD_ITEM_ADD_CB
API Reference Guide > Core Component API Reference > Core Component Callback Functions Reference > LPAFT_IG_METAD_ITEM_ADD_CB

This callback function is used to insert new items during a WRITE filter operation.

Declaration:

 
Copy Code
typedef AT_BOOL (LPACCUAPI LPAFT_IG_METAD_ITEM_ADD_CB)(
        LPVOID lpPrivate, 
        AT_MODE FormatID, 
        LPCHAR ItemName,  
        DWORD ItemID, 
        AT_MODE ItemType, 
        LPVOID ItemValue, 
        AT_MODE ValueType,
        DWORD ValueLength,
        AT_BOOL ReadOnlyValue 
);

Arguments:

Name Type Description
lpPrivate LPVOID Private callback data.
FormatID AT_MODE The ID of the format filter that will send or get the item (IG_FORMAT_... constant).
ItemName LPCHAR Provides the name of the new item.
ItemID DWORD Numerical ID of the item.
ItemType AT_MODE Specifies the type of the item and reflects the status of the 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 ValueType contains the identifier of the type of this item. ReadOnly can be either TRUE (readonly) or FALSE (read/ write). The Name and/or Id contains textual and numerical identification of the item.
  • IG_METAD_LEVEL_START - this value specifies that the current item opens a sublevel of items, and all 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 Value of the new item. If ItemType = IG_METAD_VALUE_ITEM then ItemValue contains the actual value of the item of type specified by the ValueType parameter. The ItemValue is stored as an array of elements where each element contains values of type ValueType. Length of array is provided in parameter ValueLength.
ValueType AT_MODE If ItemType = IG_METAD_VALUE_ITEM then contains actual type of value stored in ItemValue pointer. See the Manipulating Image Data section for exact list of possible types.
ValueLength DWORD Length of array in ItemValue.
ReadOnlyValue AT_BOOL This parameter is not used.

Return Value:

Returns TRUE if a new value is added to item data; FALSE if it is not. A return of TRUE will cause the call of the Add callback function one more time.

Supported Raster Image Formats:

This function does not process image pixels.

Example:

See example for IG_fltr_metad_callback_set() function.

Remarks:

If the return value is TRUE then a new value is added; and if FALSE a new value is not added. ImageGear will be calling Add callback function while it returns TRUE, so the callback function should return TRUE if the provision of additional items is it not finished yet, and FALSE if it is finished. All parameters except of lpPrivate are used to get information about the new value.

ImageGear assumes that all tags passed via LPAFT_IG_METAD_ITEM_ADD_CB callback are writable, except for the tags that were sent by LPAFT_IG_METAD_ITEM_SET_CB, marked as read-only.

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