uemf.h revision 06517eb74772b7c18a8ab8d703405646d9ec05d3
/**
@file uemf.h
@brief Structures, definitions, and function prototypes for EMF files.
EMF file Record structure information has been derived from Mingw, Wine, and libEMF header files, and from
Microsoft's EMF Information pdf, release date March 28,2012, link from here:
If the direct link fails the document may be found
by searching for: "[MS-EMF]: Enhanced Metafile Format"
*/
/** \mainpage libUEMF overview
\section ov Overview
Microsoft's WMF, EMF, and EMF+ metafile types are supported. In each case functions are provided for reading, constructing, writing, and printing
metafile records. The methods used to do that differ somewhat between metafiles, and the simplest
way to get started is to have a look at the example programs provided. The WMF, EMF, and EMF+ structs and functions are
marked with U_WMF, U_EMF, U_PMF and U_WMR, U_EMR, and U_PMR prefixes. (PMF because "+" is a reserved character
in many contexts, so U_EMF+NAME would be a problem.) Please be aware that normally both EMF and EMF+ files have the ".emf"
file extension, and that it is very common for such files to contain both an EMF and an EMF+ representation of the
drawing.
\section example_sec Example Programs
testbed_emf.c Creates an EMF file test_libuemf.emf.\n
testbed_wmf.c Creates a WMF file test_libuemf.wmf.\n
testbed_pmf.c Creates an EMF+ file test_libuemf_p.emf.\n
reademf.c Reads an EMF or EMF+ file and emits a text summary of its records.\n
readwmf.c Reads a WMF file and emits a text summary of its records.\n
emf-inout.cpp.example Example code from Inkscape to convert graphics from EMF to SVG.\n
emf-print.cpp.example Example code from Inkscape to print a drawing to EMF.\n
wmf-inout.cpp.example Example code from Inkscape to convert graphics from WMF to SVG.\n
wmf-print.cpp.example Example code from Inkscape to print a drawing to WMF.
\section doxy_limits Documentation issues
There are currently some unresolved issues with Doxygen that result in some structs
not being "defined". This comes up when several different types of structs have the same
layout. When this occurs the first one listed on the "typedef struct" is defined but all the
others will only be shown under "typedef struct" referring to the first one. This is why
clicking on U_RECTL in a function parameter jumps to a typedef struct page, why U_RECTL is shown
as plain text here, but U_RECT is shown as a link here, and clicking on it jumps directly
to its structure definition.
An additional issue is that the Enumeration names used in WMF are different from those
used in EMF, even when the values are either identical or differ only slightly, and no method
has been found yet to link one to the other in Doxygen. At present the only way to look up
these WMF enumerations is by referencing the following table:
EMF WMF WMF Manual
EMF Binary Raster Operation Enumeration BinaryRasterOperation Enumeration 2.1.1.2
EMF Bitcount Enumeration BitCount Enumeration 2.1.1.3
EMF LB_Style Enumeration BrushStyle Enumeration 2.1.1.4
EMF LF_CharSet Enumeration CharacterSet Enumeration 2.1.1.5
EMF DIBColors Enumeration ColorUsage Enumeration [has 1 extra value] 2.1.1.6
EMF BI_Compression Enumeration Compression Enumeration [has 3 extra values] 2.1.1.7
- FamilyFont Enumeration 2.1.1.8
EMF FloodFill Enumeration FloodFill Enumeration 2.1.1.9
EMF LF_Quality Enumeration FontQuality Enumeration 2.1.1.10
EMF LCS_Intent Enumeration GamutMappingIntent Enumeration 2.1.1.11
EMF HatchStyle Enumeration HatchStyle Enumeration 2.1.1.12
EMF Mirroring Enumeration LayoutEnumeration 2.1.1.13
- LogicalColorSpace Enumeration 2.1.1.14
EMF Profile Enumeration LogicalColorSpaceV5 Enumeration 2.1.1.15
EMF MapMode Enumeration MapModeEnumeration 2.1.1.16
- MetaFilesEscape Enumeration 2.1.1.17
- MetafileType Enumeration 2.1.1.18
- MetafileVersion Enumeration 2.1.1.19
EMF BackgroundMode Enumeration MixModeEnumeration 2.1.1.20
EMF LF_OutPrecision Enumeration OutPrecision Enumeration 2.1.1.21
- PaletteEntryFlag Enumeration 2.1.1.22
EMF PenStyle Enumeration PenStyle Enumeration [not values >0xFFFF] 2.1.1.23
- PitchFont Enumeration 2.1.1.24
EMF PolygonFillMode Enumeration PolyFillMode Enumeration [first 2 only] 2.1.1.25
- PostScriptCap Enumeration 2.1.1.26
- PostScriptClipping Enumeration 2.1.1.27
- PostFeatureSetting Enumeration 2.1.1.28
- PostScrioptJoin Enumeration 2.1.1.29
EMF StretchMode Enumeration StretchMode Enumeration 2.1.1.30
EMF Ternary Raster Operation Enumeration TernaryRasterOperation Enumeration 2.1.1.31
EMF LF_ClipPrecision Enumeration ClipPrecision Flags 2.1.2.1
EMF ExtTextOutOptions Enumeration ExtTextOutOptions Flags [subset] 2.1.2.2
EMF TextAlignment Enumeration TextAlignment Enumeration 2.1.2.3
EMF TextAlignment Enumeration VertialTextAlignment Enumeration 2.1.2.4
EMF LF_PitchAndFamily Enumeration PitchAndFamily Enumerations 2.2.2.14
\section refs Reference documentation
Manual Date Link
EMF 3/28/2012 http://msdn2.microsoft.com/en-us/library/cc230514.aspx
EMF+ 7/5/2012 http://msdn.microsoft.com/en-us/library/cc230724.aspx
*/
/*
File: uemf.h
Version: 0.0.31
Date: 23-APR-2015
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2015 David Mathog and California Institute of Technology (Caltech)
*/
#ifndef _UEMF_
#define _UEMF_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "uemf_utf.h"
#include "uemf_endian.h"
/** \cond */
// ***********************************************************************************
// defines not placed yet
#define U_PAN_CULTURE_LATIN 0
#define U_SYSPAL_ERROR 0
#define U_SYSPAL_STATIC 1
#define U_SYSPAL_NOSTATIC 2
#define U_ELF_VENDOR_SIZE 4
#define UNUSED_PARAMETER(x) (void)(x)
/** \endcond */
// ***************************************************************************
/** \defgroup U_EMF_Miscellaneous_values EMF Miscellaneous Values
@{
*/
#define U_NONE 0 //!< Generic for nothing selected for all flag fields
#define U_WRITE 0 //!< open file as "wb"
#define U_COLOR_ADJ_MIN ((int16_t)-100) //!< For U_COLORADJUSTMENT ca[Contrast|Brightness|Colorfulness|RedGreenTint] fields
#define U_COLOR_ADJ_MAX (int16_t) 100 //!< For U_COLORADJUSTMENT ca[Contrast|Brightness|Colorfulness|RedGreenTint] fields
#define U_REC_KEEP 0 //!< use with emf_append
#define U_ROW_ORDER_SAME 0 //!< For RGBA_to_DIB, same row order in DIB as in pixel array
#define U_CT_NO 0 //!< For RGBA_to_DIB, do not use color table
#define U_CT_BGRA 1 //!< For RGBA_to_DIB, use color table (16 bits or less only) BGRA colors, compatible with EMF+ ARGB
#define U_CT_ARGB 1 //!< For RGBA_to_DIB, use color table (16 bits or less only) BGRA colors, compatible with EMF+ ARGB
#define U_EMR_COMMENT_SPOOLFONTDEF 0x544F4E46 //!< For U_EMRCOMMENT record that is U_EMR_COMMENT_SPOOL, comment holds font definition informtion.
#define MAKE_MIN_PTR(A,B) ( A < B ? A : B)
#define IS_MEM_UNSAFE(A,B,C) ( (int8_t *)(A) > (int8_t *)(C) ? 1 : ((int8_t *)(C) - (int8_t *)(A) >= (int)(B) ? 0 : 1 )) //!< Return 1 when a region of memory starting at A of B bytes extends beyond pointer C
/** @} */
typedef float U_FLOAT; //!< 32 bit float
typedef uint32_t U_OFFBITS; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBITSMSK; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBITSSRC; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBMI; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBMIMSK; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBMISRC; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFDATA; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFDESC; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFDX; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFPLENTRIES; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFPXLFMT; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
// "Types" For array components in structures, where not otherwise defined as a structure
// "Counts" for array components in structures
/* ************************ WMF pieces used in EMF or EMF+ ****************************** */
/** \defgroup U_EMF_EMRSETROP2_iMode_Qualifiers EMF Binary Raster Operation Enumeration
For U_EMRSETROP2 iMode field
Microsoft name: Binary Raster Operation Enumeration
WMF manual 2.1.1.2
These codes specify:
1. an order of operands (composed of various orders and combinations of: Dest, Pen)
(There are 2, hence "Binary Raster Operation")
2. an order of operators to apply to the operands (composed of Not, Xor, Or, And)
Only a few of the more common operations are provided here.
The default is U_R2_COPYPEN. If this value is changed to something else all subsequenty
draw operations will use the altered logic. For instance, if it is set to U_R2_BLACK and
a red rectangle is drawn it will appear as a black rectangle.
@{
*/
/** @} */
/** \defgroup U_EMF_BITMAPINFOHEADER_biBitCount_Qualifiers EMF BitCount Enumeration
For U_BITMAPINFOHEADER biBitCount field.
Microsoft name: Bitcount Enumeration
WMF manual 2.1.1.3
@{
*/
#define U_BCBM_EXPLICIT 0 //!< Derived from JPG or PNG compressed image or ?
#define U_BCBM_COLOR16 16 //!< 2^16 colors. bmiColors is not used. Pixels are 5 bits B,G,R with 1 unused bit
#define U_BCBM_COLOR32 32 //!< 2^32 colors. bmiColors is not used. Pixels are U_RGBQUAD. Also use for EMF+ ARGB
/** @} */
/** \defgroup U_EMF_BITMAPINFOHEADER_biCompression_Qualifiers EMF BI_Compression Enumeration
For U_BITMAPINFOHEADER biCompression field
Microsoft name: Compression Enumeration
WMF manual 2.1.1.7
@{
*/
#define U_BI_RGB 0 //!< Supported by libUEMF
/** @} */
/** \defgroup U_EMF_LOGCOLORSPACE_lcsIntent_Qualifiers EMF LCS_Intent Enumeration
For U_LOGCOLORSPACEA/U_LOGCOLORSPACEW lcsIntent field
Microsoft name: LCS_Intent Enumeration
WMF manual 2.1.1.11
@{
*/
/** @} */
/** \defgroup U_EMF_LOGCOLORSPACE_lcsCSType_Qualifiers EMF LCS_CSType Enumeration
For U_LOGCOLORSPACEA/U_LOGCOLORSPACEW lcsCSType field
Microsoft name: LCS_CSType Enumeration
WMF manual 2.1.1.14
@{
*/
/** @} */
/** \defgroup U_EMF_EMR_dwROP_Qualifiers EMF Ternary Raster Operation enumeration
For U_EMR* dwROP fields.
Microsoft name: Ternary Raster Operation enumeration
WMF manual 2.1.1.31
These codes specify:
1. an order of operands (composed of various orders and combinations of: Dest, Src, Pen)
(There are 3, hence "Ternary Raster Operation")
2. an order of operators to apply to the operands (composed of Not, Xor, Or, And)
Only a few of the more common operations are provided here.
When the Operation does not use a Src operand the corresponding source bitmap may be
omitted from the record.
For more details see:
@{
*/
#define U_NOOP 0x00aa0029 //!< Many GDI programs end with a bitblt with this ROP == "D". Seems to work like flush()
/** @} */
/** \defgroup U_EMF_EMRSETTEXTALIGN_iMode_Qualifiers EMF TextAlignment Enumeration
For U_EMRSETTEXTALIGN iMode field
Microsoft name: TextAlignment Enumeration
WMF Manual 2.1.2.3
WMF Manual 2.1.2.4
Recall that EMF coordinates have UL closest to {0,0}, LR is below and to the right of UL and so has LARGER
{x,y} coordinates. In the following "TOP" is on the horizontal line defined by LR, as it has larger y coordinates,
which when viewing the EMF file, would actually be on the BOTTOM of the bounding rectangle. Similarly, left and right
are reversed.
Microsoft documentation (WMF manual, section 2.1.2.3) says that the text starts on certain edges of the bounding rectangle.
That is apparently not true, whether the bounding rectangle is {0,0,-1,-1}, which is effectively no bounding rectangle,
or if a valid bounding rectangle is specified. In all cases the text (in Windows XP Preview) starts, has center at, or ends
at the center point. Vertical offsets seem to be defined analogously, but with respect to the height of the font. The bounding
rectangle defined for the U_EMRTEXT record appears to be ignored.
Microsoft documentation (EMF manual,section 2.2.5) says that the same rectangle is used for "clipping or opaquing" by ExtTextOutA/W.
That does not seem to occur either.
@{
*/
// Horizontal text flags
#define U_TA_BASEBIT 0x10 //!< Reference point is on baseline of text if this bit is set, for 0x10 <-> 0x18
// Vertical text flags
/** @} */
/** WMF manual 2.2.2.3
\brief For U_BITMAPINFO bmiHeader field
Microsoft name: BITMAPINFOHEADER Object
*/
typedef struct {
//!< abs(biHeight) is bitmap height
//!< bitmap may appear in two orientations:
//!< biHeight > 0 origin is LL corner, may be compressed, this is height after decompression.
//!< biHeight < 0 origin is UL corner, may not be compressed
U_NUM_RGBQUAD biClrUsed; //!< Number of bmciColors in U_BITMAPINFO/U_BITMAPCOREINFO that are used by the bitmap
*PU_BITMAPINFOHEADER; //!< WMF manual 2.2.2.3
/** WMF manual 2.2.2.6
\brief For U_CIEXYZTRIPLE (all) fields
Microsoft name: CIEXYZ Object
*/
typedef struct {
} U_CIEXYZ,
*PU_CIEXYZ; //!< WMF manual 2.2.2.6
/** WMF manual 2.2.2.7
\brief For U_LOGCOLORSPACEA and U_LOGCOLORSPACEW lcsEndpints field
defines a CIE colorspace.
Microsoft name: CIEXYZTRIPLE Object
*/
typedef struct {
*PU_CIEXYZTRIPLE; //!< WMF manual 2.2.2.7
/** WMF manual 2.2.2.8
\brief For U_BITMAPINFO crColor field
NOTE that the color order is RGB reserved, flipped around from the preceding.
Microsoft name: COLORREF Object
*/
typedef struct {
} U_COLORREF,
*PU_COLORREF; //!< WMF manual 2.2.2.8
/** WMF manual 2.2.2.11
\brief For U_LCS_GAMMARGB lcsGamma* fields
Microsoft name:(unknown)
*/
typedef struct {
} U_LCS_GAMMA,
*PU_LCS_GAMMA; //!< WMF manual 2.2.2.11
/** WMF manual 2.2.2.11
\brief For U_LOGCOLORSPACEA and U_LOGCOLORSPACEW lcsGammaRGB field
Microsoft name:(unknown)
*/
typedef struct {
*PU_LCS_GAMMARGB; //!< WMF manual 2.2.2.11
/** WMF manual 2.2.2.11
\brief For U_EMRCREATECOLORSPACE lcs field
Microsoft name: LOGCOLORSPACEA Object
*/
typedef struct {
*PU_LOGCOLORSPACEA; //!< WMF manual 2.2.2.11
/** WMF manual 2.2.2.12
\brief For U_EMRCREATECOLORSPACEW lcs field
Microsoft name: LOGCOLORSPACEW Object
*/
typedef struct {
uint16_t lcsFilename[U_MAX_PATH]; //!< Could name an external color profile file, otherwise empty string
*PU_LOGCOLORSPACEW; //!< WMF manual 2.2.2.12
/** WMF manual 2.2.2.15
\brief Used for any generic pair of uint32_t
Microsoft name: POINTL Object
*/
typedef struct {
int32_t x; //!< X value
int32_t y; //!< Y value
} U_PAIR,
U_POINT, //!< WMF manual 2.2.2.15
U_POINTL, //!< WMF manual 2.2.2.15
*PU_PAIR, //!< WMF manual 2.2.2.15
*PU_POINT, //!< WMF manual 2.2.2.15
*PU_POINTL; //!< WMF manual 2.2.2.15
/** WMF manual 2.2.2.16
\brief Point type for 16 bit EMR drawing functions.
Microsoft name: POINTS Object.
Microsoft name: POINTS16 Object.
*/
typedef struct {
int16_t x; //!< X size (16 bit)
int16_t y; //!< Y size (16 bit)
} U_POINT16,
*PU_POINT16; //!< WMF manual 2.2.2.16
/** WMF manual 2.2.2.19
\brief Coordinates of the upper left, lower right corner.
Note that the coordinate system is 0,0 in the upper left corner
of the screen an N,M in the lower right corner.
Microsoft name: RECTL Object
*/
typedef struct {
} U_RECT,
U_RECTL, //!< WMF manual 2.2.2.19
*PU_RECT, //!< WMF manual 2.2.2.19
*PU_RECTL; //!< WMF manual 2.2.2.19
/** WMF manual 2.2.2.20
\brief For U_BITMAPINFO bmiColors field
NOTE that the color order is BGR, even though the name is RGB!
Microsoft name: RGBQUAD Object
*/
typedef struct {
} U_RGBQUAD,
*PU_RGBQUAD; //!< WMF manual 2.2.2.20
/** WMF manual 2.2.2.22
\brief Pair of values indicating x and y sizes.
Microsoft name: SIZE Object
Microsoft name: SIZEL Object
*/
typedef struct {
} U_SIZE,
U_SIZEL, //!< WMF manual 2.2.2.22
*PU_SIZE, //!< WMF manual 2.2.2.22
*PU_SIZEL; //!< WMF manual 2.2.2.22
/* ************************ EMF or common to EMF and EMF+ ****************************** */
// ***********************************************************************************
// Value enumerations and other predefined constants, alphabetical order by group
/** \defgroup U_EMF_FONT_STRUCT_WIDTHS EMF Font name and style widths in characters
For U_LOGFONT and U_LOGFONT_PANOSE,
@{
*/
#define U_LF_FACESIZE 32 //!< U_LOGFONT lfFaceName and U_LOGFONT_PANOSE elfStyle fields maximum width
/** @} */
/** \defgroup U_EMF_EMR_Qualifiers EMF RecordType Enumeration
(RecordType Enumeration, EMF manual 2.1.1 )
For U_EMR iType field
EMF manual 2.1.1
@{
*/
/** @} */
/** \defgroup U_EMF_DRAW_PROPERTIES EMF draw properties
Used in emr_properties() and wmr_properties. These are the bit definitions.
@{
*/
/** @} */
/** \defgroup U_EMF_EMRSETARCDIRECTION_Qualifiers EMF ArcDirection Enumeration
For U_EMRSETARCDIRECTION iArcDirection field
Microsoft name: ArcDirection Enumeration
EMF manual 2.1.2
@{
*/
/** @} */
/** \defgroup U_EMF_PANOSE_bArmStyle_Qualifiers EMF ArmStyle Enumeration
For U_PANOSE bArmStyle field
Microsoft name: ArmStyle Enumeration
EMF manual 2.1.3
@{
*/
/** @} */
/** \defgroup U_EMF_EMRSETBKMODE_iMode_Qualifiers EMF BackgroundMode enumeration
For U_EMRSETBKMODE iMode field
Microsoft name: BackgroundMode enumeration
EMF manual 2.1.4
@{
*/
/** @} */
/** \defgroup U_EMF_COLORADJUSTMENT_caFlags_Qualifiers EMF ColorAdjustment Enumeration
For U_COLORADJUSTMENT caFlags field
Microsoft name: ColorAdjustment Enumeration
EMF manual 2.1.5
@{
*/
/** @} */
/** \defgroup U_EMF_EMRCOLORMATCHTOTARGETW_dwFlags_Qualifiers EMF ColorMatchToTarget Enumeration
For U_EMRCOLORMATCHTOTARGETW dwFlags field
Microsoft name: ColorMatchToTarget Enumeration
EMF manual 2.1.6
@{
*/
#define U_COLORMATCHTOTARGET_NOTEMBEDDED 0 //!< Color match profile is not embedded in metafile
/** @} */
/** \defgroup U_EMF_EMRCOLORMATCHTOTARGETW_dwAction_Qualifiers EMF ColorSpace Enumeration
For U_EMRCOLORMATCHTOTARGETW dwAction field
Microsoft name: ColorSpace Enumeration
EMF manual 2.1.7
@{
*/
/** @} */
/** \defgroup U_EMF_PANOSE_common_Qualifiers EMF PanoseCommon Enumeration
Used by all PAN_* enumerations, but only defined once here.
See also U_PAN_ALL1 after the U_PANOSE structure
@{
*/
#define U_PAN_ANY 0 //!< Any (for any type of Panose enumeration)
/** @} */
/** \defgroup U_EMF_PANOSE_bContrast_Qualifiers EMF Contrast Enumeration
For U_PANOSE bContrast field
Microsoft name: Contrast Enumeration
EMF manual 2.1.8
@{
*/
/** @} */
/** \defgroup U_EMF_DIBITS_iUsageSrc_Qualifiers EMF DIBColors Enumeration
For U_EMRSETDIBITSTODEIVCE and U_EMRSTRETCHDIBITS iUsageSrc fields.
Microsoft name: DIBColors Enumeration
EMF manual 2.1.9
@{
*/
#define U_DIB_RGB_COLORS 0 //!< color table contains colors
/** @} */
/** \defgroup U_EMF_EMR_COMMENT_PUBLIC EMF EMRComment Enumeration
For U_EMRCOMMENT_PUBLIC pcIdent fields
Microsoft name: EMRComment Enumeration
EMF manual 2.1.10
@{
*/
#define U_EMR_COMMENT_MULTIFORMATS 0x40000004 //!< Comment contains some other representation of drawing
/** @} */
/** \defgroup U_EMF_EMRTEXT_foptions_Qualifiers EMF ExtTextOutOptions Enumeration
For U_EMRTEXT foptions field
Microsoft name: ExtTextOutOptions Enumeration
EMF manual 2.1.11
@{
*/
#define U_ETO_SMALL_CHARS 0x00000200 //!< 8 bit characters instead of 16 bit. For EMRSMALLTEXTOUT ONLY, does not affect EMRTEXTOUTA or EMRTEXTOUTW
#define U_ETO_IGNORELANGUAGE 0x00001000 //!< Process Right to Left languages exactly as specified in the metafile.
/** @} */
/** \defgroup U_EMF_PANOSE_bFamilyType_Qualifiers EMF FamilyType Enumeration
For U_PANOSE bFamilyType field
Microsoft name: FamilyType Enumeration
EMF manual 2.1.12
@{
*/
/** @} */
/** \defgroup U_EMF_EMREXTFLOODFILL_iMode_Qualifiers EMF FloodFill Enumeration
For U_EMREXTFLOODFILL iMode field
Microsoft name: FloodFill Enumeration
EMF manual 2.1.13
@{
*/
#define U_FLOODFILLBORDER 0x00000000 //!< Color specified must be the same as the border - brush fill stops at this color
#define U_FLOODFILLSURFACE 0x00000001 //!< Color specified must be different from the border - brush fills only this color
/** @} */
/** \defgroup U_EMF_DESIGNVECTOR_Signature_Qualifiers EMF Signature Enumeration
For U_DESIGNVECTOR Signature field
Microsoft name: Signature Enumeration
EMF manual 2.1.14
@{
*/
/** @} */
/** \defgroup U_EMF_EMRGRADIENTFILL_ulMode_Qualifiers EMF GradientFill Enumeration
For U_EMRGRADIENTFILL ulMode field
Microsoft name: GradientFill Enumeration
EMF manual 2.1.15
@{
*/
/** @} */
/** \defgroup U_EMF_EMREXTTEXTOUT_iGraphicsMode_Qualifiers EMF GraphicsMode Enumeration
For U_EMREXTTEXTOUTA/U_EMREXTTEXTOUTW and all other iGraphicsMode fields
Microsoft name: GraphicsMode Enumeration
EMF manual 2.1.16
@{
*/
#define U_GM_COMPATIBLE 1 //!< TrueType text ignores world to device transform except for Scale. Arcs ignore transform
#define U_GM_ADVANCED 2 //!< TrueType text and Arcs must conform to all of world to device transform.
/** @} */
/** \defgroup U_EMF_LOGBRUSH_lbHatch_Qualifiers EMF HatchStyle Enumeration
For U_LOGBRUSH lbHatch field
Microsoft name: HatchStyle Enumeration
EMF manual 2.1.17
@{
*/
#define U_HS_HORIZONTAL 0 //!< Horizontal.
/** @} */
/** \defgroup U_EMF_EMRSETICMMODE_iMode_Qualifiers EMF ICMMode Enumeration
For EMF U_EMR_SETICMMODE iMode field
Microsoft name: ICMMode Enumeration
EMF manual 2.1.18
@{
*/
/** @} */
/** \defgroup U_EMF_COLORADJUSTMENT_caIlluminantIndex_Qualifiers EMF Illuminant Enumeration
For U_COLORADJUSTMENT caIlluminantIndex field
Microsoft name: Illuminant Enumeration
EMF manual 2.1.19
@{
*/
#define U_ILLUMINANT_DEVICE_DEFAULT 0 //!< Device default
/** @} */
/** \defgroup U_EMF_PANOSE_bLetterForm_Qualifiers EMF Letterform Enumeration
For U_PANOSE bLetterForm field
Microsoft name: Letterform Enumeration
EMF manual 2.1.20
@{
*/
/** @} */
/** \defgroup U_EMF_EMRSETMAPMODE_iMode_Qualifiers EMF MapMode Enumeration
For U_EMRSETMAPMODE iMode field
Microsoft name: MapMode Enumeration
EMF manual 2.1.21
@{
*/
/** @} */
/** \defgroup U_EMF_MF_version EMF MetafileVersion Enumeration
For U_EMR_COMMENTS_METAFILE version field
Microsoft name: MetafileVersion Enumeration
EMF manual 2.1.22
@{
*/
/** @} */
/** \defgroup U_EMF_PANOSE_bMidline_Qualifiers EMF MidLine Enumeration
For U_PANOSE bMidline field
Microsoft name: MidLine Enumeration
EMF manual 2.1.23
@{
*/
/** @} */
/** \defgroup U_EMF_EMRMODIFYWORLDTRANSFORM_iMode_Qualifiers EMF ModifyWorldTransformMode Enumeration
For U_EMRMODIFYWORLDTRANSFORM iMode
Microsoft name: ModifyWorldTransformMode Enumeration
EMF manual 2.1.24
@{
*/
/** @} */
/** \defgroup U_EMF_LOGPEN_elpPenStyle_Qualifiers EMF PenStyle Enumeration
For U_LOGPEN lopnStyle and U_EXTLOGPEN elpPenStyle fields
Microsoft name: PenStyle Enumeration
EMF manual 2.1.25
@{
*/
#define U_PS_DASH 0x00000001 //!< Dashed line. This only works when NO other U_PS is set. Line width is minimum no matter what pen is set to.
#define U_PS_DOT 0x00000002 //!< Dotted line. This only works when NO other U_PS is set. Line width is minimum no matter what pen is set to.
#define U_PS_DASHDOT 0x00000003 //!< Dash-Dot line. This only works when NO other U_PS is set. Line width is minimum no matter what pen is set to.
#define U_PS_DASHDOTDOT 0x00000004 //!< Dash-Dot-Dot line. This only works when NO other U_PS is set. Line width is minimum no matter what pen is set to.
#define U_PS_INSIDEFRAME 0x00000006 //!< Draw line around drawing, then shrink drawing to fit within line taking its width into account.
#define U_PS_COSMETIC 0x00000000 //!< width may only be 1 pixel. (If set higher it is still drawn as 1).
#define U_PS_GEOMETRIC 0x00010000 //!< width may be >1 pixel, but style may only be U_PS_SOLID or U_PS_NULL.
/** @} */
/** \defgroup U_EMF_EMRPOLY_iMode_Qualifiers EMF Point Enumeration
For U_EMRPOLYDRAW and U_EMRPOLAYDRAW16 abTypes fields.
Microsoft name: Point Enumeration
EMF manual 2.1.26
@{
*/
/** @} */
/** \defgroup U_EMF_EMRSETPOLYFILLMODE_iMode_Qualifiers EMF PolygonFillMode Enumeration
For U_EMRSETPOLYFILLMODE iMode field
Microsoft name: PolygonFillMode Enumeration
EMF manual 2.1.27
@{
*/
/** @} */
/** \defgroup U_EMF_PANOSE_bProportion_Qualifiers EMF Proportion Enumeration
For U_PANOSE bProportion field
Microsoft name: Proportion Enumeration
EMF manual 2.1.28
@{
*/
/** @} */
/** \defgroup U_EMF_EMRSELECTCLIP_iMode_Qualifiers EMF RegionMode Enumeration
For U_EMRSELECTCLIPPATH and U_EMREXTSELECTCLIPRGN iMode field
Microsoft name: RegionMode Enumeration
EMF manual 2.1.29
@{
*/
#define U_RGN_NONE 0 //!< not part of EMF standard, may be used by others
/** @} */
/** \defgroup U_EMF_PANOSE_bSerifStyle_Qualifiers EMF SerifType Enumeration
For U_PANOSE bSerifStyle field
Microsoft name: SerifType Enumeration
EMF manual 2.1.30
@{
*/
/** @} */
/** \defgroup U_EMF_EMRSELECTOBJECT_ihObject_Qualifiers EMF StockObject Enumeration
For U_EMRSELECTOBJECT ihObject field.
Microsoft name: StockObject Enumeration
EMF manual 2.1.31
@{
*/
/** @} */
/** \defgroup U_EMF_EMRSETSTRETCHBLTMODE_iMode_Qualifiers EMF StretchMode Enumeration
For EMF U_EMRSETSTRETCHBLTMODE iMode field
Microsoft name: StretchMode Enumeration
EMF manual 2.1.32 and footnote 52 on page 297
@{
*/
#define U_HALFTONE 4 //!< Replace a block of destination pixels with a half-tone representation of the source pixel.
#define U_STRETCH_HALFTONE 4 //!< Replace a block of destination pixels with a half-tone representation of the source pixel.
/** @} */
/** \defgroup U_EMF_PANOSE_bStrokeVariation_Qualifiers EMF StrokeVariation Enumeration
For U_PANOSE bStrokeVariation field
Microsoft name: StrokeVariation Enumeration
EMF manual 2.1.33
@{
*/
/** @} */
/** \defgroup U_EMF_PANOSE_bWeight_Qualifiers EMF Weight Enumeration
For U_PANOSE bWeight field
EMF manual 2.1.34
@{
*/
/** @} */
/** \defgroup U_EMF_PANOSE_bXHeight_Qualifiers EMF XHeight Enumeration
For U_PANOSE bXHeight field
EMF manual 2.1.35
@{
*/
/** @} */
/** \defgroup U_EMF_LOGFONT_lfWeight_Qualifiers EMF LF_Weight Enumeration
For U_LOGFONT lfWeight field
EMF manual 2.2.13, footnote 61 (on page 297)
@{
*/
#define U_FW_DONTCARE 0 //!< Don't care
/** @} */
/** \defgroup U_EMF_LOGFONT_lfItalic_Qualifiers EMF LF_Italic Enumeration
For U_LOGFONT lfItalic field
Microsoft name: LF_Italic Enumeration
EMF manual 2.2.13
@{
*/
#define U_FW_NOITALIC 0 //!< Do not use italics.
/** @} */
/** \defgroup U_EMF_LOGFONT_lfunderline_Qualifiers EMF LF_Underline Enumeration
For U_LOGFONT lfunderline field
Microsoft name: LF_Underline Enumeration
EMF manual 2.2.13
@{
*/
#define U_FW_NOUNDERLINE 0 //!< Do not use underline.
/** @} */
/** \defgroup U_EMF_LOGFONT_lfStrikeOut_Qualifiers EMF LF_StrikeOut Enumeration
For U_LOGFONT lfStrikeOut field
EMF manual 2.2.13
@{
*/
#define U_FW_NOSTRIKEOUT 0 //!< Do not use strikeout.
/** @} */
/** \defgroup U_EMF_LOGFONT_lfCharSet_Qualifiers EMF LF_CharSet Enumeration
For U_LOGFONT lfCharSet field
EMF manual 2.2.13 & WMF manual 2.1.15
@{
*/
/** @} */
/** \defgroup U_EMF_LOGFONT_lfOutPrecision_Qualifiers EMF LF_OutPrecision Enumeration
For U_LOGFONT lfOutPrecision field
EMF manual 2.2.13 & WMF manual 2.1.1.21
@{
*/
#define U_OUT_DEFAULT_PRECIS 0 //!< Default precision
/** @} */
/** \defgroup U_EMF_LOGFONT_lfClipPrecision_Qualifiers EMF LF_ClipPrecision Enumeration
For U_LOGFONT lfClipPrecision field
EMF manual 2.2.13 & WMF manual 2.1.2.1
@{
*/
#define U_CLIP_LH_ANGLES 0x10 //!< Set: font rotation by coordinate system, Clear: device fonts (only) rotate counterclockwise.
#define U_CLIP_EMBEDDED 0x80 //!< Font embedding is required. (Method for doing so is not documented in EMF or WMF.)
/** @} */
/** \defgroup U_EMF_LOGFONT_lfQuality_Qualifiers EMF LF_Quality Enumeration
For For U_LOGFONT lfQuality field
EMF manual 2.2.13 & WMF manual 2.1.1.10
@{
*/
#define U_DEFAULT_QUALITY 0 //!< Default quality
/** @} */
/** \defgroup U_EMF_LOGFONT_lfPitchAndFamily_Qualifiers EMF LF_PitchAndFamily Enumeration
For U_LOGFONT lfPitchAndFamily field
EMF manual 2.2.13 & WMF manual 2.2.2.14
@{
*/
/** @} */
/** \defgroup U_EMF_LOGBRUSH_lbStyle_Qualifiers EMF LB_Style Enumeration
For U_LOGBRUSH lbStyle field
EMF manual 2.2.20
@{
*/
#define U_BS_SOLID 0 //!< Solid brush.
/** @} */
/** \defgroup U_EMF_PANOSE_index EMF PanoseIndex Enumeration
Fositions of each field in U_PANOSE structure.
Microsoft name: (none)
EMF manual 2.2.21
@{
*/
#define U_PAN_FAMILYTYPE_INDEX 0 //!< Familytype index
/** @} */
/** \defgroup U_EMF_PIXELFORMATDESCRIPTOR_iLayerType_Qualifiers EMF PFD_iLayerType Enumeration
For U_PIXELFORMATDESCRIPTOR iLayerType field
Microsoft name: (none)
EMF manual 2.2.22
@{
*/
#define U_PFD_MAIN_PLANE 0 //!< Main plane
/** @} */
/** \defgroup U_EMF_PIXELFORMATDESCRIPTOR_iPixelType_Qualifiers EMF PFD_iPixelType Enumeration
For U_PIXELFORMATDESCRIPTOR iPixelType field
Microsoft name: (none)
EMF manual 2.2.22
@{
*/
#define U_PFD_TYPE_RGBA 0 //!< Pixel contains an RGBA value.
/** @} */
/** \defgroup U_EMF_PIXELFORMATDESCRIPTOR_dwFlags_Qualifiers EMF PFD_dwFlags Enumeration
For U_PIXELFORMATDESCRIPTOR dwFlags field
EMF manual 2.2.22
@{
*/
/** @} */
/** \defgroup U_EMF_EMRCOMMENT_TYPES EMF Comment record types
For U_EMRCOMMENT_* cIdent fields
EMF manual 2.3.3
@{
*/
/** @} */
/** \defgroup U_EMF_EMRSETLAYOUT_iMode_Qualifiers EMF Mirroring Enumeration
For U_EMRSETLAYOUT iMode field
EMF manual 2.3.11.17
@{
*/
#define U_LAYOUT_BITMAPORIENTATIONPRESERVED 0x00000008 //!< Do not flip bitmaps if layout is right to left.
/** @} */
/** \defgroup U_EMF_BLEND_Op_Qualifiers EMF Blend Enumeration
For U_BLEND Op field
@{
*/
#define U_AC_SRC_GLOBAL 0 //!< Global
#define U_AC_SRC_CONST 0 //!< Const
/** @} */
// ***************************************************************************
// Macros
/** \defgroup U_EMF_Common_macros EMF Common Macros
@{
*/
// Note, many of these were originally defined using C99 (type){val,val,val} format, but that turned out to
// have incompatibilities with C++, so use functions as the basis to avoid this.
// These are used in EMF structures and the byte order must be the same in memory or on disk.
// These are used in EMF structures and the byte order must be the same in memory or on disk.
// These MAY be used in PNG and other libraries if these enforce byte order in memory, otherwise
// U_swap4 may need to also be employed.
//
#define colorref_set colorref3_set //!< Most frequent usage is 3 colors, so set the unqualified one to that
// color type conversions
#define U_RGB2BGR(rgb) U_BGR(U_RGBAGetR(rgb),U_RGBAGetG(rgb),U_RGBAGetB(rgb)) //!< Set any BGR color from an RGB color
#define U_BGR2RGB(rgb) U_RGB(U_BGRAGetR(rgb),U_BGRAGetG(rgb),U_BGRAGetB(rgb)) //!< Set any RGB color from an BGR color
#define U_RGBA2BGRA(rgb) U_BGRA(U_RGBAGetR(rgb),U_RGBAGetG(rgb),U_RGBAGetB(rgb),U_RGBAGetA(rgb)} //!< Set any BGRA color from an RGBA color
#define U_BGRA2RGBA(rgb) U_RGBA(U_BGRAGetR(rgb),U_BGRAGetG(rgb),U_BGRAGetB(rgb),U_BGRAGetA(rgb)} //!< Set any RGBA color from an BGRA color
#define U_CMYK(c,m,y,k)\
((COLOREF)((((uint8_t)(k)|((uint16_t)((uint8_t)(y))<<8))|(((uint32_t)(uint8_t)(m))<<16))|(((uint32_t)(uint8_t)(c))<<24))) \
//!< Color CMYK Set Macro.
// Other macros
#define U_Gamma(A) (A < U_RGB_GAMMA_MIN ? U_RGB_GAMMA_MIN : (A > U_RGB_GAMMA_MAX ? U_RGB_GAMMA_MAX: A)) \
//!< Gamma set Macro (enforce range).
#define U_PM(A,B) ((A)<-(B)?-(B):((A)>(B)?(B):(A))) //!< Plus/Minus Range Macro (B must be postitive!).
#define U_MIN(A,B) ((A)>(B)?(B):(A)) //!< Minimum of A,B
#define U_MAX(A,B) ((A)>(B)?(A):(B)) //!< Maximum of A,B
// basic EMR macros.
// Utility macros
/** @} */
/** Any generic pair of floats.
Microsoft name: (none)
*/
typedef struct {
float x; //!< X value
float y; //!< Y value
} U_PAIRF,
*PU_PAIRF; //!< Any generic pair of floats. Microsoft name: (none)
/* ************************************************************
EMF structures OTHER than those corresponding to complete U_EMR_* records
************************************************************ */
/**
\brief For U_POINT28_4 x and y fields.
EMF manual 2.2.1, Microsoft name: BitFIX28_4 Object.
*/
typedef struct {
} U_BITFIX28_4,
*PU_BITFIX28_4; //!< EMF manual 2.2.1
/**
\brief For U_EMRSETOLORADJUSTMENT ColorAdjustment field
EMF manual 2.2.2, Microsoft name: ColorAdjustment Object
Note, range constants are: RGB_GAMMA_[MIN|MAX],REFERENCE_[WHITE|BLACK]_[MIN|MAX],COLOR_ADJ_[MIN|MAX]
*/
typedef struct {
*PU_COLORADJUSTMENT; //!< EMF manual 2.2.2
/** EMF manual 2.2.3
\brief For ? (not implemented yet)
Microsoft name: DesignVector Object
*/
typedef struct {
*PU_DESIGNVECTOR; //!< EMF manual 2.2.3
/**
\brief For U_EMR_COMMENT_MULTIFORMATS record, where an array of these is used
EMF manual 2.2.4, Microsoft name: EmrFormat Object
*/
typedef struct {
} U_EMRFORMAT,
*PU_EMRFORMAT; //!< EMF manual 2.2.4
/**
\brief For U_EMR[POLY]EXTTEXTOUT[A|W] emrtext field
EMF manual 2.2.5, Microsoft name: EmrText Object
Differs from implementation in Mingw and Wine in that the core struct has a fixed size.
Optional and movable components must be handled with offsets.
U_OFFDX offDx; (required) but position isn't static. Offset in bytes to the character spacing array measured
from the start of the RECORD, NOT from the start of this structure.
The order of the next two may be reversed, they are found from their offsets.
char string (required) String buffer holding nChars (padded to a multiple of 4 bytes in length).
uint32_t Dx[1] (required) character spacing, array with one entry per glyph.
*/
typedef struct {
} U_EMRTEXT,
*PU_EMRTEXT; //!< EMF manual 2.2.5
/**
\brief For U_EPS_DATA Points field
EMF manual 2.2.23, Microsoft name: Point28_4 Object, out of order, needed for 2.2.6
*/
typedef struct {
U_BITFIX28_4 x; //!< X coordinate
U_BITFIX28_4 y; //!< Y coordinate
} U_POINT28_4,
*PU_POINT28_4; //!< EMF manual 2.2.23
/**
\brief For embedding EPS in EMF via U_EMRFORMAT offData array in U_EMR_COMMENT_MULTIFORMATS
EMF manual 2.2.6, Microsoft name: EpsData Object
*/
typedef struct {
} U_EPS_DATA,
*PU_EPS_DATA; //!< EMF manual 2.2.6
/**
\brief For GRADIENT_[TRIANGLE|U_RECT]
EMF manual 2.2.26, Microsoft name: TriVertex Object, out of order, needed for 2.2.7
*/
typedef struct {
int32_t x; //!< X coord
int32_t y; //!< Y coord
} U_TRIVERTEX,
*PU_TRIVERTEX; //!< EMF manual 2.2.26
/**
\brief For U_EMRGRADIENTFILL GradObj field
EMF manual 2.2.7, Microsoft name: GradientRectangle Object
*/
typedef struct {
} U_GRADIENT4,
*PU_GRADIENT4; //!< EMF manual 2.2.7
/**
\brief For U_EMRGRADIENTFILL GradObj field
EMF manual 2.2.8, Microsoft name: GradientTriangle Object
Gradient object notes. The next two structures are used to define the shape with reference to an existing array
of points stored in an array of TriVertex objects in the U_EMRGRADIENTFILL record. The tricky part
is that these two structures are different sizes. In some implementations (MingW) the array is cast to uint32_t
and basically the cast is then ignored. For libUEMF we leave this out of the structure entirely and get to it with offsets.
*/
typedef struct {
} U_GRADIENT3,
*PU_GRADIENT3; //!< EMF manual 2.2.8
//Microsoft name: Header object, EMF manual 2.2.9 defined below with record structs
//Microsoft name: HeaderExtension1 object, EMF manual 2.2.10 defined below with record structs
//Microsoft name: HeaderExtension1 object, EMF manual 2.2.11 defined below with record structs
/**
\brief For U_EMRCREATEBRUSHINDIRECT lb field
EMF manual 2.2.12, Microsoft name: LogBrushEx Object
*/
typedef struct { //!< In MS documentation this is LogBrushEx Object
} U_LOGBRUSH,
U_PATTERN, //!< EMF manual 2.2.12
*PU_LOGBRUSH, //!< EMF manual 2.2.12
*PU_PATTERN; //!< EMF manual 2.2.12
/**
\brief For U_LOGFONT elfLogFont field
EMF manual 2.2.13, Microsoft name: LogFont Object
*/
typedef struct {
uint16_t lfFaceName[U_LF_FACESIZE]; //!< Name of font. If <U_LF_FACESIZE chars must be null terminated
} U_LOGFONT,
*PU_LOGFONT; //!< EMF manual 2.2.13
// Microsoft name: LogFontEx Object (not implemented) EMF manual 2.2.14
// Microsoft name: LogFontExDv Object (not implemented) EMF manual 2.2.15
/**
\brief For U_LOGFONT_PANOSE elfPanose field
EMF manual 2.2.21, Microsoft name: Panose Object
*/
// out of order, needed for 2.2.16
typedef struct {
} U_PANOSE,
*PU_PANOSE; //!< EMF manual 2.2.21
#define U_PAN_ALL0 (U_PANOSE){0,0,0,0,0,0,0,0,0,0} //!< all U_PAN_ANY, have not seen this in an EMF file
#define U_PAN_ALL1 (U_PANOSE){1,1,1,1,1,1,1,1,1,1} //!< all U_PAN_NO_FIT, this is what createfont() would have made
/**
\brief For U_EMREXTCREATEFONTINDIRECTW elfw field
EMF manual 2.2.16, Microsoft name: LogFontPanose Object
*/
typedef struct {
uint16_t elfStyle[U_LF_FACESIZE]; //!< Font style (if <U_LF_FACESIZE characters, null terminate string)
*PU_LOGFONT_PANOSE; //!< EMF manual 2.2.16
/**
\brief For U_LOGPALETTE palPalEntry field(s)
EMF manual 2.2.18, Microsoft name: LogPaletteEntry Object
*/
// out of order, needed for 2.2.17
typedef struct {
} U_LOGPLTNTRY,
*PU_LOGPLTNTRY; //!< EMF manual 2.2.18
/**
\brief For U_EMRCREATEPALETTE lgpl field
EMF manual 2.2.17, Microsoft name: LogPalette Object
*/
typedef struct {
} U_LOGPALETTE,
*PU_LOGPALETTE; //!< EMF manual 2.2.17
// Microsoft name: LogPaletteEntry Object, EMF manual 2.2.18, defined above, before 2.2.17
/**
\brief For U_EMRCREATEPEN lopn field
EMF manual 2.2.19, Microsoft name: LogPen Object
*/
typedef struct {
} U_LOGPEN,
*PU_LOGPEN; //!< EMF manual 2.2.19
// Microsoft name: LogPenEx Object (not implemented) EMF manual 2.2.20
// Microsoft name: Panose Object, EMF manual 2.2.21, defined above, before 2.2.16
/**
\brief For U_EMRPIXELFORMAT pfd field
EMF manual 2.2.22, Microsoft name: PixelFormatDescriptor Object
*/
typedef struct {
*PU_PIXELFORMATDESCRIPTOR; //!< EMF manual 2.2.22
// Microsoft name: Point28_4 Object. EMF manual 2.2.23, defined above, before 2.2.6
/**
\brief For U_RGNDATA rdb field
EMF manual 2.2.25, Microsoft name: RegionDataHeader Object (RGNDATAHEADER)
*/
// out of order, needed for 2.2.24
typedef struct {
*PU_RGNDATAHEADER; //!< EMF manual 2.2.25
/**
\brief For U_EMRFILLRGN RgnData field(s)
EMF manual 2.2.24, Microsoft name: RegionData Object
*/
typedef struct {
} U_RGNDATA,
*PU_RGNDATA; //!< EMF manual 2.2.24
// Microsoft name: RegionDataHeader Object. EMF manual 2.2.25, defined above, before 2.2.24
// Microsoft name: TriVertex Object. EMF manual 2.2.26, defined above, before 2.2.7
// Microsoft name: UniversalFontId Object. EMF manual 2.2.27 (not implemented)
/**
\brief For U_EMR[FILLRGN|STRETCHBLT|MASKBLT|PLGBLT] xformSrc field
EMF manual 2.2.28, Microsoft name: Xform Object
*/
typedef struct {
} U_XFORM ,
*PU_XFORM; //!< EMF manual 2.2.28
/**
\brief For U_EMREXTCREATEPEN lopn field
EMF manual 2.2.20, Microsoft name: LogPenEx Object
*/
typedef struct {
} U_EXTLOGPEN,
*PU_EXTLOGPEN; //!< EMF manual 2.2.20
/**
\brief For U_EMR_* OffBmi* fields
WMF Manual 2.2.2.9, Microsoft name: (none).
Description of a Bitmap which in some cases is a Device Independent Bitmap (DIB)
*/
typedef struct {
} U_BITMAPINFO,
*PU_BITMAPINFO; //!< WMF Manual 2.2.2.9
/**
\brief U_EMRALPHABLEND Blend field
EMF Manual 2.3.1.1, Microsoft name: BLENDFUNCTION field of EMR_ALPHABLEND record.
*/
typedef struct {
} U_BLEND,
*PU_BLEND; //!< EMF Manual 2.3.1.1
#
/**
General form of an EMF record.
Microsoft name: ENHMETARECORD Object
For generic cast of other U_EMR_* records
*/
typedef struct {
*PU_ENHMETARECORD; //!< General form of an EMF record.
/** First two fields of all EMF records,
First two fields of all EMF+ records (1 or more within an EMF comment)
For accessing iType and nSize files in all U_EMR* records
Microsoft name: EMR Object
*/
typedef struct {
} U_EMR,
*PU_EMR; //!< First two fields of all EMF records,
/** Generic EMR record with two 32 bit values.
Microsoft name: (none)
*/
typedef struct {
*PU_EMRGENERICPAIR; //!< Generic EMR record with two 32 bit values. Microsoft name: (none)
// ***********************************************************************************
// The following have U_EMR_# records. They are ordered by their record index, not by EMF manual position.
// records which are documented but not implemented
#define U_SIZE_EMRNOTIMPLEMENTED 2048
/* Index 1 */
/**
\brief The first U_ENHMETARECORD record in the metafile.
EMF manual 2.2.9, Microsoft name: Header object, HeaderExtension1 object, HeaderExtension2 object
Microsoft names instead: Header, HeaderExtension1, and HeaderExtension2 objects. These are
used nowhere else, so they are combined here, along with the first two fields which were not listed in the Header.
Note also that three fields in this file (nBytes, nRecords, nHandles) must be (re)set after the entire EMF
is constructed, since typically they are not known until then. bOpenGL may or may not be knowable when this
header is written.
Note also that rclBounds and rclFrame are supposed to be the region bounding the drawn content within the
EMF. This is generally smaller than the size from szlDevice. However, since libUEMF does not actually draw
anything it has no way of knowing what these values are. Instead when it creates a header it sets these to
match the szl* fields.
*/
typedef struct {
/** Fields for winver >= win95 */
U_OFFPXLFMT offPixelFormat; //!< Offset in bytes to optional PixelFormatDescriptor from the start of the RECORD, 0 if no PFD
/** Fields for winver >= win98 */
} U_EMRHEADER,
*PU_EMRHEADER; //!< EMF manual 2.2.9
#define U_SIZE_EMRHEADER sizeof(U_EMRHEADER) // modern EMF files, for _really_ old ones the _MIN size applies
#define U_SIZE_EMRHEADER_MIN (U_SIZE_EMRHEADER - sizeof(U_CBPXLFMT) - sizeof(U_OFFPXLFMT) - sizeof(uint32_t) - sizeof(U_SIZEL))
/* Index 2,3,4,5,6 */
/** EMF manual 2.3.5.16
*/
typedef struct {
U_EMRPOLYGON, //!< EMF manual 2.3.5.22
U_EMRPOLYLINE, //!< EMF manual 2.3.5.24
U_EMRPOLYBEZIERTO, //!< EMF manual 2.3.5.18
U_EMRPOLYLINETO, //!< EMF manual 2.3.5.26
*PU_EMRPOLYBEZIER, //!< EMF manual 2.3.5.16
*PU_EMRPOLYGON, //!< EMF manual 2.3.5.22
*PU_EMRPOLYLINE, //!< EMF manual 2.3.5.24
*PU_EMRPOLYBEZIERTO, //!< EMF manual 2.3.5.18
*PU_EMRPOLYLINETO; //!< EMF manual 2.3.5.26
/* Index 7,8 */
/** EMF manual 2.3.5.30
After this struct the record also contains an array of points:\n
U_POINTL aptl[1];
*/
typedef struct {
U_EMRPOLYPOLYGON, //!< EMF manual 2.3.5.28
*PU_EMRPOLYPOLYLINE, //!< EMF manual 2.3.5.30
*PU_EMRPOLYPOLYGON; //!< EMF manual 2.3.5.28
#define U_SIZE_EMRPOLYPOLYLINE (sizeof(U_EMR) + sizeof(U_RECTL) + sizeof(U_NUM_POLYCOUNTS) + sizeof(U_POLYCOUNTS))
/* Index 9,11 (numbers interleave with next one) */
/** EMF manual 2.3.11.30
*/
typedef struct {
U_EMRSETVIEWPORTEXTEX, //!< EMF manual manual 2.3.11.28
*PU_EMRSETWINDOWEXTEX, //!< EMF manual manual 2.3.11.30
*PU_EMRSETVIEWPORTEXTEX; //!< EMF manual manual 2.3.11.28
#define U_SIZE_EMRSETWINDOWEXTEX (sizeof(U_EMRSETWINDOWEXTEX ))
#define U_SIZE_EMRSETVIEWPORTEXTEX (sizeof(U_EMRSETVIEWPORTEXTEX))
/* Index 10,12,13 */
/** EMF manual 2.3.11.31
*/
typedef struct {
U_EMRSETVIEWPORTORGEX, //!< EMF manual 2.3.11.29
U_EMRSETBRUSHORGEX, //!< EMF manual 2.3.11.12
*PU_EMRSETWINDOWORGEX, //!< EMF manual 2.3.11.31
*PU_EMRSETVIEWPORTORGEX, //!< EMF manual 2.3.11.29
*PU_EMRSETBRUSHORGEX; //!< EMF manual 2.3.11.12
#define U_SIZE_EMRSETWINDOWORGEX (sizeof(U_EMRSETWINDOWORGEX ))
#define U_SIZE_EMRSETVIEWPORTORGEX (sizeof(U_EMRSETVIEWPORTORGEX))
#define U_SIZE_EMRSETBRUSHORGEX (sizeof(U_EMRSETBRUSHORGEX ))
/* Index 14 */
/** EMF manual 3.2.4.1
This is a very odd structure because the nSizeLast follows an optional variable size field. Consequently
even though nSizeLast has a name it cannot actually be accessed by it! Following the core structure
appear these fields:\n
U_LOGPLTNTRY PalEntries[1]; Record may include optional array of PalEntries
uint32_t nSizeLast; Mandatory, but position isn't fixed. Must have same value as emr.nSize in header record
*/
typedef struct {
} U_EMREOF,
*PU_EMREOF; //!< EMF manual 3.2.4.1
#define U_SIZE_EMREOF (sizeof(U_EMREOF))
/* Index 15 */
/** EMF manual 2.3.5.36
*/
typedef struct {
*PU_EMRSETPIXELV; //!< EMF manual 2.3.5.36
#define U_SIZE_EMRSETPIXELV (sizeof(U_EMRSETPIXELV))
/* Index 16 */
/** EMF manual 2.3.11.20
*/
typedef struct {
*PU_EMRSETMAPPERFLAGS; //!< EMF manual 2.3.11.20
#define U_SIZE_EMRSETMAPPERFLAGS (sizeof(U_EMRSETMAPPERFLAGS))
/* Index 17,18,19,20,21,22,67,98,115
*/
/** EMF manual 2.3.11.19 MapMode enumeration
*/
typedef struct {
U_EMRSETBKMODE, //!< EMF manual 2.3.11.11 BackgroundMode Enumeration
U_EMRSETPOLYFILLMODE, //!< EMF manual 2.3.11.22 PolygonFillMode Enumeration
U_EMRSETROP2, //!< EMF manual 2.3.11.23 Binary Raster Operation Enumeration
U_EMRSETSTRETCHBLTMODE, //!< EMF manual 2.3.11.24 StretchMode Enumeration
U_EMRSETTEXTALIGN, //!< EMF manual 2.3.11.25 TextAlignment enumeration
U_EMRSELECTCLIPPATH, //!< EMF manual 2.3.2.5 RegionMode Enumeration
U_EMRSETICMMODE, //!< EMF manual 2.3.11.14 ICMMode Enumeration
U_EMRSETLAYOUT, //!< EMF manual 2.3.11.17 Mirroring Enumeration
*PU_EMRSETMAPMODE, //!< EMF manual 2.3.11.19 MapMode enumeration
*PU_EMRSETBKMODE, //!< EMF manual 2.3.11.11 BackgroundMode Enumeration
*PU_EMRSETPOLYFILLMODE, //!< EMF manual 2.3.11.22 PolygonFillMode Enumeration
*PU_EMRSETROP2, //!< EMF manual 2.3.11.23 Binary Raster Operation Enumeration
*PU_EMRSETSTRETCHBLTMODE, //!< EMF manual 2.3.11.24 StretchMode Enumeration
*PU_EMRSETTEXTALIGN, //!< EMF manual 2.3.11.25 TextAlignment enumeration
*PU_EMRSELECTCLIPPATH, //!< EMF manual 2.3.2.5 RegionMode Enumeration
*PU_EMRSETICMMODE, //!< EMF manual 2.3.11.14 ICMMode Enumeration
*PU_EMRSETLAYOUT; //!< EMF manual 2.3.11.17 Mirroring Enumeration
#define U_SIZE_EMRSETMAPMODE (sizeof(U_EMRSETMAPMODE ))
#define U_SIZE_EMRSETBKMODE (sizeof(U_EMRSETBKMODE ))
#define U_SIZE_EMRSETPOLYFILLMODE (sizeof(U_EMRSETPOLYFILLMODE ))
#define U_SIZE_EMRSETROP2 (sizeof(U_EMRSETROP2 ))
#define U_SIZE_EMRSETSTRETCHBLTMODE (sizeof(U_EMRSETSTRETCHBLTMODE))
#define U_SIZE_EMRSETTEXTALIGN (sizeof(U_EMRSETTEXTALIGN ))
#define U_SIZE_EMRSELECTCLIPPATH (sizeof(U_EMRSELECTCLIPPATH ))
#define U_SIZE_EMRSETICMMODE (sizeof(U_EMRSETICMMODE ))
#define U_SIZE_EMRSETLAYOUT (sizeof(U_EMRSETLAYOUT ))
/* Index 23 */
/** EMF manual 2.3.11.13
*/
typedef struct {
*PU_EMRSETCOLORADJUSTMENT; //!< EMF manual 2.3.11.13
#define U_SIZE_EMRSETCOLORADJUSTMENT (sizeof(U_EMRSETCOLORADJUSTMENT))
/* Index 24, 25 */
/** EMF manual 2.3.11.26
*/
typedef struct {
U_EMRSETBKCOLOR, //!< EMF manual 2.3.11.10
*PU_EMRSETTEXTCOLOR, //!< EMF manual 2.3.11.26
*PU_EMRSETBKCOLOR; //!< EMF manual 2.3.11.10
#define U_SIZE_EMRSETTEXTCOLOR (sizeof(U_EMRSETTEXTCOLOR))
#define U_SIZE_EMRSETBKCOLOR (sizeof(U_EMRSETBKCOLOR ))
/* Index 26 */
/** EMF manual 2.3.2.4
*/
typedef struct {
*PU_EMROFFSETCLIPRGN; //!< EMF manual 2.3.2.4
#define U_SIZE_EMROFFSETCLIPRGN (sizeof(U_EMROFFSETCLIPRGN))
/* Index 27, 54 */
/**
EMF manual 2.3.11.4
EMF manual 2.3.5.13
*/
typedef struct {
U_EMRLINETO, //!< EMF manual 2.3.5.13
*PU_EMRMOVETOEX, //!< EMF manual 2.3.11.4
*PU_EMRLINETO; //!< EMF manual 2.3.5.13
#define U_SIZE_EMRMOVETOEX (sizeof(U_EMRMOVETOEX))
#define U_SIZE_EMRLINETO (sizeof(U_EMRLINETO ))
/* Index 28,33,52,59,60,61,65,66,68 */
/** EMF manual 2.3.2
*/
typedef struct {
}
U_EMRSAVEDC, //!< EMF manual 2.3.11
U_EMRREALIZEPALETTE, //!< EMF manual 2.3.10
U_EMRBEGINPATH, //!< EMF manual 2.3.10
U_EMRENDPATH, //!< EMF manual 2.3.10
U_EMRCLOSEFIGURE, //!< EMF manual 2.3.10
U_EMRFLATTENPATH, //!< EMF manual 2.3.10
U_EMRWIDENPATH, //!< EMF manual 2.3.10
U_EMRABORTPATH, //!< EMF manual 2.3.10
*PU_EMRSETMETARGN, //!< EMF manual 2.3.2
*PU_EMRSAVEDC, //!< EMF manual 2.3.11
*PU_EMRREALIZEPALETTE, //!< EMF manual 2.3.10
*PU_EMRBEGINPATH, //!< EMF manual 2.3.10
*PU_EMRENDPATH, //!< EMF manual 2.3.10
*PU_EMRCLOSEFIGURE, //!< EMF manual 2.3.10
*PU_EMRFLATTENPATH, //!< EMF manual 2.3.10
*PU_EMRWIDENPATH, //!< EMF manual 2.3.10
*PU_EMRABORTPATH; //!< EMF manual 2.3.10
#define U_SIZE_EMRSETMETARGN (sizeof(U_EMRSETMETARGN ))
#define U_SIZE_EMRSAVEDC (sizeof(U_EMRSAVEDC ))
#define U_SIZE_EMRREALIZEPALETTE (sizeof(U_EMRREALIZEPALETTE))
#define U_SIZE_EMRBEGINPATH (sizeof(U_EMRBEGINPATH ))
#define U_SIZE_EMRENDPATH (sizeof(U_EMRENDPATH ))
#define U_SIZE_EMRCLOSEFIGURE (sizeof(U_EMRCLOSEFIGURE ))
#define U_SIZE_EMRFLATTENPATH (sizeof(U_EMRFLATTENPATH ))
#define U_SIZE_EMRWIDENPATH (sizeof(U_EMRWIDENPATH ))
#define U_SIZE_EMRABORTPATH (sizeof(U_EMRABORTPATH ))
/* Index 29,30 */
/** EMF manual 2.3.2.1
*/
typedef struct {
U_EMRINTERSECTCLIPRECT, //!< EMF manual 2.3.2.3
*PU_EMREXCLUDECLIPRECT, //!< EMF manual 2.3.2.1
*PU_EMRINTERSECTCLIPRECT; //!< EMF manual 2.3.2.3
#define U_SIZE_EMREXCLUDECLIPRECT (sizeof(U_EMREXCLUDECLIPRECT ))
#define U_SIZE_EMRINTERSECTCLIPRECT (sizeof(U_EMRINTERSECTCLIPRECT ))
/* Index 31,32 */
/** EMF manual 2.3.11.7
*/
typedef struct {
U_EMRSCALEWINDOWEXTEX, //!< EMF manual 2.3.11.8
*PU_EMRSCALEVIEWPORTEXTEX, //!< EMF manual 2.3.11.7
*PU_EMRSCALEWINDOWEXTEX; //!< EMF manual 2.3.11.8
#define U_SIZE_EMRSCALEVIEWPORTEXTEX (sizeof(U_EMRSCALEVIEWPORTEXTEX))
#define U_SIZE_EMRSCALEWINDOWEXTEX (sizeof(U_EMRSCALEWINDOWEXTEX ))
/* Index 33 (see 28) */
/* Index 34 */
/** EMF manual 2.3.11.6
*/
typedef struct {
*PU_EMRRESTOREDC; //!< EMF manual 2.3.11.6
#define U_SIZE_EMRRESTOREDC (sizeof(U_EMRRESTOREDC))
/* Index 35 */
/** EMF manual 2.3.12.2
*/
typedef struct {
*PU_EMRSETWORLDTRANSFORM; //!< EMF manual 2.3.12.2
#define U_SIZE_EMRSETWORLDTRANSFORM (sizeof(U_EMRSETWORLDTRANSFORM))
/* Index 36 */
/** EMF manual 2.3.12.1
*/
typedef struct {
*PU_EMRMODIFYWORLDTRANSFORM; //!< EMF manual 2.3.12.1
#define U_SIZE_EMRMODIFYWORLDTRANSFORM (sizeof(U_EMRMODIFYWORLDTRANSFORM))
/* Index 37,40 */
/** EMF manual 2.3.8.3
*/
typedef struct {
U_EMRSELECTOBJECT, //!< EMF manual 2.3.8.5
*PU_EMRDELETEOBJECT, //!< EMF manual 2.3.8.3
*PU_EMRSELECTOBJECT; //!< EMF manual 2.3.8.5
#define U_SIZE_EMRDELETEOBJECT (sizeof(U_EMRDELETEOBJECT))
#define U_SIZE_EMRSELECTOBJECT (sizeof(U_EMRSELECTOBJECT))
/* Index 38 */
/** EMF manual 2.3.7.7
*/
typedef struct {
*PU_EMRCREATEPEN; //!< EMF manual 2.3.7.7
#define U_SIZE_EMRCREATEPEN (sizeof(U_EMRCREATEPEN))
/* Index 39 */
/** EMF manual 2.3.7.1
*/
typedef struct {
*PU_EMRCREATEBRUSHINDIRECT; //!< EMF manual 2.3.7.1
#define U_SIZE_EMRCREATEBRUSHINDIRECT (sizeof(U_EMRCREATEBRUSHINDIRECT))
/* Index 40 see 37 */
/* Index 41 */
/** EMF manual 2.3.5.1
*/
typedef struct {
*PU_EMRANGLEARC; //!< EMF manual 2.3.5.1
#define U_SIZE_EMRANGLEARC (sizeof(U_EMRANGLEARC))
/* Index 42,43 */
/** EMF manual 2.3.5.5
*/
typedef struct {
} U_EMRELLIPSE,
U_EMRRECTANGLE, //!< EMF manual 2.3.5.5
*PU_EMRELLIPSE, //!< EMF manual 2.3.5.5
*PU_EMRRECTANGLE; //!< EMF manual 2.3.5.34
#define U_SIZE_EMRELLIPSE (sizeof(U_EMRELLIPSE ))
#define U_SIZE_EMRRECTANGLE (sizeof(U_EMRRECTANGLE))
/* Index 44 */
/** EMF manual 2.3.5.35
*/
typedef struct {
*PU_EMRROUNDRECT; //!< EMF manual 2.3.5.35
#define U_SIZE_EMRROUNDRECT (sizeof(U_EMRROUNDRECT))
/* Index 45, 46 ,47, 55 */
/** EMF manual 2.3.5.2
*/
typedef struct {
} U_EMRARC,
U_EMRCHORD, //!< EMF manual 2.3.5.4
U_EMRPIE, //!< EMF manual 2.3.5.15
U_EMRARCTO, //!< EMF manual 2.3.5.3
*PU_EMRARC, //!< EMF manual 2.3.5.2
*PU_EMRCHORD, //!< EMF manual 2.3.5.4
*PU_EMRPIE, //!< EMF manual 2.3.5.15
*PU_EMRARCTO; //!< EMF manual 2.3.5.3
#define U_SIZE_EMRARC (sizeof(U_EMRARC ))
#define U_SIZE_EMRCHORD (sizeof(U_EMRCHORD))
#define U_SIZE_EMRPIE (sizeof(U_EMRPIE ))
#define U_SIZE_EMRARCTO (sizeof(U_EMRARCTO))
/* Index 48 */
/** EMF manual 2.3.8.6
*/
typedef struct {
*PU_EMRSELECTPALETTE; //!< EMF manual 2.3.8.6
#define U_SIZE_EMRSELECTPALETTE (sizeof(U_EMRSELECTPALETTE))
/* Index 49 */
/** EMF manual 2.3.7.6
*/
typedef struct {
*PU_EMRCREATEPALETTE; //!< EMF manual 2.3.7.6
#define U_SIZE_EMRCREATEPALETTE (sizeof(U_EMRCREATEPALETTE))
/* Index 50 */
/** EMF manual 2.3.8.8
*/
typedef struct {
*PU_EMRSETPALETTEENTRIES; //!< EMF manual 2.3.8.8
/* Index 51 */
/** EMF manual 2.3.8.4
*/
typedef struct {
*PU_EMRRESIZEPALETTE; //!< EMF manual 2.3.8.4
#define U_SIZE_EMRRESIZEPALETTE (sizeof(U_EMRRESIZEPALETTE))
/* Index 52 (see 28) */
/* Index 53 */
/** EMF manual 2.3.5.6
*/
typedef struct {
*PU_EMREXTFLOODFILL; //!< EMF manual 2.3.5.6
#define U_SIZE_EMREXTFLOODFILL (sizeof(U_EMREXTFLOODFILL))
/* Index 54 (see 27) */
/* Index 55 (see 45) */
/* Index 56 */
/** EMF manual 2.3.5.20
followed by
uint8_t abTypes[1]; //!< Array of Point Enumeration
*/
typedef struct {
*PU_EMRPOLYDRAW; //!< EMF manual 2.3.5.20
/* Index 57 */
/** EMF manual 2.3.11.9
*/
typedef struct {
*PU_EMRSETARCDIRECTION; //!< EMF manual 2.3.11.9
#define U_SIZE_EMRSETARCDIRECTION (sizeof(U_EMRSETARCDIRECTION))
/* Index 58 */
/** EMF manual 2.3.11.21
IMPORTANT!!!! The Microsoft structure uses a float for the miterlimit but the EMF file record
uses an unsigned int. The latter form is used in this structure.
*/
typedef struct {
*PU_EMRSETMITERLIMIT; //!< EMF manual 2.3.11.21
#define U_SIZE_EMRSETMITERLIMIT (sizeof(U_EMRSETMITERLIMIT))
/* Index 59,60,61 (see 28) */
/* Index 62,63,64 */
/** EMF manual 2.3.5.9
*/
typedef struct {
U_EMRSTROKEANDFILLPATH, //!< EMF manual 2.3.5.38
U_EMRSTROKEPATH, //!< EMF manual 2.3.5.39
*PU_EMRFILLPATH, //!< EMF manual 2.3.5.9
*PU_EMRSTROKEANDFILLPATH, //!< EMF manual 2.3.5.38
*PU_EMRSTROKEPATH; //!< EMF manual 2.3.5.39
#define U_SIZE_EMRFILLPATH (sizeof(U_EMRFILLPATH ))
#define U_SIZE_EMRSTROKEANDFILLPATH (sizeof(U_EMRSTROKEANDFILLPATH))
#define U_SIZE_EMRSTROKEPATH (sizeof(U_EMRSTROKEPATH ))
/* Index 65,66 (see 28) */
/* Index 67 (see 17) */
/* Index 68 (see 28) */
/* Index 69 (not a defined U_EMR record type ) */
/* Index 70 */
/** EMF manual 2.3.3.1
*/
typedef struct {
} U_EMRCOMMENT,
*PU_EMRCOMMENT; //!< EMF manual 2.3.3.1, AKA GDICOMMENT
/* variant comment types */
/** EMF manual 2.3.3.2
*/
typedef struct {
*PU_EMRCOMMENT_EMFPLUS; //!< EMF manual 2.3.3.2, EMF Plus comment
/** EMF manual 2.3.3.3
*/
typedef struct {
*PU_EMRCOMMENT_SPOOL; //!< EMF manual 2.3.3.3, EMF Spool comment
/** EMF manual 2.3.3.4
*/
typedef struct {
*PU_EMRCOMMENT_PUBLIC; //!< EMF manual 2.3.3.4, EMF Public comment
/* Index 71 */
/** EMF manual 2.3.5.10
followed by a variable number of U_RECTLs
*/
typedef struct {
} U_EMRFILLRGN,
*PU_EMRFILLRGN; //!< EMF manual 2.3.5.10
#define U_SIZE_EMRFILLRGN (sizeof(U_EMR) + sizeof(U_RECTL) + sizeof(U_CBRGNDATA) + sizeof(uint32_t))
/* Index 72 */
/** EMF manual 2.3.5.11
*/
typedef struct {
*PU_EMRFRAMERGN; //!< EMF manual 2.3.5.11
#define U_SIZE_EMRFRAMERGN (sizeof(U_EMR) + sizeof(U_RECTL) + sizeof(U_CBRGNDATA) + sizeof(uint32_t) + sizeof(U_SIZEL))
/* Index 73,74 */
/** EMF manual 2.3.11.3
*/
typedef struct {
U_EMRPAINTRGN, //!< EMF manual 2.3.5.14
*PU_EMRINVERTRGN, //!< EMF manual 2.3.11.3
*PU_EMRPAINTRGN; //!< EMF manual 2.3.5.14
/* Index 75 */
/** EMF manual 2.3.2.2
*/
typedef struct {
*PU_EMREXTSELECTCLIPRGN; //!< EMF manual 2.3.2.2
/* Index 76 */
/** EMF manual 2.3.1.2
*/
typedef struct {
//!< Record may include optional bitmapbuffer
} U_EMRBITBLT,
*PU_EMRBITBLT; //!< EMF manual 2.3.1.2
#define U_SIZE_EMRBITBLT (sizeof(U_EMRBITBLT))
/* Index 77 */
/** EMF manual 2.3.1.6
*/
typedef struct {
//!< Record may include optional bitmapbuffer
*PU_EMRSTRETCHBLT; //!< EMF manual 2.3.1.6
#define U_SIZE_EMRSTRETCHBLT (sizeof(U_EMRSTRETCHBLT))
/* Index 78 */
/** EMF manual 2.3.1.3
*/
typedef struct {
//!< Record may include optional Source and mask bitmapbuffers
} U_EMRMASKBLT,
*PU_EMRMASKBLT; //!< EMF manual 2.3.1.3
#define U_SIZE_EMRMASKBLT (sizeof(U_EMRMASKBLT))
/* Index 79 */
/** EMF manual 2.3.1.4
*/
typedef struct {
//!< Record may include optional Source and mask bitmapbuffers
} U_EMRPLGBLT,
*PU_EMRPLGBLT; //!< EMF manual 2.3.1.4
#define U_SIZE_EMRPLGBLT (sizeof(U_EMRPLGBLT))
/* Index 80 */
/** EMF manual 2.3.1.5
*/
typedef struct {
//!< Record may includes optional bitmapbuffer
*PU_EMRSETDIBITSTODEVICE; //!< EMF manual 2.3.1.5
#define U_SIZE_EMRSETDIBITSTODEVICE (sizeof(U_EMRSETDIBITSTODEVICE))
/* Index 81 */
/** EMF manual 2.3.1.7
*/
typedef struct {
//!< Record may includes optional bitmapbuffer
*PU_EMRSTRETCHDIBITS; //!< EMF manual 2.3.1.7
#define U_SIZE_EMRSTRETCHDIBITS (sizeof(U_EMRSTRETCHDIBITS))
/* Index 82 */
/** EMF manual 2.3.7.8
*/
typedef struct {
U_LOGFONT_PANOSE elfw; //!< Font parameters, either U_LOGFONT or U_LOGFONT_PANOSE, the latter is bigger so use that type here
*PU_EMREXTCREATEFONTINDIRECTW; //!< EMF manual 2.3.7.8
#define U_SIZE_EMREXTCREATEFONTINDIRECTW_LOGFONT_PANOSE (sizeof(U_EMR) + 4 + sizeof(U_LOGFONT_PANOSE))
/* Index 83,84 */
/** EMF manual 2.3.5.7
Variable and optional fields may follow core structure in record:\n
U_OFFDX offDx; (required) Offset in bytes to the character spacing array from the start of the RECORD
uint32_t Dx (optional) character spacing array (Required, but position is not static.)
*/
typedef struct {
U_EMREXTTEXTOUTW, //!< EMF manual 2.3.5.8
*PU_EMREXTTEXTOUTA, //!< EMF manual 2.3.5.7
*PU_EMREXTTEXTOUTW; //!< EMF manual 2.3.5.8
#define U_SIZE_EMREXTTEXTOUTA (sizeof(U_EMREXTTEXTOUTA))
#define U_SIZE_EMREXTTEXTOUTW (sizeof(U_EMREXTTEXTOUTW))
/* Index 85,86,87,88,89 */
/** EMF manual 2.3.5.17
*/
typedef struct {
U_EMRPOLYGON16, //!< EMF manual 2.3.5.23
U_EMRPOLYLINE16, //!< EMF manual 2.3.5.25
U_EMRPOLYBEZIERTO16, //!< EMF manual 2.3.5.19
U_EMRPOLYLINETO16, //!< EMF manual 2.3.5.27
*PU_EMRPOLYBEZIER16, //!< EMF manual 2.3.5.17
*PU_EMRPOLYGON16, //!< EMF manual 2.3.5.23
*PU_EMRPOLYLINE16, //!< EMF manual 2.3.5.25
*PU_EMRPOLYBEZIERTO16, //!< EMF manual 2.3.5.19
*PU_EMRPOLYLINETO16; //!< EMF manual 2.3.5.27
/* Index 90,91 */
/** EMF manual 2.3.5.31
followed by
U_POINT16 apts[1]; //!< array of point16
*/
typedef struct {
U_EMRPOLYPOLYGON16, //!< EMF manual 2.3.5.29
*PU_EMRPOLYPOLYLINE16, //!< EMF manual 2.3.5.31
*PU_EMRPOLYPOLYGON16; //!< EMF manual 2.3.5.29
#define U_SIZE_EMRPOLYPOLYLINE16 (sizeof(U_EMR) + sizeof(U_RECTL) + sizeof(U_NUM_POLYCOUNTS) + sizeof(U_NUM_POINT16))
/* Index 92 */
/** EMF manual 2.3.5.21
followed by
uint8_t abTypes[1]; //!< Array of Point Enumeration
*/
typedef struct {
*PU_EMRPOLYDRAW16; //!< EMF manual 2.3.5.21
/* Index 93 */
/** EMF manual 2.3.7.5
*/
typedef struct {
//!< Record may include optional DIB bitmapbuffer
*PU_EMRCREATEMONOBRUSH; //!< EMF manual 2.3.7.5
#define U_SIZE_EMRCREATEMONOBRUSH (sizeof(U_EMRCREATEMONOBRUSH))
/* Index 94 */
/** EMF manual 2.3.7.4
*/
typedef struct {
//!< Record may include optional DIB bitmapbuffer
*PU_EMRCREATEDIBPATTERNBRUSHPT; //!< EMF manual 2.3.7.4
#define U_SIZE_EMRCREATEDIBPATTERNBRUSHPT (sizeof(U_EMRCREATEDIBPATTERNBRUSHPT))
/* Index 95 */
/** EMF manual 2.3.7.9
*/
typedef struct {
//!< Record may include optional DIB bitmap
*PU_EMREXTCREATEPEN; //!< EMF manual 2.3.7.9
#define U_SIZE_EMREXTCREATEPEN (sizeof(U_EMREXTCREATEPEN))
/* Index 96.97 */
/** EMF manual 2.3.5.32
*/
typedef struct {
U_EMRPOLYTEXTOUTW, //!< EMF manual 2.3.5.33
*PU_EMRPOLYTEXTOUTA, //!< EMF manual 2.3.5.32
*PU_EMRPOLYTEXTOUTW; //!< EMF manual 2.3.5.33
#define U_SIZE_EMRPOLYTEXTOUTA (sizeof(U_EMR) + sizeof(U_RECTL) + sizeof(uint32_t) + 2*sizeof(U_FLOAT) + sizeof(U_NUM_EMRTEXT))
/* Index 98 (see 17) */
/* Index 99 */
/** EMF manual 2.3.7.2
*/
typedef struct {
*PU_EMRCREATECOLORSPACE; //!< EMF manual 2.3.7.2
#define U_SIZE_EMRCREATECOLORSPACE (sizeof(U_EMRCREATECOLORSPACE))
/* Index 100,101 */
/** EMF manual 2.3.8.2
*/
typedef struct {
U_EMRSETCOLORSPACE, //!< EMF manual 2.3.8.7
*PU_EMRDELETECOLORSPACE, //!< EMF manual 2.3.8.2
*PU_EMRSETCOLORSPACE; //!< EMF manual 2.3.8.7
#define U_SIZE_EMRDELETECOLORSPACE (sizeof(U_EMRDELETECOLORSPACE))
#define U_SIZE_EMRSETCOLORSPACE (sizeof(U_EMRSETCOLORSPACE ))
/* Index 102 */
/** EMF manual 2.3.9.2
*/
typedef struct {
*PU_EMRGLSRECORD; //!< EMF manual 2.3.9.2
#define U_SIZE_EMRGLSRECORD (sizeof(U_EMRGLSRECORD))
/* Index 103 */
/** EMF manual 2.3.9.1
*/
typedef struct {
*PU_EMRGLSBOUNDEDRECORD; //!< EMF manual 2.3.9.1
/* Index 104 */
/** EMF manual 2.3.11.5
*/
typedef struct {
*PU_EMRPIXELFORMAT; //!< EMF manual 2.3.11.5
#define U_SIZE_EMRPIXELFORMAT (sizeof(U_EMRPIXELFORMAT))
/* Index 105 */
/** EMF manual 2.3.6.1
*/
typedef struct {
*PU_EMRDRAWESCAPE; //!< EMF manual 2.3.6.1
/* Index 106 */
/** EMF manual 2.3.6.2
*/
typedef struct {
*PU_EMREXTESCAPE; //!< EMF manual 2.3.6.2
/* Index 107 (not implemented ) */
/* Index 108 */
/** EMF manual 2.3.5.37
*/
typedef struct {
//!< the tail end of this record is variable.
//!< U_RECTL rclBounds; Record may include optional Bounding rectangle (absent when: fuOPtions & ETO_NO_U_RECT)
//!< uint32_t TextString; text to output (fuOptions & ETO_SMALL_CHARS ? 8 bit : 16 bit)
*PU_EMRSMALLTEXTOUT; //!< EMF manual 2.3.5.37
#define U_SIZE_EMRSMALLTEXTOUT (sizeof(U_EMRSMALLTEXTOUT))
/* Index 109 (not implemented )
EMF manual 2.3.11.2
*/
/* Index 110 */
/** EMF manual 2.3.6.3
followed by
uint8_t Data[1]; //!< Data for printer driver
*/
typedef struct {
*PU_EMRNAMEDESCAPE; //!< EMF manual 2.3.6.3
#define U_SIZE_EMRNAMEDESCAPE (sizeof(U_EMRNAMEDESCAPE))
/* Index 111-113 (not implemented )
EMF manual 2.3.8.1
EMF manual 2.3.11.15
EMF manual 2.3.11.16
*/
/* Index 114 */
/** EMF manual 2.3.1.1
*/
typedef struct {
//!< Record may include optional DIB bitmap
*PU_EMRALPHABLEND; //!< EMF manual 2.3.1.1
#define U_SIZE_EMRALPHABLEND (sizeof(U_EMRALPHABLEND))
/* Index 115 (see 17) */
/* Index 116 */
/** EMF manual 2.3.1.8
*/
typedef struct {
//!< Record may includes optional bitmapbuffer
*PU_EMRTRANSPARENTBLT; //!< EMF manual 2.3.1.8
#define U_SIZE_EMRTRANSPARENTBLT (sizeof(U_EMRTRANSPARENTBLT))
/* Index 117 (not a defined U_EMR record type ) */
/* Index 118 */
/** EMF manual 2.3.5.12
followed by
U_TRIVERTEX TriVert[1]; Array of TriVertex objects
uint32_t GradObj[1]; Array of gradient objects (each has 2 or 3 indices into TriVert array)
*/
typedef struct {
*PU_EMRGRADIENTFILL; //!< EMF manual 2.3.5.12
#define U_SIZE_EMRGRADIENTFILL (sizeof(U_EMRGRADIENTFILL))
/* Index 119,120 (not implemented )
EMF manual 2.3.11.18
EMF manual 2.3.11.27
*/
/* Index 121 */
/** EMF manual 2.3.11.1
*/
typedef struct {
*PU_EMRCOLORMATCHTOTARGETW; //!< EMF manual 2.3.11.1
#define U_SIZE_EMRCOLORMATCHTOTARGETW (sizeof(U_EMR) + 2*sizeof(uint32_t) + sizeof(U_CBNAME) + sizeof(U_CBDATA))
/* Index 122 */
/** EMF manual 2.3.7.3
*/
typedef struct {
*PU_EMRCREATECOLORSPACEW; //!< EMF manual 2.3.7.3
#define U_SIZE_EMRCREATECOLORSPACEW (sizeof(U_EMR) + 2*sizeof(uint32_t) + sizeof(U_LOGCOLORSPACEW) + sizeof(U_CBDATA))
// records which are not documented, so we have no idea what to do with them
#define U_SIZE_EMRUNDEFINED 2048
// ************************************************************************************************
// Utility function structures
/**
Storage for keeping track of properties of the growing EMF file as records are added.
*/
typedef struct {
char *buf; //!< Buffer for constructing the EMF in memory
} EMFTRACK;
/**
The various create functions need a place to put their handles, these are stored in the table below.
We don't actually do anything much with these handles, that is up to whatever program finally plays back the EMF, but
we do need to keep track of the numbers so that they are not accidentally reused. This structure is used for that,
and all *_set functions that touch a handle reference it.
Stock objects are not used in this limited model, so libUEMF cannot detect if a handle is still in use. Nor can it
tell when a handle has been deselected (by selecting another handle for the same type of graphic object, and thus
made deleteable). End user code must keep track of this for itself.
*/
typedef struct {
} EMFHANDLES;
/**
2 x 2 matrix, used by xform_alt_set() function.
*/
typedef struct {
double M11; //!< Matrix element 1,1
double M12; //!< Matrix element 1,2
double M21; //!< Matrix element 2,1
double M22; //!< Matrix element 2,2
} U_MAT2X2,
*PU_MAT2X2; //!< 2 x 2 matrix, used by xform_alt_set() function.
// ************************************************************************************************
// Prototypes
//! \cond
void wchar8show(const char *src);
char *U_emr_names(unsigned int idx);
int emr_arc_points(PU_ENHMETARECORD record, int *f1, int f2, PU_PAIRF center, PU_PAIRF start, PU_PAIRF end, PU_PAIRF size);
int get_real_color_count(const char *Bmih);
int drawing_size(const int xmm, const int yum, const float dpmm, U_RECTL *rclBounds, U_RECTL *rclFrame);
/* use these instead*/
/* Deprecated forms */
#define htable_create emf_htable_create
#define htable_delete emf_htable_delete
#define htable_insert emf_htable_insert
#define htable_free emf_htable_free
#define point_set point32_set
#define pointl_set point32_set
U_XFORM xform_set(U_FLOAT eM11, U_FLOAT eM12, U_FLOAT eM21, U_FLOAT eM22, U_FLOAT eDx, U_FLOAT eDy);
U_XFORM xform_alt_set(U_FLOAT scale, U_FLOAT ratio, U_FLOAT rot, U_FLOAT axisrot, U_FLOAT eDx, U_FLOAT eDy);
U_COLORREF elpColor, int32_t elpHatch, U_NUM_STYLEENTRY elpNumEntries, U_STYLEENTRY *elpStyleEntry );
U_LOGFONT logfont_set( int32_t lfHeight, int32_t lfWidth, int32_t lfEscapement, int32_t lfOrientation,
char *emrtext_set(U_POINTL ptlReference, U_NUM_STR NumString, uint32_t cbChar, void *String, uint32_t fOptions, U_RECTL rcl, uint32_t *Dx);
U_PIXELFORMATDESCRIPTOR pixelformatdescriptor_set( uint32_t dwFlags, uint8_t iPixelType, uint8_t cColorBits,
char *textcomment_set(const char *string);
// These generate the handle and then call the underlying function
char *extcreatefontindirectw_set(uint32_t *ihFont, EMFHANDLES *eht, const char *elf, const char *elfw);
char *setpaletteentries_set(uint32_t *ihPal, EMFHANDLES *eht, uint32_t iStart, U_NUM_LOGPLTNTRY cEntries, PU_LOGPLTNTRY aPalEntries);
char *framergn_set(uint32_t *ihBrush, EMFHANDLES *eht, U_RECTL rclBounds, U_SIZEL szlStroke, PU_RGNDATA RgnData);
char *createcolorspacew_set(uint32_t *ihCS, EMFHANDLES *eht, U_LOGCOLORSPACEW lcs, uint32_t dwFlags, U_CBDATA cbData, uint8_t *Data);
char *U_EMRHEADER_set( const U_RECTL rclBounds, const U_RECTL rclFrame, U_PIXELFORMATDESCRIPTOR* const pfmtDesc,
char *U_EMRPOLYPOLYLINE_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts,
char *U_EMRPOLYPOLYGON_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts,
char *U_EMRSETMAPPERFLAGS_set(void);
char *U_EMRSETMETARGN_set(void);
char *U_EMRSCALEVIEWPORTEXTEX_set(const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom);
char *U_EMRSCALEWINDOWEXTEX_set(const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom);
char *U_EMRSAVEDC_set(void);
char *U_EMRANGLEARC_set(const U_POINTL ptlCenter, const uint32_t nRadius, const U_FLOAT eStartAngle, const U_FLOAT eSweepAngle);
char *U_EMRSETPALETTEENTRIES_set(const uint32_t ihPal, const uint32_t iStart, const U_NUM_LOGPLTNTRY cEntries, const PU_LOGPLTNTRY aPalEntries);
char *U_EMRREALIZEPALETTE_set(void);
char *U_EMREXTFLOODFILL_set(const U_POINTL ptlStart, const U_COLORREF crColor, const uint32_t iMode);
char *U_EMRPOLYDRAW_set(const U_RECTL rclBounds,const U_NUM_POINTL cptl,const U_POINTL *aptl,const uint8_t *abTypes);
char *U_EMRBEGINPATH_set(void);
char *U_EMRENDPATH_set(void);
char *U_EMRCLOSEFIGURE_set(void);
char *U_EMRFLATTENPATH_set(void);
char *U_EMRWIDENPATH_set(void);
char *U_EMRABORTPATH_set(void);
// EMR_ENDEF69
char *U_EMRFRAMERGN_set(const U_RECTL rclBounds, const uint32_t ihBrush, const U_SIZEL szlStroke, const PU_RGNDATA RgnData);
const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc,
const U_POINTL Src, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc,
const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc,
char *U_EMREXTTEXTOUTA_set(U_RECTL rclBounds, uint32_t iGraphicsMode, U_FLOAT exScale, U_FLOAT eyScale, PU_EMRTEXT emrtext);
char *U_EMREXTTEXTOUTW_set(U_RECTL rclBounds, uint32_t iGraphicsMode, U_FLOAT exScale, U_FLOAT eyScale, PU_EMRTEXT emrtext);
char *U_EMRPOLYBEZIERTO16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points);
char *U_EMRPOLYPOLYLINE16_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts,const uint32_t cpts, const U_POINT16 *points);
char *U_EMRPOLYPOLYGON16_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts,const uint32_t cpts, const U_POINT16 *points);
char *U_EMRPOLYDRAW16_set(const U_RECTL rclBounds,const U_NUM_POINT16 cpts, const U_POINT16 *aptl, const uint8_t *abTypes);
char *U_EMREXTCREATEPEN_set(const uint32_t ihPen, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_EXTLOGPEN elp );
// U_EMRPOLYTEXTOUTA_set 96 NOT IMPLEMENTED, denigrated after Windows NT
// U_EMRPOLYTEXTOUTW_set 97 NOT IMPLEMENTED, denigrated after Windows NT
// U_EMRGLSRECORD_set 102 Not implemented
// U_EMRGLSBOUNDEDRECORD_set 103 Not implemented
char *U_EMRSMALLTEXTOUT_set(const U_POINTL Dest, const U_NUM_STR cChars, const uint32_t fuOptions, const uint32_t iGraphicsMode,
// U_EMRDRAWESCAPE_set 105 Not implemented
// U_EMREXTESCAPE_set 106 Not implemented
// U_EMRUNDEF107_set 107 Not implemented
// U_EMRSMALLTEXTOUT_set 108
// U_EMRFORCEUFIMAPPING_set 109 Not implemented
// U_EMRNAMEDESCAPE_set 110 Not implemented
// U_EMRCOLORCORRECTPALETTE_set 111 Not implemented
// U_EMRSETICMPROFILEA_set 112 Not implemented
// U_EMRSETICMPROFILEW_set 113 Not implemented
// U_EMRUNDEF117_set 117 Not implemented
char *U_EMRGRADIENTFILL_set(const U_RECTL rclBounds, const U_NUM_TRIVERTEX nTriVert, const U_NUM_GRADOBJ nGradObj,
// U_EMRSETLINKEDUFIS_set 119 Not implemented
// U_EMRSETTEXTJUSTIFICATION_set 120 Not implemented (denigrated)
// U_EMRCOLORMATCHTOTARGETW_set 121 Not implemented
char *U_EMRCREATECOLORSPACEW_set(const uint32_t ihCS, const U_LOGCOLORSPACEW lcs, const uint32_t dwFlags,
//! \endcond
#ifdef __cplusplus
}
#endif
#endif /* _UEMF_ */