...

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


SDK - Layer Attachments - PHYS
 

Using the PHYS meta-type

The PHYS attachment (Physical Dimensions) defines the physical dimensions associated with the image in terms of the number of pixels per unit physical distance. This replaces image PPI mark-up and can be edited directly in the Layer Properties window in the user interface for Chasys Draw IES. The metadata consists of a host-defined structure of a fixed length:

#define META_PHYS_VERSION           0x0001

#define
META_PHYS_UNIT_PPI          0x00 //pix per inch
#define META_PHYS_UNIT_PPCM         0x01 //pix per centimeter
#define META_PHYS_UNIT_PPM          0x02 //pix per meter

struct meta_PHYS_Obj
{
    unsigned short  version;        //PHYS version
    unsigned short  unused_1;       //unused, set to 0
    unsigned long   x;              //value, x
    unsigned long   y;              //value, y
    unsigned char   units;          //units
    unsigned char   unused_2[3];    //unused, set to 0
};

The plug-in requests metadata of size sizeof(meta_PHYS_Obj). The plug-in then proceeds to fill the structure with the dimensions, the units of measure and the version of the structure.