...

Online Help for Chasys Draw IES: SDK - Layer Attachments - MARK


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 Draw IES;
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;

The terminating NULL character must be included for the attachment to be valid. This NULL must be included in metadata size calculations.
Sample Code

Here’s some sample code that creates MARK metadata:
TAGS: Chasys Draw IES Source Code, Attachment, Metadata, MARK

int dpi_x,dpi_y;
char markup[3072];

... ...

//insert MARK attachment
if(data->meta_write)
{
    StringCchP
rintfA(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
}