SDK – Layer Attachments - MARK
Using the MARK meta-type
The MARK attachment (Layer Mark-up) allows plug-ins to pass on descriptive information such as EXIF data. It is a null-terminated plain-text (UTF-8) segment consisting of keywords and values separated by the equals sign, e.g.:
image.bpp=32;
exif.artist=John Paul Chacha;
exif.software=Chasys Photo;
exif.GPS.version=2,2,0,0;
exif.GPS.latitude.pos=1.2833°;
exif.GPS.latitude.ref=S;
exif.GPS.longitude.pos=36.8167°;
exif.GPS.longitude.ref=E;
exif.GPS.altitude.pos=1661 m;
exif.GPS.altitude.ref=0 (above sea-level);
All keywords must take the form [namespace.parameter]. This is to avoid conflicts. For example, a blah plug-in could append the following mark-up to a layer:
blah.engine="OpenGL";
blah.import="mesh1.x";
blah.max_size=4096;
Sample Code
Here’s some sample code that creates MARK metadata:
TAGS: Chasys Photo Source Code, Attachment, Metadata, MARK
PLUGIN_BITMAP image;
char markup[3072];
... ...
//insert MARK attachment
if(data->meta_write)
{
StringCchPrintfA(markup,_countof(markup),"image.bpp=%i;\r\n",image.bits_per_pixel);
data->meta_data=(unsigned char*)markup;
data->meta_write(data,"MARK",strlen(markup)+1); //include terminating NULL
}