/**
@file upmf.c
@brief Functions for manipulating EMF+ files and structures.
EMF+ is much more object based than is EMF or WMF, so the U_PMR_*_set and most U_PMF_*_set functions
return a pointer to a PseudoObject. PseudoObjects are structs that contain a data field to hold the
object in EMF+ file byte order, size information, and some type information. This is sufficient to allow
complex records to be built up from the various sorts of nested objects which they normally contain.
If something goes wrong a NULL pointer is returned and recsize is set to 0.
the EMF+ file byte order on the fly.
WARNING: Microsoft's EMF+ documentation is little-endian for everything EXCEPT
bitfields, which are big-endian. See EMF+ manual 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.c
Version: 0.0.12
Date: 26-JAN-2016
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2016 David Mathog and California Institute of Technology (Caltech)
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iconv.h>
#include <wchar.h>
#include <errno.h>
#include <string.h>
#include <limits.h> // for INT_MAX, INT_MIN
#include <math.h> // for sin, cos, tan2, use U_ROUND() instead of roundf()
#include <stddef.h> /* for offsetof() macro */
#if 0
#include <windef.h> //Not actually used, looking for collisions
#include <winnt.h> //Not actually used, looking for collisions
#include <wingdi.h> //Not actually used, looking for collisions
#endif
#include "uemf_endian.h" // for U_swap* functions
//! \cond
/// things Doxygen should not process
/* remove this after debugging is completed */
}
}
/* Prototypes for functions used here and defined in uemf_endian.c, but which are not supposed
to be used in end user code. */
//! \endcond
/**
\brief Utility function for writing one or more EMF+ records in a PseudoObject to the EMF output file
\return 1 on success, 0 on error.
\param po U_PSEUDO_OBJ to write, it is deleted after it is written
\param sum U_PSEUDO_OBJ to use for scratch space
\param et EMFTRACK used to write records to EMF file
*/
char *rec;
int status = 0;
if(!emf_append((PU_ENHMETARECORD)rec, et, 1))goto end; /* write it to the EMF file, delete the record, check status */
status = 1;
end:
return(status);
}
/**
\brief Utility function to draw a line.
\return 1 on success, 0 on error.
\param PenID Index of U_PMF_PEN object to use in the EMF+ object table (0-63, inclusive)
\param PathID Index of U_PMF_PATH object to use in the EMF+ object table (0-63, inclusive)
\param Start U_PMF_POINTF coordinates of start of line.
\param End U_PMF_POINTF coordinates of end of line.
\param Dashed Set if the line is dashed, clear if it is not.
\param sum PseudoObject used for scratch space
\param et EMFTRACK used to write records to EMF file
*/
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 status=0;
if(dpath){
if(poPath){
if(po){
if(po){
status = 1;
}
}
}
}
U_DPO_free(&dpath);
}
return(status);
}
/**
\brief Utility function for drawing strings onto the baseline in one call.
\return 1 on success, 0 on error.
\param string Text to draw in UTF-8 format
\param Vpos StringAlignment Enumeration. Always drawn on baseline, but using one of these three modes.
\param FontID Index of U_PMF_FONT object to use in the EMF+ object table (0-63, inclusive)
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
\param FormatID index of U_PMF_STRINGFORMAT object to use in the EMF+ Object Table.
\param Sfs StringFormat structure. Ignored values: StringAlignment, LineAlign, Flags
\param FontName Name of font to draw with
\param Height Height of font in pixels (positive)
\param fip U_FontInfoParams (ascent, descent, and so forth)
\param FontFlags FontStyle Flags
\param x X position in pixels of left side of EM box of first character
\param y Y position in pixels of baseline of first character
\param sum PseudoObject used for scratch space
\param et EMFTRACK used to write records to EMF file
EMF+ manual 2.3.4.14, Microsoft name: EmfPlusDrawString Record, Index 0x1C
For most fonts Ascent and Descent are used to adjust the bounding box to properly position the
baseline. Some fonts, like Verdana, are strange and they position the baseline on the bottom of
the bounding box if that box has the same height as the font. For those fonts specify 0.0 for
both Ascent and Descent.
*/
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 slen;
int status = 0;
poFont = U_PMF_FONT_set(U_PMF_GRAPHICSVERSIONOBJ_set(2), Height, U_UT_World, FontFlags, slen, UFontName);
if(poFont){
if(po){
if(poSF){
if(po){
rx = x;
if(fip->LineGap && (fip->LineGap < -fip->Descent)){ dval = ((double) (fip->Descent - fip->LineGap)) / ((double) fip->EmSize); } //shruti and some others
switch(Vpos){
case U_SA_Near:
break;
case U_SA_Center:
break;
case U_SA_Far:
break;
}
#if 0
(void) U_PMR_drawline(OBJ_PEN_BLACK_1,OBJ_PATH_1, (U_PMF_POINTF){x-100, ry}, (U_PMF_POINTF){x+100, ry}, 0, sum, et);
(void) U_PMR_drawline(OBJ_PEN_BLACK_1,OBJ_PATH_1, (U_PMF_POINTF){x-100, ry+rh}, (U_PMF_POINTF){x+100, ry+rh}, 0, sum, et);
(void) U_PMR_drawline(OBJ_PEN_BLACK_1,OBJ_PATH_1, (U_PMF_POINTF){x-100, ry}, (U_PMF_POINTF){x-100, ry + Height * (double) fip->Ascent / ((double) fip->EmSize)}, 0, sum, et);
(void) U_PMR_drawline(OBJ_PEN_BLACK_1,OBJ_PATH_1, (U_PMF_POINTF){x- 90, ry}, (U_PMF_POINTF){x- 90, ry - Height * (double) fip->Descent / ((double) fip->EmSize)}, 0, sum, et);
(void) U_PMR_drawline(OBJ_PEN_BLACK_1,OBJ_PATH_1, (U_PMF_POINTF){x- 80, ry}, (U_PMF_POINTF){x- 80, ry + Height * (double) fip->yMax / ((double) fip->EmSize)}, 0, sum, et);
(void) U_PMR_drawline(OBJ_PEN_BLACK_1,OBJ_PATH_1, (U_PMF_POINTF){x- 70, ry}, (U_PMF_POINTF){x- 70, ry - Height * (double) fip->yMin / ((double) fip->EmSize)}, 0, sum, et);
(void) U_PMR_drawline(OBJ_PEN_BLACK_1,OBJ_PATH_1, (U_PMF_POINTF){x- 60, ry}, (U_PMF_POINTF){x- 60, ry + Height * (double) fip->LineGap / ((double) fip->EmSize)}, 0, sum, et);
(void) U_PMR_drawline(OBJ_PEN_BLACK_1,OBJ_PATH_1, (U_PMF_POINTF){x- 50, ry}, (U_PMF_POINTF){x- 50, ry + Height * ( 1.0 - (((double) (fip->LineGap - fip->Descent)) / ((double) fip->EmSize)) )}, 0, sum, et);
#endif
if(po){
}
}
}
}
}
return(status);
}
/**
\brief Allocate and construct an array of U_POINT16 objects from a set of U_PMF_POINTF objects, endianness in and out is LE
\returns pointer to an array of U_POINT16 structures.
\param points pointer to the source U_POINT structures
\param count number of members in points
If a coordinate is out of range it saturates at boundary.
*/
int i;
for(i=0; i<count; i++){
}
return(newpts);
}
/**
\brief Look up the name of the EMR+ record by type. Returns U_EMR_INVALID if out of range.
\return name of the PMR record, "U_EMR_INVALID" if out of range.
\param idx PMR record type WITHOUT the U_PMR_RECFLAG bit.
*/
"U_PMR_INVALID",
"U_PMR_Header",
"U_PMR_EndOfFile",
"U_PMR_Comment",
"U_PMR_GetDC",
"U_PMR_MultiFormatStart",
"U_PMR_MultiFormatSection",
"U_PMR_MultiFormatEnd",
"U_PMR_Object",
"U_PMR_Clear",
"U_PMR_FillRects",
"U_PMR_DrawRects",
"U_PMR_FillPolygon",
"U_PMR_DrawLines",
"U_PMR_FillEllipse",
"U_PMR_DrawEllipse",
"U_PMR_FillPie",
"U_PMR_DrawPie",
"U_PMR_DrawArc",
"U_PMR_FillRegion",
"U_PMR_FillPath",
"U_PMR_DrawPath",
"U_PMR_FillClosedCurve",
"U_PMR_DrawClosedCurve",
"U_PMR_DrawCurve",
"U_PMR_DrawBeziers",
"U_PMR_DrawImage",
"U_PMR_DrawImagePoints",
"U_PMR_DrawString",
"U_PMR_SetRenderingOrigin",
"U_PMR_SetAntiAliasMode",
"U_PMR_SetTextRenderingHint",
"U_PMR_SetTextContrast",
"U_PMR_SetInterpolationMode",
"U_PMR_SetPixelOffsetMode",
"U_PMR_SetCompositingMode",
"U_PMR_SetCompositingQuality",
"U_PMR_Save",
"U_PMR_Restore",
"U_PMR_BeginContainer",
"U_PMR_BeginContainerNoParams",
"U_PMR_EndContainer",
"U_PMR_SetWorldTransform",
"U_PMR_ResetWorldTransform",
"U_PMR_MultiplyWorldTransform",
"U_PMR_TranslateWorldTransform",
"U_PMR_ScaleWorldTransform",
"U_PMR_RotateWorldTransform",
"U_PMR_SetPageTransform",
"U_PMR_ResetClip",
"U_PMR_SetClipRect",
"U_PMR_SetClipPath",
"U_PMR_SetClipRegion",
"U_PMR_OffsetClip",
"U_PMR_DrawDriverstring",
"U_PMR_StrokeFillPath",
"U_PMR_SerializableObject",
"U_PMR_SetTSGraphics",
"U_PMR_SetTSClip"
};
return(U_PMR_NAMES[idx]);
}
/**
\brief Convert from PseudoObject OID to ObjectType enumeration.
\returns OT value on success, 0 if no match
\param OID PseudoObject OID (based on EMF+ manual chapter number. )
Only OTs that may be stored in the EMF+ object table are supported.
*/
int otype;
else { otype = U_OT_Invalid; }
return(otype);
}
/**
\brief Convert from PseudoObject OID to BrushType enumeration.
\returns BT value on success, -1 if no match
\param OID PseudoObject OID (based on EMF+ manual chapter number. )
Only OIDs that map to BT's are supported.
*/
int otype;
else { otype = -1; }
return(otype);
}
/**
\brief Convert from PseudoObject OID to CustomLineCapDataType Enumeration.
\returns BT value on success, -1 if no match
\param OID PseudoObject OID (based on EMF+ manual chapter number. )
Only OIDs that map to CLCDT's are supported.
*/
int otype;
else { otype = -1; }
return(otype);
}
/**
\brief Convert from PseudoObject OID to ImageDataType Enumeration.
\returns BT value on success, -1 if no match
\param OID PseudoObject OID (based on EMF+ manual chapter number. )
Only OIDs that map to IDT's are supported.
*/
int otype;
else { otype = -1; }
return(otype);
}
/**
\brief Convert from PseudoObject OID to RegionNodeDataType Enumeration.
\returns BT value on success, -1 if no match
\param OID PseudoObject OID (based on EMF+ manual chapter number. )
Only OIDs that map to RNDT's are supported.
*/
int otype;
if( OID==U_PMF_REGIONNODECHILDNODES_OID ){ otype = U_RNDT_Kids; } /* there are 5 types, which must be specified separately */
else { otype = -1; }
return(otype);
}
/**
\brief Append data to an U_OBJ_ACCUM structure.
\param oa pointer to the U_OBJ_ACCUM structure
\param data data to add
\param size bytes in data
\param Type object type
\param Id Object ID
\returns 0 on success, !0 on error. -1 on Type change, -2 on Id change
Safe to test for Id, Type changes by calling with size=0.
*/
int tail;
if(!oa)return(2);
}
if(!newaccum){
return(1);
}
}
return(0);
}
/**
\brief Clear an U_OBJ_ACCUM structure. Accumulated storage is retained.
\param oa pointer to the U_OBJ_ACCUM structure
\returns 0 on success, !0 on error.
*/
if(!oa)return(2);
/* Type and Id may be ignored as they are reset on the first append */
return(0);
}
/**
\brief Release an U_OBJ_ACCUM structure. Accumulated storage is free'd.
\param oa pointer to the U_OBJ_ACCUM structure
\returns 0 on success, !0 on error.
*/
if(!oa)return(2);
return(0);
}
/**
\brief Create and set an U_PSEUDO_OBJ
\returns pointer to the U_PSEUDO_OBJ, NULL on error
\param Data Data to copy into the PseudoObject's data. If NULL, space is allocated, but is cleared instead of filled.
\param Size Number of bytes to allocate for Data (may be >Use if padding is present)
\param Use Number of data bytes in Data (whether or not Data is actually copied)
\param Type Type numbers are from manual section: 1.2.3.47 -> 0x01020347
If Data is NULL and Size is 0 an empty PseudoObject is created. One byte of storage
is allocated for Data, Size is set to 1, and Used to 0.
If Data is NULL and Size is !0 a zero filled PseudoObject is created.
If Data is !Null and Size is !0 a data filled PseudoObject is created.
*/
if(po){
}
else {
}
}
return(po);
}
/**
\brief Append data to a U_PSEUDO_OBJ object and return it
\returns pointer to the U_PSEUDO_OBJ object, NULL on error
\param po PseudoObject to append to. Cannot be NULL.
\param Data Data to copy into the PseudoObject's data. If NULL, space is allocated (if necessary) and cleared instead of filled.
\param Size Number of data bytes in Data
*/
/* po cannot be NULL,as in U_PO_po_append(), because there would be no way to determine the TYPE of the resulting PO */
if(po){
if(!newData){
}
else {
}
}
if(po){ /* po->Data ready to append new data */
}
}
return(po);
}
/**
\brief Append data to a U_PSEUDO_OBJ object and return it
\returns pointer to the U_PSEUDO_OBJ object, NULL on error
\param po PseudoObject to append to. May be NULL.
\param Src PseudoObject to append.
\param StripE Set: leading Elements in Src->Data is not copied, Clear: it is copied.
*/
if((StripE && (Src->Used == 4)) || !Src->Used){ return(po); } /* appending nothing is not an error */
if(!ipo){
}
if(ipo){
if(!newData){
}
else {
}
}
if(ipo){
if(Data){
if(StripE){ memcpy(ipo->Data + ipo->Used, Data + 4, Size); } /* Size is already 4 less, skip the leading Elements value */
}
}
}
return(ipo);
}
/**
\brief Free an U_PSEUDO_OBJ structure. All associated memory is released.
\param po Address of a pointer to the U_PSEUDO_OBJ structure, Pointer is set to NULL.
\returns 1 on success, 0 on error.
*/
if(!po)return(0);
if(!*po)return(1);
return(1);
}
/** \brief create a PseudoObject with data in the correct byte order for an EMF+ file.
\returns The PseudoObject on success, NULL on error.
\param Type the type of the PseudoObject that is created. Allowed values are in U_PID_Values.
\param List an array of U_SERIAL_DESC structures containing the data to store.
The U_PMF_SERIAL_set() function should not ever be called directly by end user code.
Each U_SERIAL_DESC element in List consists of Data fields and a description of that data. List is terminated
by the first U_SERIAL_DESC element having a TE value of U_XX.
Data fields: an array of a basic type of Units bytes repeated Reps times with the target byte order
described in TE.
Ptrs: Address of the first byte of the data fields.
Units: Number of bytes of in each data field unit
Reps: Number of repeats of the unit in data fields.
If a Ptr is NULL, and Units*Reps is not zero, then Units*Reps 0x00 bytes are stored.
If a Ptr is NULL, and Units*Reps is zero, this U_SERIAL_DESC is ignored.
if a Ptr is NOT NULL, and Units * Reps is not zero, then the data is stored in the indicated byte order.
If a Ptr is NOT NULL, and Units or Reps is zero an error is signaled.
TE: (Target Endian) the byte order in which to store each unit of a data field as defined in U_Endian.
Byte swapping is only enabled when Units is 2 or 4. In addition to the byte order values U_XE, U_LE,
and U_BE, and the array terminator U_XX, the value may also be U_RP. U_RP means there is only a
single unit in the data fields, but it is to be copied to the target Reps times. That is, the data
was passed in with a form of run length encoding.
Creates an empty PseudoObject if all pointers are NULL and all sizes are zero.
*/
char *cptr;
char *hptr;
}
if(po){
if(FSize){ /* Ptr is not NULL, that would have been detected already */
}
}
}
}
return(po);
}
/**
\brief Create U_DPSEUDO_OBJ's for the Points and Types of a path
\param Elements Number of elements in Points. May be zero, which creates an empty path.
\param Points Array of U_PMF_POINTF values.
\param First Apply to first point, unsigned byte, lower 4 bits hold the PathPointType flag upper 4 bits hold the PathPointType enumeration. Must have U_PPT_Start set.
\param Others Apply to all other points, unsigned byte, lower 4 bits hold the PathPointType flag upper 4 bits hold the PathPointType enumeration. Must have U_PPT_Line or U_PPT_Bezier set.
\returns pointer to the DU_PSEUDO_OBJ object, NULL on error
*/
U_DPSEUDO_OBJ *U_PATH_create(int Elements, const U_PMF_POINTF *Points, uint8_t First, uint8_t Others){
if(Elements){
}
U_DPSEUDO_OBJ *Path = (U_DPSEUDO_OBJ *)calloc(sizeof(U_DPSEUDO_OBJ),1); /* make poTypes and poPoints NULL */
if(Path){
if(!Elements){
}
else {
U_PSEUDO_OBJ *tpo = U_PMF_PATHPOINTTYPE_set2(Elements, First | U_PPT_Start, Others); /* PO holding types, has leading Elements value */
Path->poTypes = U_PO_po_append(NULL, tpo, U_PMF_DROP_ELEMENTS); /* remove the leading Elements value*/
}
}
}
return(Path);
}
/**
\brief Free U_DPSEUDO_OBJ's
\returns 1 on success, 0 on error.
*/
if(!dpo){ return(0); }
if(!*dpo){ return(1); }
return(1);
}
/**
\brief Clear U_DPSEUDO_OBJ's. Memory is retained, Elements and Used values are set to 0.
\returns 1 on success, 0 on error.
It is much more efficient to clear a DPO and reuse it than to free that DPO and create another.
*/
if(!dpo){ return(0); }
return(1);
}
/**
\brief Append a "moveto" point to a path
\param Path Address of a DoublePseudoObject holding the path to append to.
\param Point Point to move to.
\param Flags Flags may be (U_PTP_None, U_PTP_DashMode, U_PTP_PathMarker, U_PTP_NoBit, U_PTP_CloseSubpath)
\returns 1 on success, 0 on error.
*/
if(!Path){ return(0); }
if(!tpo){ return(0); }
if(!tpo2)return(0);
if(!tpo){ return(0); }
if(!tpo2)return(0);
return(1);
}
/**
\brief Append a "lineto" point to a path
\param Path Address of a DoublePseudoObject holding the path to append to.
\param Point U_PMF_POINTF point to draw to.
\param Flags Flags may be (U_PTP_None, U_PTP_DashMode, U_PTP_PathMarker, U_PTP_NoBit, U_PTP_CloseSubpath)
\returns 1 on success, 0 on error.
*/
if(Path->poTypes->Data[Path->Elements - 1] & U_PTP_CloseSubpath){ return(0); } /* cannot extend a closed subpath */
if(!tpo){ return(0); }
if(!tpo2)return(0);
if(!tpo){ return(0); }
if(!tpo2)return(0);
return(1);
}
/**
\brief Set the closepath bit in the last point
\param Path Address of a DoublePseudoObject holding the path to act upon.
\returns 1 on success, 0 on error.
*/
return(1);
}
/**
\brief Append a "polylineto" set of point to a path
\param Path Address of a DoublePseudoObject holding the path to append to.
\param Elements number of Points and Flags
\param Points Line points.
\param Flags Flags (U_PTP_None, U_PTP_DashMode, U_PTP_PathMarker, U_PTP_NoBit, but NOT U_PTP_CloseSubpath)
\param StartSeg If set, use U_PPT_Start PathPointType enumeration for first point, otherwise use U_PPT_Line.
\returns 1 on success, 0 on error.
*/
int U_PATH_polylineto(U_DPSEUDO_OBJ *Path, uint32_t Elements, const U_PMF_POINTF *Points, uint8_t Flags, uint8_t StartSeg){
if(!tpo2)return(0);
if(!tpo){ return(0); }
if(!tpo2)return(0);
return(1);
}
/**
\brief Append a "polybezierto" set of point to a path
\param Path Address of a DoublePseudoObject holding the path to append to.
\param Elements number of Points
\param Points Bezier points. Optional starting point, then N sets of 3, example: [P1] (Q12A Q12B P2) (Q23A Q23B P3).
\param Flags Flags (U_PTP_None, U_PTP_DashMode, U_PTP_PathMarker, U_PTP_NoBit, but NOT U_PTP_CloseSubpath)
\param StartSeg If set, use U_PPT_Start PathPointType enumeration for first point, otherwise use U_PPT_Bezier.
\returns 1 on success, 0 on error.
If Start is set Elements must be 1 + multiple of 3. Ie, P1 Q12A Q12B P2 Q23A Q23B P3
If Start is clear Elements must be a multiple of 3. Ie, (P1, already in path) Q12A Q12B P2 Q23A Q23B P3
*/
int U_PATH_polybezierto(U_DPSEUDO_OBJ *Path, uint32_t Elements, const U_PMF_POINTF *Points, uint8_t Flags, uint8_t StartSeg){
if(!Elements){
if(StartSeg){ return(0); } /* cannot have both a NEW segment and ZERO points */
else{ return(1); } /* harmless - do nothing */
}
if(!tpo2)return(0);
if(!tpo){ return(0); }
if(!tpo2)return(0);
return(1);
}
/**
\brief Append a "polygon" set of points to a path.
\param Path Address of a DoublePseudoObject holding the path to append to.
\param Elements number of Points and Flags
\param Points Line points.
\param Flags Flags (U_PTP_None, U_PTP_DashMode, U_PTP_PathMarker, U_PTP_NoBit, but NOT U_PTP_CloseSubpath)
\returns 1 on success, 0 on error.
*/
int U_PATH_polygon(U_DPSEUDO_OBJ *Path, uint32_t Elements, const U_PMF_POINTF *Points, uint8_t Flags){
if(status){
}
return(status);
}
//! \cond
// These are not exposed in the API
/* Parameterized Ellipse coordinates */
return(point);
}
/* Parameterized Ellipse derivative */
return(point);
}
double Alpha;
double t2;
return(Alpha);
}
/* Parameterized Bezier point Q1 or Q2 derivative */
U_PMF_POINTF U_qparam(double Alpha, double a, double b, U_PMF_POINTF *Point, double Ang, double Theta, int mode){
}
else {
}
return(Q);
}
//! \endcond
/**
\brief Append an "arcto" set of points to a path (Bezier points are calculated, and these are appended
\param Path Address of a pointer to the U_PSEUDO_OBJ that holds points
\param Start Start angle, >=0.0, degrees clockwise from 3:00
\param Sweep Sweep angle, -360<= angle <=360, degrees clockwise from Start
\param Rot Rotation angle to apply to coordinate system (Start and Rect), positive is degrees clockwise
\param Rect U_PMF_RECTF that defines the bounding rectangle.
\param Flags Flags (U_PTP_None, U_PTP_DashMode, U_PTP_PathMarker, U_PTP_NoBit, but NOT U_PTP_CloseSubpath)
\param StartSeg If set, the arc starts a new segment, if clear, continue the existing segment. Starting a new segment does not automatically apply U_PATH_closepath to the existing path.
\returns 1 on success, 0 on error.
Based on Luc Maisonobe's work, http://www.spaceroots.org/documents/ellipse/
*/
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){
double a, b;
int done = 0;
int fpoint = 0;
if(!Path){ return(0); }
/* Start should be between 0 and 360 degrees, but it does not really matter because sin, and cos will accept anything */
/* the sign on Sweep and Start is correct bacause LM's derivation has y positive up, but GDI+ has y positive down. */
if(!a || !b){ return(0); }
/* convert to radians */
while(!done){
if(Sweep < 0){
else {done = 0; }
}
else {
else {done = 0; }
}
if(!fpoint){
fpoint = 1;
}
}
return(1);
}
/**
\brief Allocate and construct an array of U_PMF_POINTF objects which have been subjected to a U_XFORM
\returns pointer to an array of U_PMF_POINTF structures.
\param points pointer to the source U_PMF_POINTF structures
\param count number of members in points
\param xform U_XFORM to apply
*/
int i;
float X,Y;
if(newpts){
for(i=0; i<count; i++){
X = points[i].X;
Y = points[i].Y;
}
}
return(newpts);
}
/**
\brief Allocate and construct an array of U_PMF_RECTF objects which have been subjected to a U_XFORM
\returns pointer to an array of U_PMF_RECTF structures.
\param Rects pointer to the source U_PMF_RECTF structures
\param Count number of members in Rects
\param Xform U_XFORM to apply. Rotation is ignored, only translation is applied.
*/
int i;
if(newRects){
for(i=0; i<Count; i++){
}
}
return(newRects);
}
/**
\brief Utility function calculate the transformation matrix needed to make a gradient run precisely corner to corner of a rectangle
\param Angle Rotation in degrees clockwise of the gradient. 0 is horizontal gradient.
\param w Width of the rectangle
\param h Height of the rectangle
\param x X coordinate of upper left corner of rectangle
\param y Y coordinate of upper left corner of rectangle
\param Periods Periods of gradient corner to corner. 1.0 is one, corner to corner.
\return Transformation matrix. All values are zero if Periods, w, or h are less than or equal to zero.
*/
U_PMF_TRANSFORMMATRIX tm_for_gradrect(U_FLOAT Angle, U_FLOAT w, U_FLOAT h, U_FLOAT x, U_FLOAT y, U_FLOAT Periods){
//! \cond
#define CLOSE_TO_IS_REALLY_ZERO(A) ((A) > 1.0e-10 || (A) < -1.0e-10 ? (A) : 0.0) //! \hideinitializer
//! \endcond
double scale;
}
else {
/*
scale is gradient period divided by w
The scale value sets the gradient period to match exactly with the inscribed (w,h) rectangle
in the direction specified by the angle.
The numberator of scale is the max of the four dot product values of the rotated X basis unit vector with (w,h),
with each of the vectors {w,h}, {-w,h}, {-w,-h}, {w,h}. Those vectors run from each corner in turn
to the opposite corner. The one most parallel to the rotated unit vector will have both terms positive.
Trig results like cos(pi/2) are not stable between platforms due to minor differences in the
implementation. Detect these and make them zero, which then allows binary comparison of output files.
Otherwise the binary comparisons between platforms would fail because of a bunch of insignificant digits.
*/
/* offset is to one corner of the square, depending on which quadrant the rotation selects. */
}
else {
}
}
return tm;
}
/**
\brief Create a U_PSEUDO_OBJ containing a U_PMR_FILLPATH and U_PMR_DRAWPATH records.
\returns pointer to U_PSEUDO_OBJ or NULL on error.
\param PathID U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
*/
if(po){
}
return(po);
}
/**
\brief Extract a single data field from a source.
\returns 1 on success, 0 on error.
\param Src where the data is coming from. It is incremented by the number of bytes retrieved.
\param Dst where the data will be stored. This must either be NULL (in which case the Src
is advanced and nothing is stored, or it must be allocated to Reps * Units bytes!!!!
\param Units number of bytes in each unit of the data field
\param Reps number of repeats of units in the data field.
If a Ptr is NULL, then Units*Reps 0 bytes are stored.
If a Ptr is NOT NULL, and Units or Reps, is zero an error is signaled.
If a Ptr is NULL and Units*Reps is 0, nothing happens.
\param SE logical (Source Endian). Only relevant for Sizes of 2 or 4
Indicates when Bytes may need to be rearranged when they are retrieved.
U_XE no change (this is used when the data has already been set to the proper orientation or it is not known)
U_LE source is Little Endian
U_BE source is Big Endian.
U_XX error
*/
/* need to swap */
return(1);
}
/**
\brief Conditionally extract an array of data from a source, allocating space to hold it.
\returns 1 on success, 0 on error.
\param Src where the data is coming from. It is incremented by the number of bytes retrieved.
\param Dst Caller must free. Where the pointer to the data will be stored. Reps * Units bytes will be allocated,
\param Units number of bytes in each unit of the data field
\param Reps number of repeats of units in the data field.
If a Ptr is NULL, then Units*Reps 0 bytes are stored.
If a Ptr is NOT NULL, and Units or Reps, is zero an error is signaled.
If a Ptr is NULL and Units*Reps is 0, nothing happens.
\param SE logical (Source Endian). Only relevant for Sizes of 2 or 4
Indicates when Bytes may need to be rearranged when they are retrieved.
U_XE no change (this is used when the data has already been set to the proper orientation or it is not known)
U_LE source is Little Endian
U_BE source is Big Endian.
U_XX error
\param Cond Store the data into *Dst if true, set *Dst to NULL otherwise.
*/
int U_PMF_SERIAL_array_copy_get(const char **Src, void **Dst, size_t Units, size_t Reps, int SE, int Cond){
if(!Cond){
return(1);
}
/* need to swap */
return(1);
}
/**
\brief Calculate the length in bytes of a relative path object composed of U_PMF_INTEGER7 and U_PMF_INTER15 values
\return >=0 length == success, <0 error
\param contents Start of a relative path consisting of int7 and int15 X,Y pairs.
\param Elements number of relative X,Y pairs in the object
*/
int length=0;
/* X or Y value */
}
return(length);
}
/**
\brief Calculate the length in bytes of objects which are a 4 byte Count followed by Count * float bytes
\return >=0 length == success, <0 error
Object types whose size may be derived with this function are:
U_PMF_COMPOUNDLINEDATA
U_PMF_DASHEDLINEDATA
*/
int Size;
return(Size);
}
/**
\brief Calculate the length in bytes of objects which are a 4 byte count followed by count bytes
\return >=0 length == success, <0 error
Object types whose size may be derived with this function are:
U_PMF_BOUNDARYPATHDATA
U_PMF_BOUNDARYPOINTDATA
U_PMF_CUSTOMSTARTCAPDATA
U_PMF_PATH
U_PMF_LINEPATH
U_PMF_REGIONNODEPATH
*/
int Size;
Size += 4;
return(Size);
}
/**
\brief Create a string containing the curly bracket form of the 16 byte GUID value
\return number of bytes in record, 0 on error
\param GUID pointer to the 16 unsigned bytes
\return string in curly bracket form.
Text form is Data1-Data2-Data3-Data4, the first 3 are stored as little endian integers, the last as a string (big endian).
*/
if(string){
sprintf(string,"{%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X}",
);
}
return(string);
}
/**
\brief Identify a known curly GUID
\param string Curly GUID form.
\return EmageEffects Enumerator
EMF+ manual 2.1.3.1, Microsoft name: ImageEffects Identifier
*/
int status;
else if(!strcmp(string,"{D3A1DBE1-8EC4-4C17-9F4C-EA97AD1C343D}")){ status = U_IEE_BrightnessContrastEffectGuid; }
else if(!strcmp(string,"{537E597D-251E-48DA-9664-29CA496B70F8}")){ status = U_IEE_ColorBalanceEffectGuid; }
else if(!strcmp(string,"{DD6A0022-58E4-4A67-9D9B-D48EB881A53D}")){ status = U_IEE_ColorCurveEffectGuid; }
else if(!strcmp(string,"{A7CE72A9-0F7F-40D7-B3CC-D0C02D5C3212}")){ status = U_IEE_ColorLookupTableEffectGuid; }
else if(!strcmp(string,"{718F2615-7933-40E3-A511-5F68FE14DD74}")){ status = U_IEE_ColorMatrixEffectGuid; }
else if(!strcmp(string,"{8B2DD6C3-EB07-4D87-A5F0-7108E26A9C5F}")){ status = U_IEE_HueSaturationLightnessEffectGuid;}
else if(!strcmp(string,"{99C354EC-2A31-4F3A-8C34-17A803B33A25}")){ status = U_IEE_LevelsEffectGuid; }
else if(!strcmp(string,"{74D29D05-69A4-4266-9549-3CC52836B632}")){ status = U_IEE_RedEyeCorrectionEffectGuid; }
else if(!strcmp(string,"{63CBF3EE-C526-402C-8F71-62C540BF5142}")){ status = U_IEE_SharpenEffectGuid; }
else { status = U_IEE_Unknown; }
return(status);
}
/** \brief Load a GUID from text format into EMF+ file binary format.
\param string Curly GUID as text, minus the barckets and dashes.
\return GUID in EMF+ file binary format.
This accepts a string that is 16 bytes long = 32 characters hex (no dash spaces or brackets) as text.
Text form is; Data1|Data2|Data3|Data4, first three are stored as little endian integers of 4,2,2 bytes, respectively,
last is stored like a string (big endian), after conversion from text hex to binary.
This function is not normally called by end user code.
*/
int i;
if(hold){
goto bye;
}
if(U_IS_BE){ /* these fields are stored little endian */
}
/* remainder is converted byte by byte and stored in that order */
goto bye;
}
}
}
bye:
return(hold);
}
/**
\brief Generate the 16 byte form from OID of the ImageEffects Identifier
\param OID OID of the ImageEffects Identifier
\return pointer to 16 byte buffer holding the long GUID binary form, or NULL on error.
EMF+ manual 2.1.3.1, Microsoft name: ImageEffects Identifier
*/
else if(OID == U_PMF_IE_BRIGHTNESSCONTRAST_OID ){ lf = U_LOAD_GUID("D3A1DBE18EC44C179F4CEA97AD1C343D"); }
else if(OID == U_PMF_IE_COLORLOOKUPTABLE_OID ){ lf = U_LOAD_GUID("A7CE72A90F7F40D7B3CCD0C02D5C3212"); }
else if(OID == U_PMF_IE_HUESATURATIONLIGHTNESS_OID){ lf = U_LOAD_GUID("8B2DD6C3EB074D87A5F07108E26A9C5F"); }
else if(OID == U_PMF_IE_REDEYECORRECTION_OID ){ lf = U_LOAD_GUID("74D29D0569A4426695493CC52836B632"); }
return(lf);
}
/**
\brief copy data and shift source pointer by the amount of data moved
\param Dst Destination in memory
\param Src Source in memory
\param Size Number of bytes to move
*/
}
/**
\brief copy data and shift destination pointer by the amount of data moved
\param Dst Destination in memory (this must not be NULL)
\param Src Source in memory (if this is NULL, fill with that many zero bytes instead)
\param Size Number of bytes to move
*/
}
/**
\brief Copy the single instance at Src repeatedly to Dst.
\param Dst Destination in memory
\param Src Source in memory (if this is NULL, fill with that many zero bytes instead)
\param Size number of bytes in single instance that is template.
\param Reps Number of instances of the template to opy
*/
}
}
/**
\brief save pointer to data and shift source pointer by the amount of data moved
\param Dst Destination in memory
\param Src Source in memory or NULL. If NULL Dst is set to NULL.
\param Size Number of bytes to move
*/
if(*Src){
}
else {
}
}
/**
\brief save pointer to data and shift source pointer by the amount of data moved
\return 1 on sucess, 0 on error
\param Dst Destination in memory
\param Src Source in memory or NULL. If NULL Dst is set to NULL.
\param Doit Assign if true, otherwise, set to NULL
*/
if(!Dst){ return(0); }
return(1);
}
/*
=====================================================================================
start of U_PMF_*_get() functions
*/
/**
\brief Get the 16 bit unsigned Flags field from a header.
\param contents Record from which to extract data, will be incremented by header size.
\return Flags field
In many records the only value needed from the header is Flags. Rather than mapping
the entire Header and returning it, in these instances this function may be called to
just get this one value.
*/
U_PMF_SERIAL_get(&cptr, &Flags, 2, 1, U_LE); /* EMF+ manual documents it as BE, but this code implements it as LE*/
return(Flags);
}
/**
\brief Retrieve whichever header fields are requested. NULL pointers do not retrieve.
\param contents Record from which to extract data, will be incremented by header size.
\param Type Record type
\param Flags Record flags
\param Size Records size
\param Datasize Data size
\return 1 on success, 0 on failure.
*/
if(!contents){ return(0); }
U_PMF_SERIAL_get(&contents, Flags, 2, 1, U_LE); /* EMF+ manual documents it as BE, but this code implements it as LE*/
return(1);
}
/**
\brief Get the entire EMF+ record header.
\param contents Record from which to extract data, will be offset by header size.
\param Header Location to store data (may be NULL)
\returns 1
If Header is Null, nothing is stored but contents is still offset.
*/
if(Header){
U_PMF_SERIAL_get(contents, &(Header->Flags), 2, 1, U_LE); /* EMF+ manual documents it as BE, but this code implements it as LE*/
}
else {
*contents += sizeof(U_PMF_CMN_HDR);
}
return(1);
}
/**
\brief return the size in bytes of the EMF+ record
\param contents Record from which to extract data, will not be modified.
\returns size, or 0 if contents is Null
*/
if(!contents){ return(0); }
int Size;
return(Size);
}
/**
\brief Return the size of a PenData object from an EMF+ record.
\param PenData Address in memory where the PenData object starts.
\returns size of the object in bytes
*/
return(length);
}
/**
\brief Return the size of an OptPenData object from an EMF+ record.
\param PenData Address in memory where the PenData object starts.
\param Flags PenData Flags that indicate which fields are present.
\returns size of the object in bytes
*/
int length=0;
return(length);
}
/**
\brief Create and set a U_PMF_BRUSH PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param Bd U_PSEUDO_OBJ containing one of the 5 types of Brush data
EMF+ manual 2.2.1.1, Microsoft name: EmfPlusBrush Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_CUSTOMLINECAP PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param Ld U_PSEUDO_OBJ containing one of the 2 types of Linecap data
EMF+ manual 2.2.1.2, Microsoft name: EmfPlusCustomLineCap Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_FONT PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param EmSize em size in units of SizeUnit
\param SizeUnit UnitType enumeration
\param FSFlags FontStyle flags
\param Length Number of Unicode Characters in FamilyName
\param Font Unicode (UTF-16LE) fontname
EMF+ manual 2.2.1.3, Microsoft name: EmfPlusFont Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IMAGE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param Id U_PSEUDO_OBJ containing one of the 2 types of image data
EMF+ manual 2.2.1.4, Microsoft name: EmfPlusImage Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IMAGEATTRIBUTES PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param WrapMode WrapMode object
\param ClampColor EmfPlusARGB object
\param ObjectClamp ObjectClamp Identifiers
EMF+ manual 2.2.1.5, Microsoft name: EmfPlusImageAttributes Object
*/
U_PSEUDO_OBJ *U_PMF_IMAGEATTRIBUTES_set(uint32_t Version, uint32_t WrapMode, uint32_t ClampColor, uint32_t ObjectClamp){
};
return(po);
}
/**
\brief Create and set a U_PMF_PATH PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param Points U_PSEUDO_OBJ containing array of points (of type PMFPointR, PMFPoint, or PMFPointF, determined by U_PPF_P and U_PPF_C bits in Flags)
\param Types U_PSEUDO_OBJ containing array of types (U_PMF_PATHPOINTTYPE or U_PMF_PATHPOINTTYPERLE, determined by U_PPF_R big in Flags)
EMF+ manual 2.2.1.6, Microsoft name: EmfPlusPath Object
*/
U_PSEUDO_OBJ *U_PMF_PATH_set(uint32_t Version, const U_PSEUDO_OBJ *Points, const U_PSEUDO_OBJ *Types){
int pad;
if(Points){
else { return(NULL); }
}
else { return(NULL); }
if(Types){
else { return(NULL); }
}
else { return(NULL); }
{NULL, pad, (pad ? 1 : 0), (pad ? U_XE : U_XX)}, /* if no padding is needed the Units will be zero and nothing will happen */
};
return(po);
}
/**
\brief Create and set a U_PMF_PATH PseudoObject that uses U_PMF_POINTF coordinates
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param Path U_DPSEUDO_OBJ containing a path.
EMF+ manual 2.2.1.6, Microsoft name: EmfPlusPath Object
*/
{NULL, pad, (pad ? 1 : 0), (pad ? U_XE : U_XX)}, /* if no padding is needed the Units will be zero and nothing will happen */
};
return(po);
}
/**
\brief Create and set a U_PMF_PATH PseudoObject that uses U_PMF_POINT (int 16) coordinates
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param Path U_DPSEUDO_OBJ containing a path.
EMF+ manual 2.2.1.6, Microsoft name: EmfPlusPath Object
*/
{NULL, pad, (pad ? 1 : 0), (pad ? U_XE : U_XX)}, /* if no padding is needed the Units will be zero and nothing will happen */
};
return(po);
}
/**
\brief Create and set a U_PMF_PEN PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param PenData U_PSEUDO_OBJ containing U_PMF_PENDATA object
\param Brush U_PSEUDO_OBJ containing U_PMF_BRUSH object
EMF+ manual 2.2.1.7, Microsoft name: EmfPlusPen Object
*/
U_PSEUDO_OBJ *U_PMF_PEN_set(uint32_t Version, const U_PSEUDO_OBJ *PenData, const U_PSEUDO_OBJ *Brush){
};
return(po);
}
/**
\brief Create and set a U_PMF_REGION PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Version EmfPlusGraphicsVersion object
\param Count Number of CHILD nodes. This is one less than the total number of U_PMF_REGIONNODE objects in Nodes.
\param Nodes U_PSEUDO_OBJ containing U_PMF_REGIONNODE object (Nodes defining region, may be a single element or a binary tree)
EMF+ manual 2.2.1.8, Microsoft name: EmfPlusRegion Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_STRINGFORMAT PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Sfs pointer to U_PMF_STRINGFORMAT structure, with no variable part
\param Sfd (optional) U_PSEUDO_OBJ containing U_PMF_STRINGFORMATDATA object
EMF+ manual 2.2.1.9, Microsoft name: EmfPlusStringFormat Object
*/
if(Sfd){
if((!Sfs->TabStopCount && !Sfs->RangeCount) || (Sfd->Type != U_PMF_STRINGFORMATDATA_OID))return(NULL);
}
else {
}
};
return(po);
}
/**
\brief Create and set a PMF_4NUM PseudoObject (used for BrushID's)
\return Pointer to PseudoObject, NULL on error
\param BrushID U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_ARGB PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Alpha Alpha (0-255)
\param Red Red color (0-255)
\param Green Green color (0-255)
\param Blue Blue color (0-255)
EMF+ manual 2.2.2.1, Microsoft name: EmfPlusARGB Object
*/
};
return(po);
}
/**
\brief Create and set an Array of U_PMF_ARGB valus in a PseudoObject
\return Pointer to PseudoObject containing the count, followed by the array of colors, NULL on error
\param Count Number of entries in Colors
\param Colors Array of ARGB values
EMF+ manual 2.2.2.1, Microsoft name: EmfPlusARGB Object
*/
};
return(po);
}
/**
\brief Set a U_PMF_ARGB object
\return Object
\param Alpha Alpha (0-255)
\param Red Red color (0-255)
\param Green Green color (0-255)
\param Blue Blue color (0-255)
EMF+ manual 2.2.2.1, Microsoft name: EmfPlusARGB Object
*/
return(argb);
}
/**
\brief Create and set a U_PMF_BITMAP PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Bs pointer to U_PMF_BITMAP structure, with no variable part
\param Bm U_PSEUDO_OBJ containing an U_PMF_BITMAPDATA or U_PMF_COMPRESSEDIMAGE object
EMF+ manual 2.2.2.2, Microsoft name: EmfPlusBitmap Object
*/
uint32_t Pad = UP4(Bm->Used) - Bm->Used; /* undocumented padding, must be present for at least PNG */
};
return(po);
}
/**
\brief Create and set a U_PMF_BITMAPDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Ps (optional) U_PSEUDO_OBJ containing a U_PMF_PALETTE structure
\param cbBm Bytes in Bm
\param Bm An array of bytes, meaning depends on fields in U_PMF_BITMAP object and the PixelFormat enumeration.
EMF+ manual 2.2.2.3, Microsoft name: EmfPlusBitmapData Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_BLENDCOLORS PseudoObject
\return Pointer to PseudoObject, NULL on Positions and Colors
\param Elements number of elements in Positions, must agree with the number of Colors.
\param Positions positions along gradient line. The first position MUST be 0.0 and the last MUST be 1.0.
\param Colors U_PSEUDO_OBJ containing an array of U_PMF_ARGB objects: object colors at positions on gradient line
EMF+ manual 2.2.2.4, Microsoft name: EmfPlusBlendColors Object
*/
U_PSEUDO_OBJ *U_PMF_BLENDCOLORS_set(uint32_t Elements, const U_FLOAT *Positions, const U_PSEUDO_OBJ *Colors){
};
return(po);
}
/**
\brief Create and set a U_PMF_BLENDCOLORS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Elements members in osition, inluding Start and End (0.0 - 1.0)
\param StartColor Start Color (U_PMF_ARGB)
\param EndColor End Color (U_PMF_ARGB)
EMF+ manual 2.2.2.5, Microsoft name: EmfPlusBlendFactors Object
Positions always start at 0.0 and always end at 1.0. It is not well documented but other
start and end values generally do not work.
*/
U_PSEUDO_OBJ *U_PMF_BLENDCOLORS_linear_set(uint32_t Elements, U_PMF_ARGB StartColor, U_PMF_ARGB EndColor){
unsigned int i;
if(!Colors){
return(NULL);
}
P = StartPos;
B = StartColor.Blue;
G = StartColor.Green;
R = StartColor.Red;
A = StartColor.Alpha;
for(i=0;i<Elements;i++,pC++,pP++){ /* hopefully the rounding errors are not a problem, used doubles to minimize that */
*pP = P;
P += dP;
*pC = (U_PMF_ARGB){B,G,R,A};
B += dB;
G += dG;
R += dR;
A += dA;
}
return(po);
}
/**
\brief Create and set a U_PMF_BLENDFACTORS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Elements members in each array
\param Positions positions along gradient line. The first position MUST be 0.0 and the last MUST be 1.0.
\param Factors blending factors, 0.0->1.0 values, inclusive
EMF+ manual 2.2.2.5, Microsoft name: EmfPlusBlendFactors Object
*/
U_PSEUDO_OBJ *U_PMF_BLENDFACTORS_set(uint32_t Elements, const U_FLOAT *Positions, const U_FLOAT *Factors){
};
return(po);
}
/**
\brief Create and set a U_PMF_BLENDFACTORS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Elements members in osition, inluding Start and End (0.0 - 1.0)
\param StartFactor Start Factor (0.0 - 1.0)
\param EndFactor End Factor (0.0 - 1.0)
EMF+ manual 2.2.2.5, Microsoft name: EmfPlusBlendFactors Object
Positions always start at 0.0 and always end at 1.0. It is not well documented but other
start and end values generally do not work.
*/
U_PSEUDO_OBJ *U_PMF_BLENDFACTORS_linear_set(uint32_t Elements, U_FLOAT StartFactor, U_FLOAT EndFactor){
unsigned int i;
if(!Factors){
return(NULL);
}
P = StartPos;
F = StartFactor;
for(i=0;i<Elements;i++){ /* hopefully the rounding errors are not a problem, used doubles to minimize that */
}
return(po);
}
/**
\brief Create and set a U_PMF_BOUNDARYPATHDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Path U_PSEUDO_OBJ containing U_PMF_PATH object
EMF+ manual 2.2.2.6, Microsoft name: EmfPlusBoundaryPathData Object
*/
/* PO Used is size_t, might be 8 bytes, value in record must be 4 bytes */
};
return(po);
}
/**
\brief Create and set a U_PMF_BOUNDARYPOINTDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Elements members in each array
\param Points array of U_PMF_POINTF
EMF+ manual 2.2.2.7, Microsoft name: EmfPlusBoundaryPointData Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_CHARACTERRANGE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param First First position in range
\param Length Range length
EMF+ manual 2.2.2.8, Microsoft name: EmfPlusCharacterRange Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_COMPOUNDLINEDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Elements Members in Widths
\param Widths Array of U_FLOAT Line or gap widths (0.0 <-> 1.0, fraction of total line width )
EMF+ manual 2.2.2.9, Microsoft name: EmfPlusCompoundLineData Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_COMPRESSEDIMAGE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param cbImage Bytes in Image
\param Image Stored image in one of the supported formats (GIF, PNG, etc.).
EMF+ manual 2.2.2.10, Microsoft name: EmfPlusCompressedImage Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_CUSTOMENDCAPDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Clc U_PSEUDO_OBJ containing a U_PMF_CUSTOMLINECAP object
EMF+ manual 2.2.2.11, Microsoft name: EmfPlusCustomEndCapData Object
*/
/* PO Used is size_t, might be 8 bytes, value in record must be 4 bytes */
};
return(po);
}
/**
\brief Create and set a U_PMF_CUSTOMLINECAPARROWDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Width Arrow cap width (is multiplied by line width before draw)
\param Height Arrow cap length (is multiplied by line width before draw)
\param MiddleInset Pixels between outer edge and filled region
\param FillState If set, fill, otherwise, only border
\param StartCap LineCap enumeration (type of cap)
\param EndCap LineCap enumeration
\param Join LineJoin enumeration
\param MiterLimit Maximum (miter length / line width)
\param WidthScale Scale for U_PMF_CUSTOMLINECAP object
EMF+ manual 2.2.2.12, Microsoft name: EmfPlusCustomLineCapArrowData Object
*/
){
};
return(po);
}
/**
\brief Create and set a U_PMF_CUSTOMLINECAPDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Flags CustomLineCapData flags
\param Cap LineCap enumeration (type of cap)
\param Inset Distance line cap start -> line end
\param StartCap LineCap enumeration
\param EndCap LineCap enumeration
\param Join LineJoin enumeration
\param MiterLimit Maximum (miter length / line width)
\param WidthScale Scale for U_PMF_CUSTOMLINECAP object
\param Clcod U_PSEUDO_OBJ containing a U_PMF_CUSTOMLINECAPOPTIONALDATA object
EMF+ manual 2.2.2.13, Microsoft name: EmfPlusCustomLineCapData Object
*/
const U_PSEUDO_OBJ *Clcod
){
};
return(po);
}
/**
\brief Create and set a U_PMF_CUSTOMLINECAPOPTIONALDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Fill U_PSEUDO_OBJ containing a U_PMF_FILLPATHOBJ object (optional)
\param Line U_PSEUDO_OBJ containing a U_PMF_LINEPATH object (optional)
EMF+ manual 2.2.2.14, Microsoft name: EmfPlusCustomLineCapOptionalData Object
*/
U_PSEUDO_OBJ *U_PMF_CUSTOMLINECAPOPTIONALDATA_set(const U_PSEUDO_OBJ *Fill, const U_PSEUDO_OBJ *Line){
};
return(po);
}
/**
\brief Create and set a U_PMF_CUSTOMSTARTCAPDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Clc U_PSEUDO_OBJ containing a U_PMF_CUSTOMLINECAPDATA object
EMF+ manual 2.2.2.15, Microsoft name: EmfPlusCustomStartCapData Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_DASHEDLINEDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Elements Members in Lengths
\param Lengths Array of U_FLOAT holding lengths of dashes and spaces.
EMF+ manual 2.2.2.16, Microsoft name: EmfPlusDashedLineData Object
*/
};
return(po);
}
/**
\brief Utility function to create and set a U_PMF_DASHEDLINEDATA PseudoObject from one of a predefined set of patterns
\return Pointer to PseudoObject, NULL on error
\param Unit Length of the repeat unit
\param StdPat Members in Lengths
EMF+ manual 2.2.2.16, Microsoft name: EmfPlusDashedLineData Object
*/
uint8_t *p;
int i;
/* Dot = 1, Dash = 2; Long = 3, 0 = terminate pattern */
{
{0,0,0,0,0}, // Solid
{2,0,0,0,0}, // Dash
{2,2,0,0,0}, // DashDash
{2,2,2,0,0}, // DashDashDash
{2,2,2,2,0}, // DashDashDashDash
{1,0,0,0,0}, // Dot
{1,1,0,0,0}, // DotDot
{1,1,1,0,0}, // DotDotDot
{1,1,1,1,0}, // DotDotDotDot
{2,1,0,0,0}, // DashDot
{2,2,1,0,0}, // DashDashDot
{2,2,1,1,0}, // DashDashDotDot
{2,2,2,1,0}, // DashDashDashDot
{2,1,1,0,0}, // DashDotDot
{2,1,1,1,0}, // DashDotDotDot
{2,1,2,1,0}, // DashDotDashDot
{3,0,0,0,0}, // Long
{3,3,0,0,0}, // LongLong
{3,3,3,0,0}, // LongLongLong
{3,3,3,3,0}, // LongLongLongLong
{3,1,0,0,0}, // LongDot
{3,3,1,0,0}, // LongLongDot
{3,3,1,1,0}, // LongLongDotDot
{3,3,3,1,0}, // LongLongLongDot
{3,1,1,0,0}, // LongDotDot
{3,1,1,1,0}, // LongDotDotDot
{3,1,3,1,0} // LongDotLongDot
};
Elements *= 2;
for(i=0; *p; p++){
switch(*p){
case 0: break;
case 1: /* dot */
break;
case 2: /* dash */
break;
case 3: /* long */
break;
}
}
return(po);
}
/**
\brief Utility function to create and set a U_PMF_DASHEDLINEDATA PseudoObject from the bits that are set in a uint32_t
\return Pointer to PseudoObject, NULL on error
\param Unit Length of the repeat unit
\param BitPat uint32_t holding the bit pattern, the lowest order bit MUST be set and the highest order MUST be clear.
Make a line with a dot/dash pattern defined by the bits in the BitPat value. If a bit is set it is drawn,
if clear it is not. Every bit drawn has length Unit/32, and consecutive drawn bits are merged together.
The lowest order bit is the first bit that may be drawn, the highest the last.
Example: if the integer has value 0x13 the pattern produced will be:
0 -> 2*unit/32 drawn
2*unit/32 -> 5*unit/32 not drawn
5*unit/32 -> 6*unit/32 drawn
6*unit/32 -> unit not drawn
EMF+ manual 2.2.2.16, Microsoft name: EmfPlusDashedLineData Object
*/
if(!(0x00000001 & BitPat))return(NULL); /* Pattern must start with a drawn segment, this bit must be set */
if( 0x80000000 & BitPat )return(NULL); /* Pattern must end with an undrawn segment, this bit must be clear */
int i=0;
int k;
int newType=0;
uint32_t j=1;
Lengths[0]=0;
for(k=0; k<32; k++, j=j<<1){
if(j & BitPat){
if(!lastType){
newType=1;
}
}
else {
if(lastType){
newType=1;
}
}
if(newType){
i++;
Lengths[i]=0;
Elements++;
newType = 0;
}
}
Elements = i+1;
return(po);
}
/**
\brief Create and set a U_PMF_FILLPATHOBJ PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Path U_PSEUDO_OBJ containing a U_PMF_PATH object
EMF+ manual 2.2.2.17, Microsoft name: EmfPlusFillPath Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_FOCUSSCALEDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param ScaleX value 0.0 <-> 1.0
\param ScaleY value 0.0 <-> 1.0
EMF+ manual 2.2.2.18, Microsoft name: EmfPlusFocusScaleData Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_GRAPHICSVERSION object (Signature always set to 0xDBC01)
\return Pointer to PseudoObject, NULL on error
\param GrfVersion GraphicsVersion enumeration
EMF+ manual 2.2.2.19, Microsoft name: EmfPlusGraphicsVersion Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_GRAPHICSVERSION object Structure (Signature always set to 0xDBC01)
\return U_PMF_GRAPHICSVERSION
\param GrfVersion GraphicsVersion enumeration
EMF+ manual 2.2.2.19, Microsoft name: EmfPlusGraphicsVersion Object
*/
return(tmp);
}
/**
\brief Create and set a U_PMF_HATCHBRUSHDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Style HatchStyle enumeration
\param Fg U_PSEUDO_OBJ containing a U_ARGB object, Foreground hatch pattern line color
\param Bg U_PSEUDO_OBJ containing a U_ARGB object, Background hatch pattern line color
EMF+ manual 2.2.2.20, Microsoft name: EmfPlusHatchBrushData Object
*/
U_PSEUDO_OBJ *U_PMF_HATCHBRUSHDATA_set(uint32_t Style, const U_PSEUDO_OBJ *Fg, const U_PSEUDO_OBJ *Bg){
};
return(po);
}
/**
\brief Create and set a U_PMF_INTEGER7 PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Value 7 bit signed integer (stored in an integer, range 63 <-> -64, inclusive)
EMF+ manual 2.2.2.21, Microsoft name: EmfPlusInteger7 Object
*/
U_PSEUDO_OBJ *po = U_PO_create((char *)&utmp, 1, 1, U_PMF_INTEGER7_OID); /* simple method is OK, no possibility of Endian issues */
return(po);
}
/**
\brief Create and set a U_PMF_INTEGER15 PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Value 15 bit signed integer (stored in an integer, range 32677 <-> -32678, inclusive)
EMF+ manual 2.2.2.22, Microsoft name: EmfPlusInteger15 Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_LANGUAGEIDENTIFIER value in 4 byte unsigned int, in NATIVE byte order
\return LID value in least significant two bytes and 0 in most significant two bytes.
\param SubLId Example: code for USA
\param PriLId Example: code for English
EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier Object
*/
utmp32 = ((SubLId & U_FF_MASK_SUBLID) << U_FF_SHFT_SUBLID) | ((PriLId & U_FF_MASK_PRILID) << U_FF_SHFT_PRILID);
return(utmp32);
}
/**
\brief Create and set a U_PMF_LANGUAGEIDENTIFIER PseudoObject
\return Pointer to PseudoObject, NULL on error
\param LId Language Identifier as produced by U_PMF_LANGUAGEIDENTIFIEROBJ_set().
EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_LINEARGRADIENTBRUSHDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Lgbd U_PMF_LINEARGRADIENTBRUSHDATA object (constant part)
\param Lgbod U_PSEUDO_OBJ containing a U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA object (variable part of a U_PMF_LINEARGRADIENTBRUSHDATA object)
EMF+ manual 2.2.2.24, Microsoft name: EmfPlusLinearGradientBrushData Object
*/
U_PSEUDO_OBJ *U_PMF_LINEARGRADIENTBRUSHDATA_set(const U_PMF_LINEARGRADIENTBRUSHDATA *Lgbd, const U_PSEUDO_OBJ *Lgbod){
// {NULL, 4, 2, U_LE}, /* zero fill the two Reserved fields, no matter what is passed in */
{(Lgbod->Used ? Lgbod->Data : NULL), Lgbod->Used, 1, U_XE}, /* optional Data can exist and Used can be zero, SERIAL_set would throw an error on that */
};
return(po);
}
/**
\brief Create and set a U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Flags Bits are set that indicate which of the following were included. The caller must clear before passing it in.
\param Tm (optional) U_PSEUDO_OBJ containing a U_PMF_TRANSFORMMATRIX object
\param Bc (optional) U_PSEUDO_OBJ containing a U_PMF_BLENDCOLORS object or NULL
\param BfH (optional) U_PSEUDO_OBJ containing a U_PMF_BLENDFACTORS (H) object or NULL
\param BfV (optional) U_PSEUDO_OBJ containing a U_PMF_BLENDFACTORS (V) object or NULL (WARNING, GDI+ defines this field but does not render it. DO NOT USE.)
EMF+ manual 2.2.2.25, Microsoft name: EmfPlusLinearGradientBrushOptionalData Object
The rectangular gradients repeat in a tiled pattern. Tm can rotate and offset the gradient within each tile.
The gradient wraps when it is offset.
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_LINEPATH PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Path U_PSEUDO_OBJ containing a U_PMF_PATH object
EMF+ manual 2.2.2.26, Microsoft name: EmfPlusLinePath Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_METAFILE object (NOT SUPPORTED!)
\return Null
EMF+ manual 2.2.2.27, Microsoft name: EmfPlusMetafile Object
*/
return(NULL);
}
/**
\brief Create and set a U_PMF_PALETTE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Flags PaletteStyle flags
\param Elements Members in Lengths
\param Pd Array of U_PMF_ARGB holding colors of palettes. (Palette Data)
EMF+ manual 2.2.2.28, Microsoft name: EmfPlusPalette Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_PATHGRADIENTBRUSHDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Flags PaletteStyle flags
\param WrapMode WrapMode enumeration
\param CenterColor U_PMF_ARGB Center color
\param Center Center coordinates
\param Gradient U_PSEUDO_OBJ containing an Array of U_PMF_ARGB holding colors of Gradient
\param Boundary U_PSEUDO_OBJ containing a U_PMF_BOUNDARYPATHDATA or U_PMF_BOUNDARYPOINTDATA object. (Boundary Data)
\param Data variable part of U_PMF_LINEARGRADIENTBRUSHDATA, exact composition depends on Flags
EMF+ manual 2.2.2.29, Microsoft name: EmfPlusPathGradientBrushData Object
*/
U_PSEUDO_OBJ *U_PMF_PATHGRADIENTBRUSHDATA_set(uint32_t Flags, int32_t WrapMode, U_PMF_ARGB CenterColor,
if( (Flags & U_BD_Path) && (!Boundary || (Boundary->Type != U_PMF_BOUNDARYPATHDATA_OID)))return(NULL);
if(!(Flags & U_BD_Path) && (!Boundary || (Boundary->Type != U_PMF_BOUNDARYPOINTDATA_OID)))return(NULL);
if(!(Flags & U_BD_Transform) &&
!(Flags & U_BD_PresetColors) &&
!(Flags & U_BD_BlendFactorsH) &&
!(Flags & U_BD_FocusScales) &&
};
return(po);
}
/**
\brief Create and set a U_PMF_PATHGRADIENTBRUSHOPTIONALDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Flags PaletteStyle flags
\param Tm U_PSEUDO_OBJ containing a U_PMF_TRANSFORMMATRIX. (Transformation matrix)
\param Pd U_PSEUDO_OBJ containing a U_PMF_BLENDCOLORS or U_PMF_BLENDFACTORS object. (Pattern Data)
\param Fsd U_PSEUDO_OBJ containing a U_PMF_FOCUSSSCALEDATA object. (Focus Scale Data)
EMF+ manual 2.2.2.30, Microsoft name: EmfPlusPathGradientBrushOptionalData Object
*/
if( (Flags & U_BD_PresetColors) && ((Flags & U_BD_BlendFactorsH) || !Pd || (Pd->Type != U_PMF_BLENDCOLORS_OID) ))return(NULL);
if( (Flags & U_BD_BlendFactorsH) && ((Flags & U_BD_PresetColors) || !Pd || (Pd->Type != U_PMF_BLENDFACTORS_OID)))return(NULL);
};
return(po);
}
/**
\brief Create and set an ARRAY of U_PMF_PATHPOINTTYPE objects
\return Pointer to PseudoObject, NULL on error
\param Elements Number of entries in Flags and Enumerations
\param Ppt Array of unsigned bytes, lower 4 bits hold the PathPointType flag upper 4 bits hold the PathPointType enumeration.
EMF+ manual 2.2.2.31, Microsoft name: EmfPlusPathPointType Object
*/
};
return(po);
}
/**
\brief Create and set an ARRAY of U_PMF_PATHPOINTTYPE objects, with a preceding Elements count
\return Pointer to PseudoObject, NULL on error
\param Elements Number of elements to add. First is added once and Others Elements-1 times.
\param First Apply to first point, unsigned byte, lower 4 bits hold the PathPointType flag upper 4 bits hold the PathPointType enumeration.
\param Others Apply to all other points, unsigned byte, lower 4 bits hold the PathPointType flag upper 4 bits hold the PathPointType enumeration.
EMF+ manual 2.2.2.31, Microsoft name: EmfPlusPathPointType Object
*/
};
return(po);
}
/**
\brief Create and set an ARRAY of U_PMF_PATHPOINTTYPERLE objects
\return Pointer to PseudoObject containing first the number of elements, then an array of U_PMF_PATHPOINTTYPERLE, NULL on error
\param Elements Number of entries in the arrays
\param Bz Array of unsigned bytes, if not zero, element has Bezier bit set
\param RL Array of unsigned bytes, Run lengths.
\param Ppte Array of unsigned bytes, PathPointType enumerations.
EMF+ manual 2.2.2.32, Microsoft name: EmfPlusPathPointTypeRLE Object
*/
U_PSEUDO_OBJ *U_PMF_PATHPOINTTYPERLE_set(uint32_t Elements, const uint8_t *Bz, const uint8_t *RL, const uint8_t *Ppte){
/* allocate space in the structure but put no data in */
U_PSEUDO_OBJ *po = U_PO_create(NULL, 4 + 2*Elements, 0, U_PMF_PATHPOINTTYPERLE_OID | U_PMF_ARRAY_OID);
if(po){
}
}
end:
return(holdpo);
}
/**
\brief Create and set a U_PMF_PENDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Unit UnitType enumeration
\param Width Width in units set by Unit
\param Pod U_PSEUDO_OBJ containing first the PenData flags then a U_PMF_PENOPTIONALDATA object (the second part
may be an empty if Flags is 0)
EMF+ manual 2.2.2.33, Microsoft name: EmfPlusPenData Object
*/
/* next is the (optional) U_PMF_PENOPTIONALDATA part or a terminator */
};
return(po);
}
/**
\brief Create and set a U_PMF_PENOPTIONALDATA PseudoObject
\return Pointer to PseudoObject, NULL on error. Returned PO contains first the Flags, then the PO proper.
\param Flags Determines which of the values are stored.
\param Tm U_PSEUDO_OBJ containing a U_PMF_TRANSFORMMATRIX object (Transformation matrix)
\param StartCap LineCapType enumeration
\param EndCap LineCapType enumeration
\param Join LineJoinType enumeration
\param MiterLimit Maximum (miter length / line width)
\param Style LineStyle enumeration
\param DLCap DashedLineCapType enumeration
\param DLOffset Distance line start to first dash start
\param DLData U_PSEUDO_OBJ containing a U_PMF_DASHEDLINEDATA object Dash and space widths
\param PenAlignment PenAlignment enumeration
\param CmpndLineData U_PSEUDO_OBJ containing a U_PMF_COMPOUNDLINEDATA object Compount Line (parallel lines drawn instead of one)
\param CSCapData U_PSEUDO_OBJ containing a U_PMF_CUSTOMSTARTCAPDATA object Custom start cap
\param CECapData U_PSEUDO_OBJ containing a U_PMF_CUSTOMENDCAPDATA object Custom end cap
EMF+ manual 2.2.2.34, Microsoft name: EmfPlusPenOptionalData Object
*/
U_PSEUDO_OBJ *U_PMF_PENOPTIONALDATA_set(uint32_t Flags, U_PSEUDO_OBJ *Tm, int32_t StartCap, int32_t EndCap, uint32_t Join,
){
if((Flags & U_PD_CLData) && (!CmpndLineData || (CmpndLineData->Type != U_PMF_COMPOUNDLINEDATA_OID)) )return(NULL);
if((Flags & U_PD_CustomStartCap) && (!CSCapData || (CSCapData->Type != U_PMF_CUSTOMSTARTCAPDATA_OID)))return(NULL);
if((Flags & U_PD_CustomEndCap) && (!CECapData || (CECapData->Type != U_PMF_CUSTOMENDCAPDATA_OID)) )return(NULL);
/* prepend the Flags field to the PseudoObject proper */
{((Flags & U_PD_StartCap ) ? (char *)&StartCap : NULL), ((Flags & U_PD_StartCap ) ? 4 : 0), 1, U_LE},
{((Flags & U_PD_MiterLimit ) ? (char *)&MiterLimit : NULL), ((Flags & U_PD_MiterLimit ) ? 4 : 0), 1, U_LE},
{((Flags & U_PD_LineStyle ) ? (char *)&Style : NULL), ((Flags & U_PD_LineStyle ) ? 4 : 0), 1, U_LE},
{((Flags & U_PD_DLOffset ) ? (char *)&DLOffset : NULL), ((Flags & U_PD_DLOffset ) ? 4 : 0), 1, U_LE},
{((Flags & U_PD_DLData ) ? DLData->Data : NULL), ((Flags & U_PD_DLData ) ? DLData->Used : 0), 1, U_XE},
{((Flags & U_PD_NonCenter ) ? (char *)&PenAlignment : NULL), ((Flags & U_PD_NonCenter ) ? 4 : 0), 1, U_LE},
{((Flags & U_PD_CLData ) ? CmpndLineData->Data : NULL), ((Flags & U_PD_CLData ) ? CmpndLineData->Used : 0), 1, U_XE},
{((Flags & U_PD_CustomStartCap) ? CSCapData->Data : NULL), ((Flags & U_PD_CustomStartCap) ? CSCapData->Used : 0), 1, U_XE},
{((Flags & U_PD_CustomEndCap ) ? CECapData->Data : NULL), ((Flags & U_PD_CustomEndCap ) ? CECapData->Used : 0), 1, U_XE},
};
return(po);
}
/**
\brief Create and set an ARRAY of U_PMF_POINT objects
\return Pointer to PseudoObject, NULL on error
\param Elements Number of pairs of points in Coords
\param Coords Array of X,Y pairs.
EMF+ manual 2.2.2.35, Microsoft name: EmfPlusPoint Object
*/
};
return(po);
}
/**
\brief Create and set an ARRAY of U_PMF_POINTF objects, with a leading Elements value
\return Pointer to PseudoObject, NULL on error
\param Elements Number of pairs of points in Coords
\param Coords Array of X,Y pairs.
EMF+ manual 2.2.2.36, Microsoft name: EmfPlusPointF Object
*/
};
return(po);
}
/**
\brief Create and set an ARRAY of U_PMF_POINTR objects
\return Pointer to PseudoObject, NULL on error
\param Elements Number of pairs of points in Coords
\param Coords Array of X,Y pairs. These are absolute coordinates, they are converted to Relative here.
EMF+ manual 2.2.2.37, Microsoft name: EmfPlusPointR Object
*/
int X,Y;
/* Worst case scenario it is 4 bytes per coord, plus the count */
U_PSEUDO_OBJ *po = U_PO_create(NULL, 4 + 4*Elements, 0, U_PMF_POINTR_OID); /* not exactly an array, so no U_PMF_ARRAY_OID */
/* this is not a very efficient method, too much mucking around with memory */
poi = U_PMF_INTEGER7_set(X);
poi = U_PMF_INTEGER7_set(Y);
}
/* Because the values stored were some unpredictable combination of 1 and 2 bytes, the last byte may not end
on a 4 byte boundary. Make it do so by padding with up to 3 zero bytes. */
int residual;
if(residual){
}
end:
return(holdpo);
}
/**
\brief Create and set a U_PMF_RECT object
\return Pointer to PseudoObject, NULL on error
\param X UL X value
\param Y UL Y value
\param Width Width
\param Height Height
EMF+ manual 2.2.2.38, Microsoft name: EmfPlusRect Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_RECT object
\return Pointer to PseudoObject, NULL on error
\param Rect U_PMF_RECT structures
EMF+ manual 2.2.2.38, Microsoft name: EmfPlusRect Object
*/
};
return(po);
}
/**
\brief Create and set an array of U_PMF_RECT objects in a PseudoObject
\return Pointer to PseudoObject, NULL on error. PseudoObject contains Elements followed by the array of U_PMF_RECT objects.
\param Elements Number of elements in Rects
\param Rects Array of U_PMF_RECT structures
EMF+ manual 2.2.2.38, Microsoft name: EmfPlusRect Object
*/
}
return(po);
}
/**
\brief Create and set a U_PMF_RECTF object in a PseudoObject
\return Pointer to PseudoObject, NULL on error
\param X UL X value
\param Y UL Y value
\param Width Width
\param Height Height
EMF+ manual 2.2.2.39, Microsoft name: EmfPlusRectF Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_RECTF object in a PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Rect U_PMF_RECTF structure
EMF+ manual 2.2.2.39, Microsoft name: EmfPlusRectF Object
*/
};
return(po);
}
/**
\brief Create and set an array of U_PMF_RECTF objects in a PseudoObject
\return Pointer to PseudoObject, NULL on error. PseudoObject contains Elements followed by the array of U_PMF_RECTF objects.
\param Elements Number of elements in Rects
\param Rects Array of U_PMF_RECTF structures
EMF+ manual 2.2.2.39, Microsoft name: EmfPlusRectF Object
*/
}
return(po);
}
/**
\brief Create and set a U_PMF_REGIONNODE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Type RegionNodeDataType Enumeration
\param Rnd (optional) U_PSEUDO_OBJ containing a U_PMF_REGIONNODEPATH, U_PMF_RECTF, or U_PMF_REGIONNODECHILDNODES object (Region Node Data)
EMF+ manual 2.2.2.40, Microsoft name: EmfPlusRegionNode Object
*/
/* make sure that the type of Rnd agrees with Type */
if(Rnd){
if((pType == 0) &&
(
(Type < U_RNDT_And) ||
)
){ return(NULL); }
}
else { /* only U_RNDT_Empty and U_RNDT_Infinite do not have data */
if((Type != U_RNDT_Empty) ||
}
};
return(po);
}
/**
\brief Create and set a U_PMF_REGIONNODECHILDNODES PseudoObject
\return Pointer to PseudoObject containing a U_PMF_REGIONNODECHILDNODES_OID object, NULL on error
\param Left U_PSEUDO_OBJ containing a U_PMF_REGIONNODE object
\param Right U_PSEUDO_OBJ containing a U_PMF_REGIONNODE object
EMF+ manual 2.2.2.41, Microsoft name: EmfPlusRegionNodeChildNodes Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_REGIONNODEPATH PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Path U_PSEUDO_OBJ containing a U_PMF_PATH object
EMF+ manual 2.2.2.42, Microsoft name: EmfPlusRegionNodePath Object
*/
/* PO Used is size_t, might be 8 bytes, value in record must be 4 bytes */
};
return(po);
}
/**
\brief Create and set a U_PMF_SOLIDBRUSHDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Color U_PSEUDO_OBJ containing a U_PMF_ARGB object
EMF+ manual 2.2.2.43, Microsoft name: EmfPlusSolidBrushData Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_STRINGFORMATDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param TabStopCount Entries in TabStop array
\param TabStops (optional) Array of tabstop locations
\param Ranges (optional) U_PSEUDO_OBJ containing an array of U_PMF_CHARACTERRANGE objects
EMF+ manual 2.2.2.44, Microsoft name: EmfPlusStringFormatData Object
*/
U_PSEUDO_OBJ *U_PMF_STRINGFORMATDATA_set(uint32_t TabStopCount, U_FLOAT *TabStops, const U_PSEUDO_OBJ *Ranges){
};
return(po);
}
/**
\brief Create and set a U_PMF_TEXTUREBRUSHDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Flags BrushData flags
\param WrapMode WrapMode enumeration
\param Tbod U_PSEUDO_OBJ containing an U_PMF_TEXTUREBRUSHOPTIONALDATA object
EMF+ manual 2.2.2.45, Microsoft name: EmfPlusTextureBrushData Object
*/
U_PSEUDO_OBJ *U_PMF_TEXTUREBRUSHDATA_set(uint32_t Flags, uint32_t WrapMode, const U_PSEUDO_OBJ *Tbod){
};
return(po);
}
/**
\brief Create and set a U_PMF_TEXTUREBRUSHOPTIONALDATA PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Tm (optional) U_PSEUDO_OBJ containing an U_PMF_TRANSFORMMATRIX object
\param Image (optional) U_PSEUDO_OBJ containing an U_PMF_IMAGE object
EMF+ manual 2.2.2.46, Microsoft name: EmfPlusTextureBrushOptionalData Object
*/
U_PSEUDO_OBJ *U_PMF_TEXTUREBRUSHOPTIONALDATA_set(const U_PSEUDO_OBJ *Tm, const U_PSEUDO_OBJ *Image){
};
return(po);
}
/**
\brief Create and set a U_PMF_TRANSFORMMATRIX PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Tm U_PMF_TRANSFORMMATRIX_ object
EMF+ manual 2.2.2.47, Microsoft name: EmfPlusTransformMatrix Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_BLUR PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Radius Blur radius in pixels
\param ExpandEdge 1: expand bitmap by Radius; 0: bitmap size unchanged
EMF+ manual 2.2.3.1, Microsoft name: BlurEffect Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_BRIGHTNESSCONTRAST PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Brightness -255 to 255, 0 is unchanged, positive increases, negative decreases
\param Contrast -100 to 100, 0 is unchanged, positive increases, negative decreases
EMF+ manual 2.2.3.2, Microsoft name: BrightnessContrastEffect Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_COLORBALANCE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param CyanRed -100 to 100, 0 is unchanged, positive increases Red & decreases Cyan, negative is opposite
\param MagentaGreen -100 to 100, 0 is unchanged, positive increases Green & decreases Magenta, negative is opposite
\param YellowBlue -100 to 100, 0 is unchanged, positive increases Blue & decreases Yellow, negative is opposite
EMF+ manual 2.2.3.3, Microsoft name: ColorBalanceEffect Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_COLORCURVE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Adjust CurveAdjustment enumeration
\param Channel CurveChannel enumeration
\param Intensity adjustment to apply. "Adjust" determines what field this is and range values.
EMF+ manual 2.2.3.4, Microsoft name: ColorCurveEffect Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_COLORLOOKUPTABLE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param BLUT Blue color lookup table
\param GLUT Green color lookup table
\param RLUT Red color lookup table
\param ALUT Alpha color lookup table
EMF+ manual 2.2.3.5, Microsoft name: ColorLookupTableEffect Object.
All tables have 256 entries.
*/
U_PSEUDO_OBJ *U_PMF_IE_COLORLOOKUPTABLE_set(const uint8_t *BLUT, const uint8_t *GLUT, const uint8_t *RLUT, const uint8_t *ALUT){
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_COLORMATRIX PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Matrix 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]
EMF+ manual 2.2.3.6, Microsoft name: ColorMatrixEffect Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_HUESATURATIONLIGHTNESS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Hue -180 to 180, 0 is unchanged
\param Saturation -100 to 100, 0 is unchanged
\param Lightness -100 to 100, 0 is unchanged
EMF+ manual 2.2.3.7, Microsoft name: HueSaturationLightnessEffect Object
*/
U_PSEUDO_OBJ *U_PMF_IE_HUESATURATIONLIGHTNESS_set(int32_t Hue, int32_t Saturation, int32_t Lightness){
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_LEVELS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Highlight 0 to 100, 100 is unchanged
\param Midtone -100 to 0, 0 is unchanged
\param Shadow 0 to 100, 0 is unchanged
EMF+ manual 2.2.3.8, Microsoft name: LevelsEffect Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_REDEYECORRECTION PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Elements Number of members in Rects
\param Rects Array of U_RECTL rectangular area(s) to apply red eye correction
EMF+ manual 2.2.3.9, Microsoft name: RedEyeCorrectionEffect Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_SHARPEN PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Radius Sharpening radius in pixels
\param Sharpen 0 to 100, 0 is unchanged
EMF+ manual 2.2.3.10, Microsoft name: SharpenEffect Object
*/
};
return(po);
}
/**
\brief Create and set a U_PMF_IE_TINT PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Hue -180 to 180, [positive==clockwise] rotation in degrees starting from blue
\param Amount -100 [add black] to 100[add white], 0 is unchanged. Change in hue on specified axis
EMF+ manual 2.2.3.11, Microsoft name: TintEffect Object
*/
};
return(po);
}
//! \cond
/* internal routine, not part of the API.
Returns a PseudoObject containing a U_PMR_CMN_HDR_OID object.
The type is something like U_PMR_OFFSETCLIP (the record type, NOT the U_PMR_OFFSETCLIP_OID PseudoObject Type!).
The U_PMR_RECFLAG bit is added both in the data and in the Type of the PseudoObject.
If that bit is already set no harm, no foul.
*/
uint32_t Size = 12 + UP4(DataSize); /* The header itself is always 12, PMR records must be a multiple of 4 */
Type |= U_PMR_RECFLAG;
{&Flags, 2, 1, U_LE}, /* Microsoft EMF+ manual is BE, but this field in this implementation is LE */
};
return(po);
}
//! \endcond
/**
\brief Create and set a U_PMR_STROKEFILLPATH PseudoObject
\return Pointer to PseudoObject, NULL on error
EMF+ manual mentioned in 2.1.1.1, not otherwise documented, Microsoft name: EmfPlusStrokeFillPath Record, Index 0x37
"This record closes any open figures in a path, strokes the outline of
the path by using the current pen, and fills its interior by using the current brush."
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_OFFSETCLIP PseudoObject
\return Pointer to PseudoObject, NULL on error
\param dX horizontal translation offset to apply to clipping region
\param dY vertical translation offset to apply to clipping region
EMF+ manual 2.3.1.1, Microsoft name: EmfPlusOffsetClip Record, Index 0x35
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_RESETCLIP PseudoObject
\return Pointer to PseudoObject, NULL on error
EMF+ manual 2.3.1.2, Microsoft name: EmfPlusResetClip Record, Index 0x31
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_SETCLIPPATH PseudoObject
\return Pointer to PseudoObject, NULL on error
\param CMenum CombineMode enumeration..
\param PathID U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
EMF+ manual 2.3.1.3, Microsoft name: EmfPlusSetClipPath Record, Index 0x33
*/
int Size=0;
uint16_t utmp16 = ((PathID & U_FF_MASK_OID8) << U_FF_SHFT_OID8) | ((CMenum & U_FF_MASK_CM4) << U_FF_SHFT_CM4);
};
return(po);
}
/**
\brief Create and set a U_PMR_SETCLIPRECT PseudoObject
\return Pointer to PseudoObject, NULL on error
\param CMenum CombineMode enumeration..
\param Rect U_PSEUDO_OBJ containing an U_PMF_RECTF object or an array of U_PMF_RECTF objects (the first is used)
EMF+ manual 2.3.1.4, Microsoft name: EmfPlusSetClipRect Record, Index 0x32
*/
const char *start;
if(Rect){
}
}
else { return(0); }
}
else { return(0); }
};
return(po);
}
/**
\brief Create and set a U_PMR_SETCLIPREGION PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PathID U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
\param CMenum CombineMode enumeration..
EMF+ manual 2.3.1.5, Microsoft name: EmfPlusSetClipRegion Record, Index 0x34
*/
int Size=0;
uint16_t utmp16 = ((PathID & U_FF_MASK_OID8) << U_FF_SHFT_OID8) | ((CMenum & U_FF_MASK_CM4) << U_FF_SHFT_CM4);
};
return(po);
}
/**
\brief Create and set a U_PMR_COMMENT PseudoObject
\return Pointer to PseudoObject, NULL on error
\param cbData Number of bytes in Data, must be a multiple of 4
\param Data Private data, may be anything. Stored in PseudoObject without adjusting byte order.
EMF+ manual 2.3.2.1, Microsoft name: EmfPlusComment Record, Index 0x03
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_ENDOFFILE PseudoObject
\return Pointer to PseudoObject, NULL on error
EMF+ manual 2.3.3.1, Microsoft name: EmfPlusEndOfFile Record, Index 0x02
*/
int Size=0;
};
return(po);
}
/**
\brief Create and set a U_PMR_GETDC PseudoObject
\return Pointer to PseudoObject, NULL on error
EMF+ manual 2.3.3.2, Microsoft name: EmfPlusGetDC Record, Index 0x04
*/
int Size=0;
};
return(po);
}
/**
\brief Create and set a U_PMR_HEADER PseudoObject
\return Pointer to PseudoObject, NULL on error
\param IsDual set = Dual-mode file, clear= EMF+ only file.
\param IsVideo set = video device, clear= printer. Ignore all other bits.
\param Version U_PSEUDO_OBJ containing a U_PMF_GRAPHICSVERSION object
\param LogicalDpiX Horizontal resolution reference device in DPI
\param LogicalDpiY Vertical resolution reference device in DPI
EMF+ manual 2.3.3.3, Microsoft name: EmfPlusHeader Record, Index 0x01
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_CLEAR PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Color U_PSEUDO_OBJ containing a U_PMF_ARGB object.
EMF+ manual 2.3.4.1, Microsoft name: EmfPlusClear Record, Index 0x09
Erase everything preceding, set background ARGB to Color.
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWARC PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param Start Start angle, >=0.0, degrees clockwise from 3:00
\param Sweep Sweep angle, -360<= angle <=360, degrees clockwise from Start
\param Rect U_PSEUDO_OBJ containing a U_PMF_RECT or U_PMF_RECTF object
EMF+ manual 2.3.4.2, Microsoft name: EmfPlusDrawArc Record, Index 0x12
*/
U_PSEUDO_OBJ *U_PMR_DRAWARC_set(uint32_t PenID, U_FLOAT Start, U_FLOAT Sweep, const U_PSEUDO_OBJ *Rect){
int ctype;
else {
else { return(NULL); }
}
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWBEZIERS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param Points U_PSEUDO_OBJ containing first Elements, then a U_PMF_POINT, U_PMF_POINTR or U_PMF_POINTF object
EMF+ manual 2.3.4.3, Microsoft name: EmfPlusDrawBeziers Record, Index 0x19
*/
if(Points){
else { return(NULL); }
}
else { return(NULL); }
uint16_t utmp16 = (ctype ? U_PPF_C : 0) | (RelAbs ? U_PPF_P : 0) |(PenID & U_FF_MASK_OID8) << U_FF_SHFT_OID8;
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWCLOSEDCURVE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param Tension Controls splines, 0 is straight line, >0 is curved
\param Points U_PSEUDO_OBJ containing a U_PMF_POINT, U_PMF_POINTR or U_PMF_POINTF object
EMF+ manual 2.3.4.4, Microsoft name: EmfPlusDrawClosedCurve Record, Index 0x17
Curve is a cardinal spline.
References sent by MS support:
http://msdn.microsoft.com/en-us/library/4cf6we5y(v=vs.110).aspx
*/
U_PSEUDO_OBJ *U_PMR_DRAWCLOSEDCURVE_set(uint32_t PenID, U_FLOAT Tension, const U_PSEUDO_OBJ *Points){
if(Points){
else { return(NULL); }
}
else { return(NULL); }
uint16_t utmp16 = (ctype ? U_PPF_C : 0) | (RelAbs ? U_PPF_P : 0) |(PenID & U_FF_MASK_OID8) << U_FF_SHFT_OID8;
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWCURVE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param Tension Controls splines, 0 is straight line, >0 is curved
\param Offset The starting point in the list of points, 0 is first.
\param NSegs Number of segments to draw. Starting at Offset go NSegs straight lines, must not run out of points..
\param Points U_PSEUDO_OBJ containing an element count then a series of U_PMF_POINT or U_PMF_POINTF object
EMF+ manual 2.3.4.5, Microsoft name: EmfPlusDrawCurve Record, Index 0x18
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
*/
U_PSEUDO_OBJ *U_PMR_DRAWCURVE_set(uint32_t PenID, U_FLOAT Tension, uint32_t Offset, uint32_t NSegs, const U_PSEUDO_OBJ *Points){
int ctype;
else {
else { return(NULL); }
}
uint32_t Elements = (Points->Used - 4)/(ctype ? 4 : 8); /* This way do not need to worry about byte order */
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWDRIVERSTRING PseudoObject
\return Pointer to PseudoObject, NULL on error
\param FontID U_PMF_FONT object in the EMF+ object table (0-63, inclusive)
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
\param DSOFlags DriverStringOptions flags
\param HasMatrix If 1 record contains a TransformMatrix field, if 0 it does not.
\param GlyphCount The number of Elements in Glyphs, must agree with the number of elements in Points.
\param 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.
\param Points U_PSEUDO_OBJ containing a U_PMF_POINTF object
\param Tm U_PSEUDO_OBJ containing a U_PMF_TRANSFORMMATRIX object. Apply to Glyphs & Positions. Present if HasMatrix is 1
EMF+ manual 2.3.4.6, Microsoft name: EmfPlusDrawDriverString Record, Index 0x36
*/
int btype;
if(BrushID){
else { return(NULL); }
}
else { return(NULL); }
if(HasMatrix){
}
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWELLIPSE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param Rect U_PSEUDO_OBJ containing a U_PMF_RECT or U_PMF_RECTF object
EMF+ manual 2.3.4.7, Microsoft name: EmfPlusDrawEllipse Record, Index 0x0F
*/
int ctype;
else {
else { return(NULL); }
}
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWIMAGE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param ImgID U_PMF_IMAGE object in the EMF+ object table (0-63, inclusive)
\param ImgAttrID index of a U_PMF_IMAGEATTRIBUTES object in the object table
\param SrcUnit UnitType enumeration
\param SrcRect U_PSEUDO_OBJ containing a U_PMF_RECTF object, Source region of image
\param DstRect U_PSEUDO_OBJ containing a U_PMF_RECT or U_PMF_RECTF object
EMF+ manual 2.3.4.8, Microsoft name: EmfPlusDrawImage Record, Index 0x1A
*/
int ctype;
else {
else { return(NULL); }
}
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWIMAGEPOINTS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param ImgID U_PMF_IMAGE object in the EMF+ object table (0-63, inclusive)
\param etype Set: effect from previous U_PMR_SERIALIZABLEOBJECT record will be applied; Clear: no effect applied
\param ImgAttrID index of a U_PMF_IMAGEATTRIBUTES object in the object table
\param SrcUnit UnitType enumeration
\param SrcRect U_PSEUDO_OBJ containing a U_PMF_RECTF object, Source region of image
\param Points U_PSEUDO_OBJ containing an array of 3 (U_PMF_POINT, U_PMF_POINTF, or U_PMF_POINTF) objects. These points are the UL, UR, and LL vertices of a parallelogram.
EMF+ manual 2.3.4.9, Microsoft name: EmfPlusDrawImagePoints Record, Index 0x1B
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.
*/
const U_PSEUDO_OBJ *Points){
if(Points){
else { return(NULL); }
}
else { return(NULL); }
uint16_t utmp16 = (ctype ? U_PPF_C : 0) | (etype ? U_PPF_E : 0) | (RelAbs ? U_PPF_P : 0) | (ImgID & U_FF_MASK_OID8) << U_FF_SHFT_OID8;
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWLINES PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param dtype Set: path must be closed, Clear: path is open
\param Points U_PSEUDO_OBJ containing an array of 3 U_PMF_POINT, U_PMF_POINTR, or U_PMF_POINTF objects
EMF+ manual 2.3.4.10, Microsoft name: EmfPlusDrawLines Record, Index 0x0D
*/
if(Points){
else { return(NULL); }
}
else { return(NULL); }
uint16_t utmp16 = (ctype ? U_PPF_C : 0) | (dtype ? U_PPF_D : 0) | (RelAbs ? U_PPF_P : 0) | (PenID & U_FF_MASK_OID8) << U_FF_SHFT_OID8;
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWPATH PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PathID U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
EMF+ manual 2.3.4.11, Microsoft name: EmfPlusDrawPath Record, Index 0x15
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWPIE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param Start Start angle, >=0.0, degrees clockwise from 3:00
\param Sweep Sweep angle, -360<= angle <=360, degrees clockwise from Start
\param Rect U_PSEUDO_OBJ containing a U_PMF_RECT or U_PMF_RECTF object
EMF+ manual 2.3.4.12, Microsoft name: EmfPlusDrawPie Record, Index 0x0D
*/
int ctype;
else {
else { return(NULL); }
}
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWRECTS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param Rects U_PSEUDO_OBJ containing 1 rect OR a count N follwed by N rects. Rects may be either U_PMF_RECT or U_PMF_RECTF
EMF+ manual 2.3.4.13, Microsoft name: EmfPlusDrawRects Record, Index 0x0B
*/
int ctype;
int just1;
uint32_t Elements=1; /* only used when a single rect is passed in, not an array, not even an array with one member*/
if(Rects){
else { return(NULL); }
}
else { return(NULL); }
{(just1 ? (char *)&Elements : NULL), (just1 ? 4: 0), 1, U_LE}, /* element count if a single Rect was passed in, empty otherwise */
{Rects->Data, Rects->Used, 1, U_XE}, /* Elements + Array, already stored in Rects, if an array was passed in, just rect if a single */
};
return(po);
}
/**
\brief Create and set a U_PMR_DRAWSTRING PseudoObject
\return Pointer to PseudoObject, NULL on error
\param FontID U_PMF_FONT object in the EMF+ object table (0-63, inclusive)
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
\param FormatID U_PMF_STRINGFORMAT object in EMF+ Object Table.
\param Length Number of characters in the string.
\param Rect U_PSEUDO_OBJ containing a U_PMF_RECTF object, string's bounding box
\param Text Array of UFT-16LE unicode characters.
EMF+ manual 2.3.4.14, Microsoft name: EmfPlusDrawString Record, Index 0x1C
*/
int btype;
if(BrushID){
else { return(NULL); }
}
else { return(NULL); }
};
return(po);
}
/**
\brief Create and set a U_PMR_FILLCLOSEDCURVE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param ftype If U_WINDING use winding fill, else use fill
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
\param Tension Controls splines, 0 is straight line, >0 is curved
\param Points U_PSEUDO_OBJ containing a U_PMF_POINT, U_PMF_POINTR or U_PMF_POINTF object
EMF+ manual 2.3.4.15, Microsoft name: EmfPlusFillClosedCurve Record, Index 0x16
*/
U_PSEUDO_OBJ *U_PMR_FILLCLOSEDCURVE_set(int ftype, U_FLOAT Tension, const U_PSEUDO_OBJ *BrushID, const U_PSEUDO_OBJ *Points){
int Size=0;
if(BrushID){
else { return(NULL); }
}
else { return(NULL); }
if(Points){
else { return(NULL); }
}
else { return(NULL); }
uint16_t utmp16 = (btype ? U_PPF_B : 0) | (ctype ? U_PPF_C : 0) |((ftype == U_WINDING) ? U_PPF_F : 0) |(RelAbs ? U_PPF_P : 0);
};
return(po);
}
/**
\brief Create and set a U_PMR_FILLELLIPSE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
\param Rect U_PSEUDO_OBJ containing a U_PMF_RECT or U_PMF_RECTF object
EMF+ manual 2.3.4.16, Microsoft name: EmfPlusFillEllipse Record, Index 0x0E
*/
if(BrushID){
else { return(NULL); }
}
else { return(NULL); }
if(Rect){
else { return(NULL); }
}
else { return(NULL); }
};
return(po);
}
/**
\brief Create and set a U_PMR_FILLPATH PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PathID U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
EMF+ manual 2.3.4.17, Microsoft name: EmfPlusFillPath Record, Index 0x14
*/
int btype;
int Size=0;
if(BrushID){
else { return(NULL); }
}
else { return(NULL); }
};
return(po);
}
/**
\brief Create and set a U_PMR_FILLPIE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Start Start angle, >=0.0, degrees clockwise from 3:00
\param Sweep Sweep angle, -360<= angle <=360, degrees clockwise from Start
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
\param Rect U_PSEUDO_OBJ containing a U_PMF_RECT or U_PMF_RECTF object
EMF+ manual 2.3.4.18, Microsoft name: EmfPlusFillPie Record, Index 0x10
*/
U_PSEUDO_OBJ *U_PMR_FILLPIE_set(U_FLOAT Start, U_FLOAT Sweep, const U_PSEUDO_OBJ *BrushID, const U_PSEUDO_OBJ *Rect){
if(BrushID){
else { return(NULL); }
}
else { return(NULL); }
else {
else { return(NULL); }
}
};
return(po);
}
/**
\brief Create and set a U_PMR_FILLPOLYGON PseudoObject
\return Pointer to PseudoObject, NULL on error
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
\param Points U_PSEUDO_OBJ containing an array of 3 U_PMF_POINT, U_PMF_POINTR, or U_PMF_POINTF objects
EMF+ manual 2.3.4.19, Microsoft name: EmfPlusFillPolygon Record, Index 0x0C
*/
if(BrushID){
else { return(NULL); }
}
else { return(NULL); }
if(Points){
else { return(NULL); }
}
else { return(NULL); }
};
return(po);
}
/**
\brief Create and set a U_PMR_FILLRECTS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
\param Rects U_PSEUDO_OBJ containing 1 rect OR a count N followed by N rects. Rects may be either U_PMF_RECT or U_PMF_RECTF
EMF+ manual 2.3.4.20, Microsoft name: EmfPlusFillRects Record, Index 0x0A
*/
int just1;
uint32_t Elements=1; /* only used when a single rect is passed in, not an array, not even an array with one member*/
if(BrushID){
else { return(NULL); }
}
else { return(NULL); }
if(Rects){
else { return(NULL); }
}
else { return(NULL); }
int Size = BrushID->Used + Rects->Used + (just1 ? 4 : 0); /* Elements in Rects for array, not for single */
{(just1 ? (char *)&Elements : NULL), (just1 ? 4: 0), 1, U_LE}, /* element count if a single Rect was passed in, empty otherwise */
{Rects->Data, Rects->Used, 1, U_XE}, /* Elements + Array, already stored in Rects, if an array was passed in, just rect if a single */
};
return(po);
}
/**
\brief Create and set a U_PMR_FILLREGION PseudoObject
\return Pointer to PseudoObject, NULL on error
\param RgnID U_PMF_REGION object in the EMF+ object table (0-63, inclusive)
\param BrushID U_PSEUDO_OBJ containing a U_PMF_ARGB or a U_PMF_4NUM. Color or U_PMF_BRUSH object in the EMF+ object table (0-63, inclusive)
EMF+ manual 2.3.4.21, Microsoft name: EmfPlusFillRegion Record, Index 0x13
*/
int btype;
if(BrushID){
else { return(NULL); }
}
else { return(NULL); }
};
return(po);
}
/**
\brief Create and set a U_PMR_OBJECT PseudoObject from another PseudoObject
\return Pointer to PseudoObject, NULL on error
\param ObjID Index for this object in the EMF+ object table (0-63, inclusive)
\param Po U_PSEUDO_OBJ containing an object type that may be stored in the EMF+ object table
*/
U_PSEUDO_OBJ *po = U_PMR_OBJECT_set(ObjID, otype, 0, 0, Po->Used, Po->Data); /* 0,0 = rec. not continued, TSize value (ignored) */
return(po);
}
/**
\brief Create and set a U_PMR_OBJECT PseudoObject
\return Pointer to PseudoObject, NULL on error
\param ObjID Index for this object in the EMF+ object table (0-63, inclusive)
\param otype ObjectType enumeration for this Object
\param ntype Set: object definition continues in next record; Clear: this is the sole object definition record
\param TSize If ntype is set the total number of data bytes split across multiple records. If ntype is clear, it is ignored.
\param cbData Object's data size, in bytes.
\param Data Object's data. Type from otype.
EMF+ manual 2.3.5.1, Microsoft name: EmfPlusObject Record, Index 0x13
Normally this is only called by U_PMR_OBJECT_PO_set().
U_PMR_OBJECT records can only hold a maximum of 65020 bytes of data. If the object is larger than that
then multiple U_PMR_OBJECT records are created, one after the other. If this
happens each record has cbData following ph, and the ntype flag is set. If all of the data is less than 65020
then cbData is NOT entered following ph, and the ntype flag is clear.
Call initially in all cases with ntype clear and TSize = 0. If the record needs to be fragmented
the function will call itself recursively to do so.
*/
U_PSEUDO_OBJ *U_PMR_OBJECT_set(uint32_t ObjID, int otype, int ntype, uint32_t TSize, size_t cbData, const char *Data){
ntype = 1;
if(po){
while(cbData){
if(!pot)break;
if(!newpo)break;
Data += U_OBJRECLIM;
}
if(cbData){ /* some error */
}
}
}
else {
/* Send in DataSize, U_PMR_CMN_HDR_set will adjust Header Size with 1-3 pad bytes if needed */
{NULL, (Pad ? Pad : 0), (Pad ? 1 : 0), (Pad ? U_XE : U_XX)}, /* Either 1-3 pad bytes or a terminator */
};
}
return(po);
}
/**
\brief Create and set a U_PMR_SERIALIZABLEOBJECT PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Siepb U_PSEUDO_OBJ containing a "Serialized image effects parameter block". One of the ImageEffects objects.
EMF+ manual 2.3.5.2, Microsoft name: EmfPlusSerializableObject Record, Index 0x38
This sets an ImageEffect in the renderer, which will be applied to the next EmfPlusDrawImagePoints
record that is encountered. The image effect is "consumed" by that EmfPlusDrawImagePoints record, resetting
the renderer to its original state.\n
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.
*/
/* PO Used is size_t, might be 8 bytes, value in record must be 4 bytes */
};
return(po);
}
/**
\brief Create and set a U_PMR_SETANTIALIASMODE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param SMenum SmoothingMode enumeration
\param aatype Set: anti-aliasing on; Clear: anti-aliasing off
EMF+ manual 2.3.6.1, Microsoft name: EmfPlusSetAntiAliasMode Record, Index 0x1E
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_SETCOMPOSITINGMODE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param CMenum CompositingMode enumeration
EMF+ manual 2.3.6.2, Microsoft name: EmfPlusSetCompositingMode Record, Index 0x23
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_SETCOMPOSITINGQUALITY PseudoObject
\return Pointer to PseudoObject, NULL on error
\param CQenum CompositingQuality enumeration
EMF+ manual 2.3.6.3, Microsoft name: EmfPlusSetCompositingQuality Record, Index 0x24
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_SETINTERPOLATIONMODE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param IMenum InterpolationMode enumeration
EMF+ manual 2.3.6.4, Microsoft name: EmfPlusSetInterpolationMode Record, Index 0x21
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_SETPIXELOFFSETMODE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param POMenum PixelOffsetMode enumeration
EMF+ manual 2.3.6.5, Microsoft name: EmfPlusSetPixelOffsetMode Record, Index 0x22
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_SETRENDERINGORIGIN PseudoObject
\return Pointer to PseudoObject, NULL on error
\param X X coordinate of rendering origin.
\param Y Y coordinate of rendering origin.
EMF+ manual 2.3.6.6, Microsoft name: EmfPlusSetRenderingOrigin Record, Index 0x1D
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_SETTEXTCONTRAST PseudoObject
\return Pointer to PseudoObject, NULL on error
\param TGC Text Gamma correction value (x 1000).
EMF+ manual 2.3.6.7, Microsoft name: EmfPlusSetTextContrast Record, Index 0x20
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_SETTEXTRENDERINGHINT PseudoObject
\return Pointer to PseudoObject, NULL on error
\param TRHenum TextRenderingHint enumeration
EMF+ manual 2.3.6.8, Microsoft name: EmfPlusSetTextRenderingHint Record, Index 0x1F
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_BEGINCONTAINER PseudoObject
\return Pointer to PseudoObject, NULL on error
\param UTenum UnitType enumeration
\param DstRect a U_PSEUDO_OBJ containing a U_PMF_RECTF object. with SrcRect specifies a transformation
\param SrcRect a U_PSEUDO_OBJ containing a U_PMF_RECTF object. with DstRect specifies a transformation
\param StackID EMF+ Object Stack Index to use for this graphics container
EMF+ manual 2.3.7.1, Microsoft name: EmfPlusBeginContainer Record, Index 0x27
*/
U_PSEUDO_OBJ *U_PMR_BEGINCONTAINER_set(int UTenum, U_PSEUDO_OBJ *DstRect, U_PSEUDO_OBJ *SrcRect, uint32_t StackID){
};
return(po);
}
/**
\brief Create and set a U_PMR_BEGINCONTAINERNOPARAMS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param StackID EMF+ Object Stack Index to use for this graphics container
EMF+ manual 2.3.7.2, Microsoft name: EmfPlusBeginContainerNoParams Record, Index 0x28
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_ENDCONTAINER PseudoObject
\return Pointer to PseudoObject, NULL on error
\param StackID EMF+ Object Stack Index to use for this graphics container
EMF+ manual 2.3.7.3, Microsoft name: EmfPlusEndContainer Record, Index 0x29
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_RESTORE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param StackID EMF+ Graphics State Stack to restore from. Must have been put on the GSS with a U_PMR_SAVE.
EMF+ manual 2.3.7.4, Microsoft name: EmfPlusRestore Record, Index 0x26
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_SAVE PseudoObject
\return Pointer to PseudoObject, NULL on error
\param StackID EMF+ Graphics State Stack to restore from. Must have been put on the GSS with a U_PMR_SAVE.
EMF+ manual 2.3.7.5, Microsoft name: EmfPlusSave Record, Index 0x25
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_SETTSCLIP PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Rects a U_PSEUDO_OBJ containing an array of U_PMF_RECT or U_PMF_RECTF objects.
EMF+ manual 2.3.8.1, Microsoft name: EmfPlusSetTSClip Record, Index 0x3A
*/
int ctype;
if(Rects){
if( Rects->Type == (U_PMF_RECT_OID | U_PMF_ARRAY_OID)){ ctype = 1; Elements = (Rects->Used - 4)/8; }
else if(Rects->Type == (U_PMF_RECTF_OID | U_PMF_ARRAY_OID)){ ctype = 0; Elements = (Rects->Used - 4)/16; }
else { return(NULL); }
}
else { return(NULL); }
};
return(po);
}
/**
\brief Create and set a U_PMR_SETTSGRAPHICS PseudoObject
\return Pointer to PseudoObject, NULL on error
\param vgatype Set: Palette is VGA basic colors; Clear: Palette is ???
\param Tsg A U_PMF_SETTSGRAPHICS object
\param Palette (optional) a U_PSEUDO_OBJ containing a U_PMF_PALETTE object.
EMF+ manual 2.3.8.2, Microsoft name: EmfPlusSetTSGraphics Record, Index 0x39
*/
U_PSEUDO_OBJ *U_PMR_SETTSGRAPHICS_set(int vgatype, U_PMF_SETTSGRAPHICS *Tsg, U_PSEUDO_OBJ *Palette){
};
return(po);
}
/**
\brief Create and set a U_PMR_MULTIPLYWORLDTRANSFORM PseudoObject
\return Pointer to PseudoObject, NULL on error
\param xmtype Set: Post multiply; Clear: Pre multiply
\param Tm a U_PSEUDO_OBJ containing a U_PMF_TRANSFORMMATRIX. (Transformation matrix)
EMF+ manual 2.3.9.1, Microsoft name: EmfPlusMultiplyWorldTransform Record, Index 0x2C
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_RESETWORLDTRANSFORM PseudoObject
\return Pointer to PseudoObject, NULL on error
EMF+ manual 2.3.9.2, Microsoft name: EmfPlusResetWorldTransform Record, Index 0x2B
*/
int Size = 0;
};
return(po);
}
/**
\brief Create and set a U_PMR_ROTATEWORLDTRANSFORM PseudoObject
\return Pointer to PseudoObject, NULL on error
\param xmtype Set: Post multiply; Clear: Pre multiply
\param Angle Rotation angle, in degrees
EMF+ manual 2.3.9.3, Microsoft name: EmfPlusRotateWorldTransform Record, Index 0x2F
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_SCALEWORLDTRANSFORM PseudoObject
\return Pointer to PseudoObject, NULL on error
\param xmtype Set: Post multiply; Clear: Pre multiply
\param X Scale in X
\param Y Scale in Y
EMF+ manual 2.3.9.4, Microsoft name: EmfPlusScaleWorldTransform Record, Index 0x2E
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_SETPAGETRANSFORM PseudoObject
\return Pointer to PseudoObject, NULL on error
\param PUenum Page Unit, in UnitType enumeration
\param Scale Scale factor to convert page space to device space
EMF+ manual 2.3.9.5, Microsoft name: EmfPlusSetPageTransform Record, Index 0x30
Defines Page Space -> Device Space transformation
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_SETWORLDTRANSFORM PseudoObject
\return Pointer to PseudoObject, NULL on error
\param Tm a U_PSEUDO_OBJ containing a U_PMF_TRANSFORMMATRIX. (Transformation matrix)
EMF+ manual 2.3.9.6, Microsoft name: EmfPlusSetWorldTransform Record, Index 0x2A
Defines World Space -> Page Space transformation
*/
};
return(po);
}
/**
\brief Create and set a U_PMR_TRANSLATEWORLDTRANSFORM PseudoObject
\return Pointer to PseudoObject, NULL on error
\param xmtype Set: Post multiply; Clear: Pre multiply
\param Dx X offset
\param Dy Y offset
EMF+ manual 2.3.9.7, Microsoft name: EmfPlusTranslateWorldTransform Record, Index 0x2D
*/
};
return(po);
}
/*
end of U_PMF_*_set() functions
=====================================================================================
start of U_PMF_*_get() functions
These functions all take a blimit value so that they can check if the data description in the fields
they process extend beyond the end of the record.
*/
//! \cond
/* core _get functions, not accessed outside of this routine */
/* get copies of up to 0-6 consecutive 4 byte values and a pointer to the rest */
int U_PMF_CORE1_get(const char *contents, void *v1, void *v2, void *v3, void *v4, void *v5, void *v6, const char **vR){
return(1);
}
//! \endcond
/**
\brief Get data from a U_PMF_BRUSH object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Version EmfPlusGraphicsVersion object
\param Type BrushType Enumeration
\param Data one of the 5 types of Brush data
\param blimit one byte past the end of data
EMF+ manual 2.2.1.1, Microsoft name: EmfPlusBrush Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_BRUSH_get(const char *contents, uint32_t *Version, uint32_t *Type, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_CUSTOMLINECAP object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Version EmfPlusGraphicsVersion object
\param Type CustomLineCapData Enumeration
\param Data one of the 2 types of Linecap data
\param blimit one byte past the end of data
EMF+ manual 2.2.1.2, Microsoft name: EmfPlusCustomLineCap Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_CUSTOMLINECAP_get(const char *contents, uint32_t *Version, uint32_t *Type, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_FONT object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Version EmfPlusGraphicsVersion object
\param EmSize em size in units of SizeUnit
\param SizeUnit UnitType enumeration
\param FSFlags FontStyle flags
\param Length Number of Unicode Characters in FamilyName
\param Data Unicode (UTF-16LE) name of font family
EMF+ manual 2.2.1.3, Microsoft name: EmfPlusFont Object
Caller must check Data for possible memory access violations.
*/
if(!contents || !Version || !EmSize || !SizeUnit || !FSFlags || !Length || !Data || !blimit){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMF_IMAGE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Version EmfPlusGraphicsVersion object
\param Type ImageDataType Enumeration
\param Data one of the 2 types of image data
EMF+ manual 2.2.1.4, Microsoft name: EmfPlusImage Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_IMAGE_get(const char *contents, uint32_t *Version, uint32_t *Type, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IMAGEATTRIBUTES object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Version EmfPlusGraphicsVersion object
\param WrapMode WrapMode object
\param ClampColor EmfPlusARGB object
\param ObjectClamp ObjectClamp Identifiers
EMF+ manual 2.2.1.5, Microsoft name: EmfPlusImageAttributes Object
*/
int U_PMF_IMAGEATTRIBUTES_get(const char *contents, uint32_t *Version, uint32_t *WrapMode, uint32_t *ClampColor,
/* Skip Reserved 2*/
return(1);
}
/**
\brief Get data from a U_PMF_PATH object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Version EmfPlusGraphicsVersion object
\param Count Number of points and point types in this object
\param Flags PathPoint Flags
\param Points array of points type PMFPointR, PMFPoint, or PMFPointF
EMF+ manual 2.2.1.6, Microsoft name: EmfPlusPath Object
Caller must check Types for possible memory access violations if type can be U_PMF_PATHPOINTTYPERLE.
*/
}
/* this limit is correct if there are only U_PMF_PATHPOINTTYPE PointTypes, it is a lower bound if
there can also be U_PMF_PATHPOINTTYPERLE */
return(1);
}
/**
\brief Get data from a U_PMF_PEN object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Version EmfPlusGraphicsVersion object
\param Type must be zero
\param PenData Pen description
\param Brush Brush Description
EMF+ manual 2.2.1.7, Microsoft name: EmfPlusPen Object
Caller must check Brush and PenData for possible memory access violations.
*/
int U_PMF_PEN_get(const char *contents, uint32_t *Version, uint32_t *Type, const char **PenData, const char **Brush, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_REGION object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Version EmfPlusGraphicsVersion object
\param Count Number of CHILD nodes. This is one less than the total number of U_PMF_REGIONNODE objects in Nodes.
\param Nodes Nodes defining region
EMF+ manual 2.2.1.8, Microsoft name: EmfPlusRegion Object
*/
int U_PMF_REGION_get(const char *contents, uint32_t *Version, uint32_t *Count, const char **Nodes, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_STRINGFORMAT object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Sfs pointer to U_PMF_STRINGFORMAT structure, with no variable part
\param Data pointer to variable part
EMF+ manual 2.2.1.9, Microsoft name: EmfPlusStringFormat Object
*/
int U_PMF_STRINGFORMAT_get(const char *contents, U_PMF_STRINGFORMAT *Sfs, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_ARGB object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Blue Blue color (0-255)
\param Green Green color (0-255)
\param Red Red color (0-255)
\param Alpha Alpha (0-255)
EMF+ manual 2.2.2.1, Microsoft name: EmfPlusARGB Object
*/
int U_PMF_ARGB_get(const char *contents, uint8_t *Blue, uint8_t *Green, uint8_t *Red, uint8_t *Alpha, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_BITMAP object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Bs pointer to U_PMF_BITMAP structure, with no variable part
\param Data pointer to variable part
EMF+ manual 2.2.2.2, Microsoft name: EmfPlusBitmap Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_BITMAP_get(const char *contents, U_PMF_BITMAP *Bs, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_BITMAPDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Ps pointer to U_PMF_PALETTE structure, with no variable part
\param Colors Color part of U_PMF_PALETTE object
\param Data An array of bytes, meaning depends on fields in U_PMF_BITMAP object and the PixelFormat enumeration.
EMF+ manual 2.2.2.3, Microsoft name: EmfPlusBitmapData Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_BITMAPDATA_get(const char *contents, U_PMF_PALETTE *Ps, const char **Colors, const char **Data, const char *blimit){
/* this structure is entirely optional */
/* difficult to know how big the actual bitmap will be, just return the pointer to it untested */
return(1);
}
/**
\brief Get data from a U_PMF_BLENDCOLORS object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Elements Number of members in Positions and Colors
\param Positions Caller must free. Pointer to memory holding positions along gradient line.
\param Colors Caller must NOT free memory, Pointer to memory holding colors at positions on gradient line.
EMF+ manual 2.2.2.4, Microsoft name: EmfPlusBlendColors Object
*/
int U_PMF_BLENDCOLORS_get(const char *contents, uint32_t *Elements, U_FLOAT **Positions, const char **Colors, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_BLENDFACTORS object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Elements members in each array
\param Positions Caller must free. Pointer to memory holding positions along gradient line.
\param Factors Caller must free. Pointer to memory holding blending factors, 0.0->1.0 values, inclusive along gradient line.
EMF+ manual 2.2.2.5, Microsoft name: EmfPlusBlendFactors Object
*/
int U_PMF_BLENDFACTORS_get(const char *contents, uint32_t *Elements, U_FLOAT **Positions, U_FLOAT **Factors, const char *blimit){
if(!U_PMF_SERIAL_array_copy_get(&contents, (void **)Positions, 4, *Elements, U_LE, 1)){ return(0); }
return(0);
}
return(1);
}
/**
\brief Get data from a U_PMF_BOUNDARYPATHDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Size bytes in Data
\param Data boundary of the brush
EMF+ manual 2.2.2.6, Microsoft name: EmfPlusBoundaryPathData Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_BOUNDARYPATHDATA_get(const char *contents, int32_t *Size, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_BOUNDARYPOINTDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Elements Members in Points
\param Points Caller must free. Pointer to memory holding points along gradient line. Boundary of the brush.
EMF+ manual 2.2.2.7, Microsoft name: EmfPlusBoundaryPointData Object
*/
int U_PMF_BOUNDARYPOINTDATA_get(const char *contents, int32_t *Elements, U_PMF_POINTF **Points, const char *blimit){
if(!U_PMF_SERIAL_array_copy_get(&contents, (void **)Points, 4, *Elements * 2, U_LE, 1)){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMF_CHARACTERRANGE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param First First position in range
\param Length Range length
EMF+ manual 2.2.2.8, Microsoft name: EmfPlusCharacterRange Object
*/
int U_PMF_CHARACTERRANGE_get(const char *contents, int32_t *First, int32_t *Length, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_COMPOUNDLINEDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Elements Members in the array
\param Widths Caller must free. Pointer to memory holding Line or gap widths (0.0 <-> 1.0, fraction of total line width ).
EMF+ manual 2.2.2.9, Microsoft name: EmfPlusCompoundLineData Object
*/
int U_PMF_COMPOUNDLINEDATA_get(const char *contents, int32_t *Elements, U_FLOAT **Widths, const char *blimit){
if(!*Widths){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMF_COMPRESSEDIMAGE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Data Stored image in one of the supported formats.
EMF+ manual 2.2.2.10, Microsoft name: EmfPlusCompressedImage Object
This function does not do anything useful, but it is included so that all objects have a corresponding _get().
Caller must check Data for possible memory access violations.
*/
return(1);
}
/**
\brief Get data from a U_PMF_CUSTOMENDCAPDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Size Bytes in Data
\param Data Description of linecap
EMF+ manual 2.2.2.11, Microsoft name: EmfPlusCustomEndCapData Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_CUSTOMENDCAPDATA_get(const char *contents, int32_t *Size, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_CUSTOMLINECAPARROWDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Ccad pointer to U_PMF_CUSTOMLINECAPARROWDATA structure
EMF+ manual 2.2.2.12, Microsoft name: EmfPlusCustomLineCapArrowData Object
*/
int U_PMF_CUSTOMLINECAPARROWDATA_get(const char *contents, U_PMF_CUSTOMLINECAPARROWDATA *Ccad, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_CUSTOMLINECAPDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Clcd pointer to U_PMF_CUSTOMLINECAPDATA structure, with no variable part
\param Data variable part of U_PMF_CUSTOMLINECAPDATA
EMF+ manual 2.2.2.13, Microsoft name: EmfPlusCustomLineCapData Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_CUSTOMLINECAPDATA_get(const char *contents, U_PMF_CUSTOMLINECAPDATA *Clcd, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_CUSTOMLINECAPOPTIONALDATA object
\return on success 3,5, or 7 (for varying combinations of data present) or 1 (no data is present), 0 on error
\param contents Record from which to extract data
\param FillData Path to fill (optional)
\param LineData Path to stroke (optional)
EMF+ manual 2.2.2.14, Microsoft name: EmfPlusCustomLineCapOptionalData Object
Caller must check LineData for possible memory access violations.
*/
int U_PMF_CUSTOMLINECAPOPTIONALDATA_get(const char *contents, uint32_t Flags, const char **FillData, const char **LineData, const char *blimit){
/* this structure is entirely optional */
if(Flags & U_CLCD_FillPath){
if(!FillData){ return(0); }
status += 2;
}
if(Flags & U_CLCD_LinePath){
if(!LineData){ return(0); }
status += 4;
}
return(status);
}
/**
\brief Get data from a U_PMF_CUSTOMSTARTCAPDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Size Bytes in Data
\param Data Description of linecap
EMF+ manual 2.2.2.15, Microsoft name: EmfPlusCustomStartCapData Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_CUSTOMSTARTCAPDATA_get(const char *contents, int32_t *Size, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_DASHEDLINEDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Elements Members in the array
\param Lengths Caller must free. Pointer to memory holding lengths of dashes and spaces.
EMF+ manual 2.2.2.16, Microsoft name: EmfPlusDashedLineData Object
*/
int U_PMF_DASHEDLINEDATA_get(const char *contents, int32_t *Elements, U_FLOAT **Lengths, const char *blimit){
if(!*Lengths){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMF_FILLPATHOBJ object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Size Bytes in Data
\param Data Path specification
EMF+ manual 2.2.2.17, Microsoft name: EmfPlusFillPath Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_FILLPATHOBJ_get(const char *contents, int32_t *Size, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_FOCUSSCALEDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Count must be 2
\param ScaleX value 0.0 <-> 1.0
\param ScaleY value 0.0 <-> 1.0
EMF+ manual 2.2.2.18, Microsoft name: EmfPlusFocusScaleData Object
*/
int U_PMF_FOCUSSCALEDATA_get(const char *contents, uint32_t *Count, U_FLOAT *ScaleX, U_FLOAT *ScaleY, const char *blimit){
if(*Count != 2){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMF_GRAPHICSVERSION object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Signature Must be U_GFVR_PMF (0xDBC01)
\param GrfVersion GraphicsVersion enumeration
EMF+ manual 2.2.2.19, Microsoft name: EmfPlusGraphicsVersion Object
*/
int U_PMF_GRAPHICSVERSION_get(const char *contents, int *Signature, int *GrfVersion, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_HATCHBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Style HatchStyle enumeration
\param Foreground Hatch pattern line color
\param Background Hatch pattern bkground color
EMF+ manual 2.2.2.20, Microsoft name: EmfPlusHatchBrushData Object
*/
int U_PMF_HATCHBRUSHDATA_get(const char *contents, uint32_t *Style, U_PMF_ARGB *Foreground, U_PMF_ARGB *Background, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_INTEGER7 object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Value 7 bit signed integer (stored in an integer)
\param blimit one byte past the end of data
EMF+ manual 2.2.2.21, Microsoft name: EmfPlusInteger7 Object
*/
if(tmp & U_SIGN_INT7){
}
else {
}
return(1);
}
/**
\brief Get data from a U_PMF_INTEGER15 object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Value 15 bit signed integer (stored in an integer)
\param blimit one byte past the end of data
EMF+ manual 2.2.2.22, Microsoft name: EmfPlusInteger15 Object
*/
if(tmp & U_SIGN_INT15){
}
else {
}
return(1);
}
/**
\brief Get data from a U_PMF_LANGUAGEIDENTIFIER object
\return 1 on success, 0 on error
\param LId U_PMF_LANGUAGEIDENTIFIER from which to extract data
\param SubLId Example: code for USA
\param PriLId Example: code for English
EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier Object
This type is defined as 16 bits in the manual section, but it is only ever used as part of a 32 bit field!
*/
/* 16 bits above that are not used */
return(1);
}
/**
\brief Get data from a U_PMF_LINEARGRADIENTBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Lgbd U_PMF_LINEARGRADIENTBRUSHDATA structure, with no variable part
\param Data variable part of U_PMF_LINEARGRADIENTBRUSHDATA
\param blimit one byte past the end of data
EMF+ manual 2.2.2.24, Microsoft name: EmfPlusLinearGradientBrushData Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_LINEARGRADIENTBRUSHDATA_get(const char *contents, U_PMF_LINEARGRADIENTBRUSHDATA *Lgbd, const char **Data, const char *blimit){
U_PMF_SERIAL_get(&contents, &(Lgbd->StartColor), 4, 4, U_XE); /* StartColor, EndColor, Reserved1 & 2 */
return(1);
}
/**
\brief Get data from a U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Flags BrushData flags - indicates which of the following date fields are present.
\param Tm Transformation matrix
\param Bc U_PMF_BLENDCOLORS object or NULL
\param BfH U_PMF_BLENDFACTORS (H) object or NULL
\param BfV U_PMF_BLENDFACTORS (V) object or NULL (WARNING, GDI+ defines this field but does not render it. DO NOT USE.)
\param blimit one byte past the end of data
EMF+ manual 2.2.2.25, Microsoft name: EmfPlusLinearGradientBrushOptionalData Object
*/
int U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA_get(const char *contents, uint32_t Flags, U_PMF_TRANSFORMMATRIX *Tm,
/* all of the fields are optional! */
if(Flags & U_BD_Transform){
}
if(Flags & U_BD_PresetColors){
}
else if(Flags & U_BD_BlendFactorsH){
U_PMF_PTRSAV_SHIFT(BfH, &contents, 4 + (Elements * 2 * sizeof(U_FLOAT))); /* 4 byte count + 2 * 4bytes * Elements */
if(Flags & U_BD_BlendFactorsV){
}
}
else if(Flags & U_BD_BlendFactorsV){
}
return(1);
}
/**
\brief Get data from a U_PMF_LINEPATH object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Size Bytes in Data
\param Data Outline path
\param blimit one byte past the end of data
EMF+ manual 2.2.2.26, Microsoft name: EmfPlusLinePath Object
Caller must check Data for possible memory access violations.
*/
return(1);
}
/**
\brief Get data from a U_PMF_METAFILE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Type
\param Size Bytes in Data
\param Data Various types of data, like an EMF metafile, WMF metafile, another EMF+ metafile
\param blimit one byte past the end of data
EMF+ manual 2.2.2.27, Microsoft name: EmfPlusMetafile Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_METAFILE_get(const char *contents, uint32_t *Type, uint32_t *Size, const char **Data, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_PALETTE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Flags PaletteStyle flags
\param Elements Members in the array
\param Colors Palette data (array of colors)
\param blimit one byte past the end of data
EMF+ manual 2.2.2.28, Microsoft name: EmfPlusPalette Object
*/
int U_PMF_PALETTE_get(const char *contents, uint32_t *Flags, uint32_t *Elements, const char **Colors, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_PATHGRADIENTBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Pgbd constant part of U_PMF_PATHGRADIENTBRUSHDATA object
\param Gradient variable part of U_PMF_LINEARGRADIENTBRUSHDATA, Color Gradient with Elements members
\param Boundary variable part of U_PMF_LINEARGRADIENTBRUSHDATA, U_PMF_BOUNDARYPATHDATA object if BrushDataPath bit set in Flag, else U_PMF_BOUNDARYPOINTDATA object
\param Data variable part of U_PMF_LINEARGRADIENTBRUSHDATA, exact composition depends on Flags
\param blimit one byte past the end of data
EMF+ manual 2.2.2.29, Microsoft name: EmfPlusPathGradientBrushData Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_PATHGRADIENTBRUSHDATA_get(const char *contents, U_PMF_PATHGRADIENTBRUSHDATA *Pgbd, const char **Gradient,
U_PMF_SERIAL_get(&contents, &Size, 4, 1, U_LE); /* The first 4 bytes of the Boundary are always a size */
if(Pgbd->Flags & (U_BD_Transform |U_BD_PresetColors | U_BD_BlendFactorsH| U_BD_FocusScales)){ // optional data present
}
return(1);
}
/**
\brief Get data from a U_PMF_PATHGRADIENTBRUSHOPTIONALDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Matrix Transformation matrix
\param Pattern Blend Pattern
\param Data Focus scales for the brush
\param blimit one byte past the end of data
EMF+ manual 2.2.2.30, Microsoft name: EmfPlusPathGradientBrushOptionalData Object
*/
int U_PMF_PATHGRADIENTBRUSHOPTIONALDATA_get(const char *contents, uint32_t Flags, U_PMF_TRANSFORMMATRIX *Matrix,
int varsize;
/* this structure is entirely optional */
if(Flags & U_BD_Transform){
}
contents -= 4;
}
if(Flags & U_BD_FocusScales){
}
return(1);
}
/**
\brief Get data from a U_PMF_PATHPOINTTYPE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Flags PathPointType flags
\param Type PathPointType enumeration
\param blimit one byte past the end of data
EMF+ manual 2.2.2.31, Microsoft name: EmfPlusPathPointType Object
Note: order of 4bit fields appears to be shown in the LE column, not as
documented in the BE column.
*/
return(1);
}
/**
\brief Get data from a U_PMF_PATHPOINTTYPERLE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Bezier Set: Bezier curve, Clear: straight line
\param RL Run Length
\param Ppt PathPointType enumeration
\param blimit one byte past the end of data
EMF+ manual 2.2.2.32, Microsoft name: EmfPlusPathPointTypeRLE Object
*/
int U_PMF_PATHPOINTTYPERLE_get(const char *contents, int *Bezier, int *RL, int *Ppt, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_PENDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Flags PenData flags
\param Unit UnitType enumeration
\param Width Width in units set by Unit
\param Data Optional pen data, exact composition depends on Flags
\param blimit one byte past the end of data
EMF+ manual 2.2.2.33, Microsoft name: EmfPlusPenData Object
*/
int U_PMF_PENDATA_get(const char *contents, uint32_t *Flags, uint32_t *Unit, U_FLOAT *Width, const char **Data, const char *blimit){
if(contents >= blimit)return(0); // variable data will extend farther, but this much at least must be true
return(1);
}
/**
\brief Get data from a U_PMF_PENOPTIONALDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Flags; PenData Flags - indicated which of the many fields are present.
\param Matrix; Transformation matrix
\param StartCap LineCapType enumeration
\param EndCap LineCapType enumeration
\param Join LineJoinType enumeration
\param MiterLimit Maximum (miter length / line width)
\param Style LineStyle enumeration
\param DLCap DashedLineCapType enumeration
\param DLOffset Distance line start to first dash start
\param DLData Dash and space widths
\param Alignment PenAlignment enumeration
\param CmpndLineData Compount Line (parallel lines drawn instead of one)
\param CSCapData Custom start cap
\param CECapData Custom end cap
\param blimit one byte past the end of data
EMF+ manual 2.2.2.34, Microsoft name: EmfPlusPenOptionalData Object
This object consists of a large number of optional and or variable values, which
are returned, or not, depending on bits in Flags.
*/
const char *contents,
const char **DLData,
const char **CmpndLineData,
const char **CSCapData,
const char **CECapData,
const char *blimit){
if(!contents ||
}
}
}
}
}
}
}
}
}
}
}
}
return(1);
}
/**
\brief Get data from a U_PMF_POINT object
\return 1 on success, 0 on error
\param contents Record from which to extract data. On return position is offset by sizeof(U_PMF_POINT).
\param X X coordinate
\param Y Y coordinate
\param blimit one byte past the end of data
EMF+ manual 2.2.2.35, Microsoft name: EmfPlusPoint Object
*/
return(1);
}
/**
\brief Get data from a U_PMF_POINTF object
\return 1 on success, 0 on error
\param contents Record from which to extract data. On return position is offset by sizeof(U_PMF_POINTF).
\param X X coordinate
\param Y Y coordinate
\param blimit one byte past the end of data
EMF+ manual 2.2.2.36, Microsoft name: EmfPlusPointF Object
*/
return(1);
}
/**
\brief Get data from a U_PMF_POINTR object
\return size in bytes traversed on success, 0 on error
\param contents Record from which to extract data. On return position is offset by returned size.
\param X X coordinate
\param Y Y coordinate
\param blimit one byte past the end of data
EMF+ manual 2.2.2.37, Microsoft name: EmfPlusPointR Object
*/
int size=0;
else { return(0); }
else { return(0); }
return(size);
}
/**
\brief Get data from a variable POINTS object, which may be U_PMF_POINTS, U_PMF_POINTF, or U_PMF_POINTR.
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Flags Record flags (bits U_PPF_C and U_PPF_P are referenced)
\param Elements Number of points to retrieve.
\param Points Caller must free. Array of U_PMF_POINTF coordinates.
\param blimit one byte past the end of data
This function should never be called directly by end user code.
*/
int U_PMF_VARPOINTS_get(const char *contents, uint16_t Flags, int Elements, U_PMF_POINTF **Points, const char *blimit){
int status = 0;
}
}
}
}
else {
}
}
if(Elements){ /* some error in the preceding */
}
else {
status = 1;
}
return(status);
}
/**
\brief Get data from a U_PMF_RECT object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param X UL X value
\param Y UL Y value
\param Width Width
\param Height Height
\param blimit one byte past the end of data
EMF+ manual 2.2.2.38, Microsoft name: EmfPlusRect Object
*/
int U_PMF_RECT_get(const char **contents, int16_t *X, int16_t *Y, int16_t *Width, int16_t *Height, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_RECTF object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param X UL X value
\param Y UL Y value
\param Width Width
\param Height Height
\param blimit one byte past the end of data
EMF+ manual 2.2.2.39, Microsoft name: EmfPlusRectF Object
*/
int U_PMF_RECTF_get(const char **contents, U_FLOAT *X, U_FLOAT *Y, U_FLOAT *Width, U_FLOAT *Height, const char *blimit){
return(1);
}
/**
\brief Get data from a variable RECTS object, which may be U_PMF_RECT or U_PMF_RECTF
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Flags Record flags (bit U_PPF_C is referenced)
\param Elements Number of rects to retrieve.
\param Rects Caller must free. Array of U_PMF_RECTF coordinates.
\param blimit one byte past the end of data
Rects in record may be either U_PMF_RECT or U_PMF_RECTF, but this function always
returns U_PMF_RECTF
*/
int U_PMF_VARRECTS_get(const char **contents, uint16_t Flags, int Elements, U_PMF_RECTF **Rects, const char *blimit){
if(!rts){
return(0);
}
return(0);
}
}
else {
return(0);
}
}
}
else {
}
}
return(1);
}
/**
\brief Get data from a U_PMF_REGIONNODE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Type RegionNodeDataType
\param Data Depending on Type: U_PMF_REGIONNODEPATH, U_PMF_RECTF, or U_PMF_REGIONNODECHILDNODES
\param blimit one byte past the end of data
EMF+ manual 2.2.2.40, Microsoft name: EmfPlusRegionNode Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_REGIONNODE_get(const char *contents, uint32_t *Type, const char **Data, const char *blimit){
/* Important! This only checks the constant part, the caller must check that returned data doesn't exceed blimit */
return(1);
}
/**
There is no U_PMF_REGIONNODECHILDNODES_get!
The Region object is recursive allowing U_PMF_REGIONNODECHILDNODES ->
U_PMF_REGIONNODE -> U_PMF_REGIONNODECHILDNODES etc.
So the data stored in each node must be handled as the tree is followed recursively.
See U_PMF_REGIONNODECHILDNODES_print() and U_PMF_REGIONNODE_print() for an example.
EMF+ manual 2.2.2.41, Microsoft name: EmfPlusRegionNodeChildNodes Object
*/
/**
\brief Get data from a U_PMF_REGIONNODEPATH object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Size Bytes in Data
\param Data Boundary of region node
\param blimit one byte past the end of data
EMF+ manual 2.2.2.42, Microsoft name: EmfPlusRegionNodePath Object
*/
int U_PMF_REGIONNODEPATH_get(const char *contents, int32_t *Size, const char **Data, const char *blimit){
/* Important! This only checks the constant part, the caller must check that returned data doesn't exceed blimit */
return(1);
}
/**
\brief Get data from a U_PMF_SOLIDBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Color Color of brush
\param blimit one byte past the end of data
EMF+ manual 2.2.2.43, Microsoft name: EmfPlusSolidBrushData Object
*/
return(1);
}
/**
\brief Get data from a U_PMF_STRINGFORMATDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param TabStopCount Entries in TabStop array
\param RangeCount Entries in CharRange array
\param TabStops Array of tabstop locations
\param CharRange Array of character ranges in the text
\param blimit one byte past the end of data
EMF+ manual 2.2.2.44, Microsoft name: EmfPlusStringFormatData Object
*/
return(1);
}
/**
\brief Get data from a U_PMF_TEXTUREBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Flags BrushData flags
\param WrapMode WrapMode enumeration
\param Data Optional texture data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.45, Microsoft name: EmfPlusTextureBrushData Object
Caller must check Data for possible memory access violations.
*/
int U_PMF_TEXTUREBRUSHDATA_get(const char *contents, uint32_t *Flags, int32_t *WrapMode, const char **Data, const char *blimit){
/* Important! This only checks the constant part, the caller must check that returned data doesn't exceed blimit */
return(1);
}
/**
\brief Get data from a U_PMF_TEXTUREBRUSHOPTIONALDATA object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param HasImage True if this object has an Image
\param Matrix Transformation matrix, NULL if Flag BrushDataTransform is not set.
\param Image Image that contains the texture.
\param blimit one byte past the end of data
EMF+ manual 2.2.2.46, Microsoft name: EmfPlusTextureBrushOptionalData Object
Caller must check Image for possible memory access violations.
*/
int U_PMF_TEXTUREBRUSHOPTIONALDATA_get(const char *contents, int HasImage, U_PMF_TRANSFORMMATRIX *Matrix,
if(Matrix){
}
if(HasImage){
}
return(1);
}
/**
\brief Get data from a U_PMF_TRANSFORMMATRIX object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Matrix Transformation matrix, present if Flag BrushDataTransform is set.
\param blimit one byte past the end of data
EMF+ manual 2.2.2.47, Microsoft name: EmfPlusTransformMatrix Object
*/
int U_PMF_TRANSFORMMATRIX_get(const char *contents, U_PMF_TRANSFORMMATRIX *Matrix, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IE_BLUR object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Radius Blur radius in pixels
\param ExpandEdge 1: expand bitmap by Radius; 0: bitmap size unchanged
\param blimit one byte past the end of data
EMF+ manual 2.2.3.1, Microsoft name: BlurEffect Object
*/
int U_PMF_IE_BLUR_get(const char *contents, U_FLOAT *Radius, uint32_t *ExpandEdge, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IE_BRIGHTNESSCONTRAST object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Brightness -255 to 255, 0 is unchanged, positive increases, negative decreases
\param Contrast -100 to 100, 0 is unchanged, positive increases, negative decreases
\param blimit one byte past the end of data
EMF+ manual 2.2.3.2, Microsoft name: BrightnessContrastEffect Object
*/
int U_PMF_IE_BRIGHTNESSCONTRAST_get(const char *contents, int32_t *Brightness, int32_t *Contrast, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IE_COLORBALANCE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param CyanRed -100 to 100, 0 is unchanged, positive increases Red & decreases Cyan, negative is opposite
\param MagentaGreen -100 to 100, 0 is unchanged, positive increases Green & decreases Magenta, negative is opposite
\param YellowBlue -100 to 100, 0 is unchanged, positive increases Blue & decreases Yellow, negative is opposite
\param blimit one byte past the end of data
EMF+ manual 2.2.3.3, Microsoft name: ColorBalanceEffect Object
*/
int U_PMF_IE_COLORBALANCE_get(const char *contents, int32_t *CyanRed, int32_t *MagentaGreen, int32_t *YellowBlue, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IE_COLORCURVE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Adjust CurveAdjustment enumeration
\param Channel CurveChannel enumeration
\param Intensity adjustment to apply. "Adjust" determines what field this is and range values.
\param blimit one byte past the end of data
EMF+ manual 2.2.3.4, Microsoft name: ColorCurveEffect Object
*/
int U_PMF_IE_COLORCURVE_get(const char *contents, uint32_t *Adjust, uint32_t *Channel, int32_t *Intensity, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IE_COLORLOOKUPTABLE object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param BLUT Blue color lookup table
\param GLUT Green color lookup table
\param RLUT Red color lookup table
\param ALUT Alpha color lookup table
\param blimit one byte past the end of data
EMF+ manual 2.2.3.5, Microsoft name: ColorLookupTableEffect Object
*/
const uint8_t **BLUT, const uint8_t **GLUT, const uint8_t **RLUT, const uint8_t **ALUT, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IE_COLORMATRIX object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Matrix 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]
\param blimit one byte past the end of data
EMF+ manual 2.2.3.6, Microsoft name: ColorMatrixEffect Object
*/
int U_PMF_IE_COLORMATRIX_get(const char *contents, U_PMF_IE_COLORMATRIX *Matrix, const char *blimit){
/* Important! This only checks the constant part, the caller must check that returned data doesn't exceed blimit */
return(1);
}
/**
\brief Get data from a U_PMF_IE_HUESATURATIONLIGHTNESS object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Hue -180 to 180, 0 is unchanged
\param Saturation -100 to 100, 0 is unchanged
\param Lightness -100 to 100, 0 is unchanged
\param blimit one byte past the end of data
EMF+ manual 2.2.3.7, Microsoft name: HueSaturationLightnessEffect Object
*/
int U_PMF_IE_HUESATURATIONLIGHTNESS_get(const char *contents, int32_t *Hue, int32_t *Saturation, int32_t *Lightness, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IE_LEVELS object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Highlight 0 to 100, 100 is unchanged
\param Midtone -100 to 100, 0 is unchanged
\param Shadow 0 to 100, 0 is unchanged
\param blimit one byte past the end of data
EMF+ manual 2.2.3.8, Microsoft name: LevelsEffect Object
*/
int U_PMF_IE_LEVELS_get(const char *contents, int32_t *Highlight, int32_t *Midtone, int32_t *Shadow, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IE_REDEYECORRECTION object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Elements Number of members in Rects
\param Rects Caller must free. Pointer to memory holding an array of U_RECTL.
\param blimit one byte past the end of data
EMF+ manual 2.2.3.9, Microsoft name: RedEyeCorrectionEffect Object
*/
int U_PMF_IE_REDEYECORRECTION_get(const char *contents, int32_t *Elements, U_RECTL **Rects, const char *blimit){
if(!*Rects){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMF_IE_SHARPEN object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Radius Sharpening radius in pixels
\param Sharpen 0 to 100, 0 is unchanged
\param blimit one byte past the end of data
EMF+ manual 2.2.3.10, Microsoft name: SharpenEffect Object
*/
int U_PMF_IE_SHARPEN_get(const char *contents, U_FLOAT *Radius, int32_t *Sharpen, const char *blimit){
return(1);
}
/**
\brief Get data from a U_PMF_IE_TINT object
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Hue -180 to 180, [positive==clockwise] rotation in degrees starting from blue
\param Amount -100 [add black] to 100[add white], 0 is unchanged. Change in hue on specified axis
\param blimit one byte past the end of data
EMF+ manual 2.2.3.11, Microsoft name: TintEffect Object
*/
return(1);
}
/*
end of U_PMF_*_get() functions
=====================================================================================
start of U_PMR_*_get() functions
These functions all assume that the size field in the common EMF+ header has already
been checked, so that the extent the record claims exists in the data read in for the file.
Consequently none of them takes a blimit parameter. They generate a new one from the
header size field and contents if needed.
*/
return(1);
}
/* for records that have a type but no associated flag bits or data */
/* memory access safe, only uses the common header */
if(!contents){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMR_OFFSETCLIP record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
\param dX horizontal translation offset to apply to clipping region
\param dY vertical translation offset to apply to clipping region
EMF+ manual 2.3.1.1, Microsoft name: EmfPlusOffsetClip Record, Index 0x35
*/
if(!contents){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMR_RESETCLIP record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
EMF+ manual 2.3.1.2, Microsoft name: EmfPlusResetClip Record, Index 0x31
*/
if(!contents){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMR_SETCLIPPATH record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param CMenum CombineMode enumeration..
\param PathID U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
EMF+ manual 2.3.1.3, Microsoft name: EmfPlusSetClipPath Record, Index 0x33
*/
return(1);
}
/**
\brief Get data from a U_PMR_SETCLIPRECT record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
\param CMenum Combine mode enumeration.
\param Rect Rectangle used with CombineMode enumeration from Header.Flags
EMF+ manual 2.3.1.4, Microsoft name: EmfPlusSetClipRect Record, Index 0x32
*/
int *CMenum,
U_PMF_RECTF *Rect){
return(1);
}
/**
\brief Get data from a U_PMR_SETCLIPREGION record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param CMenum CombineMode enumeration..
\param PathID U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
EMF+ manual 2.3.1.5, Microsoft name: EmfPlusSetClipRegion Record, Index 0x34
*/
return(1);
}
/**
\brief Get data from a U_PMR_COMMENT record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
\param Data Private data, may be anything
EMF+ manual 2.3.2.1, Microsoft name: EmfPlusComment Record, Index 0x03
Caller must check Data for possible memory access violations.
*/
const char **Data){
return(1);
}
/**
\brief Get data from a U_PMR_ENDOFFILE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
EMF+ manual 2.3.3.1, Microsoft name: EmfPlusEndOfFile Record, Index 0x02
*/
if(!contents){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMR_GETDC record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
EMF+ manual 2.3.3.2, Microsoft name: EmfPlusGetDC Record, Index 0x04
*/
if(!contents){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMR_HEADER record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
\param Version EmfPlusGraphicsVersion object
\param IsDual set = Dual-mode file, clear= EMF+ only file.
\param IsVideo set = video device, clear= printer. Ignore all other bits.
\param LogicalDpiX Horizontal resolution reference device in DPI
\param LogicalDpiY Vertical resolution reference device in DPI
EMF+ manual 2.3.3.3, Microsoft name: EmfPlusHeader Record, Index 0x01
*/
U_PMF_GRAPHICSVERSION *Version, int *IsDual, int *IsVideo, uint32_t *LogicalDpiX, uint32_t *LogicalDpiY){
return(1);
}
/**
\brief Get data from a U_PMR_CLEAR record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
\param Color Erase everything preceding, set background ARGB color.
EMF+ manual 2.3.4.1, Microsoft name: EmfPlusClear Record, Index 0x09
*/
U_PMF_ARGB *Color){
return(1);
}
/**
\brief Get data from a U_PMR_DRAWARC record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param Start Start angle, >=0.0, degrees clockwise from 3:00
\param Sweep Sweep angle, -360<= angle <=360, degrees clockwise from Start
\param Rect Caller must free. Bounding rectangle. Coordinate type set by ctype.
EMF+ manual 2.3.4.2, Microsoft name: EmfPlusDrawArc Record, Index 0x12
*/
U_PMF_RECTF *Rect){
return(1);
}
/**
\brief Get data from a U_PMR_DRAWBEZIERS record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param RelAbs Set: Coordinates are relative; Clear: Coordinates are absolute and their type is set by ctype
\param Elements Number of members in the Data array
\param Points Caller must free. Array of U_POINT_F = Sequence of points to connect. Coordinate type set by ctype and RelAbs.
EMF+ manual 2.3.4.3, Microsoft name: EmfPlusDrawBeziers Record, Index 0x19
*/
U_PMF_POINTF **Points){
return(status);
}
/**
\brief Get data from a U_PMR_DRAWCLOSEDCURVE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param RelAbs Set: Coordinates are relative; Clear: Coordinates are absolute and their type is set by ctype
\param Tension Controls splines, 0 is straight line, >0 is curved
\param Elements Number of members in the Data array
\param Points Caller must free. Array of U_POINT_F = Sequence of points to connect. Coordinate type set by ctype and RelAbs.
EMF+ manual 2.3.4.4, Microsoft name: EmfPlusDrawClosedCurve Record, Index 0x17
*/
U_PMF_POINTF **Points){
return(1);
}
/**
\brief Get data from a U_PMR_DRAWCURVE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param Tension Controls splines, 0 is straight line, >0 is curved
\param Offset Element in Points that is the spline's starting point
\param NSegs Number of segments
\param Elements Number of members in Data array
\param Points Caller must free. Array of U_POINT_F = Sequence of points to connect. Coordinate type set by ctype and RelAbs.
EMF+ manual 2.3.4.5, Microsoft name: EmfPlusDrawCurve Record, Index 0x18
*/
U_PMF_POINTF **Points){
if(!contents || !PenID || !ctype || !Tension || !Offset || !NSegs || !Elements || !Points){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMR_DRAWDRIVERSTRING record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param FontID U_PMF_FONT object in the EMF+ object table (0-63, inclusive)
\param btype Set: BrushID is an U_PFM_ARGB; Clear: index of U_PMF_BRUSH object in EMF+ object table.
\param BrushID Color or index of U_PMF_BRUSH object in the EMF+ object table, depends on Flags bit0
\param DSOFlags DriverStringOptions flags
\param HasMatrix If 1 record contains a TransformMatrix field, if 0 it does not.
\param Elements Number of members in Glyphs and Positions array
\param Glyphs Caller must free. 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.
\param Points Caller must free. 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.
\param Matrix Caller must free. Transformation to apply to Glyphs & Positions. Present if HasMatrix is 1
EMF+ manual 2.3.4.6, Microsoft name: EmfPlusDrawDriverString Record, Index 0x36
*/
U_PMF_SERIAL_get(&contents, BrushID, 4, 1, (*btype ? U_XE : U_LE)); /* color is not byte swapped, ID integer is */
if(!U_PMF_SERIAL_array_copy_get(&contents, (void **)Glyphs, 2, *Elements, U_LE, (*DSOFlags & U_DSO_CmapLookup))){ return(0); }
if(!U_PMF_SERIAL_array_copy_get(&contents, (void **)Points, 4, *Elements *2, U_LE, (*DSOFlags & U_DSO_RealizedAdvance))){ return(0); }
if(!U_PMF_SERIAL_array_copy_get(&contents, (void **)Matrix, 4, 6, U_LE, (*HasMatrix))){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMR_DRAWELLIPSE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param Rect Caller must free. Bounding rectangle. Coordinate type set by ctype.
EMF+ manual 2.3.4.7, Microsoft name: EmfPlusDrawEllipse Record, Index 0x0F
*/
U_PMF_RECTF *Rect){
return(1);
}
/**
\brief Get data from a U_PMR_DRAWIMAGE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param ImgID U_PMF_IMAGE object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param ImgAttrID index of a U_PMF_IMAGEATTRIBUTES object in the object table
\param SrcUnit UnitType enumeration
\param SrcRect Region of image
\param DstRect Destination rectangle for image. Coordinate type set by ctype.
EMF+ manual 2.3.4.8, Microsoft name: EmfPlusDrawImage Record, Index 0x1A
*/
return(1);
}
/**
\brief Get data from a U_PMR_DRAWIMAGEPOINTS record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param ImgID U_PMF_IMAGE object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param etype Set: effect from previous U_PMR_SERIALIZABLEOBJECT record will be applied; Clear: no effect applied
\param RelAbs Set: Data is relative, Clear: if it is absolute
\param ImgAttrID EmfPlusImageAttributes object
\param SrcUnit UnitType enumeration
\param SrcRect Region of image
\param Elements Number of members in Points, must be 3
\param Points Caller must free. 3 points of a parallelogram.. Coordinate type set by ctype and RelAbs.
EMF+ manual 2.3.4.9, Microsoft name: EmfPlusDrawImagePoints Record, Index 0x1B
*/
U_PMF_POINTF **Points){
if(!contents || !ImgID || !ctype || !etype || !RelAbs || !ImgAttrID || !SrcUnit || !Elements || !Points){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMR_DRAWLINES record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param dtype Set: path must be closed, Clear: path is open
\param RelAbs Set: Coordinates are relative; Clear: Coordinates are absolute and their type is set by ctype
\param Elements Number of members in Points
\param Points Caller must free. Array of U_POINT_F = Sequence of points to connect. Coordinate type set by ctype and RelAbs.
EMF+ manual 2.3.4.10, Microsoft name: EmfPlusDrawLines Record, Index 0x0D
*/
U_PMF_POINTF **Points){
return(1);
}
/**
\brief Get data from a U_PMR_DRAWPATH record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PathID U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
EMF+ manual 2.3.4.11, Microsoft name: EmfPlusDrawPath Record, Index 0x15
*/
return(1);
}
/**
\brief Get data from a U_PMR_DRAWPIE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param Start Start angle, >=0.0, degrees clockwise from 3:00
\param Sweep Sweep angle, -360<= angle <=360, degrees clockwise from Start
\param Rect Caller must free. Bounding rectangle. Coordinate type set by ctype.
EMF+ manual 2.3.4.12, Microsoft name: EmfPlusDrawPie Record, Index 0x0D
*/
U_PMF_RECTF *Rect){
return(1);
}
/**
\brief Get data from a U_PMR_DRAWRECTS record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PenID U_PMF_PEN object in the EMF+ object table (0-63, inclusive)
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param Elements Number of members in Rects
\param Rects Caller must free. Array of U_PMF_RECTF rectangles to draw.
EMF+ manual 2.3.4.13, Microsoft name: EmfPlusDrawRects Record, Index 0x0B
Rects in record may be either U_PMF_RECT or U_PMF_RECTF, but this function always
returns U_PMF_RECTF
*/
U_PMF_RECTF **Rects){
return(1);
}
/**
\brief Get data from a U_PMR_DRAWSTRING record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param FontID U_PMF_FONT object in the EMF+ object table (0-63, inclusive)
\param btype Set: BrushID is an U_PFM_ARGB; Clear: index of U_PMF_BRUSH object in EMF+ object table.
\param BrushID Color or index of U_PMF_BRUSH object in the EMF+ object table, depending on btype.
\param FormatID U_PMF_STRINGFORMAT object in EMF+ Object Table.
\param Elements Number of characters in the string.
\param Rect String's bounding box.
\param String Caller must free. Array of UFT-16LE unicode characters.
EMF+ manual 2.3.4.14, Microsoft name: EmfPlusDrawString Record, Index 0x1C
*/
U_PMF_SERIAL_get(&contents, BrushID, 4, 1, (*btype ? U_XE : U_LE)); /* color is not byte swapped, ID integer is */
return(1);
}
/**
\brief Get data from a U_PMR_FILLCLOSEDCURVE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param btype Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param ftype Set: winding fill; Clear: alternate fill
\param RelAbs Set: Coordinates are relative; Clear: Coordinates are absolute and their type is set by ctype
\param BrushID Color or index of U_PMF_BRUSH object in the EMF+ object table, depending on btype.
\param Tension Controls splines, 0 is straight line, >0 is curved
\param Elements Number of members in Points
\param Points Caller must free. Array of U_POINT_F = Sequence of points to connect. Coordinate type set by ctype and RelAbs.
EMF+ manual 2.3.4.15, Microsoft name: EmfPlusFillClosedCurve Record, Index 0x16
*/
U_PMF_POINTF **Points){
if(!contents || !btype || !ctype || !ftype || !RelAbs || !BrushID || !Tension || !Elements || !Points){ return(0); }
U_PMF_SERIAL_get(&contents, BrushID, 4, 1, (*btype ? U_XE : U_LE)); /* color is not byte swapped, ID integer is */
return(1);
}
/**
\brief Get data from a U_PMR_FILLELLIPSE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param btype Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param BrushID Color or index of U_PMF_BRUSH object in the EMF+ object table, depending on btype.
\param Rect Caller must free. Bounding box for elliptical pie segment being drawn. Coordinate type set by ctype.
EMF+ manual 2.3.4.16, Microsoft name: EmfPlusFillEllipse Record, Index 0x0E
*/
U_PMF_RECTF *Rect){
U_PMF_SERIAL_get(&contents, BrushID, 4, 1, (*btype ? U_XE : U_LE)); /* color is not byte swapped, ID integer is */
return(1);
}
/**
\brief Get data from a U_PMR_FILLPATH record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param btype Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
\param PathID U_PMF_PATH object in the EMF+ object table (0-63, inclusive)
\param BrushID Color or index of U_PMF_BRUSH object in the EMF+ object table, depending on btype.
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
*/
U_PMF_SERIAL_get(&contents, BrushID, 4, 1, (*btype ? U_XE : U_LE)); /* color is not byte swapped, ID integer is */
return(1);
}
/**
\brief Get data from a U_PMR_FILLPIE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param btype Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param BrushID Color or index of U_PMF_BRUSH object in the EMF+ object table, depending on btype.
\param Start Start angle, >=0.0, degrees clockwise from 3:00
\param Sweep Sweep angle, -360<= angle <=360, degrees clockwise from Start
\param Rect Bounding box for elliptical pie segment being filled. Coordinate type set by ctype.
EMF+ manual 2.3.4.18, Microsoft name: EmfPlusFillPie Record, Index 0x10
*/
U_PMF_RECTF *Rect){
U_PMF_SERIAL_get(&contents, BrushID, 4, 1, (*btype ? U_XE : U_LE)); /* color is not byte swapped, ID integer is */
return(1);
}
/**
\brief Get data from a U_PMR_FILLPOLYGON record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param btype Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param RelAbs Set: U_PMF_PathPointTypeRLE and/or U_PMF_PathPointType objects; Clear: only U_PMF_PathPointType
\param BrushID Color or index of U_PMF_BRUSH object in the EMF+ object table, depending on btype.
\param Elements Number of members in Data.
\param Points Sequence of points to connect with line segments. Coordinate type set by ctype and RelAbs.
EMF+ manual 2.3.4.19, Microsoft name: EmfPlusFillPolygon Record, Index 0x0C
*/
U_PMF_POINTF **Points){
U_PMF_SERIAL_get(&contents, BrushID, 4, 1, (*btype ? U_XE : U_LE)); /* color is not byte swapped, ID integer is */
return(1);
}
/**
\brief Get data from a U_PMR_FILLRECTS record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param btype Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param BrushID Color or index of U_PMF_BRUSH object in the EMF+ object table, depending on btype.
\param Elements Number of members in Data.
\param Rects Caller must free. Array of U_PMF_RECTF rectangles to draw.
EMF+ manual 2.3.4.20, Microsoft name: EmfPlusFillRects Record, Index 0x0A
EMF+ files have been encountered where BrushID must be a color, because it has a value like FFFF0000 but
the flags are set wrong, so that U_PPF_B is not set. Detect these by BrushID >63 for btype=0 and correct.
If the opposite problem occurs it cannot be reliably detected, so it cannot be corrected.
Rects in record may be either U_PMF_RECT or U_PMF_RECTF, but this function always
returns U_PMF_RECTF
*/
U_PMF_RECTF **Rects){
U_PMF_SERIAL_get(&contents, BrushID, 4, 1, (*btype ? U_XE : U_LE)); /* color is not byte swapped, ID integer is */
/* correct btype, if necessary, for invalid EMF+ input */
return(1);
}
/**
\brief Get data from a U_PMR_FILLREGION record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param RgnID U_PMF_REGION object in the EMF+ object table (0-63, inclusive)
\param btype Set: BrushID is an U_PFM_ARGB; Clear: is index of U_PMF_BRUSH object in EMF+ object table.
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param BrushID Color or index of U_PMF_BRUSH object in the EMF+ object table, depending on btype.
EMF+ manual 2.3.4.21, Microsoft name: EmfPlusFillRegion Record, Index 0x13
*/
U_PMF_SERIAL_get(&contents, BrushID, 4, 1, (*btype ? U_XE : U_LE)); /* color is not byte swapped, ID integer is */
return(1);
}
/**
\brief Get data from a U_PMR_OBJECT record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param ObjID Index for this object in the EMF+ object table (0-63, inclusive)
\param otype ObjectType enumeration
\param ntype Set: object definition continue bit is set
\param TSize If ntype is set, holds the total number of data bytes split across multiple records. If ntype is clear, has no meaning.
\param Data Object's data. Type from otype.
EMF+ manual 2.3.5.1, Microsoft name: EmfPlusObject Record, Index 0x13
Caller must check Data for possible memory access violations.
OTHER NOTES:
All objects are to be stored in the same table and retrieved by index.
Documentation indicates that this table contains only 64 slots, although the index
field which references it can code for values 0-127.
If a new object has the same index as an existing object the old one is deleted and
the new one goes into its storage slot.
The continuation bit (U_PPF_N) is documented as indicating that the object is continued into
the next record. Examination of emf+ records in emf files produced by PowerPoint 2003
show that changing the ObjID also serves as a continued record terminator, and that it apparently
overrides the value for the continue bit. That is, even though the preceding records said
that it was continued, the change of ObjID terminates that preceding record without adding
any more data to it. In one example the sequential emf+ records were:
ObjID type size continue
0 5 65008 Y
0 5 65008 Y
0 5 63104 Y
1 8 24 N
A DrawImagePoints record followed that referenced ObjID 0.
Examination of the records with continue set showed that data in each
was preceded by a uint32_t size value equivalent to the size of the
data that had been split across multiple records, in this case
0x0002F254 = 193108. It is not clear at present if this size value
will also be present at the end of a continued series that terminates
by not using the continue bit, rather than changing the ObjID.
*/
const char **Data){
else { *TSize = 0; }
return(1);
}
/**
\brief Get data from a U_PMR_SERIALIZABLEOBJECT record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param GUID ImageEffects identifier.
\param Size Bytes in Data.
\param Data "Serialized image effects parameter block". One of the ImageEffects objects.
EMF+ manual 2.3.5.2, Microsoft name: EmfPlusSerializableObject Record, Index 0x38
Caller must check Data for possible memory access violations.
*/
const char **Data){
return(1);
}
/**
\brief Get data from a U_PMR_SETANTIALIASMODE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param SMenum SmoothingMode enumeration
\param aatype Set: anti-aliasing on; Clear: anti-aliasing off
EMF+ manual 2.3.6.1, Microsoft name: EmfPlusSetAntiAliasMode Record, Index 0x1E
*/
return(1);
}
/**
\brief Get data from a U_PMR_SETCOMPOSITINGMODE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param CMenum CompositingMode enumeration
EMF+ manual 2.3.6.2, Microsoft name: EmfPlusSetCompositingMode Record, Index 0x23
*/
int *CMenum){
/* memory access safe, only uses the common header */
return(1);
}
/**
\brief Get data from a U_PMR_SETCOMPOSITINGQUALITY record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param CQenum CompositingQuality enumeration
EMF+ manual 2.3.6.3, Microsoft name: EmfPlusSetCompositingQuality Record, Index 0x24
*/
int *CQenum){
/* memory access safe, only uses the common header */
return(1);
}
/**
\brief Get data from a U_PMR_SETINTERPOLATIONMODE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param IMenum InterpolationMode enumeration
EMF+ manual 2.3.6.4, Microsoft name: EmfPlusSetInterpolationMode Record, Index 0x21
*/
int *IMenum){
/* memory access safe, only uses the common header */
return(1);
}
/**
\brief Get data from a U_PMR_SETPIXELOFFSETMODE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param POMenum PixelOffsetMode enumeration.
EMF+ manual 2.3.6.5, Microsoft name: EmfPlusSetPixelOffsetMode Record, Index 0x22
*/
int *POMenum){
/* memory access safe, only uses the common header */
return(1);
}
/**
\brief Get data from a U_PMR_SETRENDERINGORIGIN record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header.
\param X X coordinate of rendering origin.
\param Y Y coordinate of rendering origin.
EMF+ manual 2.3.6.6, Microsoft name: EmfPlusSetRenderingOrigin Record, Index 0x1D
*/
if(!contents || !X || !Y){ return(0); }
return(1);
}
/**
\brief Get data from a U_PMR_SETTEXTCONTRAST record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header.
\param TGC Text Gamma correction value (x 1000).
EMF+ manual 2.3.6.7, Microsoft name: EmfPlusSetTextContrast Record, Index 0x20
*/
int *TGC){
/* memory access safe, only uses the common header */
return(1);
}
/**
\brief Get data from a U_PMR_SETTEXTRENDERINGHINT record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header.
\param TRHenum TextRenderingHint enumeration
EMF+ manual 2.3.6.8, Microsoft name: EmfPlusSetTextRenderingHint Record, Index 0x1F
*/
int *TRHenum){
/* memory access safe, only uses the common header */
return(1);
}
/**
\brief Get data from a U_PMR_BEGINCONTAINER record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param UTenum UnitType enumeration
\param DstRect with SrcRect specifies a transformation
\param SrcRect with DstRect specifies a transformation
\param StackID EMF+ Object Stack Index to use for this graphics container
EMF+ manual 2.3.7.1, Microsoft name: EmfPlusBeginContainer Record, Index 0x27
*/
int *UTenum,
return(1);
}
/**
\brief Get data from a U_PMR_BEGINCONTAINERNOPARAMS record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param StackID EMF+ Object Stack Index to use for this graphics container
EMF+ manual 2.3.7.2, Microsoft name: EmfPlusBeginContainerNoParams Record, Index 0x28
*/
int U_PMR_BEGINCONTAINERNOPARAMS_get(const char *contents, U_PMF_CMN_HDR *Header, uint32_t *StackID){
}
/**
\brief Get data from a U_PMR_ENDCONTAINER record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param StackID EMF+ Object Stack Index of this graphics container
EMF+ manual 2.3.7.3, Microsoft name: EmfPlusEndContainer Record, Index 0x29
*/
}
/**
\brief Get data from a U_PMR_RESTORE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param StackID State (level) to restore from the EMF+ Graphics Stack. Must have been put on the GS with a U_PMR_SAVE.
EMF+ manual 2.3.7.4, Microsoft name: EmfPlusRestore Record, Index 0x26
*/
}
/**
\brief Get data from a U_PMR_SAVE record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param StackID State (level) to save.on the EMF+ Graphics Stack
EMF+ manual 2.3.7.5, Microsoft name: EmfPlusSave Record, Index 0x25
*/
}
/**
\brief Get data from a U_PMR_SETTSCLIP record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param ctype Set: int16_t coordinates; Clear: U_FLOAT coordinates
\param Elements Number of members in Data.
\param Rects Caller must free. Array of rectangles to draw. Coordinate type set by ctype.
EMF+ manual 2.3.8.1, Microsoft name: EmfPlusSetTSClip Record, Index 0x3A
*/
U_PMF_RECTF **Rects){
return(1);
}
/**
\brief Get data from a U_PMR_SETTSGRAPHICS record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param vgatype Set: Palette is VGA basic colors; Clear: Palette is ???
\param pptype Set: Palette is present; Clear: Palette is absent.
\param AntiAliasMode SmoothingMode enumeration
\param TextRenderHint TextRenderingHint enumeration
\param CompositingMode CompositingMode enumeration
\param CompositingQuality CompositingQuality enumeration
\param RenderOriginX Origin X for halftoning and dithering
\param RenderOriginY Origin Y for halftoning and dithering
\param TextContrast Gamma correction, range 0 to 12
\param FilterType FilterType enumeraton
\param PixelOffset PixelOffsetMode enumeration
\param WorldToDevice world to device transform
\param Data Palette (optional)
EMF+ manual 2.3.8.2, Microsoft name: EmfPlusSetTSGraphics Record, Index 0x39
Caller must check Data for possible memory access violations.
*/
uint8_t *AntiAliasMode, uint8_t *TextRenderHint, uint8_t *CompositingMode, uint8_t *CompositingQuality,
const char **Data){
return(1);
}
/**
\brief Get data from a U_PMR_MULTIPLYWORLDTRANSFORM record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param xmtype Set: Post multiply; Clear: Pre multiply
\param Matrix Transformation matrix
EMF+ manual 2.3.9.1, Microsoft name: EmfPlusMultiplyWorldTransform Record, Index 0x2C
*/
int *xmtype,
return(1);
}
/**
\brief Get data from a U_PMR_RESETWORLDTRANSFORM record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
EMF+ manual 2.3.9.2, Microsoft name: EmfPlusResetWorldTransform Record, Index 0x2B
*/
}
/**
\brief Get data from a U_PMR_ROTATEWORLDTRANSFORM record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param xmtype Set: Post multiply; Clear: Pre multiply
\param Angle Rotation angle, in degrees
EMF+ manual 2.3.9.3, Microsoft name: EmfPlusRotateWorldTransform Record, Index 0x2F
*/
int *xmtype,
return(1);
}
/**
\brief Get data from a U_PMR_SCALEWORLDTRANSFORM record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param xmtype Set: Post multiply; Clear: Pre multiply.
\param Sx X scale factor.
\param Sy Y scale factor.
EMF+ manual 2.3.9.4, Microsoft name: EmfPlusScaleWorldTransform Record, Index 0x2E
*/
int *xmtype,
return(1);
}
/**
\brief Get data from a U_PMR_SETPAGETRANSFORM record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param PUenum Page Unit, UnitType enumeration
\param Scale Scale factor to convert page space to device space
EMF+ manual 2.3.9.5, Microsoft name: EmfPlusSetPageTransform Record, Index 0x30
*/
int *PUenum,
return(1);
}
/**
\brief Get data from a U_PMR_SETWORLDTRANSFORM record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param Matrix Transformation matrix
EMF+ manual 2.3.9.6, Microsoft name: EmfPlusSetWorldTransform Record, Index 0x2A
*/
return(1);
}
/**
\brief Get data from a U_PMR_TRANSLATEWORLDTRANSFORM record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header
\param xmtype Set: Post multiply; Clear: Pre multiply
\param Dx X offset
\param Dy Y offset
EMF+ manual 2.3.9.7, Microsoft name: EmfPlusTranslateWorldTransform Record, Index 0x2D
*/
int *xmtype,
return(1);
}
/**
\brief Get data from a U_PMR_STROKEFILLPATH record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
EMF+ manual mentioned in 2.1.1.1, not otherwise documented, Microsoft name: EmfPlusStrokeFillPath Record, Index 0x37
"This record closes any open figures in a path, strokes the outline of
the path by using the current pen, and fills its interior by using the current brush."
*/
}
/**
\brief Get data from a U_PMR_MULTIFORMATSTART record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
EMF+ manual mentioned in 2.1.1.1, reserved, not otherwise documented, Microsoft name: EmfPlusMultiFormatStart Record, Index 0x05
*/
}
/**
\brief Get data from a U_PMR_MULTIFORMATSECTION record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
EMF+ manual mentioned in 2.1.1.1, reserved, not otherwise documented, Microsoft name: EmfPlusMultiFormatSection Record, Index 0x06
*/
}
/**
\brief Get data from a U_PMR_MULTIFORMATEND record
\return 1 on success, 0 on error
\param contents Record from which to extract data
\param Header Common header (ignore flags)
EMF+ manual mentioned in 2.1.1.1, reserved, not otherwise documented, Microsoft name: EmfPlusMultiFormatEnd Record, Index 0x06
*/
}
#ifdef __cplusplus
}
#endif