upmf.h revision 06517eb74772b7c18a8ab8d703405646d9ec05d3
/**
@file upmf.h
@brief Structures, definitions, and function prototypes for EMF+ files.
EMF+ file Record structure derived from Microsoft's EMF+ Information pdf, releade date July 5,2012, link from
here:
If the direct link fails the document may be found
by searching for: "[MS-EMFPLUS]: Enhanced Metafile Format Plus Extensions "
EMR records and structures are EMF or common with EMF+
PMR records and structures are specific to EMF+
Using PMF instead of EMF+ because "+" is a problem in symbol names.
*****************************************************************************************
* WARNING: Microsoft's EMF+ documentation is little-endian for everything EXCEPT *
* bitfields, which are big-endian. See section 1.3.2 *
* That documentation also uses 0 as the MOST significant bit, N-1 as the least. *
* This code is little-endian throughout, and 0 is the LEAST significant bit *
*****************************************************************************************
*/
/*
File: upmf.h
Version: 0.0.4
Date: 17-MAR-2015
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2015 David Mathog and California Institute of Technology (Caltech)
*/
#ifndef _UPMF_
#define _UPMF_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
#include "uemf.h"
/** \defgroup U_PMF_PMF_Misc PMF Miscellaneous defines
@{
*/
#define U_PMF_KEEP_ELEMENTS 0 //!< Retain leading Elements value from data.
#define U_SEG_OLD 0 //!< continue the old (current) segment in the path
#define U_FILTER_APPLY 1 //!< With U_PMR_DRAWIMAGEPOINTS_set, use whatever filter has been set up up.
#define U_FILTER_IGNORE 0 //!< With U_PMR_DRAWIMAGEPOINTS_set, ignore whatever filter has been set up up.
// used 9728 to test fragmenting of emitted object records
/** @} */
/** \defgroup U_PMF_DD_ PMF "standard" custom Dash Dot patterns for lines.
U_DD_DASH, U_DD_DOT, U_DD_DASHDOT, and U_DD_DASHDOTDOT are the only ones with corresponding
These values are used to tell U_PMF_DASHEDLINEDATA_set2() to create one of 27 custom line patterns.
Other custom line patterns may be created using U_PMF_DASHEDLINEDATA_set(), but this provides an easier
way to get the same result if one of these patterns is acceptable.
The length is divided by 2X the number of elements, so dashdash has twice as many
dashes of half the length as just dash.
Dot is 1/8 of (sub)unit length
Dash is 1/2 of (sub)unit length
Long is 3/4 of (sub)unit length
Example: DotDot has (sub)unit length 1/2, so each dot will be 1/16 of unit length.
@{
*/
#define U_DD_Solid 0 //!< Solid line.
/** @} */
/** \defgroup U_PMF_PMR_Qualifiers PMF RecordType Enumeration
EMF+ manual 2.1.1.1, Microsoft name: RecordType Enumeration
@{
*/
/** @} */
/** \defgroup U_PMF_PID_Values PMF Identifiers for PseudoObjects
These are used by the *_set routines to identify types of PseudoObject.
Note that records are U_PMR_*_OID and other objects are U_PMF_*_OID
The numbers are derived from the EMF+ manual sections, as in 2.2.1.3 become
02020103. Numbers 40000000 and up are not derived from manual setions.
@{
*/
#define U_PMF_CUSTOMLINECAPARROWDATA_OID 0x02020212 //!< PMF_CUSTOMLINECAPARROWDATA PseudoObject type.
#define U_PMF_CUSTOMLINECAPOPTIONALDATA_OID 0x02020214 //!< PMF_CUSTOMLINECAPOPTIONALDATA PseudoObject type.
#define U_PMF_LINEARGRADIENTBRUSHDATA_OID 0x02020224 //!< PMF_LINEARGRADIENTBRUSHDATA PseudoObject type.
#define U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA_OID 0x02020225 //!< PMF_LINEARGRADIENTBRUSHOPTIONALDATA PseudoObject type.
#define U_PMF_PATHGRADIENTBRUSHDATA_OID 0x02020229 //!< PMF_PATHGRADIENTBRUSHDATA PseudoObject type.
#define U_PMF_PATHGRADIENTBRUSHOPTIONALDATA_OID 0x02020230 //!< PMF_PATHGRADIENTBRUSHOPTIONALDATA PseudoObject type.
#define U_PMF_TEXTUREBRUSHOPTIONALDATA_OID 0x02020246 //!< PMF_TEXTUREBRUSHOPTIONALDATA PseudoObject type.
#define U_PMF_IE_BRIGHTNESSCONTRAST_OID 0x02020302 //!< PMF_IE_BRIGHTNESSCONTRAST PseudoObject type.
#define U_PMF_IE_HUESATURATIONLIGHTNESS_OID 0x02020307 //!< PMF_IE_HUESATURATIONLIGHTNESS PseudoObject type.
#define U_PMR_STROKEFILLPATH_OID 0x02010101 //!< PMR_STROKEFILLPATH PseudoObject type. (Mentioned in passing here).
#define U_PMR_SETCOMPOSITINGQUALITY_OID 0x02030603 //!< PMR_SETCOMPOSITINGQUALITY PseudoObject type.
#define U_PMR_BEGINCONTAINERNOPARAMS_OID 0x02030702 //!< PMR_BEGINCONTAINERNOPARAMS PseudoObject type.
#define U_PMR_MULTIPLYWORLDTRANSFORM_OID 0x02030901 //!< PMR_MULTIPLYWORLDTRANSFORM PseudoObject type.
#define U_PMR_TRANSLATEWORLDTRANSFORM_OID 0x02030907 //!< PMR_TRANSLATEWORLDTRANSFORM PseudoObject type.
#define U_PMR_TRANSLATEWORLDTRANSFORM_OID 0x02030907 //!< PMR_TRANSLATEWORLDTRANSFORM PseudoObject type.
#define U_PMF_4NUM_OID 0x40000001 //!< PMF_4NUM PseudoObject type. PseudoObject contains a 4 unsigned int in EMF+ file byte order, used in some contexts to indicate an object index number..
#define U_PMF_RAW_OID 0x40000002 //!< PMF_RAW PseudoObject type. Raw data: no preceding elements, data has native endianness.
#define U_PMF_ARRAY_OID 0x80000000 //!< PMF_ARRAY PseudoObject type modifier. PseudoObject contains an array of the data type revealed when this bit is cleared.
#define U_PMF_MASK_OID 0x7FFFFFFF //!< PMF_MASK. Select PseudoObject data type without regard to PMF_ARRAY.
/** @} */
/** \defgroup U_PMF_BDT_ PMF BitmapDataType Enumeration
For
EMF+ manual 2.1.1.2, Microsoft name: BitmapDataType Enumeration (U_BDT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_BT_ PMF BrushType Enumeration
For
EMF+ manual 2.1.1.3, Microsoft name: BrushType Enumeration (U_BT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_CM_ PMF CombineMode Enumeration
For
EMF+ manual 2.1.1.4, Microsoft name: CombineMode Enumeration (U_CM_*)
@{
*/
/** @} */
/** \defgroup U_PMF_CMS_ PMF CompositingMode Enumeration
For
EMF+ manual 2.1.1.5, Microsoft name: CompositingMode Enumeration (U_CMS_* [S==Source])
@{
*/
/** @} */
/** \defgroup U_PMF_CQ_ PMF CompositingQuality Enumeration
For
EMF+ manual 2.1.1.6, Microsoft name: CompositingQuality Enumeration (U_CQ_*)
@{
*/
/** @} */
/** \defgroup U_PMF_CA_ PMF CurveAdjustments Enumeration
For
EMF+ manual 2.1.1.7, Microsoft name: CurveAdjustments Enumeration (U_CA_*)
@{
*/
/** @} */
/** \defgroup U_PMF_CC_ PMF CurveChannel Enumeration
For
EMF+ manual 2.1.1.8, Microsoft name: CurveChannel Enumeration (U_CC_*)
@{
*/
/** @} */
/** \defgroup U_PMF_CLCDT_ PMF CustomLineCapDataType Enumeration
For
EMF+ manual 2.1.1.9, Microsoft name: CustomLineCapDataType Enumeration (U_CLCDT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_DLCT_ PMF DashedLineCapType Enumeration
For
EMF+ manual 2.1.1.10, Microsoft name: DashedLineCapType Enumeration (U_DLCT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_FT_ PMF FilterType Enumeration
For
EMF+ manual 2.1.1.11, Microsoft name: FilterType Enumeration (U_FT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_GV_ PMF GraphicsVersion Enumeration
For
EMF+ manual 2.1.1.12, Microsoft name: GraphicsVersion Enumeration (U_GV_*)
@{
*/
/** @} */
/** \defgroup U_PMF_HSP_ PMF HatchStyle Enumeration
For
EMF+ manual 2.1.1.13, Microsoft name: HatchStyle Enumeration (U_HSP_* [U_HS_ already used for EMF])
@{
*/
/** @} */
/** \defgroup U_PMF_HKP_ PMF HotkeyPrefix Enumeration
For
EMF+ manual 2.1.1.14, Microsoft name: HotkeyPrefix Enumeration (U_HKP_*)
@{
*/
/** @} */
/** \defgroup U_PMF_IDT_ PMF ImageDataType Enumeration
For
EMF+ manual 2.1.1.15, Microsoft name: ImageDataType Enumeration (U_IDT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_IM_ PMF InterpolationMode Enumeration
For
EMF+ manual 2.1.1.16, Microsoft name: InterpolationMode Enumeration (U_IM_*)
@{
*/
/** @} */
/** \defgroup U_PMF_LID_ PMF LanguageIdentifier Enumeration
For
EMF+ manual 2.1.1.17, Microsoft name: LanguageIdentifier Enumeration (U_LID_*)
@{
*/
/** @} */
/** \defgroup U_PMF_LCT_ PMF LineCapType Enumeration
For
EMF+ manual 2.1.1.18, Microsoft name: LineCapType Enumeration (U_LCT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_LJT_ PMF LineJoinType Enumeration
For
EMF+ manual 2.1.1.19, Microsoft name: LineJoinType Enumeration (U_LJT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_LS_ PMF LineStyle Enumeration
For
EMF+ manual 2.1.1.20, Microsoft name: LineStyle Enumeration (U_LS_*)
@{
*/
/** @} */
/** \defgroup U_PMF_MDT_ PMF MetafileDataType Enumeration
For
EMF+ manual 2.1.1.21, Microsoft name: MetafileDataType Enumeration (U_MDT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_OT_ PMF ObjectType Enumeration
For
EMF+ manual 2.1.1.22, Microsoft name: ObjectType Enumeration (U_OT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_PPT_ PMF PathPointType Enumeration
For
EMF+ manual 2.1.1.23, Microsoft name: PathPointType Enumeration (U_PPT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_PA_ PMF PenAlignment Enumeration
For
EMF+ manual 2.1.1.24, Microsoft name: PenAlignment Enumeration (U_PA_*)
@{
*/
/** @} */
/** \defgroup U_PMF_PF_ PMF PixelFormat Enumeration
For U_PMF_BITMAP PxFormat field
EMF+ manual 2.1.1.25, Microsoft name: PixelFormat Enumeration (U_PF_*)
Bitmap for this 32 bit value is:
0-9 ignored
10 Set: 32 bit ARGB; Clear: !32 bit ARGB
12 Set: colors premultiplied by alpha; Clear: !premultiplied
13 Set: has Alpha; Clear: !has Alpha
14 Set: Windows GDI supports; Clear: !Windows GDI supports
15 Set: uses LUT; Clear !uses LUT
16-23 = total number of BITS per pixel
24-31 = pixel format enumeration index (0->15)
@{
*/
#define U_PF_32bppPARGB 0x000E200B //!< 32 bit PARGB values (8,8,8,8, but RGB already multiplied by A)
/** @} */
/** \defgroup U_PMF_POM_ PMF PixelOffsetMode Enumeration
For
EMF+ manual 2.1.1.26, Microsoft name: PixelOffsetMode Enumeration (U_POM_*)
@{
*/
/** @} */
/** \defgroup U_PMF_RNDT_ PMF RegionNodeDataType Enumeration
For
EMF+ manual 2.1.1.27, Microsoft name: RegionNodeDataType Enumeration (U_RNDT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_SM_ PMF SmoothingMode Enumeration
For
EMF+ manual 2.1.1.28, Microsoft name: SmoothingMode Enumeration (U_SM_*)
@{
*/
/** @} */
/** \defgroup U_PMF_SA_ PMF StringAlignment Enumeration
For
EMF+ manual 2.1.1.29, Microsoft name: StringAlignment Enumeration (U_SA_*)
Note, that unlike EMF these are with respect to the bounding rectangle, not to a single point. So
to draw centered text, for instance, U_SA_Center must be used, and the bounding rectangle must also be
centered.
For horizontal positioning of L->R text Near is all the way left in the box, Far is all the way right,
and Center puts the center of the text in the center of the box.
For vertical positioning things are a little strange. Near is a certain distance down from the top, Far is a
certain distance up from the bottom, and center puts the center of the text in the center of the box. The
"certain distance" is not specified in the EMF+ documentation. See the function U_PMR_drawstring() for an
implementation that places text on the baseline.
@{
*/
/** @} */
/** \defgroup U_PMF_SDS_ PMF StringDigitSubstitution Enumeration
For
EMF+ manual 2.1.1.30, Microsoft name: StringDigitSubstitution Enumeration (U_SDS_*)
@{
*/
/** @} */
/** \defgroup U_PMF_ST_ PMF StringTrimming Enumeration
For
EMF+ manual 2.1.1.31, Microsoft name: StringTrimming Enumeration (U_ST_*)
@{
*/
/** @} */
/** \defgroup U_PMF_TRH_ PMF TextRenderingHint Enumeration
For
EMF+ manual 2.1.1.32, Microsoft name: TextRenderingHint Enumeration (U_TRH_*)
@{
*/
/** @} */
/** \defgroup U_PMF_UT_ PMF UnitType Enumeration
For
EMF+ manual 2.1.1.33, Microsoft name: UnitType Enumeration (U_UT_*)
@{
*/
/** @} */
/** \defgroup U_PMF_WM_ PMF WrapMode Enumeration
For
EMF+ manual 2.1.1.34, Microsoft name: WrapMode Enumeration (U_WM_*)
@{
*/
/** @} */
/** \defgroup U_PMF_BD_ PMF BrushData Flags
For
EMF+ manual 2.1.2.1, Microsoft name: BrushData Flags (U_BD_*)
Bit flags allowed in brush object types. Each bit indicates a type of object which is included.
There are 5 brush types abbreviated A through E, and each uses a subset of the
BrushData Flags, as summarized in the following table:
Bits Brush____Type EMF+ Manual
used Abbrev. Name
5 A U_PMF_LINEARGRADIENTBRUSHDATA 2.2.2.24
6 B U_PMF_PATHGRADIENTBRUSHDATA 2.2.2.29
3 C U_PMF_TEXTUREBRUSHDATA 2.2.2.45
0 D U_PMF_HATCHBRUSHDATA 2.2.2.20
0 E U_PMF_SOLIDBRUSHDATA 2.2.2.45
@{
*/
#define U_BD_BlendFactorsV 0x0010 //!< BlendFactorsV in {A} - Note, not actually implemented in GDI+.
/** @} */
/** \defgroup U_PMF_CLCD_ PMF CustomLineCapData Flags
For
EMF+ manual 2.1.2.2, Microsoft name: CustomLineCapData Flags (U_CLCD_*)
@{
*/
/** @} */
/** \defgroup U_PMF_DSO_ PMF DriverStringOptions Flags
For
EMF+ manual 2.1.2.3, Microsoft name: DriverStringOptions Flags (U_DSO_*)
@{
*/
#define U_DSO_CmapLookup 0x01 //!< Set: value is a Unicode character; Clear: value is an index into Glyph table in a font
#define U_DSO_RealizedAdvance 0x04 /**< Set: U_PMF_DRAWDRIVERSTRING Positions field specifies only position of first of Glyphs field,
with the rest calculated from font information; Clear: Positions specifies coordinates for each Glyphs member.*/
#define U_DSO_LimitSubpixel 0x08 //!< Set: use less memory to cache anti-aliased glyphs; Clear: use more
/** @} */
/** \defgroup U_PMF_FS_ PMF FontStyle Flags
For
EMF+ manual 2.1.2.4, Microsoft name: FontStyle Flags (U_FS_*)
# @{
*/
/** @} */
/** \defgroup U_PMF_PLTS_ PMF PaletteStyle Flags
For
EMF+ manual 2.1.2.5, Microsoft name: PaletteStyle Flags (U_PLTS_*)
@{
*/
/** @} */
/** \defgroup U_PMF_PTP_ PMF PathPointType Flags
For
EMF+ manual 2.1.2.6, Microsoft name: PathPointType Flags (U_PTP_*)
@{
*/
/** @} */
/** \defgroup U_PMF_PD_ PMF PenData Flags
For
EMF+ manual 2.1.2.7, Microsoft name: PenData Flags (U_PD_*)
If bit is set the corresponding object must be specfied in the OptionalData field
@{
*/
/** @} */
/** \defgroup U_PMF_SF_ PMF StringFormat Flags
For EmfPlusStringFormat
EMF+ manual 2.1.2.8, Microsoft name: StringFormat Flags (U_SF_*)
@{
*/
/** @} */
/** \defgroup U_PMF_IE_ PMF ImageEffects Identifiers
For
EMF+ manual 2.1.3.1, Microsoft name: ImageEffects Identifiers (U_IE_*)
@{
*/
#define U_IE_BrightnessContrastEffectGuid "{D3A1DBE1-8EC4-4C17-9F4C-EA97AD1C343D}" //!< Brightness Contrast Effect
#define U_IE_ColorBalanceEffectGuid "{537E597D-251E-48DA-9664-29CA496B70F8}" //!< Color Balance Effect
#define U_IE_ColorLookupTableEffectGuid "{A7CE72A9-0F7F-40D7-B3CC-D0C02D5C3212}" //!< Color Lookup Table Effect
#define U_IE_ColorMatrixEffectGuid "{718F2615-7933-40E3-A511-5F68FE14DD74}" //!< Color Matrix Effect
#define U_IE_HueSaturationLightnessEffectGuid "{8B2DD6C3-EB07-4D87-A5F0-7108E26A9C5F}" //!< Hue Saturation Lightness Effect
#define U_IE_RedEyeCorrectionEffectGuid "{74D29D05-69A4-4266-9549-3CC52836B632}" //!< Red Eye Correction Effect
/** @} */
/** \defgroup U_PMF_IEE_ PMF ImageEffects Enumerators
based on U_IE_
These may be used by a parser to set up for a switch() statement.
@{
*/
#define U_IEE_Unknown 0 //!< none of the following
/** @} */
/** \defgroup U_PMF_OC_ PMF ObjectClamp Identifiers
For U_PMF_IMAGEATTRIBUTES ObjectClamp field
EMF+ manual 2.2.1.5, Microsoft name: ImageEffects Identifiers (U_OC_*)
@{
*/
/** @} */
/** \defgroup U_PMF_PPF_ PMF PathPoint Flags
For U_PMF_PATH Flags field
For U_PMF_CMN_HDR Flags field
EMF+ manual 2.2.1.6, Microsoft name: PathPoint Flags (U_PPF_*)
For U_PMF_CMN_HDR Flags the bits are scattered all over the EMF+ manual.
NOTE: bitfields in manual are BIG endian and MSB 0.
This code reads the 16 bit flag field as LITTLE endian and uses LSB 0.
The values shown are AFTER the data has been read into a uint16_t and the byte order set
appropriately.
All of these come out of a 16 bit field.
@{
*/
#define U_PPF_B 0x8000 //!< 15 Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
#define U_PPF_N 0x8000 //!< 15 Set: object definition continues in next record; Clear: this is the final object definition record
#define U_PPF_E 0x2000 //!< 13 Set: effect from previous U_PMF_SERIALIZABLEOBJECT record will be applied,; Clear: no effect applied
#define U_PPF_R 0x1000 //!< 12 Set: U_PMF_PathPointTypeRLE and/or U_PMF_PathPointType objects; Clear: only U_PMF_PathPointType
#define U_PPF_VIDEO 0x0001 //!< 0 Set: reference device is video display; Clear: reference devis is printer
/** @} */
/** \defgroup U_PMF_FF_ PMF Masks and offsets for 16 bit flag fields
Documenting the OBSERVED positions of fields in 16 bit flag integers
after they have been read in Little Ended from files.
Note, some of these are used in more than one record type, only a single reference is provided
@{
*/
#define U_FF_MASK_SUBLID 0x003F //!< EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier
#define U_FF_SHFT_SUBLID 0x000A //!< EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier
#define U_FF_MASK_PRILID 0x03FF //!< EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier
#define U_FF_SHFT_PRILID 0x0000 //!< EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier
/* the next one is used most places an object ID is specified */
/** @} */
/** \defgroup U_PMF_GFVR_ PMF MetafileSignature
For U_PMF_GRAPHICSVERSION Signature field
EMF+ manual 2.2.2.19, Microsoft name: (none) (U_GFVR_*)
@{
*/
/** @} */
/** \defgroup U_PMF_XM_ PMF Matrix Multiplication Enumerator
For U_PMF_RotateWorldTransform and others
EMF+ manual 2.3.9.3, Microsoft name: (none) (U_XM_*)
@{
*/
#define U_XM_PreX 0 //!< Pre Multiply change to current Transformation Matrix
/** @} */
/* Utility objects, not defined in EMF+ spec */
/** @brief Used to accumulate data for objects continued over multiple records.
see EMF+ manual 2.3.5.1
*/
typedef struct {
char *accum; /**< data accumulates here */
int Type; /**< ObjectType enumeration */
int Id; /**< Object ID */
} U_OBJ_ACCUM;
/** @brief Holds EMF+ objects and records in EMF+ file format byte order.
*/
typedef struct {
char *Data; /**< Buffer that hold's the PseudoObject's data */
} U_PSEUDO_OBJ;
/** @brief DoublePseudoObject holds pairs of PseudoObjects. Used for constructing paths along with their types.
The data stored in the PsuedoObjects maintains LittleEndian-ness, as expected in the final file.
The type is U_RAW_OID, and there is no elements count at the beginning of Data
*/
typedef struct {
/** @brief Serializer description records.
An array of these are passed to U_PMF_SERIAL_set() to construct EMF+ objects from their component parts.
The U_PMF_SERIAL_set() function should not ever be called directly by end user code.
*/
typedef struct {
const void *Ptr; /**< Pointer to the first byte of the data field.
Each data field is an array of a basic type of Units
bytes repeated Reps times */
int TE; /**< (Target Endian). Only relevant for Units of 2 or 4*/
/** @brief FontInfoParams hold font information that is needed by U_PMR_drawstring so that it can
place text on the baseline. This must be extracted from the font file using
an appropriate utility. (See testbed_pmf.c for a table of these values for some
common fonts.)
*/
typedef struct {
char *name; /**< Font name (like "Arial") */
int Ascent; /**< in Font units (positive) */
int Descent; /**< in Font units (negative) */
int LineGap; /**< in Font units (positive) */
int EmSize; /**< Y extent of Em square, usually 2048 */
int yMax; /**< in Font units (positive) */
int yMin; /**< in Font units (negative) */
/* EMF+ objects */
/** @brief EMF+ manual 2.2.1.1, Microsoft name: EmfPlusBrush Object
variable part of object follows structure:
uint32_t Data[]; // one of the 5 types of Brush data (2.2.2 20, 24, 29, 43, or 45)
*/
typedef struct {
} U_PMF_BRUSH;
/** @brief EMF+ manual 2.2.1.2, Microsoft name: EmfPlusCustomLineCap Object */
typedef struct {
/*@{*/
/* variable part of object, not part of structure
uint32_t Data[]; //!< one of the 2 types of Linecap data (2.2.2 12, 13)
*/
/*@}*/
/** @brief EMF+ manual 2.2.1.3, Microsoft name: EmfPlusFont Object */
typedef struct {
/*@{*/
/* variable part of object, not part of structure
uint16_t FamilyName[]; //!< Unicode (UTF-16LE) name of font family
*/
/*@}*/
} U_PMF_FONT;
/** @brief EMF+ manual 2.2.1.4, Microsoft name: EmfPlusImage Object */
typedef struct {
/*@{*/
/* variable part of object, not part of structure
uint32_t Data[]; //!< one of the 2 types of image data (2.2.2 2 or 27)
*/
/*@}*/
} U_PMF_IMAGE;
/** @brief EMF+ manual 2.2.2.1, Microsoft name: EmfPlusARGB Object, out of order, needed for 2.2.1.5 */
typedef struct {
/*@{*/
/*@}*/
} U_PMF_ARGB;
/** @brief EMF+ manual 2.2.1.5, Microsoft name: EmfPlusImageAttributes Object */
typedef struct {
/*@{*/
/*@}*/
/** @brief EMF+ manual 2.2.1.6, Microsoft name: EmfPlusPath Object */
typedef struct {
/*@{*/
/* variable part of object, not part of structure
points array of points like:
U_PPF_P U_PPF_C Type
1 x U_PMF_POINTR
0 1 U_PMF_POINT
0 0 U_PMF_POINTF
types array of:.
U_PPF_R Type
0 U_PMF_PathPointType (only)
alignment padding up to 3 bytes
*/
/*@}*/
} U_PMF_PATH;
/** @brief EMF+ manual 2.2.1.7, Microsoft name: EmfPlusPen Object */
typedef struct {
/* variable part of object, not part of structure
U_PMF_PENDATA pen
U_PMF_BRUSH brush
*/
} U_PMF_PEN;
/** @brief EMF+ manual 2.2.2.40, Microsoft name: EmfPlusRegionNode Object, out of order, needed for 2.2.1.8 */
typedef struct {
/* variable part of object, not part of structure, will be absent in object for some types
data data is a tree made up of some combination of these objects
U_PMF_REGIONNODEPATH 2.2.2.42 terminal node
U_PMF_RECTF 2.2.2.39 terminal node
U_PMF_REGIONNODECHILDNODES 2.2.2.41 non-terminal node
*/
/** @brief EMF+ manual 2.2.1.8, Microsoft name: EmfPlusRegion Object */
typedef struct {
/* variable part of object, not part of structure, will be absent in object for some types
U_PMF_REGIONNODE Nodes[1]; //!< Nodes defining region
*/
} U_PMF_REGION;
/** @brief EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier Object, out of order, needed for 2.2.1.9
Bit fields are not used in structs in this implementation, these are serialized/deserialized in
the corresponding routines. Bitfields in the FILE (LITTLE endian here, manual uses BIG endian) are:
int SubLId : 6; Example: code for USA
int PriLId : 10; Example: code for English
This type is defined as 16 bits in the manual section, but it is only ever used as part of a 32 bit field!
*/
typedef uint32_t U_PMF_LANGUAGEIDENTIFIER;
/** @brief EMF+ manual 2.2.1.9, Microsoft name: EmfPlusStringFormat Object */
typedef struct {
Language; //!< String's Language
DigitLanguage; //!< Digit's Language (overrides Language, above)
/* variable part of object, not part of structure.
U_PMF_STRINGFORMATDATA data
Note that U_PMF_STRINGFORMATDATA has no struct as it is entirely variable
and the size of the two fields in it are specified by the two preceding fields in this object type.
*/
/** U_PMF_ARGB EMF+ manual 2.2.2.1, Microsoft name: EmfPlusARGB Object, defined above, before 2.2.1.6*/
/** @brief EMF+ manual 2.2.2.2, Microsoft name: EmfPlusBitmap Object */
typedef struct {
/* variable part of object, not part of structure.
(various types) BitmapData //!< is either an U_PMF_BITMAPDATA or U_PMF_COMPRESSEDIMAGE object
*/
} U_PMF_BITMAP;
/** U_PMF_BITMAPDATA EMF+ manual 2.2.2.3, Microsoft name: EmfPlusBitmapData Object
U_PMF_BITMAPDATA is an entirely variable object, there is no corresponding struct. It consists of
Colors U_PMF_PALETTE object
PixelData An array of bytes, meaning depends on fields in U_PMF_BITMAP object and the PixelFormat enumeration.
*/
/** @brief EMF+ manual 2.2.2.4, Microsoft name: EmfPlusBlendColors Object
For Pattern field of U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA
*/
typedef struct {
/* variable part of object, not part of structure.
U_FLOAT Positions //!< positions along gradient line. The first position MUST be 0.0 and the last MUST be 1.0.
U_PMF_ARGB Colors //!< colors at positions on gradient line
*/
/** @brief EMF+ manual 2.2.2.5, Microsoft name: EmfPlusBlendFactors Object */
typedef struct {
/* variable part of object, not part of structure.
U_FLOAT Positions //!< positions along gradient line. The first position MUST be 0.0 and the last MUST be 1.0.
U_FLOAT Factors //!< blending factors, 0.0->1.0 values, inclusive
*/
/** @brief EMF+ manual 2.2.2.6, Microsoft name: EmfPlusBoundaryPathData Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_PATH Data //!< Boundary of the brush
*/
/** @brief EMF+ manual 2.2.2.7, Microsoft name: EmfPlusBoundaryPointData Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_POINTF Points //!< Boundary of the brush
*/
/** @brief EMF+ manual 2.2.2.8, Microsoft name: EmfPlusCharacterRange Object */
typedef struct {
/** @brief EMF+ manual 2.2.2.9, Microsoft name: EmfPlusCompoundLineData Object
Compound lines are pens that draw several parallel lines at once. The data here
alternates (sub)line width (as fraction of total width and gaps (also as fraction
of total width).
*/
typedef struct {
/* variable part of object, not part of structure.
U_FLOAT Data //!< Line or gap width (0.0 <-> 1.0, fraction of total line width )
*/
/** @brief EMF+ manual 2.2.2.10, Microsoft name: EmfPlusCompressedImage Object
Holds an EXIF, GIF, JFIF, PNG, or TIFF image.
For U_PMF_BITMAP BitmapData field
object has no assocated struct!
U_PMF_COMPRESSEDIMAGE
*/
/** @brief EMF+ manual 2.2.2.11, Microsoft name: EmfPlusCustomEndCapData Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_CUSTOMLINECAP Data //!< Description of linecap
*/
/** @brief EMF+ manual 2.2.2.12, Microsoft name: EmfPlusCustomLineCapArrowData Object */
typedef struct {
/** @brief EMF+ manual 2.2.2.13, Microsoft name: EmfPlusCustomLineCapData Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_CUSTOMLINECAPOPTIONALDATA Data //!< meaning determined by Flags
*/
/** U_PMF_CUSTOMLINECAPOPTIONALDATA EMF+ manual 2.2.2.14, Microsoft name: EmfPlusCustomLineCapOptionalData Object
object has no assocated struct!
U_PMF_FILLPATHO FillData; //!< path to fill (optional)
U_PMF_LINEPATH LineData; //!< path to stroke (optional)
*/
/** @brief EMF+ manual 2.2.2.15, Microsoft name: EmfPlusCustomStartCapData Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_CUSTOMLINECAP Data //!< Description of linecap
*/
/** @brief EMF+ manual 2.2.2.16, Microsoft name: EmfPlusDashedLineData Object */
typedef struct {
/* variable part of object, not part of structure.
U_FLOAT Data; //!< Array of lengths of dashes and spaces
*/
/** @brief EMF+ manual 2.2.2.17, Microsoft name: EmfPlusFillPath Object
Note: U_PMF_FILLPATHOBJ is the object, U_PMF_FILLPATH is the file record
*/
typedef struct {
/* variable part of object, not part of structure.
U_PMF_PATH Data; //!< Path specification
*/
/** @brief EMF+ manual 2.2.2.18, Microsoft name: EmfPlusFocusScaleData Object
for U_PMF_PATHGRADIENTBRUSHOPTIONALDATA data field
Used with path gradient brushes. May be used to expand the center color
of a gradient, which would otherwise only be found at the center point.
The expanded area is the width, height X scale factor, but in no case
less than 1 pixel.
*/
typedef struct {
/** @brief EMF+ manual 2.2.2.19, Microsoft name: EmfPlusGraphicsVersion Object
Bit fields are not used in structs in this implementation, these are serialized/deserialized in
the corresponding routines. Bitfields in the FILE (LITTLE endian here, manual uses BIG endian) are:
unsigned int GrfVersion : 12; GraphicsVersion enumeration
unsigned int Signature : 20; Must be U_GFVR_PMF (0xDBC01)
@{
*/
typedef uint32_t U_PMF_GRAPHICSVERSION; //!< EMF+ manual 2.2.2.19, Microsoft name: EmfPlusGraphicsVersion Object
/** @} */
/** @brief EMF+ manual 2.2.2.20, Microsoft name: EmfPlusHatchBrushData Object */
typedef struct {
/** \defgroup U_PMF_Int7 PMF 7 bit signed integer
@brief EMF+ manual 2.2.2.21, Microsoft name: EmfPlusInteger7 Object
bit 7 U_INT7 Clear in Integer7 objects
bits 0-6 7 bit signed integer value
@{
*/
/** @} */
/** \defgroup U_PMF_Int15 PMF 15 bit signed integer
@brief EMF+ manual 2.2.2.22, Microsoft name: EmfPlusInteger15 Object
bit 15 U_INT15 Set in Integer15 objects
bits 0-15 15 bit signed integer value
This is the one data type that really does seem to be stored into the file in Big Endian order.
It has to be this way because the bit that determines if data is int7 or int15 must be in the first byte
the parser sees, and that byte is the high order byte.
@{
*/
/** @} */
/* EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier Object, defined above, before 2.2.1.9 */
/** @brief EMF+ manual 2.2.2.39, Microsoft name: EmfPlusRectF Object, out of order, needed for 2.2.2.24 */
typedef struct {
U_FLOAT X; //!< UL X value
U_FLOAT Y; //!< UL Y value
} U_PMF_RECTF;
/** @brief EMF+ manual 2.2.2.24, Microsoft name: EmfPlusLinearGradientBrushData Object
Manual says that Reserved1 and Reserved2 must be ignored. In practice if Reserved1 is not set to StartColor
and Reserved2 is not set to EndColor, then XP Preview will not display the gradient.
*/
typedef struct {
/* variable part of object, not part of structure.
U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA data; //!< presence and meaning depend on Flags field
*/
/** @brief EMF+ manual 2.2.2.47, Microsoft name: EmfPlusTransformMatrix Object, out of order, needed for 2.2.2.25 */
typedef struct {
/** NOT DOCUMENTED. Encountered in actual EmfPlusLinearGradientBrushOptionalData Object made by PowerPoint 2003. This
structure is needed for the next. */
typedef struct {
/** @brief EMF+ manual 2.2.2.25, Microsoft name: EmfPlusLinearGradientBrushOptionalData Object
For U_PMF_LINEARGRADIENTBRUSHDATA data field
*/
/* Entire object is variable and not part of a structure! U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA
U_PMF_ROTMATRIX Matrix; //!< Rotation matrix, Manuals says that this should be Transformation matrix, but last two values are missing
(various) pattern; //!< Presence and meaning depend on Flags field, see below
Flag values
U_BD_PresetColors U_BD_BlendFactorsH U_BD_BlendFactorsV pattern(s) present?
0 0 0 none
1 0 0 U_PMF_BLENDCOLORS
0 1 0 U_PMF_BLENDFACTORS
0 0 1 U_PMF_BLENDFACTORS
0 1 1 U_PMF_BLENDFACTORS, U_PMF_BLENDFACTORS
*/
/** @brief EMF+ manual 2.2.2.26, Microsoft name: EmfPlusLinePath Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_PATH Data; //!< Outline path
*/
/** @brief EMF+ manual 2.2.2.27, Microsoft name: EmfPlusMetafile Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_IMAGE Data; //!< Various types of data, like an EMF metafile, WMF metafile, another EMF+ metafile
*/
/** @brief EMF+ manual 2.2.2.28, Microsoft name: EmfPlusPalette Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_ARGB Data; //!< Palette data (array of colors)
*/
/** @brief EMF+ manual 2.2.2.36, Microsoft name: EmfPlusPointF Object, out of order, needed for 2.2.2.29 */
typedef struct {
U_FLOAT X; //!< UL X value
U_FLOAT Y; //!< UL Y value
} U_PMF_POINTF;
/** @brief EMF+ manual 2.2.2.29, Microsoft name: EmfPlusPathGradientBrushData Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_ARGB Gradient; //!< Color Gradient with Elements members
(varies) Boundary; //!< U_PMF_BOUNDARYPATHDATA object if BrushDataPath bit set in Flag, else U_PMF_BOUNDARYPOINTDATA object
U_PMF_GRADIENTBRUSHOPTIONALDATA data; //!< exact composition depends on Flags
*/
/** EMF+ manual 2.2.2.30, Microsoft name: EmfPlusPathGradientBrushOptionalData Object
for U_PMF_PATHGRADIENTNBRUSHDATA data field
*/
/* Entire thing is variable or optional.
typedef struct {
U_PMF_TRANSFORMMATRIX Matrix; //!< Optional Transformation matrix
U_PMF_BLENDCOLORS Pattern; //!< presence and meaning depend on Flags field
Flag values
U_BD_PresetColors U_BD_BlendFactorsH pattern?
0 0 none
1 0 U_PMF_BLENDCOLORS
0 1 U_PMF_BLENDFACTORS
U_PMF_FOCUSSSCALEDATA data //!< Present if U_BD_FocusScales bit set in Flags in U_PMF_PATHGRADIENTNBRUSHDATA object
} U_PMF_PATHGRADIENTBRUSHOPTIONALDATA;
*/
/** \defgroup U_PMF_PPTYPE PMF Path Point Types
@brief EMF+ manual 2.2.2.31, Microsoft name: EmfPlusPathPointType Object
Bitfields in the FILE (LITTLE endian here, manual uses BIG endian) are:
bits 4-7 PathPointType flags
bits 0-3 PathPointType enumeration
@{
*/
typedef uint8_t U_PMF_PATHPOINTTYPE; //!< EMF+ manual 2.2.2.31, Microsoft name: EmfPlusPathPointType Object
/** @} */
/** \defgroup U_PMF_PPTYPERLE PMF Run Length Encoded Path Point Types
@brief EMF+ manual 2.2.2.32, Microsoft name: EmfPlusPathPointTypeRLE Object
U_PMF_PATHPOINTTYPERLE fields specify point types in a path where the path is Run Length Encoded.
Bit fields are not used in structs in this implementation, these are serialized/deserialized in
the corresponding routines. Bitfields in the FILE (LITTLE endian here, manual uses BIG endian) are:
bit 15 Set: Bezier curve; Clear: straight line
bit 14 ignored
bits 8-13 Run count
bits 0-7 PathPointType enumeration
@{
*/
typedef uint16_t U_PMF_PATHPOINTTYPERLE; //!< EMF+ manual 2.2.2.32, Microsoft name: EmfPlusPathPointTypeRLE Object
/** @} */
/** @brief EMF+ manual 2.2.2.33, Microsoft name: EmfPlusPenData Object
Variable part of object follows structure:
U_PMF_PENOPTIONALDATA data; Optional pen data, exact composition depends on Flags
*/
typedef struct {
/** @brief EMF+ manual 2.2.2.34, Microsoft name: EmfPlusPenOptionalData Object
Every part of this object is variable or optional, there is no corresponding struct
Present if Flag What is it
U_PMF_TRANSFORMMATRIX Matrix //!< U_PD_Transform Transformation matrix
int32_t StartCap //!< U_PD_StartCap LineCapType enumeration
int32_t EndCap //!< U_PD_EndCap LineCapType enumeration
uint32_t Join //!< U_PD_Join LineJoinType enumeration
U_FLOAT MiterLimit //!< U_PD_MiterLimit Maximum (miter length / line width)
int32_t Style //!< U_PD_LineStyle LineStyle enumeration
int32_t DLCap //!< U_PD_DLCap DashedLineCapType enumeration
U_FLOAT DLOffset //!< U_PD_DLOffset Distance line start to first dash start
U_PMF_DASHEDLINEDATA DLData //!< U_PD_DLData Dash and space widths
int32_t PenAlignment //!< U_PD_NonCenter PenAlignment enumeration
U_PMF_COMPOUNDLINEDATA CLData //!< U_PD_CompoundLineData Compount Line (parallel lines drawn instead of one)
U_PMF_CUSTOMSTARTCAPDATA CSCapData //!< U_PD_CustomStartCap Custom start cap
U_PMF_CUSTOMENDCAPDATA CECapData //!< U_PD_CustomEndCap Custom end cap
*/
/** @brief EMF+ manual 2.2.2.35, Microsoft name: EmfPlusPoint Object */
typedef struct {
int16_t X; //!< X coordinate
int16_t Y; //!< Y coordinate
} U_PMF_POINT;
/** U_PMF_POINTF EMF+ manual 2.2.2.36, Microsoft name: EmfPlusPointF Object, defined above, before 2.2.2.29 */
/** U_PMF_POINTR EMF+ manual 2.2.2.37, Microsoft name: EmfPlusPointR Object
For U_PMF_DRAWBEZIERS data field (optionally).
Both parts of this object are variable, there is no corresponding struct.
Any combination of the two allowed types of integer is valid.
(varies) X; //!< U_PMF_INTEGER7 or U_PMF_INTEGER15
(varies) Y; //!< U_PMF_INTEGER7 or U_PMF_INTEGER15
*/
/** @brief EMF+ manual 2.2.2.38, Microsoft name: EmfPlusRect Object */
typedef struct {
int16_t X; //!< UL X value
int16_t Y; //!< UL Y value
} U_PMF_RECT;
/** U_PMF_RECTF EMF+ manual 2.2.2.39, Microsoft name: EmfPlusRectF Object, defined above, before 2.2.2.24 */
/** U_PMF_REGIONNODE EMF+ manual 2.2.2.40, Microsoft name: EmfPlusRegionNode Object, defined above, before 2.2.1.8 */
/** U_PMF_REGIONNODECHILDNODES EMF+ manual 2.2.2.41, Microsoft name: EmfPlusRegionNodeChildNodes Object
For U_PMF_REGIONNODE data field (optionally).
Both parts of this object are variable, there is no corresponding struct.
U_PMF_REGIONNODE Left; //!< Left child
U_PMF_REGIONNODE Right; //!< Right child
*/
/** @brief EMF+ manual 2.2.2.42, Microsoft name: EmfPlusRegionNodePath Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_PATH Data; //!< Boundary of region node
*/
/** @brief EMF+ manual 2.2.2.43, Microsoft name: EmfPlusSolidBrushData Object
For U_PMF_BRUSH data field (one type of brush)
*/
typedef struct {
/** U_PMF_STRINGFORMATDATA EMF+ manual 2.2.2.44, Microsoft name: EmfPlusStringFormatData Object
Both parts of this object are variable and optional, there is no corresponding struct
U_FLOAT TabStops[]; //!< Array of tabstop locations
U_PMF_CHARACTERRANGE CharRange[]; //!< Array of character ranges in the text
*/
/** @brief EMF+ manual 2.2.2.45, Microsoft name: EmfPlusTextureBrushData Object */
typedef struct {
/* variable part of object, not part of structure.
U_PMF_TEXTUREBRUSHOPTIONALDATA data; //!< Optional texture data
*/
/** U_PMF_TEXTUREBRUSHOPTIONALDATA EMF+ manual 2.2.2.46, Microsoft name: EmfPlusTextureBrushOptionalData Object
Every part of this object is variable or optional, there is no corresponding struct
U_PMF_TRANSFORMMATRIX Matrix; Transformation matrix, present if Flag BrushDataTransform is set.
U_PMF_IMAGE Image Image that contains the texture. Present if the PMR record that includes this object still has space
for an U_PMF_IMAGE after all the other variable and optional data
within it has been accounted for.
*/
/** U_PMF_TRANSFORMMATRIX EMF+ manual 2.2.2.47, Microsoft name: EmfPlusTransformMatrix Object, defined above, before 2.2.2.25 */
/** common structure present at the beginning of all(*) EMF+ records */
typedef struct {
/** These are the Image Effect Objects 2.2.3.* They specify parameters for "filters" that may be applied to bitmaps. */
/** @brief EMF+ manual 2.2.3.1, Microsoft name: BlurEffect Object */
typedef struct {
/** @brief EMF+ manual 2.2.3.2, Microsoft name: BrightnessContrastEffect Object */
typedef struct {
/** @brief EMF+ manual 2.2.3.3, Microsoft name: ColorBalanceEffect Object */
typedef struct {
int32_t CyanRed; //!< -100 to 100, 0 is unchanged, positive increases Red & decreases Cyan, negative is opposite
int32_t MagentaGreen; //!< -100 to 100, 0 is unchanged, positive increases Green & decreases Magenta, negative is opposite
int32_t YellowBlue; //!< -100 to 100, 0 is unchanged, positive increases Blue & decreases Yellow, negative is opposite
/** @brief EMF+ manual 2.2.3.4, Microsoft name: ColorCurveEffect Object
Adjust Range
Exposure -255 to 255, 0 is unchanged
Density -255 to 255, 0 is unchanged
Contrast -100 to 100, 0 is unchanged
Highlight -100 to 100, 0 is unchanged
Shadow -100 to 100, 0 is unchanged
WhiteSaturation 0 to 255
BlackSaturation 0 to 255
*/
typedef struct {
int32_t Intensity; //!< adjustment to apply. "Adjust" determines what field this is and range values.
/** @brief EMF+ manual 2.2.3.5, Microsoft name: ColorLookupTableEffect Object */
typedef struct {
/** @brief EMF+ manual 2.2.3.6, Microsoft name: ColorMatrixEffect Object */
typedef struct {
U_FLOAT M[5][5]; //!< 5 x 5 color transformation matrix, First 4 rows are [{4 multiplier values},0.0] for R,G,B,A, last Row is [{4 color translation valuess}, 1.0]
/** @brief EMF+ manual 2.2.3.7, Microsoft name: HueSaturationLightnessEffect Object */
typedef struct {
/** @brief EMF+ manual 2.2.3.8, Microsoft name: LevelsEffect Object */
typedef struct {
/** @brief EMF+ manual 2.2.3.9, Microsoft name: RedEyeCorrectionEffect Object */
typedef struct {
/* variable part of object, not included in structure
U_RECTL Rects[]; //!< Array of rectangular area(s) to apply red eye correction
*/
/** @brief EMF+ manual 2.2.3.10, Microsoft name: SharpenEffect Object */
typedef struct {
/** @brief EMF+ manual 2.2.3.11, Microsoft name: TintEffect Object */
typedef struct {
int32_t Amount; //!< -100 [add black] to 100[add white], 0 is unchanged. Change in hue on specified axis
/* ************************** EMF+ Records ******************************** */
/** @brief EMF+ manual 2.3.1.1, Microsoft name: EmfPlusOffsetClip Record, Index 0x35 */
typedef struct {
/** @brief U_PMF_RESETCLIP EMF+ manual 2.3.1.2, Microsoft name: EmfPlusResetClip Record, Index 0x31 */
typedef struct {
/** @brief EMF+ manual 2.3.1.3, Microsoft name: EmfPlusSetClipPath Record, Index 0x33
flags (LITTLE endian here, manual uses BIG endian)
bits 8-11 CombineMode enumeration
bits 0-7 Index of an U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/** @brief EMF+ manual 2.3.1.4, Microsoft name: EmfPlusSetClipRect Record, Index 0x32
flags (LITTLE endian here, manual uses BIG endian)
bits 8-11 CombineMode enumeration
*/
typedef struct {
/** @brief EMF+ manual 2.3.1.5, Microsoft name: EmfPlusSetClipRegion Record, Index 0x34
flags (LITTLE endian here, manual uses BIG endian)
bits 12-15 CombineMode enumeration
bits 0-7 Index of an U_PMF_REGION object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/** @brief EMF+ manual 2.3.2.1, Microsoft name: EmfPlusComment Record, Index 0x03
variable part of record, not included in structure
char data[]; //!< Private data, may be anything
*/
typedef struct {
/** @brief EMF+ manual 2.3.3.1, Microsoft name: EmfPlusEndOfFile Record, Index 0x02 */
typedef struct {
/** @brief EMF+ manual 2.3.3.2, Microsoft name: EmfPlusGetDC Record, Index 0x04 */
typedef struct {
} U_PMF_GETDC;
/** @brief EMF+ manual 2.3.3.3, Microsoft name: EmfPlusHeader Record, Index 0x01
flags (LITTLE endian here, manual uses BIG endian)
bit 0 Set indicates "dual mode" EMF+
*/
typedef struct {
uint32_t EmfPlusFlags; //!< Reference device 0 bit: set = video device, clear= printer. Ignore all other bits.
} U_PMF_HEADER;
/** @brief EMF+ manual 2.3.4.1, Microsoft name: EmfPlusClear Record, Index 0x09 */
typedef struct {
} U_PMF_CLEAR;
/** @brief EMF+ manual 2.3.4.2, Microsoft name: EmfPlusDrawArc Record, Index 0x12
flags (LITTLE endian here, manual uses BIG endian)
bit 9 U_PPF_C Set: Rect is U_PMF_RECT; Clear: Rect is U_PMF_RECTF
bits 0-7 Index of an U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/* variable part of record, not included in structure
U_RECT or U_RECTF Rect; //!< Bounding box for elliptical arc being drawn.
*/
/** @brief EMF+ manual 2.3.4.3, Microsoft name: EmfPlusDrawBeziers Record, Index 0x19
flags (LITTLE endian here, manual uses BIG endian)
bit 9 U_PPF_C Set: int16_t coordinates; Clear: U_FLOAT coordinates (IGNORE if bit 4 is set)
bit 12 U_PPF_P Set: Coordinates are relative; Clear: they are absolute
bits 0-7 Index of an U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
bit1 bit4 Type of Data
1 0 U_EMF_POINT
0 0 U_EMF_POINTF
0 1 U_EMF_POINTR
*/
typedef struct {
/*
variable part of record, not included in structure
(varies) Points; //!< Points, for type see table above
*/
/** @brief EMF+ manual 2.3.4.4, Microsoft name: EmfPlusDrawClosedCurve Record, Index 0x17
flags (LITTLE endian here, manual uses BIG endian)
bit 9 U_PPF_C Set: int16_t coordinates; Clear: U_FLOAT coordinates (IGNORE if bit 4 is set)
bit 12 U_PPF_P Set: Coordinates are relative; Clear: they are absolute
bits 0-7 Index of an U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
bit1 bit4 Type of Data
1 0 U_EMF_POINT
0 0 U_EMF_POINTF
0 1 U_EMF_POINTR
Curve is a cardinal spline.
References sent by MS support:
http://msdn.microsoft.com/en-us/library/4cf6we5y(v=vs.110).aspx
*/
typedef struct {
/*
variable part of record, not included in structure
(varies) Points; //!< Points, for type see table above
*/
/** @brief EMF+ manual 2.3.4.5, Microsoft name: EmfPlusDrawCurve Record, Index 0x18
flags (LITTLE endian here, manual uses BIG endian)
bit 9 U_PPF_C Set: int16_t coordinates; Clear: U_FLOAT coordinates (IGNORE if bit 4 is set)
bits 0-7 Index of an U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
bit1 Type of Data
1 U_EMF_POINT
0 U_EMF_POINTF
Curve is a cardinal spline, using doubled terminator points to generate curves for the terminal segments.
References sent by MS support:
http://msdn.microsoft.com/en-us/library/4cf6we5y(v=vs.110).aspx
*/
typedef struct {
/*
variable part of record, not included in structure
(varies) Points; //!< Points, for type see table above
*/
/** @brief EMF+ manual 2.3.4.6, Microsoft name: EmfPlusDrawDriverString Record, Index 0x36
flags (LITTLE endian here, manual uses BIG endian)
. bit 15 U_PPF_B Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table
bits 0-7 Index of an U_PMF_FONT object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/*
variable part of record, not included in structure
uint16_t Glyphs; //!< If U_DSO_CmapLookup is set in DSOFlags this is an array
of UTF16LE characters, otherwise, it is an array of indices into the U_PMF_FONT
object indexed by Object_ID in flags.
U_PMF_POINTF Positions; //!< Coordinates of each member of Glyphs. U_DSO_RealizedAdvance set in DSOFlags
Relative then positions are calculated relative to the first glyph which is stored
in Positions, otherwise, all glyph positions are stored in Positions.
U_PMF_TRANSFORMMATRIX Matrix; //!< Transformation to apply to Glyphs & Positions. Present if HasMatrix is 1
*/
/** @brief EMF+ manual 2.3.4.7, Microsoft name: EmfPlusDrawEllipse Record, Index 0x0F
flags (LITTLE endian here, manual uses BIG endian)
bit 9 U_PPF_C Set: Rect is U_PMF_RECT; Clear: Rect is U_PMF_RECTF
bits 0-7 Index of an U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/*
variable part of record, not included in structure
(varies) Rect; //!< Bounding rectangle, data type set by bit1 of Header.Flags
*/
/** @brief EMF+ manual 2.3.4.8, Microsoft name: EmfPlusDrawImage Record, Index 0x1A
flags (LITTLE endian here, manual uses BIG endian)
bit 9 U_PPF_C Set: DstRect is U_PMF_RECT; Clear: DstRect is U_PMF_RECTF
bits 0-7 Index of an U_PMF_Image object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/*
variable part of record, not included in structure
(varies) DstRect; //!< Destination rectangle for image. Type controlled by bit1 of Header.Flags
*/
/** @brief EMF+ manual 2.3.4.9, Microsoft name: EmfPlusDrawImagePoints Record, Index 0x1B
flags (LITTLE endian here, manual uses BIG endian)
bit 14 U_PPF_C Set: Points is U_PMF_POINT; Clear: Points is U_PMF_POINTF
bit 13 U_PPF_E Set: effect from previous U_PMF_SERIALIZABLEOBJECT record will be applied; Clear: no effect applied
bit 11 U_PPF_P Set: Points has relative coordinates; Clear: Points has absolute coordinates
bits 0-7 Index of an U_PMF_Image object in the EMF+ object table (0-63, inclusive)
bit1 bit4 Type of Data
1 0 U_EMF_POINT
0 0 U_EMF_POINTF
0 1 U_EMF_POINTR
WARNING! Windows XP Preview does not show filter effects, whether or not U_PPF_E is set. They are visible if the EMF+
file is inserted as an image into PowerPoint.
*/
typedef struct {
/*
variable part of record, not included in structure
(varies) Points; //!< 3 points of a parallelogram. Type from bit1 and bit4 of Header.Flags, see table above
*/
/** @brief EMF+ manual 2.3.4.10, Microsoft name: EmfPlusDrawLines Record, Index 0x0D
flags (LITTLE endian here, manual uses BIG endian)
bit 9 U_PPF_C Set: Points is U_PMF_POINT; Clear: Points is U_PMF_POINTF
bit 10 U_PPF_D Set: close shape by connecting last point to first; Clear: leave path open
bit 12 U_PPF_P Set: Points has relative coordinates; Clear: Points has absolute coordinates
bits 0-7 Index of an U_PMF_Image object in the EMF+ object table (0-63, inclusive)
bit1 bit4 Type of Data
1 0 U_EMF_POINT
0 0 U_EMF_POINTF
0 1 U_EMF_POINTR
*/
typedef struct {
/*
variable part of record, not included in structure
(varies) Points; //!< Sequence of points to connect with line segments. Type from bit1 and bit4 of Header.Flags, see table above
*/
/** @brief EMF+ manual 2.3.4.11, Microsoft name: EmfPlusDrawPath Record, Index 0x15
flags (LITTLE endian here, manual uses BIG endian)
bits 0-7 Index of an U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/** @brief EMF+ manual 2.3.4.12, Microsoft name: EmfPlusDrawPie Record, Index 0x0D
flags (LITTLE endian here, manual uses BIG endian)
bit 9 U_PPF_C Set: Rect is U_PMF_RECT; Clear: Rect is U_PMF_RECTF
bits 0-7 Index of an U_PMF_Pen object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/*
variable part of record, not included in structure
U_RECT or U_RECTF Rect; //!< Bounding box for elliptical pie segment being drawn. Type from bit1 of Header.Flags, see above
*/
/** @brief EMF+ manual 2.3.4.13, Microsoft name: EmfPlusDrawRects Record, Index 0x0B
flags (LITTLE endian here, manual uses BIG endian)
bit 9 U_PPF_C Set: Rect is U_PMF_RECT; Clear: Rect is U_PMF_RECTF
bits 0-7 Index of an U_PMF_Pen object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/*
variable part of record, not included in structure
U_RECT or U_RECTF Rects; //!< Array of rectangles to draw. Type from bit1 of Header.Flags, see above
*/
/** @brief EMF+ manual 2.3.4.14, Microsoft name: EmfPlusDrawString Record, Index 0x1C
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_B Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
bits 0-7 Index of an U_PMF_FONT object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/*
variable part of record, not included in structure
uint16_t String; //!< Array of UFT-16LE unicode characters.
*/
/** @brief EMF+ manual 2.3.4.15, Microsoft name: EmfPlusFillClosedCurve Record, Index 0x16
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_B Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
bit 9 U_PPF_C Set: Points is U_PMF_POINT; Clear: Points is U_PMF_POINTF
bit 10 U_PPF_F Set: winding fill; Clear: alternate fill
bit 12 U_PPF_P Set: Points has relative coordinates; Clear: Points has absolute coordinates
bit1 bit4 Type of Data
1 0 U_EMF_POINT
0 0 U_EMF_POINTF
0 1 U_EMF_POINTR
*/
typedef struct {
/*
variable part of record, not included in structure
(varies) Points; //!< Sequence of points to connect. Type from bit1 and bit4 of Header.Flags, see table above
*/
/** @brief EMF+ manual 2.3.4.16, Microsoft name: EmfPlusFillEllipse Record, Index 0x0E
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_B Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
bit 9 U_PPF_C Set: Rect is U_PMF_RECT; Clear: Rect is U_PMF_RECTF
*/
typedef struct {
/*
variable part of record, not included in structure
U_RECT or U_RECTF Rect; //!< Bounding box for elliptical pie segment being drawn. Type from bit1 of Header.Flags, see above
*/
/** @brief EMF+ manual 2.3.4.17, Microsoft name: EmfPlusFillPath Record, Index 0x14
Note: U_PMF_FILLPATHOBJ is the object, U_PMF_FILLPATH is the file record
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_B Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
bits 0-7 Index of an U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/** @brief EMF+ manual 2.3.4.18, Microsoft name: EmfPlusFillPie Record, Index 0x10
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_B Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
bit 9 U_PPF_C Set: Rect is U_PMF_RECT; Clear: Rect is U_PMF_RECTF
*/
typedef struct {
/*
variable part of record, not included in structure
U_RECT or U_RECTF Rect; //!< Bounding box for elliptical pie segment being filled. Type from bit1 of Header.Flags, see above
*/
/** @brief EMF+ manual 2.3.4.19, Microsoft name: EmfPlusFillPolygon Record, Index 0x0C
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_B Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
bit 9 U_PPF_C Set: Points is U_PMF_POINT; Clear: Points is U_PMF_POINTF
bit 12 U_PPF_P Set: Points has relative coordinates; Clear: Points has absolute coordinates
bit1 bit4 Type of Data
1 0 U_EMF_POINT
0 0 U_EMF_POINTF
0 1 U_EMF_POINTR
*/
typedef struct {
/*
variable part of record, not included in structure
(varies) Points; //!< Sequence of points to connect with line segments. Type from bit1 and bit4 of Header.Flags, see table above
*/
/** @brief EMF+ manual 2.3.4.20, Microsoft name: EmfPlusFillRects Record, Index 0x0A
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_B Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
bit 9 U_PPF_C Set: Rect is U_PMF_RECT; Clear: Rect is U_PMF_RECTF
*/
typedef struct {
/*
variable part of record, not included in structure
U_RECT or U_RECTF Rects; //!< Array of rectangles to draw. Type from bit1 of Header.Flags, see above
*/
/** @brief EMF+ manual 2.3.4.21, Microsoft name: EmfPlusFillRegion Record, Index 0x13
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_B Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
bits 0-7 Index of an U_PMF_REGION object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/** @brief EMF+ manual 2.3.5.1, Microsoft name: EmfPlusObject Record, Index 0x13
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_N Set: object definition continues in next record; Clear: this is the final object definition record
bits 8-14 Type of object being created, ObjectType enumeration
bits 0-7 Index of an U_PMF_REGION object in the EMF+ object table (0-63, inclusive)
*/
typedef struct {
/*
variable part of record, not included in structure
uint8_t Data; //!< Object's data. Type from bits1-7 and bits8-15 of Header.Flags, see above
*/
} U_PMF_OBJECT;
/** @brief EMF+ manual 2.3.5.2, Microsoft name: EmfPlusSerializableObject Record, Index 0x38
WARNING! Windows XP Preview does not show filter effects, whether or not U_PPF_E is set. They are visible if the EMF+
file is inserted as an image into PowerPoint.
*/
typedef struct {
//!< Data1-Data3 are stored as little endian integers. Data4 is stored big endian (like a string)
/*
variable part of record, not included in structure
uint8_t Data; //!< "Serialized image effects parameter block". One of the ImageEffects objects.
*/
/** @brief EMF+ manual 2.3.6.1, Microsoft name: EmfPlusSetAntiAliasMode Record, Index 0x1E
flags (LITTLE endian here, manual uses BIG endian)
bits 7-1 SmoothingMode enumeration
bit 0 U_PPF_AA Set: anti-aliasing on; Clear: anti-aliasing off
*/
typedef struct {
/** @brief EMF+ manual 2.3.6.2, Microsoft name: EmfPlusSetCompositingMode Record, Index 0x23
flags (LITTLE endian here, manual uses BIG endian)
bits 0-7 CompositingMode enumeration
*/
typedef struct {
/** @brief EMF+ manual 2.3.6.3, Microsoft name: EmfPlusSetCompositingQuality Record, Index 0x24
flags (LITTLE endian here, manual uses BIG endian)
bits 0-7 CompositingQuality enumeration
*/
typedef struct {
/** @brief EMF+ manual 2.3.6.4, Microsoft name: EmfPlusSetInterpolationMode Record, Index 0x21
flags (LITTLE endian here, manual uses BIG endian)
bits 0-7 InterpolationMode enumeration
*/
typedef struct {
/** @brief EMF+ manual 2.3.6.5, Microsoft name: EmfPlusSetPixelOffsetMode Record, Index 0x22
flags (LITTLE endian here, manual uses BIG endian)
bits 0-7 PixelOffsetMode enumeration
*/
typedef struct {
/** @brief EMF+ manual 2.3.6.6, Microsoft name: EmfPlusSetRenderingOrigin Record, Index 0x1D */
typedef struct {
int32_t X; //!< X coordinate of rendering origin
int32_t Y; //!< Y coordinate of rendering origin
/** @brief EMF+ manual 2.3.6.7, Microsoft name: EmfPlusSetTextContrast Record, Index 0x20
flags (LITTLE endian here, manual uses BIG endian)
bits 12-0 1000 x Gamma correction value. Range 1000-2200 = gamma 1.0-2.2
*/
typedef struct {
/** @brief EMF+ manual 2.3.6.8, Microsoft name: EmfPlusSetTextRenderingHint Record, Index 0x1F
flags (LITTLE endian here, manual uses BIG endian)
bits 0-7 TextRenderingHint enumeration
*/
typedef struct {
/** @brief EMF+ manual 2.3.7.1, Microsoft name: EmfPlusBeginContainer Record, Index 0x27
flags (LITTLE endian here, manual uses BIG endian)
bits 8-15 UnitType enumeration
bits 0-7 (all zero)
*/
typedef struct {
/** @brief EMF+ manual 2.3.7.2, Microsoft name: EmfPlusBeginContainerNoParams Record, Index 0x28 */
typedef struct {
/** @brief EMF+ manual 2.3.7.3, Microsoft name: EmfPlusEndContainer Record, Index 0x29 */
typedef struct {
uint32_t Index; //!< Index of container being closed, from U_PMF_BEGINCONTAINERNOPARAMS or U_PMF_BEGINCONTAINER
/** @brief EMF+ manual 2.3.7.4, Microsoft name: EmfPlusRestore Record, Index 0x26 */
typedef struct {
/** @brief EMF+ manual 2.3.7.5, Microsoft name: EmfPlusSave Record, Index 0x25 */
typedef struct {
} U_PMF_SAVE;
/** @brief EMF+ manual 2.3.8.1, Microsoft name: EmfPlusSetTSClip Record, Index 0x3A
flags (LITTLE endian here, manual uses BIG endian)
bit 15 U_PPF_K Set: Rect is U_PMF_RECT; Clear: Rect is U_PMF_RECTF
bits 14-0 Number of rectangles in Rects field
*/
typedef struct {
/*
variable part of record, not included in structure
U_RECT or U_RECTF Rects; //!< Array of rectangles to draw. Type from bit0 of Header.Flags, see above
*/
/** @brief EMF+ manual 2.3.8.2, Microsoft name: EmfPlusSetTSGraphics Record, Index 0x39
flags (LITTLE endian here, manual uses BIG endian)
bit 1 U_PPF_VGA Set: Palette is VGA basic colors; Clear: Palette is a U_PMF_PALETTE object.
bit 0 U_PPF_PP Set: Palette field is present; Clear: Palette field is absent
*/
typedef struct {
/*
optional part of record, not included in structure
U_PMF_PALETTE Palette; //!< Present if bit15 of Header.Flags is set
*/
/** @brief EMF+ manual 2.3.9.1, Microsoft name: EmfPlusMultiplyWorldTransform Record, Index 0x2C
flags (LITTLE endian here, manual uses BIG endian)
bit 13 U_PPF_XM Set: Post multiply; Clear: Pre multiply
*/
typedef struct {
/** @brief EMF+ manual 2.3.9.2, Microsoft name: EmfPlusResetWorldTransform Record, Index 0x2B
Sets transformation matrix to identity matrix.
*/
typedef struct {
/** @brief EMF+ manual 2.3.9.3, Microsoft name: EmfPlusRotateWorldTransform Record, Index 0x2F
Construct transformation matrix from Angle:
sin(Angle) cos(Angle) 0
cos(Angle) -sin(Angle) 0
Multiply this against current world space transform, result becomes new world space transform.
flags (LITTLE endian here, manual uses BIG endian)
bit 13 U_PPF_XM Set: Post multiply; Clear: Pre multiply
*/
typedef struct {
/** @brief EMF+ manual 2.3.9.4, Microsoft name: EmfPlusScaleWorldTransform Record, Index 0x2E
Construct transformation matrix:
Sx 0 0
0 Sy 0
Multiply this against current world space transform, result becomes new world space transform.
flags (LITTLE endian here, manual uses BIG endian)
bit 13 U_PPF_XM Set: Post multiply; Clear: Pre multiply
*/
typedef struct {
/** @brief EMF+ manual 2.3.9.5, Microsoft name: EmfPlusSetPageTransform Record, Index 0x30
flags (LITTLE endian here, manual uses BIG endian)
bits 0-7 UnitType enumeration
*/
typedef struct {
/** @brief EMF+ manual 2.3.9.6, Microsoft name: EmfPlusSetWorldTransform Record, Index 0x2A */
typedef struct {
/** @brief EMF+ manual 2.3.9.7, Microsoft name: EmfPlusTranslateWorldTransform Record, Index 0x2D
Construct transformation matrix:
1 0 Dx
0 1 Dy
Multiply this against current world space transform, result becomes new world space transform.
flags (LITTLE endian here, manual uses BIG endian)
bit 13 U_PPF_XM Set: Post multiply; Clear: Pre multiply
*/
typedef struct {
//! \cond
/* EMF+ prototypes (helper functions) */
int U_PMR_drawline(uint32_t PenID, uint32_t PathID, U_PMF_POINTF Start, U_PMF_POINTF End, int Dashed, U_PSEUDO_OBJ *sum, EMFTRACK *et);
int U_PMR_drawstring( const char *string, int Vpos, uint32_t FontID, const U_PSEUDO_OBJ *BrushID, uint32_t FormatID,
U_PMF_STRINGFORMAT Sfs, const char *FontName, U_FLOAT Height, U_FontInfoParams *fip, uint32_t FontFlags,
int U_PMF_LEN_FLOATDATA(const char *contents);
int U_PMF_LEN_BYTEDATA(const char *contents);
int U_PMF_LEN_PENDATA(const char *PenData);
int U_PMF_KNOWNCURLYGUID_set(const char *string);
int U_PMF_RECORD_SIZE_get(const char *contents);
U_DPSEUDO_OBJ *U_PATH_create(int Elements, const U_PMF_POINTF *Points, uint8_t First, uint8_t Others);
int U_PATH_polylineto(U_DPSEUDO_OBJ *path, uint32_t Elements, const U_PMF_POINTF *Points, uint8_t Flags, uint8_t StartSeg);
int U_PATH_polybezierto(U_DPSEUDO_OBJ *path, uint32_t Elements, const U_PMF_POINTF *Points, uint8_t Flags, uint8_t StartSeg);
int U_PATH_polygon(U_DPSEUDO_OBJ *Path, uint32_t Elements, const U_PMF_POINTF *Points, uint8_t Flags);
int U_PATH_arcto(U_DPSEUDO_OBJ *Path, U_FLOAT Start, U_FLOAT Sweep, U_FLOAT Rot, U_PMF_RECTF *Rect, uint8_t Flags, int StartSeg);
U_PMF_TRANSFORMMATRIX tm_for_gradrect(U_FLOAT Angle, U_FLOAT w, U_FLOAT h, U_FLOAT x, U_FLOAT y, U_FLOAT Periods);
char *U_pmr_names(unsigned int idx);
/* EMF+ prototypes (objects_set) */
U_PSEUDO_OBJ *U_PMF_IMAGEATTRIBUTES_set(uint32_t Version, uint32_t WrapMode, uint32_t ClampColor, uint32_t ObjectClamp);
U_PSEUDO_OBJ *U_PMF_PATH_set(uint32_t Version, const U_PSEUDO_OBJ *Points, const U_PSEUDO_OBJ *Types);
U_PSEUDO_OBJ *U_PMF_PEN_set(uint32_t Version, const U_PSEUDO_OBJ *PenData, const U_PSEUDO_OBJ *Brush);
U_PSEUDO_OBJ *U_PMF_BLENDCOLORS_set(uint32_t Elements, const U_FLOAT *Positions, const U_PSEUDO_OBJ *Colors);
U_PSEUDO_OBJ *U_PMF_BLENDCOLORS_linear_set(uint32_t Elements,U_PMF_ARGB StartColor, U_PMF_ARGB EndColor);
U_PSEUDO_OBJ *U_PMF_BLENDFACTORS_set(uint32_t Elements, const U_FLOAT *Positions, const U_FLOAT *Factors);
U_PSEUDO_OBJ *U_PMF_BLENDFACTORS_linear_set(uint32_t Elements, U_FLOAT StartFactor, U_FLOAT EndFactor);
const U_PSEUDO_OBJ *Clcod);
U_PSEUDO_OBJ *U_PMF_CUSTOMLINECAPOPTIONALDATA_set(const U_PSEUDO_OBJ *Fill, const U_PSEUDO_OBJ *Line);
U_PSEUDO_OBJ *U_PMF_HATCHBRUSHDATA_set(uint32_t Style, const U_PSEUDO_OBJ *Fg, const U_PSEUDO_OBJ *Bg);
U_PSEUDO_OBJ *U_PMF_LINEARGRADIENTBRUSHDATA_set(const U_PMF_LINEARGRADIENTBRUSHDATA *Lgbd, const U_PSEUDO_OBJ *Lgbod);
U_PSEUDO_OBJ *U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA_set(uint32_t *Flags, const U_PSEUDO_OBJ *Tm, const U_PSEUDO_OBJ *Bc, const U_PSEUDO_OBJ *BfH, const U_PSEUDO_OBJ *BfV);
U_PSEUDO_OBJ *U_PMF_METAFILE_set(void);
U_PSEUDO_OBJ *U_PMF_PATHGRADIENTBRUSHDATA_set(uint32_t Flags, int32_t WrapMode, U_PMF_ARGB CenterColor,
U_PMF_POINTF Center, const U_PSEUDO_OBJ *Gradient, const U_PSEUDO_OBJ *Boundary, const U_PSEUDO_OBJ *Data);
U_PSEUDO_OBJ *U_PMF_PATHPOINTTYPERLE_set(uint32_t Elements, const uint8_t *Bz, const uint8_t *RL, const uint8_t *Ppte);
U_PSEUDO_OBJ *U_PMF_PENOPTIONALDATA_set(uint32_t Flags, U_PSEUDO_OBJ *Tm, int32_t StartCap, int32_t EndCap, uint32_t Join,
U_PSEUDO_OBJ *U_PMF_STRINGFORMATDATA_set(uint32_t TabStopCount, U_FLOAT *TabStops, const U_PSEUDO_OBJ *Ranges);
U_PSEUDO_OBJ *U_PMF_TEXTUREBRUSHDATA_set(uint32_t Flags, uint32_t WrapMode, const U_PSEUDO_OBJ *Tbod);
U_PSEUDO_OBJ *U_PMF_TEXTUREBRUSHOPTIONALDATA_set(const U_PSEUDO_OBJ *Tm, const U_PSEUDO_OBJ *Image);
U_PSEUDO_OBJ *U_PMF_IE_COLORLOOKUPTABLE_set(const uint8_t *BLUT, const uint8_t *GLUT, const uint8_t *RLUT, const uint8_t *ALUT);
U_PSEUDO_OBJ *U_PMF_IE_HUESATURATIONLIGHTNESS_set(int32_t Hue, int32_t Saturation, int32_t Lightness);
/* EMF+ prototypes (records_set) */
U_PSEUDO_OBJ *U_PMR_RESETCLIP_set(void);
U_PSEUDO_OBJ *U_PMR_ENDOFFILE_set(void);
U_PSEUDO_OBJ *U_PMR_GETDC_set(void);
U_PSEUDO_OBJ *U_PMR_DRAWARC_set(uint32_t PenID, U_FLOAT Start, U_FLOAT Sweep, const U_PSEUDO_OBJ *Rect);
U_PSEUDO_OBJ *U_PMR_DRAWCLOSEDCURVE_set(uint32_t PenID, U_FLOAT Tension, const U_PSEUDO_OBJ *Points);
U_PSEUDO_OBJ *U_PMR_DRAWCURVE_set(uint32_t PenID, U_FLOAT Tension,uint32_t Offset, uint32_t NSegs, const U_PSEUDO_OBJ *Points);
U_PSEUDO_OBJ *U_PMR_DRAWDRIVERSTRING_set(uint32_t FontID, U_FLOAT Tension, const U_PSEUDO_OBJ *BrushID,
U_PSEUDO_OBJ *U_PMR_DRAWIMAGE_set(uint32_t ImgID, int32_t ImgAttrID, int32_t SrcUnit, const U_PSEUDO_OBJ *SrcRect, const U_PSEUDO_OBJ *DstRect);
U_PSEUDO_OBJ *U_PMR_DRAWIMAGEPOINTS_set(uint32_t ImgID, int etype, int32_t ImgAttrID, int32_t SrcUnit, const U_PSEUDO_OBJ *SrcRect, const U_PSEUDO_OBJ *Points);
U_PSEUDO_OBJ *U_PMR_DRAWPIE_set(uint32_t PenID, U_FLOAT Start, U_FLOAT Sweep, const U_PSEUDO_OBJ *Rect);
U_PSEUDO_OBJ *U_PMR_FILLCLOSEDCURVE_set(int ftype, U_FLOAT Tension, const U_PSEUDO_OBJ * BrushID, const U_PSEUDO_OBJ *Points);
U_PSEUDO_OBJ *U_PMR_FILLPIE_set(U_FLOAT Start, U_FLOAT Sweep, const U_PSEUDO_OBJ *BrushID, const U_PSEUDO_OBJ *Rect);
U_PSEUDO_OBJ *U_PMR_OBJECT_set(uint32_t ObjID, int otype, int ntype, uint32_t TSize, size_t cbData, const char *Data);
U_PSEUDO_OBJ *U_PMR_BEGINCONTAINER_set(int UTenum, U_PSEUDO_OBJ *DstRect, U_PSEUDO_OBJ *SrcRect, uint32_t StackID);
U_PSEUDO_OBJ *U_PMR_SETTSGRAPHICS_set(int vgatype, U_PMF_SETTSGRAPHICS *Tsg, U_PSEUDO_OBJ *Palette);
U_PSEUDO_OBJ *U_PMR_STROKEFILLPATH_set(void);
/* EMF+ prototypes (objects_get) */
int U_PMF_BRUSH_get(const char *contents, uint32_t *Version, uint32_t *Type, const char **Data, const char *blimit);
int U_PMF_CUSTOMLINECAP_get(const char *contents, uint32_t *Version, uint32_t *Type, const char **Data, const char *blimit);
int U_PMF_FONT_get(const char *contents, uint32_t *Version, U_FLOAT *EmSize, uint32_t *SizeUnit, int32_t *FSFlags, uint32_t *Length, const char **Data, const char *blimit);
int U_PMF_IMAGE_get(const char *contents, uint32_t *Version, uint32_t *Type, const char **Data, const char *blimit);
int U_PMF_IMAGEATTRIBUTES_get(const char *contents, uint32_t *Version, uint32_t *WrapMode, uint32_t *ClampColor, uint32_t *ObjectClamp, const char *blimit);
int U_PMF_PATH_get(const char *contents, uint32_t *Version, uint32_t *Count, uint16_t *Flags, const char **Points, const char **Types, const char *blimit);
int U_PMF_PEN_get(const char *contents, uint32_t *Version, uint32_t *Type, const char **PenData, const char **Brush, const char *blimit);
int U_PMF_REGION_get(const char *contents, uint32_t *Version, uint32_t *Count, const char **Nodes, const char *blimit);
int U_PMF_STRINGFORMAT_get(const char *contents, U_PMF_STRINGFORMAT *Sfs, const char **Data, const char *blimit);
int U_PMF_ARGB_get(const char *contents, uint8_t *Blue, uint8_t *Green, uint8_t *Red, uint8_t *Alpha, const char *blimit);
int U_PMF_BITMAP_get(const char *contents, U_PMF_BITMAP *Bs, const char **Data, const char *blimit);
int U_PMF_BITMAPDATA_get(const char *contents, U_PMF_PALETTE *Ps, const char **Colors, const char **Data, const char *blimit);
int U_PMF_BLENDCOLORS_get(const char *contents, uint32_t *Elements, U_FLOAT **Positions, const char **Colors, const char *blimit);
int U_PMF_BLENDFACTORS_get(const char *contents, uint32_t *Elements, U_FLOAT **Positions, U_FLOAT **Factors, const char *blimit);
int U_PMF_BOUNDARYPATHDATA_get(const char *contents, int32_t *Size, const char **Data, const char *blimit);
int U_PMF_BOUNDARYPOINTDATA_get(const char *contents, int32_t *Elements, U_PMF_POINTF **Points, const char *blimit);
int U_PMF_CHARACTERRANGE_get(const char *contents, int32_t *First, int32_t *Length, const char *blimit);
int U_PMF_COMPOUNDLINEDATA_get(const char *contents, int32_t *Elements, U_FLOAT **Widths, const char *blimit);
int U_PMF_CUSTOMENDCAPDATA_get(const char *contents, int32_t *Size, const char **Data, const char *blimit);
int U_PMF_CUSTOMLINECAPARROWDATA_get(const char *contents, U_PMF_CUSTOMLINECAPARROWDATA *Ccad, const char *blimit);
int U_PMF_CUSTOMLINECAPDATA_get(const char *contents, U_PMF_CUSTOMLINECAPDATA *Clcd, const char **Data, const char *blimit);
int U_PMF_CUSTOMLINECAPOPTIONALDATA_get(const char *contents, uint32_t Flags, const char **FillData, const char **LineData, const char *blimit);
int U_PMF_CUSTOMSTARTCAPDATA_get(const char *contents, int32_t *Size, const char **Data, const char *blimit);
int U_PMF_DASHEDLINEDATA_get(const char *contents, int32_t *Elements, U_FLOAT **Lengths, const char *blimit);
int U_PMF_FILLPATHOBJ_get(const char *contents, int32_t *Size, const char **Data, const char *blimit);
int U_PMF_FOCUSSCALEDATA_get(const char *contents, uint32_t *Count, U_FLOAT *ScaleX, U_FLOAT *ScaleY, const char *blimit);
int U_PMF_GRAPHICSVERSION_get(const char *contents, int *Signature, int *GrfVersion, const char *blimit);
int U_PMF_HATCHBRUSHDATA_get(const char *contents, uint32_t *Style, U_PMF_ARGB *Foreground, U_PMF_ARGB *Background, const char *blimit);
int U_PMF_LINEARGRADIENTBRUSHDATA_get(const char *contents, U_PMF_LINEARGRADIENTBRUSHDATA *Lgbd, const char **Data, const char *blimit);
int U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA_get(const char *contents, uint32_t Flags, U_PMF_TRANSFORMMATRIX *Tm, const char **Bc, const char **BfH, const char **BfV, const char *blimit);
int U_PMF_METAFILE_get(const char *contents, uint32_t *Type, uint32_t *Size, const char **Data, const char *blimit);
int U_PMF_PALETTE_get(const char *contents, uint32_t *Flags, uint32_t *Elements, const char **Data, const char *blimit);
int U_PMF_PATHGRADIENTBRUSHDATA_get(const char *contents, U_PMF_PATHGRADIENTBRUSHDATA *Pgbd, const char **Gradient, const char **Boundary, const char **Data, const char *blimit);
int U_PMF_PATHGRADIENTBRUSHOPTIONALDATA_get(const char *contents, uint32_t Flags, U_PMF_TRANSFORMMATRIX *Matrix, const char **Pattern, const char **Data, const char *blimit);
int U_PMF_PATHPOINTTYPERLE_get(const char *contents, int *Bezier, int *RL, int *Ppt, const char *blimit);
int U_PMF_PENDATA_get(const char *contents, uint32_t *Flags, uint32_t *Unit, U_FLOAT *Width, const char **Data, const char *blimit);
int32_t *StartCap, int32_t *EndCap, uint32_t *Join, U_FLOAT *MiterLimit, int32_t *Style, int32_t *DLCap, U_FLOAT *DLOffset,
const char **DLData, int32_t *Alignment, const char **CmpndLineData, const char **CSCapData, const char **CECapData, const char *blimit);
int U_PMF_RECT_get(const char **contents, int16_t *X, int16_t *Y, int16_t *Width, int16_t *Height, const char *blimit);
int U_PMF_RECTF_get(const char **contents, U_FLOAT *X, U_FLOAT *Y, U_FLOAT *Width, U_FLOAT *Height, const char *blimit);
int U_PMF_REGIONNODE_get(const char *contents, uint32_t *Type, const char **Data, const char *blimit);
/* There is no U_PMF_REGIONNODECHILDNODES_get, see the note in upmf.c */
int U_PMF_REGIONNODEPATH_get(const char *contents, int32_t *Size, const char **Data, const char *blimit);
int U_PMF_TEXTUREBRUSHDATA_get(const char *contents, uint32_t *Flags, int32_t *WrapMode, const char **Data, const char *blimit);
int U_PMF_TEXTUREBRUSHOPTIONALDATA_get(const char *contents, int HasImage, U_PMF_TRANSFORMMATRIX *Matrix, const char **Image, const char *blimit);
int U_PMF_TRANSFORMMATRIX_get(const char *contents, U_PMF_TRANSFORMMATRIX *Matrix, const char *blimit);
int U_PMF_IE_BLUR_get(const char *contents, U_FLOAT *Radius, uint32_t *ExpandEdge, const char *blimit);
int U_PMF_IE_BRIGHTNESSCONTRAST_get(const char *contents, int32_t *Brightness, int32_t *Contrast, const char *blimit);
int U_PMF_IE_COLORBALANCE_get(const char *contents, int32_t *CyanRed, int32_t *MagentaGreen, int32_t *YellowBlue, const char *blimit);
int U_PMF_IE_COLORCURVE_get(const char *contents, uint32_t *Adjust, uint32_t *Channel, int32_t *Intensity, const char *blimit);
int U_PMF_IE_COLORLOOKUPTABLE_get(const char *contents,
const uint8_t **BLUT, const uint8_t **GLUT, const uint8_t **RLUT, const uint8_t **ALUT, const char *blimit);
int U_PMF_IE_COLORMATRIX_get(const char *contents, U_PMF_IE_COLORMATRIX *Matrix, const char *blimit);
int U_PMF_IE_HUESATURATIONLIGHTNESS_get(const char *contents, int32_t *Hue, int32_t *Saturation, int32_t *Lightness, const char *blimit);
int U_PMF_IE_LEVELS_get(const char *contents, int32_t *Highlight, int32_t *Midtone, int32_t *Shadow, const char *blimit);
int U_PMF_IE_REDEYECORRECTION_get(const char *contents, int32_t *Elements, U_RECTL **Rects, const char *blimit);
int U_PMF_IE_SHARPEN_get(const char *contents, U_FLOAT *Radius, int32_t *Sharpen, const char *blimit);
/* EMF+ prototypes (records_get) */
int U_PMR_SETCLIPPATH_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PathID, int *CMenum);
int U_PMR_SETCLIPRECT_get(const char *contents, U_PMF_CMN_HDR *Header, int *CMenum, U_PMF_RECTF *Rect);
int U_PMR_SETCLIPREGION_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PathID, int *CMenum);
int U_PMR_HEADER_get(const char *contents, U_PMF_CMN_HDR *Header, U_PMF_GRAPHICSVERSION *Version, int *IsDual, int *IsVideo, uint32_t *LogicalDpiX, uint32_t *LogicalDpiY);
int U_PMR_DRAWARC_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PenID, int *ctype, U_FLOAT *Start, U_FLOAT *Sweep, U_PMF_RECTF *Rect);
int U_PMR_DRAWBEZIERS_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PenID, int *ctype, int *RelAbs, uint32_t *Elements, U_PMF_POINTF **Points);
int U_PMR_DRAWCLOSEDCURVE_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PenID, int *ctype, int *RelAbs, U_FLOAT *Tension, uint32_t *Elements, U_PMF_POINTF **Points);
int U_PMR_DRAWCURVE_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PenID, int *ctype, U_FLOAT *Tension, uint32_t *Offset, uint32_t *NSegs, uint32_t *Elements, U_PMF_POINTF **Points);
int U_PMR_DRAWDRIVERSTRING_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *FontID, int *btype, U_FLOAT *Tension, uint32_t *BrushID, uint32_t *DSOFlags, uint32_t *HasMatrix, uint32_t *Elements, uint16_t **Glyphs, U_PMF_POINTF **Points, U_PMF_TRANSFORMMATRIX **Matrix);
int U_PMR_DRAWELLIPSE_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PenID, int *ctype, U_PMF_RECTF *Rect);
int U_PMR_DRAWIMAGE_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *ImgID, int *ctype, uint32_t *ImgAttrID, int32_t *SrcUnit, U_PMF_RECTF *SrcRect, U_PMF_RECTF *DstRect);
int U_PMR_DRAWIMAGEPOINTS_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *ImgID, int *ctype, int *etype, int *RelAbs, uint32_t *ImgAttrID, int32_t *SrcUnit, U_PMF_RECTF *SrcRect, uint32_t *Elements, U_PMF_POINTF **Points);
int U_PMR_DRAWLINES_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PenID, int *ctype, int *dtype, int *RelAbs, uint32_t *Elements, U_PMF_POINTF **Points);
int U_PMR_DRAWPATH_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PathID, uint32_t *PenID);
int U_PMR_DRAWPIE_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PenID, int *ctype, U_FLOAT *Start, U_FLOAT *Sweep, U_PMF_RECTF *Rect);
int U_PMR_DRAWRECTS_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PenID, int *ctype, uint32_t *Elements, U_PMF_RECTF **Rects);
int U_PMR_DRAWSTRING_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *FontID, int *btype, uint32_t *BrushID, uint32_t *FormatID, uint32_t *Elements, U_PMF_RECTF *Rect, uint16_t **String);
int U_PMR_FILLCLOSEDCURVE_get(const char *contents, U_PMF_CMN_HDR *Header, int *btype, int *ctype, int *ftype, int *RelAbs, uint32_t *BrushID, U_FLOAT *Tension, uint32_t *Elements, U_PMF_POINTF **Points);
int U_PMR_FILLELLIPSE_get(const char *contents, U_PMF_CMN_HDR *Header, int *btype, int *ctype, uint32_t *BrushID, U_PMF_RECTF *Rect);
int U_PMR_FILLPATH_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *PathID, int *btype, uint32_t *BrushID);
int U_PMR_FILLPIE_get(const char *contents, U_PMF_CMN_HDR *Header, int *btype, int *ctype, uint32_t *BrushID, U_FLOAT *Start, U_FLOAT *Sweep, U_PMF_RECTF *Rect);
int U_PMR_FILLPOLYGON_get(const char *contents, U_PMF_CMN_HDR *Header, int *btype, int *ctype, int *RelAbs, uint32_t *BrushID, uint32_t *Elements, U_PMF_POINTF **Points);
int U_PMR_FILLRECTS_get(const char *contents, U_PMF_CMN_HDR *Header, int *btype, int *ctype, uint32_t *BrushID, uint32_t *Elements, U_PMF_RECTF **Rects);
int U_PMR_FILLREGION_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *RgnID, int *btype, int *ctype, uint32_t *BrushID);
int U_PMR_OBJECT_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *ObjID, int *otype, int *ntype, uint32_t *TSize, const char **Data);
int U_PMR_SERIALIZABLEOBJECT_get(const char *contents, U_PMF_CMN_HDR *Header, uint8_t *GUID, uint32_t *Size, const char **Data);
int U_PMR_SETANTIALIASMODE_get(const char *contents, U_PMF_CMN_HDR *Header, int *SMenum, int *aatype);
int U_PMR_SETRENDERINGORIGIN_get(const char *contents, U_PMF_CMN_HDR *Header, int32_t *X, int32_t *Y);
int U_PMR_BEGINCONTAINER_get(const char *contents, U_PMF_CMN_HDR *Header, int *UTenum, U_PMF_RECTF *DstRect, U_PMF_RECTF *SrcRect, uint32_t *StackID);
int U_PMR_BEGINCONTAINERNOPARAMS_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *StackID);
int U_PMR_SETTSCLIP_get(const char *contents, U_PMF_CMN_HDR *Header, int *ctype, uint32_t *Elements, U_PMF_RECTF **Rects);
int U_PMR_SETTSGRAPHICS_get(const char *contents, U_PMF_CMN_HDR *Header, int *vgatype, int *pptype, uint8_t *AntiAliasMode, uint8_t *TextRenderHint, uint8_t *CompositingMode, uint8_t *CompositingQuality, int16_t *RenderOriginX, int16_t *RenderOriginY, uint16_t *TextContrast, uint8_t *FilterType, uint8_t *PixelOffset, U_PMF_TRANSFORMMATRIX *WorldToDevice, const char **Data);
int U_PMR_MULTIPLYWORLDTRANSFORM_get(const char *contents, U_PMF_CMN_HDR *Header, int *xmtype, U_PMF_TRANSFORMMATRIX *Matrix);
int U_PMR_ROTATEWORLDTRANSFORM_get(const char *contents, U_PMF_CMN_HDR *Header, int *xmtype, U_FLOAT *Angle);
int U_PMR_SCALEWORLDTRANSFORM_get(const char *contents, U_PMF_CMN_HDR *Header, int *xmtype, U_FLOAT *Sx, U_FLOAT *Sy);
int U_PMR_SETPAGETRANSFORM_get(const char *contents, U_PMF_CMN_HDR *Header, int *PUenum, U_FLOAT *Scale);
int U_PMR_SETWORLDTRANSFORM_get(const char *contents, U_PMF_CMN_HDR *Header, U_PMF_TRANSFORMMATRIX *Matrix);
int U_PMR_TRANSLATEWORLDTRANSFORM_get(const char *contents, U_PMF_CMN_HDR *Header, int *xmtype, U_FLOAT *Dx, U_FLOAT *Dy);
//! \endcond
#ifdef __cplusplus
}
#endif
#endif /* _UPMF_ */