upmf_print.c revision 8bda3b4c9722b7481a9ed97a4f5c946a5b6797ac
/**
@file upmf_print.c
@brief Functions for printing EMF records
*/
/*
File: upmf_print.c
Version: 0.0.8
Date: 26-JAN-2016
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2016 David Mathog and California Institute of Technology (Caltech)
*/
/* compiler options:
-DNOBRUSH causes brush objects to be treated as pen objects. PowerPoint 2003 and 2010 define pen objects
as brush objects, and this is one way to see their structure even though they are misidentified.
This option should only be used for tiny test files, consisting of just line objects.
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h> /* for offsetof() macro */
#include <string.h>
#include "upmf_print.h"
#include "uemf_print.h"
#include "uemf_safe.h"
//! \cond
#define UNUSED(x) (void)(x) //! Please ignore - Doxygen simply insisted on including this
/*
this function is not visible in the API. Print "data" for one of the many records that has none.
*/
int U_PMR_NODATAREC_print(const char *contents){
return(status);
}
/*
this function is not visible in the API. Common routine used by many functions that draw points.
*/
void U_PMF_VARPOINTS_print(const char **contents, int Flags, uint32_t Elements, const char *blimit){
unsigned int i;
else { printf(" + Points(Float):"); }
printf(" %d:",i);
}
#if 0
int residual;
#endif
printf("\n");
}
/*
this function is not visible in the API. Common routine used by many functions that draw points.
*/
unsigned int i;
printf(" + Points:");
printf(" %d:",i);
(void) U_PMF_POINTF_S_print(Points);
}
printf("\n");
}
/*
this function is not visible in the API. Common routine used by many functions that draw rectangles.
*/
if(!Elements)return(0);
else { printf(" Rects(Float):"); }
while(1){
Elements--;
if(!Elements)break;
printf(" ");
}
return(1);
}
/*
this function is not visible in the API. Common routine used by many functions.
*/
if(btype){
printf(" Color:");
(void) U_PMF_ARGB_print((char *)&(BrushID));
}
else {
}
return(1);
}
//! \endcond
/**
\brief Print any EMF+ record
\returns record length for a normal record, 0 for EMREOF or , -1 for a bad record
\param contents pointer to a buffer holding this EMF+ record
\param blimit one byte after this EMF+ record
\param recnum EMF number of this record in contents
\param off Offset from the beginning of the EMF+ file to the start of this record.
*/
int status;
int rstatus;
be split across multiple EMF Comment records */
/* Check that COMMON header data in record can be touched without an access violation. If it cannot be
this is either a corrupt EMF or one engineered to cause a buffer overflow. Pointer math
could wrap so check both sides of the range.
*/
int type = Header.Type & U_PMR_TYPE_MASK; /* strip the U_PMR_RECFLAG bit, leaving the indexable part */
/* Buggy EMF+ can set the continue bit and then do something else. In that case, force out the pending
Object. Side effect - clears the pending object. */
}
/* Check that the record size is OK, abort if not. */
switch(type){
U_OA_release(&ObjCont); break;
case (U_PMR_TRANSLATEWORLDTRANSFORM): rstatus = U_PMR_TRANSLATEWORLDTRANSFORM_print(contents); break;
}
return(status);
}
/**
\brief Print data from a U_PMF_CMN_HDR object
\return number of bytes in record, 0 on error
\param contents pointer to a buffer holding this EMF+ record
\param Header Header of the record
\param precnum EMF+ record number in file.
\param off Offset in file to the start of this EMF+ record.
common structure present at the beginning of all(*) EMF+ records
*/
printf(" %-29srec+:%5d type:%X offset:%8d rsize:%8u dsize:%8u flags:%4.4X crc32:%8.8X\n",
U_pmr_names(Header.Type &U_PMR_TYPE_MASK),precnum, Header.Type,off,Header.Size,Header.DataSize,Header.Flags,
}
/**
\brief Print data from a an array of uint8_t values
\return 1
\param Start Text to lead array data
\param Array uint8_t array of data passed as char *
\param Elements Number of elements in Array
\param End Text to follow array data
*/
return(1);
}
/**
\brief Print value of an BrushType Enumeration
\returns record 1 on sucess, 0 on error
\param otype Value to print.
EMF+ manual 2.1.1.3, Microsoft name: BrushType Enumeration
*/
int U_PMF_BRUSHTYPEENUMERATION_print(int otype){
int status=1;
switch(otype){
}
return(status);
}
/**
\brief Print value of an BrushType Enumeration
\returns record 1 on sucess, 0 on error
\param otype Value to print.
EMF+ manual 2.1.1.4, Microsoft name: BrushType Enumeration
*/
int U_PMF_COMBINEMODEENUMERATION_print(int otype){
int status=1;
switch(otype){
}
return(status);
}
/**
\brief Print value of a HatchStyle Enumeration
\returns record 1 on sucess, 0 on error
\param hstype Value to print.
EMF+ manual 2.1.1.13, Microsoft name: HatchStyle Enumeration
*/
int U_PMF_HATCHSTYLEENUMERATION_print(int hstype){
int status=1;
switch(hstype){
}
return(status);
}
/**
\brief Print value of an ObjectType Enumeration
\returns record 1 on sucess, 0 on error
\param otype Value to print.
EMF+ manual 2.1.1.22, Microsoft name: ObjectType Enumeration
*/
int U_PMF_OBJECTTYPEENUMERATION_print(int otype){
int status=1;
switch(otype){
default:
}
return(status);
}
/**
\brief Print value of a U_PMF_PATHPOINTTYPE_ENUM object
\return 1
\param Type Value to print
EMF+ manual 2.1.1.23, Microsoft name: PathPointType Enumeration
*/
int U_PMF_PATHPOINTTYPE_ENUM_print(int Type){
switch(Type & U_PPT_MASK){
}
return(1);
}
/**
\brief Print data from a PixelFormat Enumeration value
\return 1 always
\param pfe A PixelFormat Enumeration value
EMF+ manual 2.1.1.25, Microsoft name: PixelFormat Enumeration (U_PF_*)
*/
int U_PMF_PX_FMT_ENUM_print(int pfe){
printf(" + PxFmtEnum: ");
switch(idx){
case 0: printf("undefined"); break;
}
printf(")");
return(1);
}
/**
\brief Print as text a RegionNodeDataType Enumeration
\return 1
\param Type RegionNodeDataType Enumeration
EMF+ manual 2.1.1.27, Microsoft name: RegionNodeDataType Enumeration (U_RNDT_*)
*/
int U_PMF_NODETYPE_print(int Type){
else { printf("Undefined" ); return(0); }
return(1);
}
/**
\brief Print data from a U_PMF_BRUSH object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.1.1, Microsoft name: EmfPlusBrush Object
*/
const char *Data;
if(status){
printf(" + Brush:");
(void) U_PMF_GRAPHICSVERSION_memsafe_print((char *)&Version);;
(void) U_PMF_BRUSHTYPEENUMERATION_print(Type);
printf(")");
switch(Type){
case U_BT_SolidColor:
break;
case U_BT_HatchFill:
printf("\n");
break;
case U_BT_TextureFill:
printf("\n");
break;
case U_BT_PathGradient:
printf("\n");
break;
case U_BT_LinearGradient:
printf("\n");
break;
default:
status = 0;
}
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_CUSTOMLINECAP object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param Which A string which is either "Start" or "End".
\param blimit one byte past the end of data
EMF+ manual 2.2.1.2, Microsoft name: EmfPlusCustomLineCap Object
*/
const char *Data;
if(status){
(void) U_PMF_GRAPHICSVERSION_memsafe_print((char *)&Version);;
switch(Type){
case U_CLCDT_Default:
break;
case U_CLCDT_AdjustableArrow:
break;
default:
status = 0;
}
}
return(status);
}
/**
\brief Print data from a U_PMF_FONT object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.1.3, Microsoft name: EmfPlusFont Object
*/
const char *Data;
char *string;
int status = U_PMF_FONT_get(contents, &Version, &EmSize, &SizeUnit, &FSFlags, &Length, &Data, blimit);
if(status){
printf(" + Font:");
(void) U_PMF_GRAPHICSVERSION_memsafe_print((char *)&Version);;
if(string){
}
else {
printf(" Family:<>\n");
}
}
return(status);
}
/**
\brief Print data from a U_PMF_IMAGE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.1.4, Microsoft name: EmfPlusImage Object
*/
const char *Data;
if(status){
printf(" + Image:");
(void) U_PMF_GRAPHICSVERSION_memsafe_print((char *)&Version);;
switch(Type){
case U_IDT_Unknown:
printf(" + Unknown Image Type\n");
break;
case U_IDT_Bitmap:
break;
case U_IDT_Metafile:
break;
default:
status = 0;
}
}
return(status);
}
/**
\brief Print data from a U_PMF_IMAGEATTRIBUTES object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.1.5, Microsoft name: EmfPlusImageAttributes Object
*/
int status = U_PMF_IMAGEATTRIBUTES_get(contents, &Version, &WrapMode, &ClampColor, &ObjectClamp, blimit);
if(status){
printf(" + Image Attributes: ");
(void) U_PMF_GRAPHICSVERSION_memsafe_print((char *)&Version);;
}
return(status);
}
/**
\brief Print data from a U_PMF_PATH object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.1.6, Microsoft name: EmfPlusPath Object
*/
unsigned int i, pos;
const char *Points;
const char *Types;
if(status){
/* Points part */
/* Types part */
printf(" + Types:");
pos = 0;
for(i=0; i<Count; i++){
/* EMF+ manual says that the first of these two cases can actually contain either type
of PATHPOINT, but it does not say how the program is supposed to figure out which record
is which type. */
Types+=2;
}
else {
printf(" %d:",i);
Types++;
}
}
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_PEN object
\return 1 on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.2.1.7, Microsoft name: EmfPlusPen Object
*/
const char *PenData;
const char *Brush;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_REGION object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.1.8, Microsoft name: EmfPlusRegion Object
*/
const char *Nodes;
if(status){
printf(" + ");
(void) U_PMF_GRAPHICSVERSION_memsafe_print((char *)&Version);;
}
return(status);
}
/**
\brief Print data from a U_PMF_STRINGFORMAT object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.1.9, Microsoft name: EmfPlusStringFormat Object
*/
const char *Data;
if(status){
printf(" + StringFormat: ");
}
return(status);
}
/**
\brief Print data from a U_PMF_ARGB object
\return 1 on success, 0 on error
\param contents Record from which to print data
Does not accept a blimit value.
EMF+ manual 2.2.2.1, Microsoft name: EmfPlusARGB Object
*/
int U_PMF_ARGB_print(const char *contents){
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_BITMAP object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.2, Microsoft name: EmfPlusBitmap Object
*/
const char *Data;
if(status){
case 0: printf(" Type:MSBitmap\n"); break;
}
/* Pixel data is never shown - it could easily swamp the output for even a smallish picture */
}
return(status);
}
/**
\brief Print data from a U_PMF_BITMAPDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.3, Microsoft name: EmfPlusBitmapData Object
*/
unsigned int i;
const char *Colors;
const char *Data;
if(status){
status = 0;
(void) U_PMF_ARGB_print(Colors);
}
}
return(status);
}
/**
\brief Print data from a U_PMF_BLENDCOLORS object
\return size in bytes on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.4, Microsoft name: EmfPlusBlendColors Object
*/
unsigned int i;
const char *Colors;
if(status){
for(i=0; i<Elements; i++){
(void) U_PMF_ARGB_print(Colors);
Colors += sizeof(U_PMF_ARGB);
printf(")");
}
}
return(status);
}
/**
\brief Print data from a U_PMF_BLENDFACTORS object
\return size on success, 0 on error
\param type Type of BlendFactors, usually H or V
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.5, Microsoft name: EmfPlusBlendFactors Object
*/
unsigned int i;
if(status){
for(i=0; i<Elements; i++){
}
}
return(status);
}
/**
\brief Print data from a U_PMF_BOUNDARYPATHDATA object
\return size on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.6, Microsoft name: EmfPlusBoundaryPathData Object
*/
const char *Data;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_BOUNDARYPOINTDATA object
\return size on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.7, Microsoft name: EmfPlusBoundaryPointData Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_CHARACTERRANGE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.8, Microsoft name: EmfPlusCharacterRange Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_DASHEDLINEDATA object
\return 1 on success, 0 on error
\param blimit one byte past the end of data
\param contents Record from which to print data
EMF+ manual 2.2.2.9, Microsoft name: EmfPlusCompoundLineData Object
*/
if(status){
Elements--;
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_COMPRESSEDIMAGE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
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().
*/
const char *Data;
if(status){
printf("CompressedImage:\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_CUSTOMENDCAPDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.11, Microsoft name: EmfPlusCustomEndCapData Object
*/
const char *Data;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_CUSTOMLINECAPARROWDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.12, Microsoft name: EmfPlusCustomLineCapArrowData Object
*/
if(status){
printf("CustomLineCapArrowData: ");
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_CUSTOMLINECAPDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.13, Microsoft name: EmfPlusCustomLineCapData Object
*/
const char *Data;
if(status){
printf(" + CustomLineCapData: ");
/* preceding line always emits an EOL */
}
return(status);
}
/**
\brief Print data from a U_PMF_CUSTOMLINECAPOPTIONALDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param Flags CustomLineCapData Flags
\param blimit one byte past the end of data
EMF+ manual 2.2.2.14, Microsoft name: EmfPlusCustomLineCapOptionalData Object
*/
int U_PMF_CUSTOMLINECAPOPTIONALDATA_print(const char *contents, uint32_t Flags, const char *blimit){
const char *FillData;
const char *LineData;
if(status){ /* True even if there is nothing in it! */
printf(" + CustomLineCapOptionalData:");
}
else {
printf("None");
}
}
return(status);
}
/**
\brief Print data from a U_PMF_CUSTOMSTARTCAPDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.15, Microsoft name: EmfPlusCustomStartCapData Object
*/
const char *Data;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_DASHEDLINEDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.16, Microsoft name: EmfPlusDashedLineData Object
*/
if(status){
Elements--;
}
return(status);
}
/**
\brief Print data from a U_PMF_FILLPATHOBJ object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.17, Microsoft name: EmfPlusFillPath Object
*/
const char *Data;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_FOCUSSCALEDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.18, Microsoft name: EmfPlusFocusScaleData Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_GRAPHICSVERSION object already known to be memory safe
\return 1 on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.2.2.19, Microsoft name: EmfPlusGraphicsVersion Object
In this module the only time a U_PMF_GRAPHICSVERSION is printed is after it
has already been copied into a safe memory structure. This routine fakes up
a blimit for the general routine.
*/
int U_PMF_GRAPHICSVERSION_memsafe_print(const char *contents){
}
/**
\brief Print data from a U_PMF_GRAPHICSVERSION object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.19, Microsoft name: EmfPlusGraphicsVersion Object
*/
int Signature,GrfVersion;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_HATCHBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit One byte past the last record in memory.
EMF+ manual 2.2.2.20, Microsoft name: EmfPlusHatchBrushData Object
*/
if(status){
printf(") FG:{");
(void) U_PMF_ARGB_print((char *)&Foreground);
printf("} BG:{");
(void) U_PMF_ARGB_print((char *)&Background);
printf("}");
}
return(status);
}
/**
\brief Print data from a U_PMF_LANGUAGEIDENTIFIER object
\return 1 on success, 0 on error
\param LId Record from which to print data
EMF+ manual 2.2.2.23, Microsoft name: EmfPlusLanguageIdentifier Object
*/
if(status){ /* do it the hard way just to verify that the preceding call works, OK to just print LId directly */
}
return(status);
}
/**
\brief Print data from a U_PMF_LINEARGRADIENTBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit One byte past the last record in memory.
EMF+ manual 2.2.2.24, Microsoft name: EmfPlusLinearGradientBrushData Object
*/
const char *Data;
if(status){
printf(" StartColor:");
printf(" EndColor:");
/* Technically these are to be ignored, in practice they must be colors with the same value as the preceding 2*/
printf(" Reserved1:");
printf(" Reserved2:");
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param BDFlag Describes optional values in contents
\param blimit One byte past the last record in memory.
EMF+ manual 2.2.2.25, Microsoft name: EmfPlusLinearGradientBrushOptionalData Object
*/
int U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA_print(const char *contents, int BDFlag, const char *blimit){
const char *Bc;
const char *BfH;
const char *BfV;
int None=1;
printf(" + LinearGradientBrushOptionalData: ");
int status = U_PMF_LINEARGRADIENTBRUSHOPTIONALDATA_get(contents, BDFlag, &Tm, &Bc, &BfH, &BfV, blimit);
if(status){
if(BDFlag & U_BD_Transform){
None=0;
}
if(Bc){
printf("\n");
None=0;
}
if(BfH){
printf("\n");
None=0;
}
if(BfV){
printf("\n");
None=0;
}
if(None){
printf("(none)");
}
}
return(status);
}
/**
\brief Print data from a U_PMF_LINEPATH object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.26, Microsoft name: EmfPlusLinePath Object
*/
const char *Data;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_METAFILE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.27, Microsoft name: EmfPlusMetafile Object
*/
const char *Data;
if(status){
/* embedded metafiles are not handled beyond this*/
}
return(status);
}
/**
\brief Print data from a U_PMF_PALETTE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.28, Microsoft name: EmfPlusPalette Object
*/
unsigned int i;
const char *Data;
if(status){
for(i=0; i<Elements; i++){
(void) U_PMF_ARGB_print(Data);
Data += sizeof(U_PMF_ARGB);
}
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_PATHGRADIENTBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.29, Microsoft name: EmfPlusPathGradientBrushData Object
*/
const char *Gradient;
const char *Boundary;
unsigned int i;
if(status){
printf(" Center:");
printf(" + SurroundingColor: ");
(void) U_PMF_ARGB_print(Gradient);
}
printf("\n");
}
}
else {
}
}
return(status);
}
/**
\brief Print data from a U_PMF_PATHGRADIENTBRUSHOPTIONALDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param BDFlag Describes optional values in contents
\param blimit one byte past the end of data
EMF+ manual 2.2.2.30, Microsoft name: EmfPlusPathGradientBrushOptionalData Object
*/
int U_PMF_PATHGRADIENTBRUSHOPTIONALDATA_print(const char *contents, int BDFlag, const char *blimit){
printf(" + PathGradientBrushOptionalData: ");
}
if(BDFlag & U_BD_Transform){
contents += sizeof(U_PMF_TRANSFORMMATRIX);
}
}
}
if(BDFlag & U_BD_FocusScales){
}
return(1);
}
/**
\brief Print data from a U_PMF_PATHPOINTTYPE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.31, Microsoft name: EmfPlusPathPointType Object
*/
if(status){
(void) U_PMF_PATHPOINTTYPE_ENUM_print(Type);
printf("}");
}
return(status);
}
/**
\brief Print data from a U_PMF_PATHPOINTTYPERLE object
\return Number of elements in the run, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.32, Microsoft name: EmfPlusPathPointTypeRLE Object
*/
if(status){
(void) U_PMF_PATHPOINTTYPE_ENUM_print(Type);
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_PATHPOINTTYPERLE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.33, Microsoft name: EmfPlusPenData Object
*/
const char *Data;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_PENOPTIONALDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
\param Flags PenData Flags that determine which optionaldata fields are present in the record.
EMF+ manual 2.2.2.34, Microsoft name: EmfPlusPenOptionalData Object
*/
const char *DLData;
const char *CmpndLineData;
const char *CSCapData;
const char *CECapData;
int status = U_PMF_PENOPTIONALDATA_get(
Flags, // determines which fields are filled
&Matrix,
&StartCap,
&EndCap,
&Join,
&Style,
&DLCap,
&DLOffset,
&DLData,
blimit);
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_POINT object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.35, Microsoft name: EmfPlusPoint Object
*/
U_FLOAT X, Y;
if(status){
printf("{%f,%f}", X, Y);
}
return(status);
}
/**
\brief Print data from a U_PMF_POINT Structure
\return 1 on success, 0 on error
\param Point U_PMF_POINT Structure to print
EMF+ manual 2.2.2.35, Microsoft name: EmfPlusPoint Object
*/
if(!Point){ return(0); }
return(1);
}
/**
\brief Print data from a U_PMF_POINTF object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.36, Microsoft name: EmfPlusPointF Object
*/
U_FLOAT X, Y;
if(status){
printf("{%f,%f}", X, Y);
}
return(status);
}
/**
\brief Print data from a U_PMF_POINTF Structure
\return 1 on success, 0 on error
\param Point U_PMF_POINTF Structure to print
EMF+ manual 2.2.2.36, Microsoft name: EmfPlusPointF Object
*/
if(!Point){ return(0); }
return(1);
}
/**
\brief Print data from a U_PMF_POINTR object
\return bytes traversed on success, 0 on error
\param contents Pointer to next data to print
\param Xpos X coordinate for current point
\param Ypos Y coordinate for current point
\param blimit one byte past the end of data
On each call the next relative offset is extracted, the current
coordinates are modified with that offset, and the pointer is
advanced to the next data point.
EMF+ manual 2.2.2.37, Microsoft name: EmfPlusPointR Object
*/
U_FLOAT X, Y;
*Xpos += X;
*Ypos += Y;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_RECT object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.38, Microsoft name: EmfPlusRect Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_RECT Structure
\return 1 on success, 0 on error
\param Rect U_PMF_RECT structure
EMF+ manual 2.2.2.39, Microsoft name: EmfPlusRectF Object
*/
return(1);
}
/**
\brief Print data from a U_PMF_RECTF object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.39, Microsoft name: EmfPlusRectF Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_RECTF Structure
\return 1 on success, 0 on error
\param Rect U_PMF_RECTF Structure
EMF+ manual 2.2.2.39, Microsoft name: EmfPlusRectF Object
*/
return(1);
}
/**
\brief Print data from a U_PMF_REGIONNODE object
\return size on success, 0 on error
\param contents Record from which to print data
\param Level Tree level. This routine is recursive and could go down many levels. 1 is the top, >1 are child nodes.
\param blimit one byte past the end of data
EMF+ manual 2.2.2.40, Microsoft name: EmfPlusRegionNode Object
*/
const char *Data;
if(status){
printf(")");
}
else if(Type == U_RNDT_Rect){
len += sizeof(U_PMF_RECTF);
printf("\n");
}
else if(Type == U_RNDT_Path){
}
/* U_RNDT_Empty and U_RNDT_Infinite do not change the length */
}
printf("\n");
return(status);
}
/**
\brief Print data from a U_PMF_REGIONNODECHILDNODES object
\return size on success, 0 on error
\param contents Record from which to print data
\param Level Tree level. This routine is recursive and could go down many levels. 1 is the top, >1 are child nodes.
\param blimit one byte past the end of data
EMF+ manual 2.2.2.41, Microsoft name: EmfPlusRegionNodeChildNodes Object
*/
printf(" RegionNodeChildNodes:\n");
if(size){
}
return(size);
}
/**
\brief Print data from a U_PMF_REGIONNODEPATH object
\return Size of data on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.42, Microsoft name: EmfPlusRegionNodePath Object
*/
const char *Data;
if(status){
printf(" RegionNodePath: \n");
}
return(status);
}
/**
\brief Print data from a U_PMF_SOLIDBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.43, Microsoft name: EmfPlusSolidBrushData Object
*/
if(status){
printf(" SolidBrushData: ");
(void) U_PMF_ARGB_print((char *) &Color);
}
return(status);
}
/**
\brief Print data from a U_PMF_STRINGFORMATDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param TabStopCount Entries in TabStop array
\param RangeCount Entries in CharRange array
\param blimit one byte past the end of data
EMF+ manual 2.2.2.44, Microsoft name: EmfPlusStringFormatData Object
*/
int U_PMF_STRINGFORMATDATA_print(const char *contents, uint32_t TabStopCount, uint32_t RangeCount, const char *blimit){
const U_PMF_CHARACTERRANGE *CharRange;
int status = U_PMF_STRINGFORMATDATA_get(contents, TabStopCount, RangeCount, &TabStops, &CharRange, blimit);
if(status){
printf(" Tabstops:");
printf("\n");
printf(" CharRange:");
for(; RangeCount; RangeCount--,CharRange++){ printf(" {%d,%d}",CharRange->First,CharRange->Length); }
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_TEXTUREBRUSHDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.45, Microsoft name: EmfPlusTextureBrushData Object
*/
const char *Data;
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_TEXTUREBRUSHOPTIONALDATA object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param HasMatrix True if the record contains a matrix.
\param HasImage True if the record contains an image.
\param blimit one byte past the end of data
EMF+ manual 2.2.2.46, Microsoft name: EmfPlusTextureBrushOptionalData Object
*/
int U_PMF_TEXTUREBRUSHOPTIONALDATA_print(const char *contents, int HasMatrix, int HasImage, const char *blimit){
const char *Image;
if(status){
(void) U_PMF_TRANSFORMMATRIX2_print(&Matrix);
}
return(status);
}
/**
\brief Print data from a U_PMF_TRANSFORMMATRIX object stored in file byte order.
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.2.47, Microsoft name: EmfPlusTransformMatrix Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_TRANSFORMMATRIX structure
\return 1 on success, 0 on error
\param Tm U_PMF_TRANSFORMMATRIX structure
EMF+ manual 2.2.2.47, Microsoft name: EmfPlusTransformMatrix Object
*/
if(Tm){
}
else {
printf(" Matrix:(None)");
}
return(1);
}
/**
\brief Print data from a U_PMF_ROTMATRIX object
\return 1 on success, 0 on error
\param Rm U_PMF_ROTMATRIX object
NOT DOCUMENTED, like EMF+ manual 2.2.2.47, Microsoft name: EmfPlusTransformMatrix Object, but missing offset values
*/
return(1);
}
/**
\brief Print data from a U_PMF_IE_BLUR object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.1, Microsoft name: BlurEffect Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_BRIGHTNESSCONTRAST object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.2, Microsoft name: BrightnessContrastEffect Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_COLORBALANCE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.3, Microsoft name: ColorBalanceEffect Object
*/
if(status){
printf("ColorBalanceEffect CyanRed:%d MagentaGreen:%d YellowBlue:%d\n", CyanRed, MagentaGreen, YellowBlue);
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_COLORCURVE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.4, Microsoft name: ColorCurveEffect Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_COLORLOOKUPTABLE object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.5, Microsoft name: ColorLookupTableEffect Object
*/
if(status){
printf("ColorLookupTableEffect \n");
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_COLORMATRIX object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.6, Microsoft name: ColorMatrixEffect Object
*/
int i,j;
if(status){
printf("ColorMatrixEffect\n");
for(i=0;i<5;i++){
printf(" {");
}
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_HUESATURATIONLIGHTNESS object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.7, Microsoft name: HueSaturationLightnessEffect Object
*/
if(status){
printf("HueSaturationLightnessEffect Hue:%d Saturation:%d Lightness:%d\n", Hue, Saturation, Lightness);
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_LEVELS object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.8, Microsoft name: LevelsEffect Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_REDEYECORRECTION object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.9, Microsoft name: RedEyeCorrectionEffect Object
*/
if(status){
printf(" ");
rectl_print(*Rects);
}
printf("\n");
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_SHARPEN object
\return 1 on success, 0 on error
\param blimit one byte past the end of data
\param contents Record from which to print data
EMF+ manual 2.2.3.10, Microsoft name: SharpenEffect Object
*/
if(status){
}
return(status);
}
/**
\brief Print data from a U_PMF_IE_TINT object
\return 1 on success, 0 on error
\param contents Record from which to print data
\param blimit one byte past the end of data
EMF+ manual 2.2.3.11, Microsoft name: TintEffect Object
*/
if(status){
}
return(status);
}
/* ***************************************************************************************** */
/* EMF+ records, the EMF+ record header is printed separately, these print the contents only */
/* ***************************************************************************************** */
/**
\brief Print data from a U_PMR_OFFSETCLIP record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.1.1, Microsoft name: EmfPlusOffsetClip Record, Index 0x35
*/
int U_PMR_OFFSETCLIP_print(const char *contents){
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_OFFSETCLIP record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.1.2, Microsoft name: EmfPlusResetClip Record, Index 0x31
*/
int U_PMR_RESETCLIP_print(const char *contents){
return(U_PMR_NODATAREC_print(contents));
}
/**
\brief Print data from a U_PMR_SETCLIPPATH record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.1.3, Microsoft name: EmfPlusSetClipPath Record, Index 0x33
*/
int U_PMR_SETCLIPPATH_print(const char *contents){
int CMenum;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETCLIPRECT record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.1.4, Microsoft name: EmfPlusSetClipRect Record, Index 0x32
*/
int U_PMR_SETCLIPRECT_print(const char *contents){
int CMenum;
if(status){
printf(") Rect:");
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETCLIPREGION record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.1.5, Microsoft name: EmfPlusSetClipRegion Record, Index 0x34
*/
int U_PMR_SETCLIPREGION_print(const char *contents){
int CMenum;
if(status){
printf(")\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_COMMENT record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.2.1, Microsoft name: EmfPlusComment Record, Index 0x03
*/
int U_PMR_COMMENT_print(const char *contents){
const char *Data;
unsigned int i=0;
if(status){
printf(" corrupt record\n");
return(0);
}
/* try to print it, but only ASCII, bail on anything that is not ASCII */
printf(" + Data:");
if(!*Data)break;
else { break; }
}
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_ENDOFFILE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.3.1, Microsoft name: EmfPlusEndOfFile Record, Index 0x02
*/
int U_PMR_ENDOFFILE_print(const char *contents){
return(U_PMR_NODATAREC_print(contents));
}
/**
\brief Print data from a U_PMR_ENDOFFILE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.3.2, Microsoft name: EmfPlusGetDC Record, Index 0x04
*/
int U_PMR_GETDC_print(const char *contents){
return(U_PMR_NODATAREC_print(contents));
}
/**
\brief Print data from a U_PMR_HEADER record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.3.3, Microsoft name: EmfPlusHeader Record, Index 0x01
*/
int U_PMR_HEADER_print(const char *contents){
int status = U_PMR_HEADER_get(contents, NULL, &Version, &IsDual, &IsVideo, &LogicalDpiX, &LogicalDpiY);
if(status){
/* try to print it, but only ASCII, bail on anything that is not ASCII */
printf(" + ");
(void) U_PMF_GRAPHICSVERSION_memsafe_print((char *)&Version);;
printf(" IsDual:%c IsVideo:%d LogicalDpiX,y:{%u,%u}\n",(IsDual ? 'Y' : 'N'),IsVideo,LogicalDpiX, LogicalDpiY);
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_CLEAR record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.1, Microsoft name: EmfPlusClear Record, Index 0x09
*/
int U_PMR_CLEAR_print(const char *contents){
if(status){
/* try to print it, but only ASCII, bail on anything that is not ASCII */
printf(" + Color:");
(void) U_PMF_ARGB_print((char *) &Color);
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWARC record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.2, Microsoft name: EmfPlusDrawArc Record, Index 0x12
*/
int U_PMR_DRAWARC_print(const char *contents){
int ctype;
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWBEZIERS record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.3, Microsoft name: EmfPlusDrawBeziers Record, Index 0x19
*/
int U_PMR_DRAWBEZIERS_print(const char *contents){
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWCLOSEDCURVE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
Curve is a cardinal spline.
References sent by MS support:
http://msdn.microsoft.com/en-us/library/4cf6we5y(v=vs.110).aspx
EMF+ manual 2.3.4.4, Microsoft name: EmfPlusDrawClosedCurve Record, Index 0x17
*/
int U_PMR_DRAWCLOSEDCURVE_print(const char *contents){
int status = U_PMR_DRAWCLOSEDCURVE_get(contents, NULL, &PenID, &ctype, &RelAbs, &Tension, &Elements, &Points);
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWCURVE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
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
EMF+ manual 2.3.4.5, Microsoft name: EmfPlusDrawCurve Record, Index 0x18
*/
int U_PMR_DRAWCURVE_print(const char *contents){
int ctype;
int status = U_PMR_DRAWCURVE_get(contents, NULL, &PenID, &ctype, &Tension, &Offset, &NSegs, &Elements, &Points);
if(status){
printf(" + PenID:%u ctype:%d Tension:%f Offset:%u NSegs:%u Elements:%u\n", PenID, ctype, Tension, Offset, NSegs, Elements);
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWDRIVERSTRING record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.6, Microsoft name: EmfPlusDrawDriverString Record, Index 0x36
*/
int U_PMR_DRAWDRIVERSTRING_print(const char *contents){
unsigned int i;
int btype;
if(status){
printf(" + FontID:%u btype:%d BrushID:%u DSOFlags:%X Elements:%u\n", FontID,btype, BrushID, DSOFlags, Elements);
printf(" + Glyphs:");
if(*Glyphs){
}
else {
printf("(none)");
}
printf("\n");
printf(" + Positions:\n");
if(Points){
}
else {
printf("(none)\n");
}
if(Matrix){
printf(" + ");
printf("\n");
}
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWELLIPSE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.7, Microsoft name: EmfPlusDrawEllipse Record, Index 0x0F
*/
int U_PMR_DRAWELLIPSE_print(const char *contents){
int ctype;
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWIMAGE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.8, Microsoft name: EmfPlusDrawImage Record, Index 0x1A
*/
int U_PMR_DRAWIMAGE_print(const char *contents){
int ctype;
int status = U_PMR_DRAWIMAGE_get(contents, NULL, &ImgID, &ctype, &ImgAttrID, &SrcUnit, &SrcRect, &DstRect);
if(status){
(void) U_PMF_RECTF_S_print(&SrcRect);
printf(" DstRect:");
(void) U_PMF_RECTF_S_print(&DstRect);
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWIMAGEPOINTS record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.9, Microsoft name: EmfPlusDrawImagePoints Record, Index 0x1B
*/
int U_PMR_DRAWIMAGEPOINTS_print(const char *contents){
if(status){
printf(" + ImgID:%u ctype:%d etype:%d ImgAttrID:%u SrcUnit:%d Elements:%u SrcRect:",
(void) U_PMF_RECTF_S_print(&SrcRect);
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWLINES record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.10, Microsoft name: EmfPlusDrawLines Record, Index 0x0D
*/
int U_PMR_DRAWLINES_print(const char *contents){
int status = U_PMR_DRAWLINES_get(contents, NULL, &PenIdx, &ctype, &dtype, &RelAbs, &Elements, &Points);
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWPATH record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.11, Microsoft name: EmfPlusDrawPath Record, Index 0x15
*/
int U_PMR_DRAWPATH_print(const char *contents){
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWPIE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.12, Microsoft name: EmfPlusDrawPie Record, Index 0x0D
*/
int U_PMR_DRAWPIE_print(const char *contents){
int ctype;
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWRECTS record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.13, Microsoft name: EmfPlusDrawRects Record, Index 0x0B
*/
int U_PMR_DRAWRECTS_print(const char *contents){
int ctype;
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_DRAWSTRING record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.14, Microsoft name: EmfPlusDrawString Record, Index 0x1C
*/
int U_PMR_DRAWSTRING_print(const char *contents){
int btype;
if(status){
(void) U_PMF_RECTF_S_print(&Rect);
if(String16){
if(String8){
}
}
else {
printf(" String(as_UTF8):(none)\n");
}
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_FILLCLOSEDCURVE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.15, Microsoft name: EmfPlusFillClosedCurve Record, Index 0x16
*/
int U_PMR_FILLCLOSEDCURVE_print(const char *contents){
if(status){
printf(" + btype:%d ctype:%d ftype:%d RelAbs:%d Elements:%u",
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_FILLELLIPSE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.16, Microsoft name: EmfPlusFillEllipse Record, Index 0x0E
*/
int U_PMR_FILLELLIPSE_print(const char *contents){
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_FILLPATH record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.17, Microsoft name: EmfPlusFillPath Record, Index 0x14
*/
int U_PMR_FILLPATH_print(const char *contents){
int btype;
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_FILLPIE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.18, Microsoft name: EmfPlusFillPie Record, Index 0x10
*/
int U_PMR_FILLPIE_print(const char *contents){
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_FILLPOLYGON record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.19, Microsoft name: EmfPlusFillPolygon Record, Index 0x0C
*/
int U_PMR_FILLPOLYGON_print(const char *contents){
int status = U_PMR_FILLPOLYGON_get(contents, NULL, &btype, &ctype, &RelAbs, &BrushID, &Elements, &Points);
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_FILLRECTS record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.20, Microsoft name: EmfPlusFillRects Record, Index 0x0A
*/
int U_PMR_FILLRECTS_print(const char *contents){
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_FILLREGION record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.4.21, Microsoft name: EmfPlusFillRegion Record, Index 0x13
*/
int U_PMR_FILLREGION_print(const char *contents){
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_OBJECT record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
\param blimit One byte past the last record in memory.
\param ObjCont Structure that holds accumulated object.
\param term Flag used when an abnormal termination of a series of continuation records is encountered.
EMF+ manual 2.3.5.1, Microsoft name: EmfPlusObject Record, Index 0x13
This is the ONLY EMF+ record type which needs an explicit blimit passed in. Since it glues
together multiple records, and calls itself recursively, the initial caller cannot determine
that all of the sizes will be OK from the first record's header.
*/
const char *Data;
//int k; const char *cptr; for(cptr=contents, k=0; k<608;k++,cptr++){ printf("%3.3d %2.2X\n",k,*(uint8_t*)cptr); }; fflush(stdout);
/* Continued records are a pain. Each contains the total size of the continued object in the first 4 bytes
of data. When the total hits that then then the record is complete, even though the continuation bit will
still be set on that last record. Check for this and then print the terminated continued series.
*/
if(term){ /* mode for handling unexpected end of accumulated object */
printf(" + START Forced Termination of Accumulating object Bytes:%u ObjID:%u DeclaredType:%d(",
printf(")\n");
status = 1;
}
else {
/* In a corrupt EMF+ file we might hit a new type of record before all the continuation records
expected have been found. If that happens terminate whatever we have accumulated so far, and then go on
to emit the new (unexpected) record. */
if(!status){
printf(" corrupt record\n");
return(status);
}
}
if(ntype){
U_OA_append(ObjCont, Data, Header.DataSize - 4, otype, ObjID); // The total byte count is not added to the object
}
else {
U_OA_append(ObjCont, Data, Header.DataSize, otype, ObjID); // The total byte count is not added to the object
}
printf("\n");
/* preceding terminates any continued series for >= accumulated bytes */
}
if(status){
switch(ttype){
case U_OT_Invalid:
default:
printf("INVALID OBJECT TYPE!!!!\n");
break;
}
}
return(status);
}
/**
\brief Print data from a U_PMR_SERIALIZABLEOBJECT record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.5.2, Microsoft name: EmfPlusSerializableObject Record, Index 0x38
*/
int U_PMR_SERIALIZABLEOBJECT_print(const char *contents){
const char *Data;
int iee;
if(status){
if(string){
printf("\n + Effect:");
switch(iee){
case U_IEE_BrightnessContrastEffectGuid: U_PMF_IE_BRIGHTNESSCONTRAST_print(Data, Data + sizeof(U_PMF_IE_BRIGHTNESSCONTRAST)); break;
case U_IEE_ColorBalanceEffectGuid: U_PMF_IE_COLORBALANCE_print(Data, Data + sizeof(U_PMF_IE_COLORBALANCE)); break;
case U_IEE_ColorCurveEffectGuid: U_PMF_IE_COLORCURVE_print(Data, Data + sizeof(U_PMF_IE_COLORCURVE)); break;
case U_IEE_ColorLookupTableEffectGuid: U_PMF_IE_COLORLOOKUPTABLE_print(Data, Data + sizeof(U_PMF_IE_COLORLOOKUPTABLE)); break;
case U_IEE_ColorMatrixEffectGuid: U_PMF_IE_COLORMATRIX_print(Data, Data + sizeof(U_PMF_IE_COLORMATRIX)); break;
case U_IEE_HueSaturationLightnessEffectGuid: U_PMF_IE_HUESATURATIONLIGHTNESS_print(Data, Data + sizeof(U_PMF_IE_HUESATURATIONLIGHTNESS)); break;
case U_IEE_RedEyeCorrectionEffectGuid: U_PMF_IE_REDEYECORRECTION_print(Data, Data + sizeof(U_PMF_IE_REDEYECORRECTION)); break;
}
}
else {
}
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETANTIALIASMODE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.6.1, Microsoft name: EmfPlusSetAntiAliasMode Record, Index 0x1E
*/
int U_PMR_SETANTIALIASMODE_print(const char *contents){
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETCOMPOSITINGMODE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.6.2, Microsoft name: EmfPlusSetCompositingMode Record, Index 0x23
*/
int U_PMR_SETCOMPOSITINGMODE_print(const char *contents){
int CMenum;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETCOMPOSITINGQUALITY record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.6.3, Microsoft name: EmfPlusSetCompositingQuality Record, Index 0x24
*/
int U_PMR_SETCOMPOSITINGQUALITY_print(const char *contents){
int CQenum;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETINTERPOLATIONMODE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.6.4, Microsoft name: EmfPlusSetInterpolationMode Record, Index 0x21
*/
int U_PMR_SETINTERPOLATIONMODE_print(const char *contents){
int IMenum;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETPIXELOFFSETMODE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.6.5, Microsoft name: EmfPlusSetPixelOffsetMode Record, Index 0x22
*/
int U_PMR_SETPIXELOFFSETMODE_print(const char *contents){
int POMenum;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETRENDERINGORIGIN record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.6.6, Microsoft name: EmfPlusSetRenderingOrigin Record, Index 0x1D
*/
int U_PMR_SETRENDERINGORIGIN_print(const char *contents){
int32_t X, Y;
if(status){
printf(" + X:%d Y:%d\n", X, Y);
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETTEXTCONTRAST record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.6.7, Microsoft name: EmfPlusSetTextContrast Record, Index 0x20
*/
int U_PMR_SETTEXTCONTRAST_print(const char *contents){
int GC;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETTEXTRENDERINGHINT record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.6.8, Microsoft name: EmfPlusSetTextRenderingHint Record, Index 0x1F
*/
int U_PMR_SETTEXTRENDERINGHINT_print(const char *contents){
int TRHenum;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_BEGINCONTAINER record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.7.1, Microsoft name: EmfPlusBeginContainer Record, Index 0x27
*/
int U_PMR_BEGINCONTAINER_print(const char *contents){
int UTenum;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_BEGINCONTAINERNOPARAMS record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.7.2, Microsoft name: EmfPlusBeginContainerNoParams Record, Index 0x28
*/
int U_PMR_BEGINCONTAINERNOPARAMS_print(const char *contents){
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_ENDCONTAINER record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.7.3, Microsoft name: EmfPlusEndContainer Record, Index 0x29
*/
int U_PMR_ENDCONTAINER_print(const char *contents){
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_RESTORE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.7.4, Microsoft name: EmfPlusRestore Record, Index 0x26
*/
int U_PMR_RESTORE_print(const char *contents){
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SAVE record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.7.5, Microsoft name: EmfPlusSave Record, Index 0x25
*/
int U_PMR_SAVE_print(const char *contents){
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETTSCLIP record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.8.1, Microsoft name: EmfPlusSetTSClip Record, Index 0x3A
*/
int U_PMR_SETTSCLIP_print(const char *contents){
int ctype;
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETTSGRAPHICS record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.8.2, Microsoft name: EmfPlusSetTSGraphics Record, Index 0x39
*/
int U_PMR_SETTSGRAPHICS_print(const char *contents){
uint8_t AntiAliasMode, TextRenderHint, CompositingMode, CompositingQuality, FilterType, PixelOffset;
const char *Data;
if(status){
printf(" AntiAliasMode:%u TextRenderHint:%u CompositingMode:%u CompositingQuality:%u",
printf(" WorldToDevice:");
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_MULTIPLYWORLDTRANSFORM record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.9.1, Microsoft name: EmfPlusMultiplyWorldTransform Record, Index 0x2C
*/
int U_PMR_MULTIPLYWORLDTRANSFORM_print(const char *contents){
int xmtype;
if(status){
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_RESETWORLDTRANSFORM record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.9.2, Microsoft name: EmfPlusResetWorldTransform Record, Index 0x2B
*/
int U_PMR_RESETWORLDTRANSFORM_print(const char *contents){
return(U_PMR_NODATAREC_print(contents));
}
/**
\brief Print data from a U_PMR_ROTATEWORLDTRANSFORM record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.9.3, Microsoft name: EmfPlusRotateWorldTransform Record, Index 0x2F
*/
int U_PMR_ROTATEWORLDTRANSFORM_print(const char *contents){
int xmtype;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SCALEWORLDTRANSFORM record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.9.4, Microsoft name: EmfPlusScaleWorldTransform Record, Index 0x2E
*/
int U_PMR_SCALEWORLDTRANSFORM_print(const char *contents){
int xmtype;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETPAGETRANSFORM record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.9.5, Microsoft name: EmfPlusSetPageTransform Record, Index 0x30
*/
int U_PMR_SETPAGETRANSFORM_print(const char *contents){
int UTenum;
if(status){
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_SETWORLDTRANSFORM record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.9.6, Microsoft name: EmfPlusSetWorldTransform Record, Index 0x2A
*/
int U_PMR_SETWORLDTRANSFORM_print(const char *contents){
if(status){
printf(" + ");
printf("\n");
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_TRANSLATEWORLDTRANSFORM record
\return size of record in bytes on success, 0 on error
\param contents Record from which to print data
EMF+ manual 2.3.9.7, Microsoft name: EmfPlusTranslateWorldTransform Record, Index 0x2D
*/
int U_PMR_TRANSLATEWORLDTRANSFORM_print(const char *contents){
int xmtype;
if(status){
printf(" + xmtype:%d Multiply:%s TranslateX:%f TranlateY:%f\n",xmtype,(xmtype ? "Post" : "Pre"), Dx, Dy);
}
else {
printf(" corrupt record\n");
}
return(status);
}
/**
\brief Print data from a U_PMR_STROKEFILLPATH record
\return 1 on success, 0 on error
\param contents Record from which to print data
*/
int U_PMR_STROKEFILLPATH_print(const char *contents){
return(U_PMR_NODATAREC_print(contents));
}
/**
\brief Print data from a U_PMR_MULTIFORMATSTART record
\return 1 on success, 0 on error
\param contents Record from which to print data
EMF+ manual mentioned in 2.1.1.1, reserved, not otherwise documented, Microsoft name: EmfPlusMultiFormatStart Record, Index 0x05
*/
int U_PMR_MULTIFORMATSTART_print(const char *contents){
return(U_PMR_NODATAREC_print(contents));
}
/**
\brief Print data from a U_PMR_MULTIFORMATSECTION record
\return 1 on success, 0 on error
\param contents Record from which to print data
EMF+ manual mentioned in 2.1.1.1, reserved, not otherwise documented, Microsoft name: EmfPlusMultiFormatSection Record, Index 0x06
*/
int U_PMR_MULTIFORMATSECTION_print(const char *contents){
return(U_PMR_NODATAREC_print(contents));
}
/**
\brief Print data from a U_PMR_MULTIFORMATEND record
\return 1 on success, 0 on error
\param contents Record from which to print data
EMF+ manual mentioned in 2.1.1.1, reserved, not otherwise documented, Microsoft name: EmfPlusMultiFormatEnd Record, Index 0x06
*/
int U_PMR_MULTIFORMATEND_print(const char *contents){
return(U_PMR_NODATAREC_print(contents));
}
#ifdef __cplusplus
}
#endif