libUEMF
A portable library for reading and writing WMF, EMF and EMF+ files
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
uemf.h
Go to the documentation of this file.
1 
96 /*
97 File: uemf.h
98 Version: 0.0.24
99 Date: 06-NOV-2013
100 Author: David Mathog, Biology Division, Caltech
101 email: mathog@caltech.edu
102 Copyright: 2013 David Mathog and California Institute of Technology (Caltech)
103 */
104 
105 #ifndef _UEMF_
106 #define _UEMF_
107 
108 #ifdef __cplusplus
109 extern "C" {
110 #endif
111 
112 #include <stdlib.h>
113 #include <stdio.h>
114 #include <stdint.h>
115 #include <string.h>
116 #include <stdbool.h>
117 #include "uemf_utf.h"
118 #include "uemf_endian.h"
119 
120 
122 // ***********************************************************************************
123 // defines not placed yet
124 
125 #define U_PAN_CULTURE_LATIN 0
126 
127 #define U_SYSPAL_ERROR 0
128 #define U_SYSPAL_STATIC 1
129 #define U_SYSPAL_NOSTATIC 2
130 
131 #define U_ELF_VENDOR_SIZE 4
132 
134 // ***************************************************************************
138 #define U_NONE 0
139 #define U_PI 3.14159265358979323846
140 #define U_READ 1
141 #define U_WRITE 0
142 #define U_DV_SGNTR 0x08007664
143 #define U_LP_VERSION 0x0300
144 #define U_RDH_RECTANGLES 1
145 #define U_RDH_OBJSIZE 0x20
146 #define U_RGB_GAMMA_MIN (uint16_t)02500
147 #define U_RGB_GAMMA_MAX (uint16_t)65000
148 #define U_REFERENCE_WHITE_MIN (uint16_t)6000
149 #define U_REFERENCE_WHITE_MAX (uint16_t)10000
150 #define U_REFERENCE_BLACK_MIN (uint16_t)0
151 #define U_REFERENCE_BLACK_MAX (uint16_t)4000
152 #define U_COLOR_ADJ_MIN ((int16_t)-100)
153 #define U_COLOR_ADJ_MAX (int16_t) 100
154 #define U_MAX_PATH 1024
155 #define U_LCS_SIGNATURE 0x50534F43
156 #define U_LCS_VERSION 0x400
157 #define U_REC_FREE 1
158 #define U_REC_KEEP 0
159 #define U_ROW_ORDER_INVERT 1
160 #define U_ROW_ORDER_SAME 0
161 #define U_CT_NO 0
162 #define U_CT_BGRA 1
163 #define U_CT_ARGB 1
164 #define U_EMR_COMMENT_SPOOLFONTDEF 0x544F4E46
165 
166 #define U_ROUND(A) ( (A) > 0 ? floor((A)+0.5) : ( (A) < 0 ? -floor(-(A)+0.5) : (A) ) )
167 
171 typedef float U_FLOAT;
172 
173 typedef uint32_t U_CBBITS;
174 typedef uint32_t U_CBBITSMSK;
175 typedef uint32_t U_CBBITSSRC;
176 typedef uint32_t U_CBBMI;
177 typedef uint32_t U_CBBMIMSK;
178 typedef uint32_t U_CBBMISRC;
179 typedef uint32_t U_CBDATA;
180 typedef uint32_t U_CBNAME;
181 typedef uint32_t U_CBPLENTRIES;
182 typedef uint32_t U_CBPXLFMT;
183 typedef uint32_t U_CBRGNDATA;
184 typedef uint32_t U_CBSTR;
185 
186 typedef uint32_t U_OFFBITS;
187 typedef uint32_t U_OFFBITSMSK;
188 typedef uint32_t U_OFFBITSSRC;
189 typedef uint32_t U_OFFBMI;
190 typedef uint32_t U_OFFBMIMSK;
191 typedef uint32_t U_OFFBMISRC;
192 typedef uint32_t U_OFFDATA;
193 typedef uint32_t U_OFFDESC;
194 typedef uint32_t U_OFFDX;
195 typedef uint32_t U_OFFPLENTRIES;
196 typedef uint32_t U_OFFPXLFMT;
197 typedef uint32_t U_OFFSTR;
198 typedef uint8_t U_DATA;
199 
200 // "Types" For array components in structures, where not otherwise defined as a structure
201 typedef uint32_t U_FNTAXES;
202 typedef uint32_t U_STYLEENTRY;
203 typedef uint32_t U_POLYCOUNTS;
204 
205 // "Counts" for array components in structures
206 typedef uint32_t U_NUM_FNTAXES;
207 typedef uint32_t U_NUM_LOGPLTNTRY;
208 typedef uint32_t U_NUM_RECTL;
209 typedef uint32_t U_NUM_POINTL;
210 typedef uint32_t U_NUM_POINT16;
211 typedef uint32_t U_NUM_STYLEENTRY;
212 typedef uint32_t U_NUM_POLYCOUNTS;
213 typedef uint32_t U_NUM_EMRTEXT;
214 typedef uint32_t U_NUM_STR;
215 typedef uint32_t U_NUM_TRIVERTEX;
216 typedef uint32_t U_NUM_GRADOBJ;
217 typedef uint32_t U_NUM_RGBQUAD;
218 
219 
220 
221 /* ************************ WMF pieces used in EMF or EMF+ ****************************** */
222 
241 #define U_R2_BLACK 1
242 #define U_R2_NOTMERGEPEN 2
243 #define U_R2_MASKNOTPEN 3
244 #define U_R2_NOTCOPYPEN 4
245 #define U_R2_MASKPENNOT 5
246 #define U_R2_NOT 6
247 #define U_R2_XORPEN 7
248 #define U_R2_NOTMASKPEN 8
249 #define U_R2_MASKPEN 9
250 #define U_R2_NOTXORPEN 10
251 #define U_R2_NOP 11
252 #define U_R2_MERGENOTPEN 12
253 #define U_R2_COPYPEN 13
254 #define U_R2_MERGEPENNOT 14
255 #define U_R2_MERGEPEN 15
256 #define U_R2_WHITE 16
257 #define U_R2_LAST 16
258 
266 #define U_BCBM_EXPLICIT 0
267 #define U_BCBM_MONOCHROME 1
268 #define U_BCBM_COLOR4 4
269 #define U_BCBM_COLOR8 8
270 #define U_BCBM_COLOR16 16
271 #define U_BCBM_COLOR24 24
272 #define U_BCBM_COLOR32 32
273 
281 #define U_BI_UNKNOWN -1
282 #define U_BI_RGB 0
283 #define U_BI_RLE8 1
284 #define U_BI_RLE4 2
285 #define U_BI_BITFIELDS 3
286 #define U_BI_JPEG 4
287 #define U_BI_PNG 5
288 
296 #define U_LCS_GM_BUSINESS 0x00000001L
297 #define U_LCS_GM_GRAPHICS 0x00000002L
298 #define U_LCS_GM_IMAGES 0x00000004L
299 #define U_LCS_GM_ABS_COLORIMETRIC 0x00000008L
300 
308 #define U_LCS_CALIBRATED_RGB 0x00000000L
309 #define U_LCS_DEVICE_RGB 0x00000001L
310 #define U_LCS_DEVICE_CMYK 0x00000002L
311 
333 #define U_SRCCOPY 0x00cc0020
334 #define U_SRCPAINT 0x00ee0086
335 #define U_SRCAND 0x008800c6
336 #define U_SRCINVERT 0x00660046
337 #define U_SRCERASE 0x00440328
338 #define U_NOTSRCCOPY 0x00330008
339 #define U_NOTSRCERASE 0x001100a6
340 #define U_MERGECOPY 0x00c000ca
341 #define U_MERGEPAINT 0x00bb0226
342 #define U_PATCOPY 0x00f00021
343 #define U_PATPAINT 0x00fb0a09
344 #define U_PATINVERT 0x005a0049
345 #define U_DSTINVERT 0x00550009
346 #define U_BLACKNESS 0x00000042
347 #define U_WHITENESS 0x00ff0062
348 #define U_NOOP 0x00aa0029
349 #define U_NOMIRRORBITMAP 0x80000000
350 
374 // Horizontal text flags
375 #define U_TA_DEFAULT 0x00
376 #define U_TA_NOUPDATECP 0x00
377 #define U_TA_UPDATECP 0x01
378 #define U_TA_LEFT 0x00
379 #define U_TA_RIGHT 0x02
380 #define U_TA_CENTER 0x06
381 #define U_TA_TOP 0x00
382 #define U_TA_BOTTOM 0x08
383 #define U_TA_BASEBIT 0x10
384 #define U_TA_BASELINE 0x18
385 #define U_TA_RTLREADING 0x100
386 #define U_TA_MASK U_TA_BASELINE+U_TA_CENTER+U_TA_UPDATECP+U_TA_RTLREADING
387 // Vertical text flags
388 #define U_VTA_BASELINE U_TA_BASELINE
389 #define U_VTA_LEFT U_TA_BOTTOM
390 #define U_VTA_RIGHT U_TA_TOP
391 #define U_VTA_CENTER U_TA_CENTER
392 #define U_VTA_BOTTOM U_TA_RIGHT
393 #define U_VTA_TOP U_TA_LEFT
394 
401 typedef struct {
402  uint32_t biSize;
403  int32_t biWidth;
404  int32_t biHeight;
405  uint16_t biPlanes;
410  uint16_t biBitCount;
411  uint32_t biCompression;
412  uint32_t biSizeImage;
413  int32_t biXPelsPerMeter;
414  int32_t biYPelsPerMeter;
415  U_NUM_RGBQUAD biClrUsed;
416  uint32_t biClrImportant;
419 
425 typedef struct {
426  int32_t ciexyzX;
427  int32_t ciexyzY;
428  int32_t ciexyzZ;
429 } U_CIEXYZ,
430  *PU_CIEXYZ;
431 
439 typedef struct {
444  *PU_CIEXYZTRIPLE;
445 
452 typedef struct {
453  uint8_t Red;
454  uint8_t Green;
455  uint8_t Blue;
456  uint8_t Reserved;
457 } U_COLORREF,
458  *PU_COLORREF;
459 
465 typedef struct {
466  unsigned ignoreHi :8;
467  unsigned intPart :8;
468  unsigned fracPart :8;
469  unsigned ignoreLo :8;
470 } U_LCS_GAMMA,
471  *PU_LCS_GAMMA;
472 
478 typedef struct {
483  *PU_LCS_GAMMARGB;
484 
490 typedef struct {
491  uint32_t lcsSignature;
492  uint32_t lcsVersion;
493  uint32_t lcsSize;
494  int32_t lcsCSType;
495  int32_t lcsIntent;
498  char lcsFilename[U_MAX_PATH];
501 
507 typedef struct {
508  uint32_t lcsSignature;
509  uint32_t lcsVersion;
510  uint32_t lcsSize;
511  int32_t lcsCSType;
512  int32_t lcsIntent;
515  uint16_t lcsFilename[U_MAX_PATH];
518 
524 typedef struct {
525  int32_t x;
526  int32_t y;
527 } U_PAIR,
528  U_POINT,
529  U_POINTL,
530  *PU_PAIR,
531  *PU_POINT,
532  *PU_POINTL;
533 
534 
541 typedef struct {
542  int16_t x;
543  int16_t y;
544 } U_POINT16,
545  *PU_POINT16;
546 
554 typedef struct {
555  int32_t left;
556  int32_t top;
557  int32_t right;
558  int32_t bottom;
559 } U_RECT,
560  U_RECTL,
561  *PU_RECT,
562  *PU_RECTL;
563 
570 typedef struct {
571  uint8_t Blue;
572  uint8_t Green;
573  uint8_t Red;
574  uint8_t Reserved;
575 } U_RGBQUAD,
576  *PU_RGBQUAD;
577 
578 #define U_RCL_DEF (U_RECTL){0,0,-1,-1}
579 
580 
586 typedef struct {
587  int32_t cx;
588  int32_t cy;
589 } U_SIZE,
590  U_SIZEL,
591  *PU_SIZE,
592  *PU_SIZEL;
593 
594 
595 
596 /* ************************ EMF or common to EMF and EMF+ ****************************** */
597 
598 // ***********************************************************************************
599 // Value enumerations and other predefined constants, alphabetical order by group
600 
601 
606 #define U_LF_FACESIZE 32
607 #define U_LF_FULLFACESIZE 64
608 
616 #define U_EMR_HEADER 1
617 #define U_EMR_POLYBEZIER 2
618 #define U_EMR_POLYGON 3
619 #define U_EMR_POLYLINE 4
620 #define U_EMR_POLYBEZIERTO 5
621 #define U_EMR_POLYLINETO 6
622 #define U_EMR_POLYPOLYLINE 7
623 #define U_EMR_POLYPOLYGON 8
624 #define U_EMR_SETWINDOWEXTEX 9
625 #define U_EMR_SETWINDOWORGEX 10
626 #define U_EMR_SETVIEWPORTEXTEX 11
627 #define U_EMR_SETVIEWPORTORGEX 12
628 #define U_EMR_SETBRUSHORGEX 13
629 #define U_EMR_EOF 14
630 #define U_EMR_SETPIXELV 15
631 #define U_EMR_SETMAPPERFLAGS 16
632 #define U_EMR_SETMAPMODE 17
633 #define U_EMR_SETBKMODE 18
634 #define U_EMR_SETPOLYFILLMODE 19
635 #define U_EMR_SETROP2 20
636 #define U_EMR_SETSTRETCHBLTMODE 21
637 #define U_EMR_SETTEXTALIGN 22
638 #define U_EMR_SETCOLORADJUSTMENT 23
639 #define U_EMR_SETTEXTCOLOR 24
640 #define U_EMR_SETBKCOLOR 25
641 #define U_EMR_OFFSETCLIPRGN 26
642 #define U_EMR_MOVETOEX 27
643 #define U_EMR_SETMETARGN 28
644 #define U_EMR_EXCLUDECLIPRECT 29
645 #define U_EMR_INTERSECTCLIPRECT 30
646 #define U_EMR_SCALEVIEWPORTEXTEX 31
647 #define U_EMR_SCALEWINDOWEXTEX 32
648 #define U_EMR_SAVEDC 33
649 #define U_EMR_RESTOREDC 34
650 #define U_EMR_SETWORLDTRANSFORM 35
651 #define U_EMR_MODIFYWORLDTRANSFORM 36
652 #define U_EMR_SELECTOBJECT 37
653 #define U_EMR_CREATEPEN 38
654 #define U_EMR_CREATEBRUSHINDIRECT 39
655 #define U_EMR_DELETEOBJECT 40
656 #define U_EMR_ANGLEARC 41
657 #define U_EMR_ELLIPSE 42
658 #define U_EMR_RECTANGLE 43
659 #define U_EMR_ROUNDRECT 44
660 #define U_EMR_ARC 45
661 #define U_EMR_CHORD 46
662 #define U_EMR_PIE 47
663 #define U_EMR_SELECTPALETTE 48
664 #define U_EMR_CREATEPALETTE 49
665 #define U_EMR_SETPALETTEENTRIES 50
666 #define U_EMR_RESIZEPALETTE 51
667 #define U_EMR_REALIZEPALETTE 52
668 #define U_EMR_EXTFLOODFILL 53
669 #define U_EMR_LINETO 54
670 #define U_EMR_ARCTO 55
671 #define U_EMR_POLYDRAW 56
672 #define U_EMR_SETARCDIRECTION 57
673 #define U_EMR_SETMITERLIMIT 58
674 #define U_EMR_BEGINPATH 59
675 #define U_EMR_ENDPATH 60
676 #define U_EMR_CLOSEFIGURE 61
677 #define U_EMR_FILLPATH 62
678 #define U_EMR_STROKEANDFILLPATH 63
679 #define U_EMR_STROKEPATH 64
680 #define U_EMR_FLATTENPATH 65
681 #define U_EMR_WIDENPATH 66
682 #define U_EMR_SELECTCLIPPATH 67
683 #define U_EMR_ABORTPATH 68
684 #define U_EMR_UNDEF69 69
685 #define U_EMR_COMMENT 70
686 #define U_EMR_FILLRGN 71
687 #define U_EMR_FRAMERGN 72
688 #define U_EMR_INVERTRGN 73
689 #define U_EMR_PAINTRGN 74
690 #define U_EMR_EXTSELECTCLIPRGN 75
691 #define U_EMR_BITBLT 76
692 #define U_EMR_STRETCHBLT 77
693 #define U_EMR_MASKBLT 78
694 #define U_EMR_PLGBLT 79
695 #define U_EMR_SETDIBITSTODEVICE 80
696 #define U_EMR_STRETCHDIBITS 81
697 #define U_EMR_EXTCREATEFONTINDIRECTW 82
698 #define U_EMR_EXTTEXTOUTA 83
699 #define U_EMR_EXTTEXTOUTW 84
700 #define U_EMR_POLYBEZIER16 85
701 #define U_EMR_POLYGON16 86
702 #define U_EMR_POLYLINE16 87
703 #define U_EMR_POLYBEZIERTO16 88
704 #define U_EMR_POLYLINETO16 89
705 #define U_EMR_POLYPOLYLINE16 90
706 #define U_EMR_POLYPOLYGON16 91
707 #define U_EMR_POLYDRAW16 92
708 #define U_EMR_CREATEMONOBRUSH 93
709 #define U_EMR_CREATEDIBPATTERNBRUSHPT 94
710 #define U_EMR_EXTCREATEPEN 95
711 #define U_EMR_POLYTEXTOUTA 96
712 #define U_EMR_POLYTEXTOUTW 97
713 #define U_EMR_SETICMMODE 98
714 #define U_EMR_CREATECOLORSPACE 99
715 #define U_EMR_SETCOLORSPACE 100
716 #define U_EMR_DELETECOLORSPACE 101
717 #define U_EMR_GLSRECORD 102
718 #define U_EMR_GLSBOUNDEDRECORD 103
719 #define U_EMR_PIXELFORMAT 104
720 #define U_EMR_DRAWESCAPE 105
721 #define U_EMR_EXTESCAPE 106
722 #define U_EMR_UNDEF107 107
723 #define U_EMR_SMALLTEXTOUT 108
724 #define U_EMR_FORCEUFIMAPPING 109
725 #define U_EMR_NAMEDESCAPE 110
726 #define U_EMR_COLORCORRECTPALETTE 111
727 #define U_EMR_SETICMPROFILEA 112
728 #define U_EMR_SETICMPROFILEW 113
729 #define U_EMR_ALPHABLEND 114
730 #define U_EMR_SETLAYOUT 115
731 #define U_EMR_TRANSPARENTBLT 116
732 #define U_EMR_UNDEF117 117
733 #define U_EMR_GRADIENTFILL 118
734 #define U_EMR_SETLINKEDUFIS 119
735 #define U_EMR_SETTEXTJUSTIFICATION 120
736 #define U_EMR_COLORMATCHTOTARGETW 121
737 #define U_EMR_CREATECOLORSPACEW 122
738 
739 #define U_EMR_MIN 1
740 #define U_EMR_MAX 122
741 
742 #define U_EMR_INVALID 0xFFFFFFFF
743 
750 #define U_DRAW_NOTEMPTY 0x001
751 #define U_DRAW_VISIBLE 0x002
752 #define U_DRAW_CLOSED 0x004
753 #define U_DRAW_ONLYTO 0x008
754 #define U_DRAW_FORCE 0x010
755 #define U_DRAW_ALTERS 0x020
756 #define U_DRAW_PATH 0x040
757 #define U_DRAW_TEXT 0x080
758 #define U_DRAW_OBJECT 0x100
759 #define U_DRAW_NOFILL 0x200
760 
761 
768 #define U_AD_COUNTERCLOCKWISE 1
769 #define U_AD_CLOCKWISE 2
770 
778 #define U_PAN_STRAIGHT_ARMS_HORZ 2
779 #define U_PAN_STRAIGHT_ARMS_WEDGE 3
780 #define U_PAN_STRAIGHT_ARMS_VERT 4
781 #define U_PAN_STRAIGHT_ARMS_SINGLE_SERIF 5
782 #define U_PAN_STRAIGHT_ARMS_DOUBLE_SERIF 6
783 #define U_PAN_BENT_ARMS_HORZ 7
784 #define U_PAN_BENT_ARMS_WEDGE 8
785 #define U_PAN_BENT_ARMS_VERT 9
786 #define U_PAN_BENT_ARMS_SINGLE_SERIF 10
787 #define U_PAN_BENT_ARMS_DOUBLE_SERIF 11
788 
796 #define U_TRANSPARENT 1
797 #define U_OPAQUE 2
798 
806 #define U_CA_NEGATIVE 0x0001
807 #define U_CA_LOG_FILTER 0x0002
808 
816 #define U_COLORMATCHTOTARGET_NOTEMBEDDED 0
817 #define U_COLORMATCHTOTARGET_EMBEDDED 1
818 
826 #define U_CS_ENABLE 1
827 #define U_CS_DISABLE 2
828 #define U_CS_DELETE_TRANSFORM 3
829 
836 #define U_PAN_ANY 0
837 #define U_PAN_NO_FIT 1
838 
846 #define U_PAN_CONTRAST_NONE 2
847 #define U_PAN_CONTRAST_VERY_LOW 3
848 #define U_PAN_CONTRAST_LOW 4
849 #define U_PAN_CONTRAST_MEDIUM_LOW 5
850 #define U_PAN_CONTRAST_MEDIUM 6
851 #define U_PAN_CONTRAST_MEDIUM_HIGH 7
852 #define U_PAN_CONTRAST_HIGH 8
853 #define U_PAN_CONTRAST_VERY_HIGH 9
854 
862 #define U_DIB_RGB_COLORS 0
863 #define U_DIB_PAL_COLORS 1
864 #define U_DIB_PAL_INDICES 2
865 
873 #define U_EMR_COMMENT_WINDOWS_METAFILE 0x80000001
874 #define U_EMR_COMMENT_BEGINGROUP 0x00000002
875 #define U_EMR_COMMENT_ENDGROUP 0x00000003
876 #define U_EMR_COMMENT_MULTIFORMATS 0x40000004
877 #define U_EMR_COMMENT_UNICODE_STRING 0x00000040
878 #define U_EMR_COMMENT_UNICODE_END 0x00000080
879 
887 #define U_ETO_NONE 0x00000000
888 #define U_ETO_GRAYED 0x00000001
889 #define U_ETO_OPAQUE 0x00000002
890 #define U_ETO_CLIPPED 0x00000004
891 #define U_ETO_GLYPH_INDEX 0x00000010
892 #define U_ETO_RTLREADING 0x00000080
893 #define U_ETO_NO_RECT 0x00000100
894 #define U_ETO_SMALL_CHARS 0x00000200
895 #define U_ETO_NUMERICSLOCAL 0x00000400
896 #define U_ETO_NUMERICSLATIN 0x00000800
897 #define U_ETO_IGNORELANGUAGE 0x00001000
898 #define U_ETO_PDY 0x00002000
899 #define U_ETO_REVERSE_INDEX_MAP 0x00010000
900 
908 #define U_PAN_FAMILY_TEXT_DISPLAY 2
909 #define U_PAN_FAMILY_SCRIPT 3
910 #define U_PAN_FAMILY_DECORATIVE 4
911 #define U_PAN_FAMILY_PICTORIAL 5
912 
920 #define U_FLOODFILLBORDER 0x00000000
921 #define U_FLOODFILLSURFACE 0x00000001
922 
930 #define U_ENHMETA_SIGNATURE 0x464D4520
931 #define U_EPS_SIGNATURE 0x46535045
932 
940 #define U_GRADIENT_FILL_RECT_H 0x00000000
941 #define U_GRADIENT_FILL_RECT_V 0x00000001
942 #define U_GRADIENT_FILL_TRIANGLE 0x00000002
943 
951 #define U_GM_COMPATIBLE 1
952 #define U_GM_ADVANCED 2
953 #define U_GM_LAST 2
954 
962 #define U_HS_HORIZONTAL 0
963 #define U_HS_VERTICAL 1
964 #define U_HS_FDIAGONAL 2
965 #define U_HS_BDIAGONAL 3
966 #define U_HS_CROSS 4
967 #define U_HS_DIAGCROSS 5
968 #define U_HS_SOLIDCLR 6
969 #define U_HS_DITHEREDCLR 7
970 #define U_HS_SOLIDTEXTCLR 8
971 #define U_HS_DITHEREDTEXTCLR 9
972 #define U_HS_SOLIDBKCLR 10
973 #define U_HS_DITHEREDBKCLR 11
974 
982 #define U_ICM_OFF 1
983 #define U_ICM_ON 2
984 #define U_ICM_QUERY 3
985 
993 #define U_ILLUMINANT_DEVICE_DEFAULT 0
994 #define U_ILLUMINANT_A 1
995 #define U_ILLUMINANT_B 2
996 #define U_ILLUMINANT_C 3
997 #define U_ILLUMINANT_D50 4
998 #define U_ILLUMINANT_D55 5
999 #define U_ILLUMINANT_D65 6
1000 #define U_ILLUMINANT_D75 7
1001 #define U_ILLUMINANT_F2 8
1002 #define U_ILLUMINANT_MAX_INDEX ILLUMINANT_F2
1003 #define U_ILLUMINANT_TUNGSTEN ILLUMINANT_A
1004 #define U_ILLUMINANT_DAYLIGHT ILLUMINANT_C
1005 #define U_ILLUMINANT_FLUORESCENT ILLUMINANT_F2
1006 #define U_ILLUMINANT_NTSC ILLUMINANT_C
1007 
1015 #define U_PAN_LETT_NORMAL_COMPACT 2
1016 #define U_PAN_LETT_NORMAL_WEIGHTED 3
1017 #define U_PAN_LETT_NORMAL_BOXED 4
1018 #define U_PAN_LETT_NORMAL_FLATTENED 5
1019 #define U_PAN_LETT_NORMAL_ROUNDED 6
1020 #define U_PAN_LETT_NORMAL_OFF_CENTER 7
1021 #define U_PAN_LETT_NORMAL_SQUARE 8
1022 #define U_PAN_LETT_OBLIQUE_COMPACT 9
1023 #define U_PAN_LETT_OBLIQUE_WEIGHTED 10
1024 #define U_PAN_LETT_OBLIQUE_BOXED 11
1025 #define U_PAN_LETT_OBLIQUE_FLATTENED 12
1026 #define U_PAN_LETT_OBLIQUE_ROUNDED 13
1027 #define U_PAN_LETT_OBLIQUE_OFF_CENTER 14
1028 #define U_PAN_LETT_OBLIQUE_SQUARE 15
1029 
1037 #define U_MM_TEXT 1
1038 #define U_MM_LOMETRIC 2
1039 #define U_MM_HIMETRIC 3
1040 #define U_MM_LOENGLISH 4
1041 #define U_MM_HIENGLISH 5
1042 #define U_MM_TWIPS 6
1043 #define U_MM_ISOTROPIC 7
1044 #define U_MM_ANISOTROPIC 8
1045 #define U_MM_MIN U_MM_TEXT
1046 #define U_MM_MAX U_MM_ANISOTROPIC
1047 #define U_MM_MAX_FIXEDSCALE U_MM_TWIPS
1048 
1056 #define U_ENHMETA_VERSION 0x00010000
1057 
1065 #define U_PAN_MIDLINE_STANDARD_TRIMMED 2
1066 #define U_PAN_MIDLINE_STANDARD_POINTED 3
1067 #define U_PAN_MIDLINE_STANDARD_SERIFED 4
1068 #define U_PAN_MIDLINE_HIGH_TRIMMED 5
1069 #define U_PAN_MIDLINE_HIGH_POINTED 6
1070 #define U_PAN_MIDLINE_HIGH_SERIFED 7
1071 #define U_PAN_MIDLINE_CONSTANT_TRIMMED 8
1072 #define U_PAN_MIDLINE_CONSTANT_POINTED 9
1073 #define U_PAN_MIDLINE_CONSTANT_SERIFED 10
1074 #define U_PAN_MIDLINE_LOW_TRIMMED 11
1075 #define U_PAN_MIDLINE_LOW_POINTED 12
1076 #define U_PAN_MIDLINE_LOW_SERIFED 13
1077 
1085 #define U_MWT_IDENTITY 1
1086 #define U_MWT_LEFTMULTIPLY 2
1087 #define U_MWT_RIGHTMULTIPLY 3
1088 #define U_MWT_MIN U_MWT_IDENTITY
1089 #define U_MWT_MAX U_MWT_RIGHTMULTIPLY
1090 
1098 #define U_PS_SOLID 0x00000000
1099 #define U_PS_DASH 0x00000001
1100 #define U_PS_DOT 0x00000002
1101 #define U_PS_DASHDOT 0x00000003
1102 #define U_PS_DASHDOTDOT 0x00000004
1103 #define U_PS_NULL 0x00000005
1104 #define U_PS_INSIDEFRAME 0x00000006
1105 #define U_PS_USERSTYLE 0x00000007
1106 #define U_PS_ALTERNATE 0x00000008
1107 #define U_PS_STYLE_MASK 0x0000000f
1108 
1109 #define U_PS_ENDCAP_ROUND 0x00000000
1110 #define U_PS_ENDCAP_SQUARE 0x00000100
1111 #define U_PS_ENDCAP_FLAT 0x00000200
1112 #define U_PS_ENDCAP_MASK 0x00000f00
1113 
1114 #define U_PS_JOIN_ROUND 0x00000000
1115 #define U_PS_JOIN_BEVEL 0x00001000
1116 #define U_PS_JOIN_MITER 0x00002000
1117 #define U_PS_JOIN_MASK 0x0000f000
1118 
1119 #define U_PS_COSMETIC 0x00000000
1120 #define U_PS_GEOMETRIC 0x00010000
1121 #define U_PS_TYPE_MASK 0x000f0000
1122 
1129 #define U_PT_CLOSEFIGURE 0x0001
1130 #define U_PT_LINETO 0x0002
1131 #define U_PT_BEZIERTO 0x0004
1132 #define U_PT_MOVETO 0x0006
1133 
1141 #define U_ALTERNATE 1
1142 #define U_WINDING 2
1143 #define U_POLYFILL_LAST 2
1144 
1152 #define U_PAN_PROP_OLD_STYLE 2
1153 #define U_PAN_PROP_MODERN 3
1154 #define U_PAN_PROP_EVEN_WIDTH 4
1155 #define U_PAN_PROP_EXPANDED 5
1156 #define U_PAN_PROP_CONDENSED 6
1157 #define U_PAN_PROP_VERY_EXPANDED 7
1158 #define U_PAN_PROP_VERY_CONDENSED 8
1159 #define U_PAN_PROP_MONOSPACED 9
1160 
1168 #define U_RGN_AND 1
1169 #define U_RGN_OR 2
1170 #define U_RGN_XOR 3
1171 #define U_RGN_DIFF 4
1172 #define U_RGN_COPY 5
1173 #define U_RGN_MIN U_RGN_AND
1174 #define U_RGN_MAX U_RGN_COPY
1175 
1183 #define U_PAN_SERIF_COVE 2
1184 #define U_PAN_SERIF_OBTUSE_COVE 3
1185 #define U_PAN_SERIF_SQUARE_COVE 4
1186 #define U_PAN_SERIF_OBTUSE_SQUARE_COVE 5
1187 #define U_PAN_SERIF_SQUARE 6
1188 #define U_PAN_SERIF_THIN 7
1189 #define U_PAN_SERIF_BONE 8
1190 #define U_PAN_SERIF_EXAGGERATED 9
1191 #define U_PAN_SERIF_TRIANGLE 10
1192 #define U_PAN_SERIF_NORMAL_SANS 11
1193 #define U_PAN_SERIF_OBTUSE_SANS 12
1194 #define U_PAN_SERIF_PERP_SANS 13
1195 #define U_PAN_SERIF_FLARED 14
1196 #define U_PAN_SERIF_ROUNDED 15
1197 
1205 #define U_STOCK_OBJECT 0x80000000
1206 #define U_WHITE_BRUSH 0x80000000
1207 #define U_LTGRAY_BRUSH 0x80000001
1208 #define U_GRAY_BRUSH 0x80000002
1209 #define U_DKGRAY_BRUSH 0x80000003
1210 #define U_BLACK_BRUSH 0x80000004
1211 #define U_NULL_BRUSH 0x80000005
1212 #define U_HOLLOW_BRUSH 0x80000005
1213 #define U_WHITE_PEN 0x80000006
1214 #define U_BLACK_PEN 0x80000007
1215 #define U_NULL_PEN 0x80000008
1216 #define U_OEM_FIXED_FONT 0x8000000A
1217 #define U_ANSI_FIXED_FONT 0x8000000B
1218 #define U_ANSI_VAR_FONT 0x8000000C
1219 #define U_SYSTEM_FONT 0x8000000D
1220 #define U_DEVICE_DEFAULT_FONT 0x8000000E
1221 #define U_DEFAULT_PALETTE 0x8000000F
1222 #define U_SYSTEM_FIXED_FONT 0x80000010
1223 #define U_DEFAULT_GUI_FONT 0x80000011
1224 #define U_STOCK_LAST 0x80000011
1225 
1233 #define U_BLACKONWHITE 1
1234 #define U_WHITEONBLACK 2
1235 #define U_COLORONCOLOR 3
1236 #define U_HALFTONE 4
1237 #define U_MAXSTRETCHBLTMODE 4
1238 #define U_STRETCH_ANDSCANS 1
1239 #define U_STRETCH_ORSCANS 2
1240 #define U_STRETCH_DELETESCANS 3
1241 #define U_STRETCH_HALFTONE 4
1242 
1250 #define U_PAN_STROKE_GRADUAL_DIAG 2
1251 #define U_PAN_STROKE_GRADUAL_TRAN 3
1252 #define U_PAN_STROKE_GRADUAL_VERT 4
1253 #define U_PAN_STROKE_GRADUAL_HORZ 5
1254 #define U_PAN_STROKE_RAPID_VERT 6
1255 #define U_PAN_STROKE_RAPID_HORZ 7
1256 #define U_PAN_STROKE_INSTANT_VERT 8
1257 
1264 #define U_PAN_WEIGHT_VERY_LIGHT 2
1265 #define U_PAN_WEIGHT_LIGHT 3
1266 #define U_PAN_WEIGHT_THIN 4
1267 #define U_PAN_WEIGHT_BOOK 5
1268 #define U_PAN_WEIGHT_MEDIUM 6
1269 #define U_PAN_WEIGHT_DEMI 7
1270 #define U_PAN_WEIGHT_BOLD 8
1271 #define U_PAN_WEIGHT_HEAVY 9
1272 #define U_PAN_WEIGHT_BLACK 10
1273 #define U_PAN_WEIGHT_NORD 11
1274 
1281 #define U_PAN_XHEIGHT_CONSTANT_SMALL 2
1282 #define U_PAN_XHEIGHT_CONSTANT_STANDARD 3
1283 #define U_PAN_XHEIGHT_CONSTANT_LARGE 4
1284 #define U_PAN_XHEIGHT_DUCKING_SMALL 5
1285 #define U_PAN_XHEIGHT_DUCKING_STANDARD 6
1286 #define U_PAN_XHEIGHT_DUCKING_LARGE 7
1287 
1294 #define U_FW_DONTCARE 0
1295 #define U_FW_THIN 100
1296 #define U_FW_EXTRALIGHT 200
1297 #define U_FW_ULTRALIGHT 200
1298 #define U_FW_LIGHT 300
1299 #define U_FW_NORMAL 400
1300 #define U_FW_REGULAR 400
1301 #define U_FW_MEDIUM 500
1302 #define U_FW_SEMIBOLD 600
1303 #define U_FW_DEMIBOLD 600
1304 #define U_FW_BOLD 700
1305 #define U_FW_EXTRABOLD 800
1306 #define U_FW_ULTRABOLD 800
1307 #define U_FW_HEAVY 900
1308 #define U_FW_BLACK 900
1309 
1317 #define U_FW_NOITALIC 0
1318 #define U_FW_ITALIC 1
1319 
1327 #define U_FW_NOUNDERLINE 0
1328 #define U_FW_UNDERLINE 1
1329 
1336 #define U_FW_NOSTRIKEOUT 0
1337 #define U_FW_STRIKEOUT 1
1338 
1345 #define U_ANSI_CHARSET (uint8_t)0
1346 #define U_DEFAULT_CHARSET (uint8_t)1
1347 #define U_SYMBOL_CHARSET (uint8_t)2
1348 #define U_SHIFTJIS_CHARSET (uint8_t)128
1349 #define U_HANGEUL_CHARSET (uint8_t)129
1350 #define U_HANGUL_CHARSET U_HANGEUL_CHARSET
1351 #define U_GB2312_CHARSET (uint8_t)134
1352 #define U_CHINESEBIG5_CHARSET (uint8_t)136
1353 #define U_GREEK_CHARSET (uint8_t)161
1354 #define U_TURKISH_CHARSET (uint8_t)162
1355 #define U_HEBREW_CHARSET (uint8_t)177
1356 #define U_ARABIC_CHARSET (uint8_t)178
1357 #define U_BALTIC_CHARSET (uint8_t)186
1358 #define U_RUSSIAN_CHARSET (uint8_t)204
1359 #define U_EE_CHARSET (uint8_t)238
1360 #define U_EASTEUROPE_CHARSET U_EE_CHARSET
1361 #define U_THAI_CHARSET (uint8_t)222
1362 #define U_JOHAB_CHARSET (uint8_t)130
1363 #define U_MAC_CHARSET (uint8_t)77
1364 #define U_OEM_CHARSET (uint8_t)255
1365 #define U_VISCII_CHARSET (uint8_t)240
1366 #define U_TCVN_CHARSET (uint8_t)241
1367 #define U_KOI8_CHARSET (uint8_t)242
1368 #define U_ISO3_CHARSET (uint8_t)243
1369 #define U_ISO4_CHARSET (uint8_t)244
1370 #define U_ISO10_CHARSET (uint8_t)245
1371 #define U_CELTIC_CHARSET (uint8_t)246
1372 
1379 #define U_OUT_DEFAULT_PRECIS 0
1380 #define U_OUT_STRING_PRECIS 1
1381 #define U_OUT_CHARACTER_PRECIS 2
1382 #define U_OUT_STROKE_PRECIS 3
1383 #define U_OUT_TT_PRECIS 4
1384 #define U_OUT_DEVICE_PRECIS 5
1385 #define U_OUT_RASTER_PRECIS 6
1386 #define U_OUT_TT_ONLY_PRECIS 7
1387 #define U_OUT_OUTLINE_PRECIS 8
1388 
1395 #define U_CLIP_DEFAULT_PRECIS 0x00
1396 #define U_CLIP_CHARACTER_PRECIS 0x01
1397 #define U_CLIP_STROKE_PRECIS 0x02
1398 #define U_CLIP_MASK 0x0F
1399 #define U_CLIP_LH_ANGLES 0x10
1400 #define U_CLIP_TT_ALWAYS 0x20
1401 #define U_CLIP_EMBEDDED 0x80
1402 
1409 #define U_DEFAULT_QUALITY 0
1410 #define U_DRAFT_QUALITY 1
1411 #define U_PROOF_QUALITY 2
1412 #define U_NONANTIALIASED_QUALITY 3
1413 #define U_ANTIALIASED_QUALITY 4
1414 
1421 #define U_DEFAULT_PITCH 0x00
1422 #define U_FIXED_PITCH 0x01
1423 #define U_VARIABLE_PITCH 0x02
1424 #define U_MONO_FONT 0x08
1425 #define U_FF_DONTCARE 0x00
1426 #define U_FF_ROMAN 0x10
1427 #define U_FF_SWISS 0x20
1428 #define U_FF_MODERN 0x30
1429 #define U_FF_SCRIPT 0x40
1430 #define U_FF_DECORATIVE 0x50
1431 
1438 #define U_BS_SOLID 0
1439 #define U_BS_NULL 1
1440 #define U_BS_HOLLOW 1
1441 #define U_BS_HATCHED 2
1442 #define U_BS_PATTERN 3
1443 #define U_BS_INDEXED 4
1444 #define U_BS_DIBPATTERN 5
1445 #define U_BS_DIBPATTERNPT 6
1446 #define U_BS_PATTERN8X8 7
1447 #define U_BS_DIBPATTERN8X8 8
1448 #define U_BS_MONOPATTERN 9
1449 
1457 #define U_PAN_FAMILYTYPE_INDEX 0
1458 #define U_PAN_SERIFSTYLE_INDEX 1
1459 #define U_PAN_WEIGHT_INDEX 2
1460 #define U_PAN_PROPORTION_INDEX 3
1461 #define U_PAN_CONTRAST_INDEX 4
1462 #define U_PAN_STROKEVARIATION_INDEX 5
1463 #define U_PAN_ARMSTYLE_INDEX 6
1464 #define U_PAN_LETTERFORM_INDEX 7
1465 #define U_PAN_MIDLINE_INDEX 8
1466 #define U_PAN_XHEIGHT_INDEX 9
1467 #define U_PAN_COUNT 10
1468 
1477 #define U_PFD_MAIN_PLANE 0
1478 #define U_PFD_OVERLAY_PLANE 1
1479 #define U_PFD_UNDERLAY_PLANE (-1)
1480 
1488 #define U_PFD_TYPE_RGBA 0
1489 #define U_PFD_TYPE_COLORINDEX 1
1490 
1497 #define U_PFD_DOUBLEBUFFER 0x00000001
1498 #define U_PFD_STEREO 0x00000002
1499 #define U_PFD_DRAW_TO_WINDOW 0x00000004
1500 #define U_PFD_DRAW_TO_BITMAP 0x00000008
1501 #define U_PFD_SUPPORT_GDI 0x00000010
1502 #define U_PFD_SUPPORT_OPENGL 0x00000020
1503 #define U_PFD_GENERIC_FORMAT 0x00000040
1504 #define U_PFD_NEED_PALETTE 0x00000080
1505 #define U_PFD_NEED_SYSTEM_PALETTE 0x00000100
1506 #define U_PFD_SWAP_EXCHANGE 0x00000200
1507 #define U_PFD_SWAP_COPY 0x00000400
1508 #define U_PFD_SWAP_LAYER_BUFFERS 0x00000800
1509 #define U_PFD_GENERIC_ACCELERATED 0x00001000
1510 
1517 #define U_EMR_COMMENT_PUBLIC 0x43494447
1518 #define U_EMR_COMMENT_SPOOL 0x00000000
1519 #define U_EMR_COMMENT_EMFPLUSRECORD 0x2B464D45
1520 
1527 #define U_LAYOUT_LTR 0x00000000
1528 #define U_LAYOUT_RTL 0x00000001
1529 #define U_LAYOUT_BITMAPORIENTATIONPRESERVED 0x00000008
1530 
1537 #define U_AC_SRC_GLOBAL 0
1538 #define U_AC_SRC_CONST 0
1539 #define U_AC_SRC_ALPHA 1
1540 
1543 // ***************************************************************************
1544 // Macros
1545 
1549 // Note, many of these were originally defined using C99 (type){val,val,val} format, but that turned out to
1550 // have incompatibilities with C++, so use functions as the basis to avoid this.
1551 
1552 // Set/Get for U_RGBQUAD Colors, which are stored in byte order: {B,G,R,A}.
1553 // These are used in EMF structures and the byte order must be the same in memory or on disk.
1554 #define U_BGR(r,g,b) rgbquad_set(r, g, b, 0)
1555 #define U_BGRA(r,g,b,a) rgbquad_set(r, g, b, a)
1556 #define U_WHITE U_BGR(255,255,255)
1557 #define U_BLACK U_BGR(0,0,0)
1558 #define U_BGRAGetR(rgb) (rgb.Red )
1559 #define U_BGRAGetG(rgb) (rgb.Green )
1560 #define U_BGRAGetB(rgb) (rgb.Blue )
1561 #define U_BGRAGetA(rgb) (rgb.Reserved)
1562 
1563 
1564 // Set/Get for U_COLORREF Color, which are stored in byte order:: {R,G,B,A}.
1565 // These are used in EMF structures and the byte order must be the same in memory or on disk.
1566 // These MAY be used in PNG and other libraries if these enforce byte order in memory, otherwise
1567 // U_swap4 may need to also be employed.
1568 //
1569 
1570 #define colorref_set colorref3_set
1571 #define U_RGB(r,g,b) colorref3_set(r, g, b)
1572 #define U_RGBA(r,g,b,a) colorref4_set(r, g, b, a)
1573 #define U_RGBAGetR(rgb) (rgb.Red )
1574 #define U_RGBAGetG(rgb) (rgb.Green )
1575 #define U_RGBAGetB(rgb) (rgb.Blue )
1576 #define U_RGBAGetA(rgb) (rgb.Reserved)
1577 
1578 // color type conversions
1579 #define U_RGB2BGR(rgb) U_BGR(U_RGBAGetR(rgb),U_RGBAGetG(rgb),U_RGBAGetB(rgb))
1580 #define U_BGR2RGB(rgb) U_RGB(U_BGRAGetR(rgb),U_BGRAGetG(rgb),U_BGRAGetB(rgb))
1581 #define U_RGBA2BGRA(rgb) U_BGRA(U_RGBAGetR(rgb),U_RGBAGetG(rgb),U_RGBAGetB(rgb),U_RGBAGetA(rgb)}
1582 #define U_BGRA2RGBA(rgb) U_RGBA(U_BGRAGetR(rgb),U_BGRAGetG(rgb),U_BGRAGetB(rgb),U_BGRAGetA(rgb)}
1583 
1584 // Color CMYK Get/Set Macros
1585 #define U_CMYK(c,m,y,k)\
1586  ((COLOREF)((((uint8_t)(k)|((uint16_t)((uint8_t)(y))<<8))|(((uint32_t)(uint8_t)(m))<<16))|(((uint32_t)(uint8_t)(c))<<24))) \
1587 #define U_GetKValue(cmyk) ((uint8_t) (cmyk) )
1589 #define U_GetYValue(cmyk) ((uint8_t) ((cymk) >> 8))
1590 #define U_GetMValue(cmyk) ((uint8_t) ((cymk) >> 16))
1591 #define U_GetCValue(cmyk) ((uint8_t) ((cymk) >> 24))
1593 // Other macros
1594 #define U_Gamma(A) (A < U_RGB_GAMMA_MIN ? U_RGB_GAMMA_MIN : (A > U_RGB_GAMMA_MAX ? U_RGB_GAMMA_MAX: A)) \
1595 #define U_PM(A,B) ((A)<-(B)?-(B):((A)>(B)?(B):(A)))
1597 #define U_MNMX(A,B,C) ((A)<(B)?(B):((A)>(C)?(C):(A)))
1598 #define U_MIN(A,B) ((A)>(B)?(B):(A))
1599 #define U_MAX(A,B) ((A)>(B)?(A):(B))
1601 // basic EMR macros.
1602 #define U_EMRTYPE(A) (((PU_EMR)A)->iType)
1603 #define U_EMRSIZE(A) (((PU_EMR)A)->nSize)
1604 
1605 // Utility macros
1606 #define UP4(A) (4 * ((A + 3 ) / 4))
1607 
1608 
1614 typedef struct {
1615  float x;
1616  float y;
1620 
1621 /* ************************************************************
1622  EMF structures OTHER than those corresponding to complete U_EMR_* records
1623  ************************************************************ */
1624 
1630 typedef struct {
1631  signed IntValue :28;
1632  unsigned FracValue :4;
1643 typedef struct {
1644  uint16_t caSize;
1645  uint16_t caFlags;
1646  uint16_t caIlluminantIndex;
1647  uint16_t caRedGamma;
1648  uint16_t caGreenGamma;
1649  uint16_t caBlueGamma;
1650  uint16_t caReferenceBlack;
1651  uint16_t caReferenceWhite;
1652  int16_t caContrast;
1653  int16_t caBrightness;
1654  int16_t caColorfulness;
1655  int16_t caRedGreenTint;
1664 typedef struct {
1665  uint32_t Signature;
1666  U_NUM_FNTAXES NumAxes;
1667  U_FNTAXES Values[1];
1676 typedef struct {
1677  uint32_t signature;
1678  uint32_t nVersion;
1679  U_CBDATA cbData;
1680  U_OFFDATA offData;
1705 typedef struct {
1706  U_POINTL ptlReference;
1707  U_NUM_STR nChars;
1708  U_OFFSTR offString;
1709  uint32_t fOptions;
1718 typedef struct {
1719  U_BITFIX28_4 x;
1720  U_BITFIX28_4 y;
1729 typedef struct {
1730  uint32_t sizeData;
1731  uint32_t version;
1732  U_POINT28_4 Points[3];
1733  U_RECTL PostScriptData;
1742 typedef struct {
1743  int32_t x;
1744  int32_t y;
1745  uint16_t Red;
1746  uint16_t Green;
1747  uint16_t Blue;
1748  uint16_t Alpha;
1757 typedef struct {
1758  uint32_t UpperLeft;
1759  uint32_t LowerRight;
1773 typedef struct {
1774  uint32_t Vertex1;
1775  uint32_t Vertex2;
1776  uint32_t Vertex3;
1780 //Microsoft name: Header object, EMF manual 2.2.9 defined below with record structs
1781 //Microsoft name: HeaderExtension1 object, EMF manual 2.2.10 defined below with record structs
1782 //Microsoft name: HeaderExtension1 object, EMF manual 2.2.11 defined below with record structs
1783 
1789 typedef struct {
1790  uint32_t lbStyle;
1791  U_COLORREF lbColor;
1792  uint32_t lbHatch;
1796  *PU_PATTERN;
1797 
1803 typedef struct {
1804  int32_t lfHeight;
1805  int32_t lfWidth;
1806  int32_t lfEscapement;
1807  int32_t lfOrientation;
1808  int32_t lfWeight;
1809  uint8_t lfItalic;
1810  uint8_t lfUnderline;
1811  uint8_t lfStrikeOut;
1812  uint8_t lfCharSet;
1813  uint8_t lfOutPrecision;
1814  uint8_t lfClipPrecision;
1815  uint8_t lfQuality;
1816  uint8_t lfPitchAndFamily;
1817  uint16_t lfFaceName[U_LF_FACESIZE];
1821 // Microsoft name: LogFontEx Object (not implemented) EMF manual 2.2.14
1822 // Microsoft name: LogFontExDv Object (not implemented) EMF manual 2.2.15
1823 
1829 // out of order, needed for 2.2.16
1830 typedef struct {
1831  uint8_t bFamilyType;
1832  uint8_t bSerifStyle;
1833  uint8_t bWeight;
1834  uint8_t bProportion;
1835  uint8_t bContrast;
1836  uint8_t bStrokeVariation;
1837  uint8_t bArmStyle;
1838  uint8_t bLetterform;
1839  uint8_t bMidline;
1840  uint8_t bXHeight;
1844 #define U_PAN_ALL0 (U_PANOSE){0,0,0,0,0,0,0,0,0,0}
1845 #define U_PAN_ALL1 (U_PANOSE){1,1,1,1,1,1,1,1,1,1}
1846 
1852 typedef struct {
1853  U_LOGFONT elfLogFont;
1854  uint16_t elfFullName[U_LF_FULLFACESIZE];
1855  uint16_t elfStyle[U_LF_FACESIZE];
1856  uint32_t elfVersion;
1857  uint32_t elfStyleSize;
1858  uint32_t elfMatch;
1859  uint32_t elfReserved;
1860  uint8_t elfVendorId[U_ELF_VENDOR_SIZE];
1861  uint32_t elfCulture;
1862  U_PANOSE elfPanose;
1863  uint16_t elfPadding;
1872 // out of order, needed for 2.2.17
1873 typedef struct {
1874  uint8_t peReserved;
1875  uint8_t peRed;
1876  uint8_t peGreen;
1877  uint8_t peBlue;
1887 typedef struct {
1888  uint16_t palVersion;
1889  uint16_t palNumEntries;
1890  U_LOGPLTNTRY palPalEntry[1];
1894 // Microsoft name: LogPaletteEntry Object, EMF manual 2.2.18, defined above, before 2.2.17
1895 
1901 typedef struct {
1902  uint32_t lopnStyle;
1903  U_POINT lopnWidth;
1904  U_COLORREF lopnColor;
1908 // Microsoft name: LogPenEx Object (not implemented) EMF manual 2.2.20
1909 // Microsoft name: Panose Object, EMF manual 2.2.21, defined above, before 2.2.16
1910 
1916 typedef struct {
1917  uint16_t nSize;
1918  uint16_t nVersion;
1919  uint32_t dwFlags;
1920  uint8_t iPixelType;
1921  uint8_t cColorBits;
1922  uint8_t cRedBits;
1923  uint8_t cRedShift;
1924  uint8_t cGreenBits;
1925  uint8_t cGreenShift;
1926  uint8_t cBlueBits;
1927  uint8_t cBlueShift;
1928  uint8_t cAlphaBits;
1929  uint8_t cAlphaShift;
1930  uint8_t cAccumBits;
1931  uint8_t cAccumRedBits;
1932  uint8_t cAccumGreenBits;
1933  uint8_t cAccumBlueBits;
1934  uint8_t cAccumAlphaBits;
1935  uint8_t cDepthBits;
1936  uint8_t cStencilBits;
1937  uint8_t cAuxBuffers;
1938  uint8_t iLayerType;
1939  uint8_t bReserved;
1940  uint32_t dwLayerMask;
1941  uint32_t dwVisibleMask;
1942  uint32_t dwDamageMask;
1946 // Microsoft name: Point28_4 Object. EMF manual 2.2.23, defined above, before 2.2.6
1947 
1953 // out of order, needed for 2.2.24
1954 typedef struct {
1955  uint32_t dwSize;
1956  uint32_t iType;
1957  U_NUM_RECTL nCount;
1958  uint32_t nRgnSize;
1959  U_RECTL rclBounds;
1969 typedef struct {
1970  U_RGNDATAHEADER rdh;
1971  U_RECTL Buffer[1];
1975 // Microsoft name: RegionDataHeader Object. EMF manual 2.2.25, defined above, before 2.2.24
1976 // Microsoft name: TriVertex Object. EMF manual 2.2.26, defined above, before 2.2.7
1977 // Microsoft name: UniversalFontId Object. EMF manual 2.2.27 (not implemented)
1978 
1984 typedef struct {
1985  U_FLOAT eM11;
1986  U_FLOAT eM12;
1987  U_FLOAT eM21;
1988  U_FLOAT eM22;
1989  U_FLOAT eDx;
1990  U_FLOAT eDy;
1999 typedef struct {
2000  uint32_t elpPenStyle;
2001  uint32_t elpWidth;
2002  uint32_t elpBrushStyle;
2003  U_COLORREF elpColor;
2004  uint32_t elpHatch;
2005  U_NUM_STYLEENTRY elpNumEntries;
2006  U_STYLEENTRY elpStyleEntry[1];
2017 typedef struct {
2018  U_BITMAPINFOHEADER bmiHeader;
2019  U_RGBQUAD bmiColors[1];
2028 typedef struct {
2029  uint8_t Operation;
2030  uint8_t Flags;
2031  uint8_t Global;
2032  uint8_t Op;
2036 
2042 typedef struct {
2043  uint32_t iType;
2044  uint32_t nSize;
2045  uint32_t dParm[1];
2054 typedef struct {
2055  uint32_t iType;
2056  uint32_t nSize;
2063 typedef struct {
2064  U_EMR emr;
2065  U_PAIR pair;
2069 
2070 
2071 
2072 // ***********************************************************************************
2073 // The following have U_EMR_# records. They are ordered by their record index, not by EMF manual position.
2074 
2075 /* Index 1 */
2094 typedef struct {
2095  U_EMR emr;
2096  U_RECTL rclBounds;
2097  U_RECTL rclFrame;
2098  uint32_t dSignature;
2099  uint32_t nVersion;
2100  uint32_t nBytes;
2101  uint32_t nRecords;
2102  uint16_t nHandles;
2103  uint16_t sReserved;
2104  uint32_t nDescription;
2105  uint32_t offDescription;
2106  uint32_t nPalEntries;
2107  U_SIZEL szlDevice;
2108  U_SIZEL szlMillimeters;
2110  U_CBPXLFMT cbPixelFormat;
2111  U_OFFPXLFMT offPixelFormat;
2112  uint32_t bOpenGL;
2114  U_SIZEL szlMicrometers;
2116  *PU_EMRHEADER;
2118 /* Index 2,3,4,5,6 */
2121 typedef struct {
2122  U_EMR emr;
2123  U_RECTL rclBounds;
2125  U_POINTL aptl[1];
2130  U_EMRPOLYLINETO,
2131  *PU_EMRPOLYBEZIER,
2132  *PU_EMRPOLYGON,
2133  *PU_EMRPOLYLINE,
2135  *PU_EMRPOLYLINETO;
2136 
2137 /* Index 7,8 */
2143 typedef struct {
2144  U_EMR emr;
2145  U_RECTL rclBounds;
2148  U_POLYCOUNTS aPolyCounts[1];
2153 
2154 /* Index 9,11 (numbers interleave with next one) */
2157 typedef struct {
2158  U_EMR emr;
2159  U_SIZEL szlExtent;
2164 
2165 /* Index 10,12,13 */
2168 typedef struct {
2169  U_EMR emr;
2170  U_POINTL ptlOrigin;
2177 
2178 
2179 /* Index 14 */
2191 typedef struct {
2192  U_EMR emr;
2193  U_CBPLENTRIES cbPalEntries;
2194  U_OFFPLENTRIES offPalEntries;
2198 /* Index 15 */
2201 typedef struct {
2202  U_EMR emr;
2203  U_POINTL ptlPixel;
2204  U_COLORREF crColor;
2208 /* Index 16 */
2211 typedef struct {
2212  U_EMR emr;
2213  uint32_t dwFlags;
2217 /* Index 17,18,19,20,21,22,67,98,115
2218 */
2221 typedef struct {
2222  U_EMR emr;
2223  uint32_t iMode;
2227  U_EMRSETROP2,
2231  U_EMRSETICMMODE,
2232  U_EMRSETLAYOUT,
2233  *PU_EMRSETMAPMODE,
2234  *PU_EMRSETBKMODE,
2236  *PU_EMRSETROP2,
2240  *PU_EMRSETICMMODE,
2241  *PU_EMRSETLAYOUT;
2242 
2243 /* Index 23 */
2246 typedef struct {
2247  U_EMR emr;
2248  U_COLORADJUSTMENT ColorAdjustment;
2252 /* Index 24, 25 */
2255 typedef struct {
2256  U_EMR emr;
2257  U_COLORREF crColor;
2261  *PU_EMRSETBKCOLOR;
2262 
2263 /* Index 26 */
2266 typedef struct {
2267  U_EMR emr;
2268  U_POINTL ptlOffset;
2272 /* Index 27, 54 */
2277 typedef struct {
2278  U_EMR emr;
2279  U_POINTL ptl;
2283  *PU_EMRLINETO;
2284 
2285 /* Index 28,33,52,59,60,61,65,66,68 */
2288 typedef struct {
2289  U_EMR emr;
2290 }
2294  U_EMRBEGINPATH,
2295  U_EMRENDPATH,
2298  U_EMRWIDENPATH,
2299  U_EMRABORTPATH,
2300  *PU_EMRSETMETARGN,
2301  *PU_EMRSAVEDC,
2303  *PU_EMRBEGINPATH,
2304  *PU_EMRENDPATH,
2307  *PU_EMRWIDENPATH,
2308  *PU_EMRABORTPATH;
2309 
2310 /* Index 29,30 */
2313 typedef struct {
2314  U_EMR emr;
2315  U_RECTL rclClip;
2320 
2321 /* Index 31,32 */
2324 typedef struct {
2325  U_EMR emr;
2326  int32_t xNum;
2327  int32_t xDenom;
2328  int32_t yNum;
2329  int32_t yDenom;
2334 
2335 /* Index 33 (see 28) */
2336 
2337 /* Index 34 */
2340 typedef struct {
2341  U_EMR emr;
2342  int32_t iRelative;
2346 /* Index 35 */
2349 typedef struct {
2350  U_EMR emr;
2351  U_XFORM xform;
2355 /* Index 36 */
2358 typedef struct {
2359  U_EMR emr;
2360  U_XFORM xform;
2361  uint32_t iMode;
2365 /* Index 37,40 */
2368 typedef struct {
2369  U_EMR emr;
2370  uint32_t ihObject;
2375 
2376 /* Index 38 */
2379 typedef struct {
2380  U_EMR emr;
2381  uint32_t ihPen;
2382  U_LOGPEN lopn;
2386 /* Index 39 */
2389 typedef struct {
2390  U_EMR emr;
2391  uint32_t ihBrush;
2396 /* Index 40 see 37 */
2397 
2398 /* Index 41 */
2401 typedef struct {
2402  U_EMR emr;
2403  U_POINTL ptlCenter;
2404  uint32_t nRadius;
2405  U_FLOAT eStartAngle;
2406  U_FLOAT eSweepAngle;
2410 /* Index 42,43 */
2413 typedef struct {
2414  U_EMR emr;
2415  U_RECTL rclBox;
2419  *PU_EMRRECTANGLE;
2420 
2421 /* Index 44 */
2424 typedef struct {
2425  U_EMR emr;
2426  U_RECTL rclBox;
2427  U_SIZEL szlCorner;
2431 /* Index 45, 46 ,47, 55 */
2434 typedef struct {
2435  U_EMR emr;
2436  U_RECTL rclBox;
2437  U_POINTL ptlStart;
2438  U_POINTL ptlEnd;
2442  U_EMRARCTO,
2443  *PU_EMRARC,
2444  *PU_EMRCHORD,
2445  *PU_EMRPIE,
2446  *PU_EMRARCTO;
2447 
2448 /* Index 48 */
2451 typedef struct {
2452  U_EMR emr;
2453  uint32_t ihPal;
2457 /* Index 49 */
2460 typedef struct {
2461  U_EMR emr;
2462  uint32_t ihPal;
2467 /* Index 50 */
2470 typedef struct {
2471  U_EMR emr;
2472  uint32_t ihPal;
2473  uint32_t iStart;
2474  U_NUM_LOGPLTNTRY cEntries;
2475  U_LOGPLTNTRY aPalEntries[1];
2479 /* Index 51 */
2482 typedef struct {
2483  U_EMR emr;
2484  uint32_t ihPal;
2485  uint32_t cEntries;
2489 /* Index 52 (see 28) */
2490 
2491 /* Index 53 */
2494 typedef struct {
2495  U_EMR emr;
2496  U_POINTL ptlStart;
2497  U_COLORREF crColor;
2498  uint32_t iMode;
2502 /* Index 54 (see 27) */
2503 
2504 /* Index 55 (see 45) */
2505 
2506 /* Index 56 */
2509 typedef struct {
2510  U_EMR emr;
2511  U_RECTL rclBounds;
2513  U_POINTL aptl[1];
2514  uint8_t abTypes[1];
2518 /* Index 57 */
2521 typedef struct {
2522  U_EMR emr;
2523  uint32_t iArcDirection;
2527 /* Index 58 */
2533 typedef struct {
2534  U_EMR emr;
2535  uint32_t eMiterLimit;
2539 /* Index 59,60,61 (see 28) */
2540 
2541 /* Index 62,63,64 */
2544 typedef struct {
2545  U_EMR emr;
2546  U_RECTL rclBounds;
2550  *PU_EMRFILLPATH,
2552  *PU_EMRSTROKEPATH;
2553 
2554 /* Index 65,66 (see 28) */
2555 /* Index 67 (see 17) */
2556 /* Index 68 (see 28) */
2557 /* Index 69 (not a defined U_EMR record type ) */
2558 
2559 
2560 /* Index 70 */
2563 typedef struct {
2564  U_EMR emr;
2565  U_CBDATA cbData;
2566  uint8_t Data[1];
2570 /* variant comment types */
2573 typedef struct {
2574  U_EMR emr;
2575  U_CBDATA cbData;
2576  uint32_t cIdent;
2577  uint8_t Data[1];
2583 typedef struct {
2584  U_EMR emr;
2585  U_CBDATA cbData;
2586  uint32_t cIdent;
2587  uint32_t esrIdent;
2588  uint8_t Data[1];
2594 typedef struct {
2595  U_EMR emr;
2596  U_CBDATA cbData;
2597  uint32_t cIdent;
2598  uint32_t pcIdent;
2599  uint8_t Data[1];
2603 /* Index 71 */
2606 typedef struct {
2607  U_EMR emr;
2608  U_RECTL rclBounds;
2609  U_CBRGNDATA cbRgnData;
2610  uint32_t ihBrush;
2611  U_RGNDATA RgnData[1];
2615 /* Index 72 */
2618 typedef struct {
2619  U_EMR emr;
2620  U_RECTL rclBounds;
2621  U_CBRGNDATA cbRgnData;
2622  uint32_t ihBrush;
2623  U_SIZEL szlStroke;
2624  U_RGNDATA RgnData[1];
2628 /* Index 73,74 */
2631 typedef struct {
2632  U_EMR emr;
2633  U_RECTL rclBounds;
2634  U_CBRGNDATA cbRgnData;
2635  U_RGNDATA RgnData[1];
2639  *PU_EMRPAINTRGN;
2640 
2641 /* Index 75 */
2644 typedef struct {
2645  U_EMR emr;
2646  U_CBRGNDATA cbRgnData;
2647  uint32_t iMode;
2648  U_RGNDATA RgnData[1];
2652 /* Index 76 */
2655 typedef struct {
2656  U_EMR emr;
2657  U_RECTL rclBounds;
2658  U_POINTL Dest;
2659  U_POINTL cDest;
2660  uint32_t dwRop;
2661  U_POINTL Src;
2662  U_XFORM xformSrc;
2663  U_COLORREF crBkColorSrc;
2664  uint32_t iUsageSrc;
2665  U_OFFBMISRC offBmiSrc;
2666  U_CBBMISRC cbBmiSrc;
2667  U_OFFBITSSRC offBitsSrc;
2668  U_CBBITS cbBitsSrc;
2672 
2673 /* Index 77 */
2676 typedef struct {
2677  U_EMR emr;
2678  U_RECTL rclBounds;
2679  U_POINTL Dest;
2680  U_POINTL cDest;
2681  uint32_t dwRop;
2682  U_POINTL Src;
2683  U_XFORM xformSrc;
2684  U_COLORREF crBkColorSrc;
2685  uint32_t iUsageSrc;
2686  U_OFFBMISRC offBmiSrc;
2687  U_CBBMISRC cbBmiSrc;
2688  U_OFFBITSSRC offBitsSrc;
2689  U_CBBITS cbBitsSrc;
2690  U_POINTL cSrc;
2694 
2695 /* Index 78 */
2698 typedef struct {
2699  U_EMR emr;
2700  U_RECTL rclBounds;
2701  U_POINTL Dest;
2702  U_POINTL cDest;
2703  uint32_t dwRop;
2704  U_POINTL Src;
2705  U_XFORM xformSrc;
2706  U_COLORREF crBkColorSrc;
2707  uint32_t iUsageSrc;
2708  U_OFFBMISRC offBmiSrc;
2709  U_CBBMISRC cbBmiSrc;
2710  U_OFFBITSSRC offBitsSrc;
2711  U_CBBITS cbBitsSrc;
2712  U_POINTL Mask;
2713  uint32_t iUsageMask;
2714  U_OFFBMIMSK offBmiMask;
2715  U_CBBMIMSK cbBmiMask;
2716  U_OFFBITSMSK offBitsMask;
2717  U_CBBITSMSK cbBitsMask;
2721 
2722 /* Index 79 */
2725 typedef struct {
2726  U_EMR emr;
2727  U_RECTL rclBounds;
2728  U_POINTL aptlDst[3];
2729  U_POINTL Src;
2730  U_POINTL cSrc;
2731  U_XFORM xformSrc;
2732  U_COLORREF crBkColorSrc;
2733  uint32_t iUsageSrc;
2734  U_OFFBMISRC offBmiSrc;
2735  U_CBBMISRC cbBmiSrc;
2736  U_OFFBITSSRC offBitsSrc;
2737  U_CBBITS cbBitsSrc;
2738  U_POINTL Mask;
2739  uint32_t iUsageMask;
2740  U_OFFBMIMSK offBmiMask;
2741  U_CBBMIMSK cbBmiMask;
2742  U_OFFBITSMSK offBitsMask;
2743  U_CBBITSMSK cbBitsMask;
2747 
2748 /* Index 80 */
2751 typedef struct {
2752  U_EMR emr;
2753  U_RECTL rclBounds;
2754  U_POINTL Dest;
2755  U_POINTL Src;
2756  U_POINTL cSrc;
2757  U_OFFBMISRC offBmiSrc;
2758  U_CBBMISRC cbBmiSrc;
2759  U_OFFBITSSRC offBitsSrc;
2760  U_CBBITS cbBitsSrc;
2761  uint32_t iUsageSrc;
2762  uint32_t iStartScan;
2763  uint32_t cScans;
2767 
2768 /* Index 81 */
2771 typedef struct {
2772  U_EMR emr;
2773  U_RECTL rclBounds;
2774  U_POINTL Dest;
2775  U_POINTL Src;
2776  U_POINTL cSrc;
2777  U_OFFBMISRC offBmiSrc;
2778  U_CBBMISRC cbBmiSrc;
2779  U_OFFBITSSRC offBitsSrc;
2780  U_CBBITS cbBitsSrc;
2781  uint32_t iUsageSrc;
2782  uint32_t dwRop;
2783  U_POINTL cDest;
2787 
2788 /* Index 82 */
2791 typedef struct {
2792  U_EMR emr;
2793  uint32_t ihFont;
2798 /* Index 83,84 */
2809 typedef struct {
2810  U_EMR emr;
2811  U_RECTL rclBounds;
2812  uint32_t iGraphicsMode;
2813  U_FLOAT exScale;
2814  U_FLOAT eyScale;
2815  U_EMRTEXT emrtext;
2820 
2821 /* Index 85,86,87,88,89 */
2824 typedef struct {
2825  U_EMR emr;
2826  U_RECTL rclBounds;
2828  U_POINT16 apts[1];
2835  *PU_EMRPOLYGON16,
2836  *PU_EMRPOLYLINE16,
2839 
2840 /* Index 90,91 */
2843 typedef struct {
2844  U_EMR emr;
2845  U_RECTL rclBounds;
2848  U_POLYCOUNTS aPolyCounts[1];
2849 // This will appear somewhere but is not really part of the core structure.
2850 // U_POINT16 apts[1]; //!< array of point16
2855 
2856 /* Index 92 */
2859 typedef struct {
2860  U_EMR emr;
2861  U_RECTL rclBounds;
2863  U_POINT16 apts[1];
2864  uint8_t abTypes[1];
2868 /* Index 93 */
2871 typedef struct {
2872  U_EMR emr;
2873  uint32_t ihBrush;
2874  uint32_t iUsage;
2875  U_OFFBMI offBmi;
2876  U_CBBMI cbBmi;
2877  U_OFFBITS offBits;
2878  U_CBBITS cbBits;
2882 
2883 /* Index 94 */
2886 typedef struct {
2887  U_EMR emr;
2888  uint32_t ihBrush;
2889  uint32_t iUsage;
2890  U_OFFBMI offBmi;
2891  U_CBBMI cbBmi;
2892  U_OFFBITS offBits;
2893  U_CBBITS cbBits;
2897 
2898 /* Index 95 */
2901 typedef struct {
2902  U_EMR emr;
2903  uint32_t ihPen;
2904  U_OFFBMI offBmi;
2905  U_CBBMI cbBmi;
2906  U_OFFBITS offBits;
2907  U_CBBITS cbBits;
2912 
2913 /* Index 96.97 */
2916 typedef struct {
2917  U_EMR emr;
2918  U_RECTL rclBounds;
2919  uint32_t iGraphicsMode;
2920  U_FLOAT exScale;
2921  U_FLOAT eyScale;
2922  U_NUM_EMRTEXT cStrings;
2923  U_EMRTEXT emrtext[1];
2928 
2929 /* Index 98 (see 17) */
2930 
2931 /* Index 99 */
2934 typedef struct {
2935  U_EMR emr;
2936  uint32_t ihCS;
2941 /* Index 100,101 */
2944 typedef struct {
2945  U_EMR emr;
2946  uint32_t ihCS;
2951 
2952 /* Index 102 */
2955 typedef struct {
2956  U_EMR emr;
2957  U_CBDATA cbData;
2958  U_DATA Data[1];
2962 /* Index 103 */
2965 typedef struct {
2966  U_EMR emr;
2967  U_RECTL rclBounds;
2968  U_CBDATA cbData;
2969  U_DATA Data[1];
2973 /* Index 104 */
2976 typedef struct {
2977  U_EMR emr;
2982 /* Index 105 */
2985 typedef struct {
2986  U_EMR emr;
2987  U_CBDATA cjIn;
2988  U_DATA Data[1];
2992 /* Index 106 */
2995 typedef struct {
2996  U_EMR emr;
2997  U_CBDATA cjIn;
2998  U_DATA Data[1];
3002 /* Index 107 (not implemented ) */
3003 
3004 /* Index 108 */
3007 typedef struct {
3008  U_EMR emr;
3009  U_POINTL Dest;
3010  U_NUM_STR cChars;
3011  uint32_t fuOptions;
3012  uint32_t iGraphicsMode;
3013  U_FLOAT exScale;
3014  U_FLOAT eyScale;
3020 
3021 /* Index 109 (not implemented )
3022 EMF manual 2.3.11.2
3023 */
3024 
3025 /* Index 110 */
3028 typedef struct {
3029  U_EMR emr;
3030  U_CBDATA cbDriver;
3031  U_CBDATA cbData;
3032  uint16_t Driver[1];
3033  uint8_t Data[1];
3037 /* Index 111-113 (not implemented )
3038  EMF manual 2.3.8.1
3039  EMF manual 2.3.11.15
3040  EMF manual 2.3.11.16
3041 */
3042 
3043 /* Index 114 */
3046 typedef struct {
3047  U_EMR emr;
3048  U_RECTL rclBounds;
3049  U_POINTL Dest;
3050  U_POINTL cDest;
3051  U_BLEND Blend;
3052  U_POINTL Src;
3053  U_XFORM xformSrc;
3054  U_COLORREF crBkColorSrc;
3055  uint32_t iUsageSrc;
3056  U_OFFBMISRC offBmiSrc;
3057  U_CBBMISRC cbBmiSrc;
3058  U_OFFBITSSRC offBitsSrc;
3059  U_CBBITS cbBitsSrc;
3060  U_POINTL cSrc;
3064 
3065 /* Index 115 (see 17) */
3066 
3067 /* Index 116 */
3070 typedef struct {
3071  U_EMR emr;
3072  U_RECTL rclBounds;
3073  U_POINTL Dest;
3074  U_POINTL cDest;
3075  uint32_t TColor;
3076  U_POINTL Src;
3077  U_XFORM xformSrc;
3078  U_COLORREF crBkColorSrc;
3079  uint32_t iUsageSrc;
3080  U_OFFBMISRC offBmiSrc;
3081  U_CBBMISRC cbBmiSrc;
3082  U_OFFBITSSRC offBitsSrc;
3083  U_CBBITS cbBitsSrc;
3084  U_POINTL cSrc;
3088 
3089 /* Index 117 (not a defined U_EMR record type ) */
3090 
3091 /* Index 118 */
3094 typedef struct {
3095  U_EMR emr;
3096  U_RECTL rclBounds;
3097  U_NUM_TRIVERTEX nTriVert;
3098  U_NUM_GRADOBJ nGradObj;
3099  uint32_t ulMode;
3100 //parts that are required but which are not included in the core structure
3101 // U_TRIVERTEX TriVert[1]; Array of TriVertex objects
3102 // uint32_t GradObj[1]; Array of gradient objects (each has 2 or 3 indices into TriVert array)
3105 
3106 /* Index 119,120 (not implemented )
3107 EMF manual 2.3.11.18
3108 EMF manual 2.3.11.27
3109 */
3110 
3111 /* Index 121 */
3114 typedef struct {
3115  U_EMR emr;
3116  uint32_t dwAction;
3117  uint32_t dwFlags;
3118  U_CBNAME cbName;
3119  U_CBDATA cbData;
3120  uint8_t Data[1];
3124 /* Index 122 */
3127 typedef struct {
3128  U_EMR emr;
3129  uint32_t ihCS;
3131  uint32_t dwFlags;
3132  U_CBDATA cbData;
3133  uint8_t Data[1];
3137 // ************************************************************************************************
3138 // Utility function structures
3139 
3143 typedef struct {
3144  FILE *fp;
3145  size_t allocated;
3146  size_t used;
3147  uint32_t records;
3148  uint16_t ignore;
3149  uint32_t PalEntries;
3150  uint32_t chunk;
3151  char *buf;
3164 typedef struct {
3165  uint32_t *table;
3166  uint32_t *stack;
3167  size_t allocated;
3168  size_t chunk;
3169  uint32_t sptr;
3170  uint32_t top;
3171  uint32_t peak;
3177 typedef struct {
3178  double M11;
3179  double M12;
3180  double M21;
3181  double M22;
3185 // ************************************************************************************************
3186 // Prototypes
3187 
3189 int memprobe(const void *buf, size_t size);
3190 void wchar8show(const char *src);
3191 void wchar16show(const uint16_t *src);
3192 void wchar32show(const uint32_t *src);
3193 void wchartshow(const wchar_t *src);
3194 void dumpeht(char *string, unsigned int *handle, EMFHANDLES *eht);
3195 
3196 
3197 char *U_emr_names(unsigned int idx);
3198 uint32_t *dx_set(int32_t height, uint32_t weight, uint32_t members);
3199 uint32_t emr_properties(uint32_t type);
3200 int emr_arc_points(PU_ENHMETARECORD record, int *f1, int f2, PU_PAIRF center, PU_PAIRF start, PU_PAIRF end, PU_PAIRF size);
3201 int emr_arc_points_common(PU_RECTL rclBox, PU_POINTL ArcStart, PU_POINTL ArcEnd,
3202  int *f1, int f2, PU_PAIRF center, PU_PAIRF start, PU_PAIRF end, PU_PAIRF size);
3203 int get_real_color_count(const char *Bmih);
3204 int get_real_color_icount(int Colors, int BitCount, int Width, int Height);
3205 int RGBA_to_DIB(char **px, uint32_t *cbPx, PU_RGBQUAD *ct, int *numCt,
3206  const char *rgba_px, int w, int h, int stride, uint32_t colortype, int use_ct, int invert);
3207 int get_DIB_params( void *pEmr, uint32_t offBitsSrc, uint32_t offBmiSrc,
3208  const char **px, const U_RGBQUAD **ct, uint32_t *numCt,
3209  uint32_t *width, uint32_t *height, uint32_t *colortype, uint32_t *invert );
3210 int DIB_to_RGBA(const char *px, const U_RGBQUAD *ct, int numCt,
3211  char **rgba_px, int w, int h, uint32_t colortype, int use_ct, int invert);
3212 char *RGBA_to_RGBA(char *rgba_px, int w, int h, int sl, int st, int *ew, int *eh);
3213 
3214 int device_size(const int xmm, const int ymm, const float dpmm, U_SIZEL *szlDev, U_SIZEL *szlMm);
3215 int drawing_size(const int xmm, const int yum, const float dpmm, U_RECTL *rclBounds, U_RECTL *rclFrame);
3216 
3217 int emf_start(const char *name, const uint32_t initsize, const uint32_t chunksize, EMFTRACK **et);
3218 int emf_finish(EMFTRACK *et, EMFHANDLES *eht);
3219 int emf_free(EMFTRACK **et);
3220 int emf_append(U_ENHMETARECORD *rec, EMFTRACK *et, int freerec);
3221 int emf_readdata(const char *filename, char **contents, size_t *length);
3222 FILE *emf_fopen(const char *filename, const int mode);
3223 
3224 
3225 /* use these instead*/
3226 int emf_htable_create(uint32_t initsize, uint32_t chunksize, EMFHANDLES **eht);
3227 int emf_htable_delete(uint32_t *ih, EMFHANDLES *eht);
3228 int emf_htable_insert(uint32_t *ih, EMFHANDLES *eht);
3229 int emf_htable_free(EMFHANDLES **eht);
3230 /* Deprecated forms */
3231 #define htable_create emf_htable_create
3232 #define htable_delete emf_htable_delete
3233 #define htable_insert emf_htable_insert
3234 #define htable_free emf_htable_free
3235 
3236 U_RECTL rectl_set(U_POINTL ul, U_POINTL lr);
3237 U_SIZEL sizel_set(int32_t x, int32_t y);
3238 U_POINTL point32_set(int32_t x, int32_t y);
3239 #define point_set point32_set
3240 #define pointl_set point32_set
3241 U_POINT16 point16_set(int16_t x, int16_t y);
3242 U_PANOSE panose_set(uint8_t bFamilyType, uint8_t bSerifStyle, uint8_t bWeight, uint8_t bProportion,
3243  uint8_t bContrast, uint8_t bStrokeVariation, uint8_t bArmStyle, uint8_t bLetterform,
3244  uint8_t bMidline, uint8_t bXHeight );
3245 U_COLORREF colorref3_set(uint8_t red, uint8_t green, uint8_t blue);
3246 U_COLORREF colorref4_set(uint8_t red, uint8_t green, uint8_t blue, uint8_t reserved);
3247 U_RGBQUAD rgbquad_set(uint8_t red,uint8_t green, uint8_t blue, uint8_t reserved);
3248 U_LOGBRUSH logbrush_set(uint32_t lbStyle, U_COLORREF lbColor, int32_t lbHatch);
3249 U_XFORM xform_set(U_FLOAT eM11, U_FLOAT eM12, U_FLOAT eM21, U_FLOAT eM22, U_FLOAT eDx, U_FLOAT eDy);
3250 U_XFORM xform_alt_set(U_FLOAT scale, U_FLOAT ratio, U_FLOAT rot, U_FLOAT axisrot, U_FLOAT eDx, U_FLOAT eDy);
3251 U_LOGPEN logpen_set( uint32_t lopnStyle, U_POINT lopnWidth, U_COLORREF lopnColor );
3252 PU_EXTLOGPEN extlogpen_set(uint32_t elpPenStyle, uint32_t elpWidth, uint32_t elpBrushStyle,
3253  U_COLORREF elpColor, int32_t elpHatch, U_NUM_STYLEENTRY elpNumEntries, U_STYLEENTRY *elpStyleEntry );
3254 U_LOGFONT_PANOSE logfont_panose_set(U_LOGFONT elfLogFont, uint16_t *elfFullName,
3255  uint16_t *elfStyle, uint32_t elfStyleSize, U_PANOSE elfPanose);
3256 U_LOGFONT logfont_set( int32_t lfHeight, int32_t lfWidth, int32_t lfEscapement, int32_t lfOrientation,
3257  int32_t lfWeight, uint8_t lfItalic, uint8_t lfUnderline, uint8_t lfStrikeOut,
3258  uint8_t lfCharSet, uint8_t lfOutPrecision, uint8_t lfClipPrecision,
3259  uint8_t lfQuality, uint8_t lfPitchAndFamily, uint16_t *lfFaceName);
3260 char *emrtext_set(U_POINTL ptlReference, U_NUM_STR NumString, uint32_t cbChar, void *String, uint32_t fOptions, U_RECTL rcl, uint32_t *Dx);
3261 U_LOGPLTNTRY logpltntry_set(uint8_t peReserved,uint8_t peRed,uint8_t peGreen,uint8_t peBlue);
3262 PU_LOGPALETTE logpalette_set(U_NUM_LOGPLTNTRY palNumEntries,PU_LOGPLTNTRY *palPalEntry);
3263 U_RGNDATAHEADER rgndataheader_set( U_NUM_RECTL nCount, U_RECTL rcBound);
3264 PU_RGNDATA rgndata_set( U_RGNDATAHEADER rdh, PU_RECTL Buffer);
3265 U_BITMAPINFOHEADER bitmapinfoheader_set(int32_t biWidth, int32_t biHeight,
3266  uint16_t biPlanes, uint16_t biBitCount, uint32_t biCompression,
3267  uint32_t biSizeImage, int32_t biXPelsPerMeter,
3268  int32_t biYPelsPerMeter, U_NUM_RGBQUAD biClrUsed, uint32_t biClrImportant);
3269 PU_BITMAPINFO bitmapinfo_set(U_BITMAPINFOHEADER BmiHeader, PU_RGBQUAD BmiColors);
3270 U_LOGCOLORSPACEA logcolorspacea_set(int32_t lcsCSType, int32_t lcsIntent,
3271  U_CIEXYZTRIPLE lcsEndpoints, U_LCS_GAMMARGB lcsGammaRGB, char *lcsFilename);
3272 U_LOGCOLORSPACEW logcolorspacew_set(int32_t lcsCSType, int32_t lcsIntent,
3273  U_CIEXYZTRIPLE lcsEndpoints, U_LCS_GAMMARGB lcsGammaRGB, uint16_t *lcsFilename);
3274 U_COLORADJUSTMENT coloradjustment_set(uint16_t Size, uint16_t Flags, uint16_t IlluminantIndex,
3275  uint16_t RedGamma, uint16_t GreenGamma, uint16_t BlueGamma,
3276  uint16_t ReferenceBlack, uint16_t ReferenceWhite,
3277  int16_t Contrast, int16_t Brightness, int16_t Colorfulness, int16_t RedGreenTint);
3278 U_PIXELFORMATDESCRIPTOR pixelformatdescriptor_set( uint32_t dwFlags, uint8_t iPixelType, uint8_t cColorBits,
3279  uint8_t cRedBits, uint8_t cRedShift,
3280  uint8_t cGreenBits, uint8_t cGreenShift,
3281  uint8_t cBlueBits, uint8_t cBlueShift,
3282  uint8_t cAlphaBits, uint8_t cAlphaShift,
3283  uint8_t cAccumBits, uint8_t cAccumRedBits, uint8_t cAccumGreenBits, uint8_t cAccumBlueBits,
3284  uint8_t cAccumAlphaBits, uint8_t cDepthBits, uint8_t cStencilBits,
3285  uint8_t cAuxBuffers, uint8_t iLayerType, uint8_t bReserved, uint32_t dwLayerMask,
3286  uint32_t dwVisibleMask, uint32_t dwDamageMask);
3287 
3288 PU_POINT points_transform(PU_POINT points, int count, U_XFORM xform);
3289 PU_POINT16 point16_transform(PU_POINT16 points, int count, U_XFORM xform);
3291 PU_POINT point16_to_point(PU_POINT16 points, int count);
3292 PU_POINT16 point_to_point16(PU_POINT points, int count);
3293 
3294 U_RECT findbounds(uint32_t count, PU_POINT pts, uint32_t width);
3295 U_RECT findbounds16(uint32_t count, PU_POINT16 pts, uint32_t width);
3296 char *emr_dup(const char *emr);
3297 
3298 char *textcomment_set(const char *string);
3299 
3300 // These generate the handle and then call the underlying function
3301 char *deleteobject_set(uint32_t *ihObject, EMFHANDLES *eht);
3302 char *selectobject_set(uint32_t ihObject, EMFHANDLES *eht);
3303 char *createpen_set(uint32_t *ihPen, EMFHANDLES *eht, U_LOGPEN lopn );
3304 char *extcreatepen_set(uint32_t *ihPen, EMFHANDLES *eht,
3305  PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, PU_EXTLOGPEN elp);
3306 char *createbrushindirect_set(uint32_t *ihBrush, EMFHANDLES *eht, U_LOGBRUSH lb );
3307 char *createdibpatternbrushpt_set(uint32_t *ihBrush, EMFHANDLES *eht, uint32_t iUsage,
3308  PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px);
3309 char *createmonobrush_set(uint32_t *ihBrush, EMFHANDLES *eht, uint32_t iUsage,
3310  PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px);
3311 char *extcreatefontindirectw_set(uint32_t *ihFont, EMFHANDLES *eht, const char *elf, const char *elfw);
3312 char *createpalette_set(uint32_t *ihPal, EMFHANDLES *eht, U_LOGPALETTE lgpl);
3313 char *setpaletteentries_set(uint32_t *ihPal, EMFHANDLES *eht, uint32_t iStart, U_NUM_LOGPLTNTRY cEntries, PU_LOGPLTNTRY aPalEntries);
3314 char *fillrgn_set(uint32_t *ihBrush, EMFHANDLES *eht, U_RECTL rclBounds,PU_RGNDATA RgnData);
3315 char *framergn_set(uint32_t *ihBrush, EMFHANDLES *eht, U_RECTL rclBounds, U_SIZEL szlStroke, PU_RGNDATA RgnData);
3316 char *createcolorspace_set(uint32_t *ihCS, EMFHANDLES *eht, U_LOGCOLORSPACEA lcs);
3317 char *createcolorspacew_set(uint32_t *ihCS, EMFHANDLES *eht, U_LOGCOLORSPACEW lcs, uint32_t dwFlags, U_CBDATA cbData, uint8_t *Data);
3318 
3319 char *U_EMRHEADER_set( const U_RECTL rclBounds, const U_RECTL rclFrame, U_PIXELFORMATDESCRIPTOR* const pfmtDesc,
3320  U_CBSTR nDesc, uint16_t* const Description, const U_SIZEL szlDevice, const U_SIZEL szlMillimeters,
3321  const uint32_t bOpenGL);
3322 char *U_EMRPOLYBEZIER_set( const U_RECTL rclBounds, const uint32_t count, const U_POINTL *points);
3323 char *U_EMRPOLYGON_set( const U_RECTL rclBounds, const uint32_t count, const U_POINTL *points);
3324 char *U_EMRPOLYLINE_set( const U_RECTL rclBounds, const uint32_t count, const U_POINTL *points);
3325 char *U_EMRPOLYBEZIERTO_set(const U_RECTL rclBounds, const uint32_t count, const U_POINTL *points);
3326 char *U_EMRPOLYLINETO_set( const U_RECTL rclBounds, const uint32_t count, const U_POINTL *points);
3327 
3328 char *U_EMRPOLYPOLYLINE_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts,
3329  const uint32_t cptl, const U_POINTL *points);
3330 char *U_EMRPOLYPOLYGON_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts,
3331  const uint32_t cptl, const U_POINTL *points);
3332 char *U_EMRSETWINDOWEXTEX_set(const U_SIZEL szlExtent);
3333 char *U_EMRSETWINDOWORGEX_set(const U_POINTL ptlOrigin);
3334 char *U_EMRSETVIEWPORTEXTEX_set(const U_SIZEL szlExtent);
3335 char *U_EMRSETVIEWPORTORGEX_set(const U_POINTL ptlOrigin);
3336 char *U_EMRSETBRUSHORGEX_set(const U_POINTL ptlOrigin);
3337 char *U_EMREOF_set(const U_CBPLENTRIES cbPalEntries, const PU_LOGPLTNTRY PalEntries, EMFTRACK *et);
3338 char *U_EMRSETPIXELV_set(const U_POINTL ptlPixel, const U_COLORREF crColor);
3339 char *U_EMRSETMAPPERFLAGS_set(void);
3340 char *U_EMRSETMAPMODE_set(const uint32_t iMode);
3341 char *U_EMRSETBKMODE_set(const uint32_t iMode);
3342 char *U_EMRSETPOLYFILLMODE_set(const uint32_t iMode);
3343 char *U_EMRSETROP2_set(const uint32_t iMode);
3344 char *U_EMRSETSTRETCHBLTMODE_set(const uint32_t iMode);
3345 char *U_EMRSETTEXTALIGN_set(const uint32_t iMode);
3346 char *U_EMRSETCOLORADJUSTMENT_set(const U_COLORADJUSTMENT ColorAdjustment);
3347 char *U_EMRSETTEXTCOLOR_set(const U_COLORREF crColor);
3348 char *U_EMRSETBKCOLOR_set(const U_COLORREF crColor);
3349 char *U_EMROFFSETCLIPRGN_set(const U_POINTL ptl);
3350 char *U_EMRMOVETOEX_set(const U_POINTL ptl);
3351 char *U_EMRSETMETARGN_set(void);
3352 char *U_EMREXCLUDECLIPRECT_set(const U_RECTL rclClip);
3353 char *U_EMRINTERSECTCLIPRECT_set(const U_RECTL rclClip);
3354 char *U_EMRSCALEVIEWPORTEXTEX_set(const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom);
3355 char *U_EMRSCALEWINDOWEXTEX_set(const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom);
3356 char *U_EMRSAVEDC_set(void);
3357 char *U_EMRRESTOREDC_set(const int32_t iRelative);
3358 char *U_EMRSETWORLDTRANSFORM_set(const U_XFORM xform);
3359 char *U_EMRMODIFYWORLDTRANSFORM_set(const U_XFORM xform, const uint32_t iMode);
3360 char *U_EMRSELECTOBJECT_set(const uint32_t ihObject); // better to call selectobject_set()
3361 char *U_EMRCREATEPEN_set(const uint32_t ihPen, const U_LOGPEN lopn );
3362 char *U_EMRCREATEBRUSHINDIRECT_set(const uint32_t ihBrush, const U_LOGBRUSH lb);
3363 char *U_EMRDELETEOBJECT_set(const uint32_t ihObject); // better to call deleteobject_set()
3364 char *U_EMRANGLEARC_set(const U_POINTL ptlCenter, const uint32_t nRadius, const U_FLOAT eStartAngle, const U_FLOAT eSweepAngle);
3365 char *U_EMRELLIPSE_set(const U_RECTL rclBox);
3366 char *U_EMRRECTANGLE_set(const U_RECTL rclBox);
3367 char *U_EMRROUNDRECT_set(const U_RECTL rclBox, const U_SIZEL szlCorner);
3368 char *U_EMRARC_set(const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd);
3369 char *U_EMRCHORD_set(const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd);
3370 char *U_EMRPIE_set(const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd);
3371 char *U_EMRSELECTPALETTE_set(const uint32_t ihPal);
3372 char *U_EMRCREATEPALETTE_set(const uint32_t ihPal, const U_LOGPALETTE lgpl);
3373 char *U_EMRSETPALETTEENTRIES_set(const uint32_t ihPal, const uint32_t iStart, const U_NUM_LOGPLTNTRY cEntries, const PU_LOGPLTNTRY aPalEntries);
3374 char *U_EMRRESIZEPALETTE_set(const uint32_t ihPal, const uint32_t cEntries);
3375 char *U_EMRREALIZEPALETTE_set(void);
3376 char *U_EMREXTFLOODFILL_set(const U_POINTL ptlStart, const U_COLORREF crColor, const uint32_t iMode);
3377 char *U_EMRLINETO_set(const U_POINTL ptl);
3378 char *U_EMRARCTO_set(const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd);
3379 char *U_EMRPOLYDRAW_set(const U_RECTL rclBounds,const U_NUM_POINTL cptl,const U_POINTL *aptl,const uint8_t *abTypes);
3380 char *U_EMRSETARCDIRECTION_set(const uint32_t iArcDirection);
3381 char *U_EMRSETMITERLIMIT_set(const uint32_t eMiterLimit);
3382 char *U_EMRBEGINPATH_set(void);
3383 char *U_EMRENDPATH_set(void);
3384 char *U_EMRCLOSEFIGURE_set(void);
3385 char *U_EMRFILLPATH_set(const U_RECTL rclBox);
3386 char *U_EMRSTROKEANDFILLPATH_set(const U_RECTL rclBox);
3387 char *U_EMRSTROKEPATH_set(const U_RECTL rclBox);
3388 char *U_EMRFLATTENPATH_set(void);
3389 char *U_EMRWIDENPATH_set(void);
3390 char *U_EMRSELECTCLIPPATH_set(const uint32_t iMode);
3391 char *U_EMRABORTPATH_set(void);
3392 // EMR_ENDEF69
3393 char *U_EMRCOMMENT_set(const U_CBDATA cbData, const char *Data);
3394 char *U_EMRFILLRGN_set(const U_RECTL rclBounds, const uint32_t ihBrush, const PU_RGNDATA RgnData);
3395 char *U_EMRFRAMERGN_set(const U_RECTL rclBounds, const uint32_t ihBrush, const U_SIZEL szlStroke, const PU_RGNDATA RgnData);
3396 char *U_EMRINVERTRGN_set(const PU_RGNDATA RgnData);
3397 char *U_EMRPAINTRGN_set(const PU_RGNDATA RgnData);
3398 char *U_EMREXTSELECTCLIPRGN_set(const uint32_t iMode, const PU_RGNDATA RgnData);
3399 char *U_EMRBITBLT_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest,
3400  const U_POINTL Src, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc,
3401  const uint32_t iUsageSrc, const uint32_t dwRop,
3402  const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px);
3403 char *U_EMRSTRETCHBLT_set(U_RECTL rclBounds, U_POINTL Dest, U_POINTL cDest,
3404  const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc,
3405  const uint32_t dwRop,
3406  const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px);
3407 char *U_EMRMASKBLT_set(U_RECTL rclBounds, U_POINTL Dest, U_POINTL cDest,
3408  const U_POINTL Src, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc,
3409  const U_POINTL Mask, const uint32_t iUsageMask,
3410  const uint32_t dwRop,
3411  const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px,
3412  const PU_BITMAPINFO BmiMsk, const uint32_t cbMsk, char *Msk);
3413 char *U_EMRPLGBLT_set(const U_RECTL rclBounds, const PU_POINTL aptlDst,
3414  const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc,
3415  const U_POINTL Mask, const uint32_t iUsageMask,
3416  const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px,
3417  const PU_BITMAPINFO BmiMsk, const uint32_t cbMsk, char *Msk);
3418 char *U_EMRSETDIBITSTODEVICE_set(const U_RECTL rclBounds, const U_POINTL Dest,
3419  const U_POINTL Src, const U_POINTL cSrc, const uint32_t iUsageSrc,
3420  const uint32_t iStartScan, const uint32_t cScans,
3421  const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px);
3422 char *U_EMRSTRETCHDIBITS_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest,
3423  const U_POINTL Src, const U_POINTL cSrc, const uint32_t iUsageSrc,
3424  const uint32_t dwRop,
3425  const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px);
3426 char *U_EMREXTCREATEFONTINDIRECTW_set( uint32_t ihFont, const char *elf, const char *elfw);
3427 char *U_EMREXTTEXTOUTA_set(U_RECTL rclBounds, uint32_t iGraphicsMode, U_FLOAT exScale, U_FLOAT eyScale, PU_EMRTEXT emrtext);
3428 char *U_EMREXTTEXTOUTW_set(U_RECTL rclBounds, uint32_t iGraphicsMode, U_FLOAT exScale, U_FLOAT eyScale, PU_EMRTEXT emrtext);
3429 char *U_EMRPOLYBEZIER16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points);
3430 char *U_EMRPOLYGON16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points);
3431 char *U_EMRPOLYLINE16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points);
3432 char *U_EMRPOLYBEZIERTO16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points);
3433 char *U_EMRPOLYLINETO16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points);
3434 char *U_EMRPOLYPOLYLINE16_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts,const uint32_t cpts, const U_POINT16 *points);
3435 char *U_EMRPOLYPOLYGON16_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts,const uint32_t cpts, const U_POINT16 *points);
3436 char *U_EMRPOLYDRAW16_set(const U_RECTL rclBounds,const U_NUM_POINT16 cpts, const U_POINT16 *aptl, const uint8_t *abTypes);
3437 char *U_EMRCREATEMONOBRUSH_set(const uint32_t ihBrush, const uint32_t iUsage,
3438  const PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px);
3439 char *U_EMRCREATEDIBPATTERNBRUSHPT_set(const uint32_t ihBrush, const uint32_t iUsage,
3440  const PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px);
3441 char *U_EMREXTCREATEPEN_set(const uint32_t ihPen, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_EXTLOGPEN elp );
3442 // U_EMRPOLYTEXTOUTA_set 96 NOT IMPLEMENTED, denigrated after Windows NT
3443 // U_EMRPOLYTEXTOUTW_set 97 NOT IMPLEMENTED, denigrated after Windows NT
3444 char *U_EMRSETICMMODE_set(const uint32_t iMode);
3445 char *U_EMRCREATECOLORSPACE_set(const uint32_t ihCS, const U_LOGCOLORSPACEA lcs);
3446 char *U_EMRSETCOLORSPACE_set(const uint32_t ihCS );
3447 char *U_EMRDELETECOLORSPACE_set(const uint32_t ihCS);
3448 // U_EMRGLSRECORD_set 102 Not implemented
3449 // U_EMRGLSBOUNDEDRECORD_set 103 Not implemented
3451 char *U_EMRSMALLTEXTOUT_set(const U_POINTL Dest, const U_NUM_STR cChars, const uint32_t fuOptions, const uint32_t iGraphicsMode,
3452  const U_FLOAT exScale, const U_FLOAT eyScale, const U_RECTL rclBounds, const char *TextString);
3453 // U_EMRDRAWESCAPE_set 105 Not implemented
3454 // U_EMREXTESCAPE_set 106 Not implemented
3455 // U_EMRUNDEF107_set 107 Not implemented
3456 // U_EMRSMALLTEXTOUT_set 108
3457 // U_EMRFORCEUFIMAPPING_set 109 Not implemented
3458 // U_EMRNAMEDESCAPE_set 110 Not implemented
3459 // U_EMRCOLORCORRECTPALETTE_set 111 Not implemented
3460 // U_EMRSETICMPROFILEA_set 112 Not implemented
3461 // U_EMRSETICMPROFILEW_set 113 Not implemented
3462 
3463 char *U_EMRALPHABLEND_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest,
3464  const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc,
3465  const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc,
3466  const U_BLEND Blend,
3467  const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px);
3468 char *U_EMRSETLAYOUT_set(const uint32_t iMode);
3469 char *U_EMRTRANSPARENTBLT_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest,
3470  const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc,
3471  const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t TColor,
3472  const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px);
3473 // U_EMRUNDEF117_set 117 Not implemented
3474 char *U_EMRGRADIENTFILL_set(const U_RECTL rclBounds, const U_NUM_TRIVERTEX nTriVert, const U_NUM_GRADOBJ nGradObj,
3475  const uint32_t ulMode, const PU_TRIVERTEX TriVert, const uint32_t *GradObj );
3476 // U_EMRSETLINKEDUFIS_set 119 Not implemented
3477 // U_EMRSETTEXTJUSTIFICATION_set 120 Not implemented (denigrated)
3478 // U_EMRCOLORMATCHTOTARGETW_set 121 Not implemented
3479 char *U_EMRCREATECOLORSPACEW_set(const uint32_t ihCS, const U_LOGCOLORSPACEW lcs, const uint32_t dwFlags,
3480  const U_CBDATA cbData, const uint8_t *Data);
3481 
3483 
3484 #ifdef __cplusplus
3485 }
3486 #endif
3487 
3488 #endif /* _UEMF_ */
U_RECTL rectl_set(U_POINTL ul, U_POINTL lr)
Set rect and rectl objects from Upper Left and Lower Right corner points.
Definition: uemf.c:1603
struct U_EMRSETMAPMODE U_EMRSETSTRETCHBLTMODE
EMF manual 2.3.11.24 StretchMode Enumeration.
struct U_BLEND * PU_BLEND
EMF Manual 2.3.1.1.
char * U_EMREXTCREATEPEN_set(const uint32_t ihPen, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_EXTLOGPEN elp)
Allocate and construct a U_EMR_EXTCREATEPEN record. Use extcreatepen_set() instead of calling this fu...
Definition: uemf.c:5175
struct U_PAIR * PU_POINT
WMF manual 2.2.2.15.
struct U_PAIR * PU_POINTL
WMF manual 2.2.2.15.
char * extcreatepen_set(uint32_t *ihPen, EMFHANDLES *eht, PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, PU_EXTLOGPEN elp)
Allocate and construct a U_EMREXTCREATEPEN structure, create a handle and return it. Use this function instead of calling U_EMREXTCREATEPEN_set() directly.
Definition: uemf.c:2494
int32_t cy
Y size.
Definition: uemf.h:588
char * U_EMRSETWINDOWORGEX_set(const U_POINTL ptlOrigin)
Allocate and construct a U_EMR_SETWINDOWORGEX record.
Definition: uemf.c:3407
Definition: uemf.h:2280
char * U_EMRPOLYLINE_set(const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
Allocate and construct a U_EMR_POLYLINE record.
Definition: uemf.c:3306
Definition: uemf.h:2224
Definition: uemf.h:2404
struct U_EMRGENERICPAIR * PU_EMRGENERICPAIR
Generic EMR record with two 32 bit values. Microsoft name: (none)
int drawing_size(const int xmm, const int ymm, const float dpmm, U_RECTL *rclBounds, U_RECTL *rclFrame)
Set up fields for an EMR_HEADER for drawing by physical size in mm and dots per millimeter. Technically rclBounds is supposed to be the extent of the drawing within the EMF, but libUEMF has no way of knowing this since it never actually draws anything. Instead this is set to the full drawing size. Coordinates are inclusive inclusive, so 297 -&gt; 0,29699.
Definition: uemf.c:1527
char * U_EMRSTROKEANDFILLPATH_set(const U_RECTL rclBox)
Allocate and construct a U_EMR_STROKEANDFILLPATH record.
Definition: uemf.c:4316
char * U_EMRSETVIEWPORTORGEX_set(const U_POINTL ptlOrigin)
Allocate and construct a U_EMR_SETVIEWPORTORGEX record.
Definition: uemf.c:3434
Definition: uemf.h:2754
struct U_EMRMOVETOEX * PU_EMRMOVETOEX
EMF manual 2.3.11.4.
char * U_EMRBITBLT_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
Allocate and construct a U_EMR_BITBLT record.
Definition: uemf.c:4555
struct U_EMRSETMAPMODE * PU_EMRSETPOLYFILLMODE
EMF manual 2.3.11.22 PolygonFillMode Enumeration.
struct U_EMRARC U_EMRCHORD
EMF manual 2.3.5.4.
struct U_EMRELLIPSE U_EMRRECTANGLE
EMF manual 2.3.5.5.
struct U_EMRMOVETOEX * PU_EMRLINETO
EMF manual 2.3.5.13.
struct U_EMRINVERTRGN * PU_EMRINVERTRGN
EMF manual 2.3.11.3.
struct U_EMRGRADIENTFILL * PU_EMRGRADIENTFILL
EMF manual 2.3.5.12.
struct U_EMRALPHABLEND * PU_EMRALPHABLEND
EMF manual 2.3.1.1.
struct U_EMRINVERTRGN U_EMRPAINTRGN
EMF manual 2.3.5.14.
Definition: uemf.h:2269
struct U_EMRSETMETARGN * PU_EMRREALIZEPALETTE
EMF manual 2.3.10.
Definition: uemf.h:2427
struct U_EMRPOLYBEZIER16 U_EMRPOLYBEZIERTO16
EMF manual 2.3.5.19.
uint32_t U_CBPLENTRIES
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:181
char * U_EMRSETTEXTALIGN_set(const uint32_t iMode)
Allocate and construct a U_EMR_SETTEXTALIGN record.
Definition: uemf.c:3606
struct U_EMRSETMAPMODE * PU_EMRSETMAPMODE
EMF manual 2.3.11.19 MapMode enumeration.
char * createdibpatternbrushpt_set(uint32_t *ihBrush, EMFHANDLES *eht, const uint32_t iUsage, PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px)
Allocate and construct a U_EMRCREATEDIBPATTERNBRUSHPT_set structure, create a handle and returns it U...
Definition: uemf.c:2551
Definition: uemf.h:2352
char * U_EMRSETMAPMODE_set(const uint32_t iMode)
Allocate and construct a U_EMR_SETMAPMODE record.
Definition: uemf.c:3546
For U_EMRFILLRGN RgnData field(s)
Definition: uemf.h:1972
Definition: uemf.h:2621
uint32_t U_OFFDX
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:194
struct U_EMRNAMEDESCAPE * PU_EMRNAMEDESCAPE
EMF manual 2.3.6.3.
char * U_EMREXTTEXTOUTA_set(const U_RECTL rclBounds, const uint32_t iGraphicsMode, const U_FLOAT exScale, const U_FLOAT eyScale, const PU_EMRTEXT emrtext)
Allocate and construct a U_EMR_EXTTEXTOUTA record.
Definition: uemf.c:4931
int memprobe(const void *buf, size_t size)
Debugging utility, used with valgrind to find uninitialized values. Not for use in production code...
Definition: uemf.c:263
struct U_PIXELFORMATDESCRIPTOR * PU_PIXELFORMATDESCRIPTOR
EMF manual 2.2.22.
U_COLORREF colorref4_set(uint8_t red, uint8_t green, uint8_t blue, uint8_t Reserved)
Set a U_COLORREF value from separate R,G,B, and Reserved values.
Definition: uemf.c:1570
uint32_t U_CBBMIMSK
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:177
struct U_EMRTRANSPARENTBLT * PU_EMRTRANSPARENTBLT
EMF manual 2.3.1.8.
char * U_EMRSCALEVIEWPORTEXTEX_set(const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom)
Allocate and construct a U_EMR_SCALEVIEWPORTEXTEX record.
Definition: uemf.c:3724
char * U_EMRPLGBLT_set(const U_RECTL rclBounds, const PU_POINTL aptlDst, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const U_POINTL Mask, const uint32_t iUsageMask, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_BITMAPINFO MskBmi, const uint32_t cbMsk, char *Msk)
Allocate and construct a U_EMRPLGBLT record.
Definition: uemf.c:4739
struct U_COLORADJUSTMENT * PU_COLORADJUSTMENT
EMF manual 2.2.2.
struct U_EMRSETMETARGN * PU_EMRSAVEDC
EMF manual 2.3.11.
struct U_EMRSETWINDOWORGEX * PU_EMRSETWINDOWORGEX
EMF manual 2.3.11.31.
struct U_EMRPIXELFORMAT * PU_EMRPIXELFORMAT
EMF manual 2.3.11.5.
int device_size(const int xmm, const int ymm, const float dpmm, U_SIZEL *szlDev, U_SIZEL *szlMm)
Set up fields for an EMR_HEADER from the physical device&#39;s width and height in mm and dots per millim...
Definition: uemf.c:1500
Definition: uemf.h:2609
struct U_EMRSETTEXTCOLOR U_EMRSETBKCOLOR
EMF manual 2.3.11.10.
struct U_EMRCREATEPEN * PU_EMRCREATEPEN
EMF manual 2.3.7.7.
Definition: uemf.h:2862
struct U_LCS_GAMMARGB * PU_LCS_GAMMARGB
WMF manual 2.2.2.11.
char * U_EMRSETBKCOLOR_set(const U_COLORREF crColor)
Allocate and construct a U_EMR_SETBKCOLOR record.
Definition: uemf.c:3652
char * selectobject_set(uint32_t ihObject, EMFHANDLES *eht)
Allocate and construct a U_EMRSELECTOBJECT structure, checks that the handle specified is one that ca...
Definition: uemf.c:2472
Definition: uemf.h:2361
struct U_RGNDATA * PU_RGNDATA
EMF manual 2.2.24.
struct U_BITMAPINFOHEADER * PU_BITMAPINFOHEADER
WMF manual 2.2.2.3.
Definition: uemf.h:3117
int emf_htable_free(EMFHANDLES **eht)
Free all memory in an htable. Sets the pointer to NULL.
Definition: uemf.c:1469
char * U_EMRFLATTENPATH_set(void)
Allocate and construct a U_EMR_FLATTENPATH record.
Definition: uemf.c:4341
For U_LOGPALETTE palPalEntry field(s)
Definition: uemf.h:1876
PU_TRIVERTEX trivertex_transform(PU_TRIVERTEX tv, int count, U_XFORM xform)
Allocate and construct an array of U_TRIVERTEX objects which has been subjected to a U_XFORM...
Definition: uemf.c:2781
struct U_EMRDELETEOBJECT * PU_EMRSELECTOBJECT
EMF manual 2.3.8.5.
struct U_EMRELLIPSE * PU_EMRELLIPSE
EMF manual 2.3.5.5.
struct U_EMRPOLYBEZIER16 U_EMRPOLYLINE16
EMF manual 2.3.5.25.
char * U_EMRBEGINPATH_set(void)
Allocate and construct a U_EMR_BEGINPATH record.
Definition: uemf.c:4270
int emf_start(const char *name, const uint32_t initsize, const uint32_t chunksize, EMFTRACK **et)
Start constructing an emf in memory. Supply the file name and initial size.
Definition: uemf.c:1161
struct U_SIZE * PU_SIZEL
WMF manual 2.2.2.22.
struct U_EMRSCALEVIEWPORTEXTEX U_EMRSCALEWINDOWEXTEX
EMF manual 2.3.11.8.
Definition: uemf.h:2919
Prototypes for functions that manipulate UTF and various types of text.
struct U_PAIRF * PU_PAIRF
Any generic pair of floats. Microsoft name: (none)
struct U_EMREXTTEXTOUTA U_EMREXTTEXTOUTW
EMF manual 2.3.5.8.
struct U_POINT16 * PU_POINT16
WMF manual 2.2.2.16.
struct U_EMRARC U_EMRPIE
EMF manual 2.3.5.15.
struct U_EMRSETWINDOWORGEX * PU_EMRSETVIEWPORTORGEX
EMF manual 2.3.11.29.
int32_t top
top coordinate
Definition: uemf.h:556
U_EMRALPHABLEND Blend field.
Definition: uemf.h:2031
Definition: uemf.h:2597
uint32_t U_OFFPLENTRIES
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:195
uint32_t U_OFFBITS
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:186
char * U_EMRFILLRGN_set(const U_RECTL rclBounds, const uint32_t ihBrush, const PU_RGNDATA RgnData)
Allocate and construct a U_EMR_FILLRGN record. Use fillrgn_set() instead of calling this function dir...
Definition: uemf.c:4414
For U_POINT28_4 x and y fields.
Definition: uemf.h:1633
uint32_t U_NUM_LOGPLTNTRY
Number of U_LOGPLTENTRY.
Definition: uemf.h:207
char * U_EMRREALIZEPALETTE_set(void)
Allocate and construct a U_EMR_REALIZEPALETTE record.
Definition: uemf.c:4137
struct U_EMREXTTEXTOUTA * PU_EMREXTTEXTOUTW
EMF manual 2.3.5.8.
struct U_POINT28_4 * PU_POINT28_4
EMF manual 2.2.23.
struct U_EMRPOLYBEZIER * PU_EMRPOLYLINE
EMF manual 2.3.5.24.
Definition: uemf.h:2066
Definition: uemf.h:2124
uint32_t U_CBRGNDATA
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:183
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYGON16
EMF manual 2.3.5.23.
Definition: uemf.h:2291
struct U_BITFIX28_4 * PU_BITFIX28_4
EMF manual 2.2.1.
uint32_t U_CBBITSSRC
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:175
uint8_t Red
Red color (0-255)
Definition: uemf.h:573
struct U_EMREOF * PU_EMREOF
EMF manual 3.2.4.1.
char * U_EMRPOLYGON_set(const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
Allocate and construct a U_EMR_POLYGON record.
Definition: uemf.c:3290
struct U_EMRSETMETARGN * PU_EMRENDPATH
EMF manual 2.3.10.
struct U_EMRPOLYBEZIER U_EMRPOLYLINE
EMF manual 2.3.5.24.
struct U_EMRPOLYBEZIER U_EMRPOLYGON
EMF manual 2.3.5.22.
U_LCS_GAMMA lcsGammaGreen
Green Gamma.
Definition: uemf.h:480
struct U_EMRPOLYPOLYLINE U_EMRPOLYPOLYGON
EMF manual 2.3.5.28.
struct U_RGBQUAD * PU_RGBQUAD
WMF manual 2.2.2.20.
char * U_EMREXTCREATEFONTINDIRECTW_set(const uint32_t ihFont, const char *elf, const char *elfw)
Allocate and construct a U_EMR_EXTCREATEFONTINDIRECTW record. Use extcreatefontindirectw_set() instea...
Definition: uemf.c:4895
char * U_EMRCREATEPEN_set(const uint32_t ihPen, const U_LOGPEN lopn)
Allocate and construct a U_EMR_CREATEPEN record. Use createpen_set() instead of calling this function...
Definition: uemf.c:3851
struct U_EMRPOLYPOLYLINE * PU_EMRPOLYPOLYGON
EMF manual 2.3.5.28.
struct U_EMREXTESCAPE * PU_EMREXTESCAPE
EMF manual 2.3.6.2.
struct U_EMRSETWINDOWORGEX U_EMRSETVIEWPORTORGEX
EMF manual 2.3.11.29.
char * framergn_set(uint32_t *ihBrush, EMFHANDLES *eht, const U_RECTL rclBounds, const U_SIZEL szlStroke, const PU_RGNDATA RgnData)
Allocate and construct a U_EMRFRAMERGN structure, create a handle and returns it Use this function in...
Definition: uemf.c:2715
uint32_t U_OFFPXLFMT
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:196
Definition: uemf.h:2463
struct U_EMRROUNDRECT * PU_EMRROUNDRECT
EMF manual 2.3.5.35.
int emf_finish(EMFTRACK *et, EMFHANDLES *eht)
Finalize the emf in memory and write it to the file.
Definition: uemf.c:1202
For U_EMRSETOLORADJUSTMENT ColorAdjustment field.
Definition: uemf.h:1646
struct U_RECT U_RECTL
WMF manual 2.2.2.19.
struct U_LOGCOLORSPACEW * PU_LOGCOLORSPACEW
WMF manual 2.2.2.12.
int32_t lcsCSType
lcsCSType Enumeration
Definition: uemf.h:511
char * U_EMRSETROP2_set(const uint32_t iMode)
Allocate and construct a U_EMR_SETROP2 record.
Definition: uemf.c:3582
Definition: uemf.h:2146
struct U_TRIVERTEX * PU_TRIVERTEX
EMF manual 2.2.26.
void wchar32show(const uint32_t *src)
Dump a UTF32 string. Not for use in production code.
Definition: uemf_utf.c:91
U_RGBQUAD rgbquad_set(uint8_t red, uint8_t green, uint8_t blue, uint8_t reserved)
Set a U_RGBQUAD value from separate R,G,B, Reserved values.
Definition: uemf.c:1588
Definition: uemf.h:2454
int get_DIB_params(void *pEmr, uint32_t offBitsSrc, uint32_t offBmiSrc, const char **px, const U_RGBQUAD **ct, uint32_t *numCt, uint32_t *width, uint32_t *height, uint32_t *colortype, uint32_t *invert)
Get the DIB parameters from the BMI of the record for use by DBI_to_RGBA()
Definition: uemf.c:866
Definition: uemf.h:2998
int get_real_color_icount(int Colors, int BitCount, int Width, int Height)
Get the actual number of colors in the color table from the ClrUsed, BitCount, Width, and Height.
Definition: uemf.c:833
struct U_EMRSETMETARGN * PU_EMRBEGINPATH
EMF manual 2.3.10.
void wchar16show(const uint16_t *src)
Dump a UTF16 string. Not for use in production code.
Definition: uemf_utf.c:80
char * U_EMRCLOSEFIGURE_set(void)
Allocate and construct a U_EMR_CLOSEFIGURE record.
Definition: uemf.c:4288
uint32_t lcsSignature
must be U_LCS_SIGNATURE
Definition: uemf.h:508
struct U_EMRCOMMENT_SPOOL * PU_EMRCOMMENT_SPOOL
EMF manual 2.3.3.3, EMF Spool comment.
struct U_EMRSETWINDOWORGEX U_EMRSETBRUSHORGEX
EMF manual 2.3.11.12.
struct U_EMRCREATEPALETTE * PU_EMRCREATEPALETTE
EMF manual 2.3.7.6.
void wchar8show(const char *src)
Dump a UTF8 string. Not for use in production code.
Definition: uemf_utf.c:68
U_PANOSE panose_set(uint8_t bFamilyType, uint8_t bSerifStyle, uint8_t bWeight, uint8_t bProportion, uint8_t bContrast, uint8_t bStrokeVariation, uint8_t bArmStyle, uint8_t bLetterform, uint8_t bMidline, uint8_t bXHeight)
Construct a U_PANOSE structure.
Definition: uemf.c:1892
Definition: uemf.h:2634
char * createcolorspace_set(uint32_t *ihCS, EMFHANDLES *eht, U_LOGCOLORSPACEA lcs)
Allocate and construct a U_EMRCREATECOLORSPACE structure, create a handle and returns it Use this fun...
Definition: uemf.c:2597
struct U_EMRSETMAPMODE U_EMRSETICMMODE
EMF manual 2.3.11.14 ICMMode Enumeration.
uint32_t U_OFFBMISRC
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:191
Definition: uemf.h:2485
Definition: uemf.h:2679
struct U_EMRSETARCDIRECTION * PU_EMRSETARCDIRECTION
EMF manual 2.3.11.9.
struct U_DESIGNVECTOR * PU_DESIGNVECTOR
EMF manual 2.2.3.
struct U_EMRSETPALETTEENTRIES * PU_EMRSETPALETTEENTRIES
EMF manual 2.3.8.8.
struct U_EMRSETMETARGN U_EMRBEGINPATH
EMF manual 2.3.10.
uint8_t Blue
Blue color (0-255)
Definition: uemf.h:455
struct U_EMRFRAMERGN * PU_EMRFRAMERGN
EMF manual 2.3.5.11.
U_COLORADJUSTMENT coloradjustment_set(uint16_t Size, uint16_t Flags, uint16_t IlluminantIndex, uint16_t RedGamma, uint16_t GreenGamma, uint16_t BlueGamma, uint16_t ReferenceBlack, uint16_t ReferenceWhite, int16_t Contrast, int16_t Brightness, int16_t Colorfulness, int16_t RedGreenTint)
Construct a U_COLORADJUSTMENT structure.
Definition: uemf.c:2244
char * U_EMRSETWORLDTRANSFORM_set(const U_XFORM xform)
Allocate and construct a U_EMR_SETWORLDTRANSFORM record.
Definition: uemf.c:3779
char * U_EMRFILLPATH_set(const U_RECTL rclBox)
Allocate and construct a U_EMR_FILLPATH record.
Definition: uemf.c:4300
For U_LOGCOLORSPACEA and U_LOGCOLORSPACEW lcsEndpints field.
Definition: uemf.h:439
For U_EMREXTCREATEPEN lopn field.
Definition: uemf.h:2002
U_NUM_RGBQUAD biClrUsed
Number of bmciColors in U_BITMAPINFO/U_BITMAPCOREINFO that are used by the bitmap.
Definition: uemf.h:415
Definition: uemf.h:2658
U_LOGBRUSH logbrush_set(uint32_t lbStyle, U_COLORREF lbColor, int32_t lbHatch)
Construct a U_LOGBRUSH structure.
Definition: uemf.c:1726
char * U_EMRSETVIEWPORTEXTEX_set(const U_SIZEL szlExtent)
Allocate and construct a U_EMR_SETVIEWPORTEXTEX record.
Definition: uemf.c:3419
struct U_EMRMOVETOEX U_EMRLINETO
EMF manual 2.3.5.13.
Definition: uemf.h:2258
struct U_XFORM * PU_XFORM
EMF manual 2.2.28.
#define U_MAX_PATH
longest path name for a file
Definition: uemf.h:154
struct U_EMRSETWORLDTRANSFORM * PU_EMRSETWORLDTRANSFORM
EMF manual 2.3.12.2.
int32_t biWidth
Bitmap width in pixels.
Definition: uemf.h:403
Definition: uemf.h:2937
Definition: uemf.h:3073
struct U_EMRRESTOREDC * PU_EMRRESTOREDC
EMF manual 2.3.11.6.
char * U_EMRRESIZEPALETTE_set(const uint32_t ihPal, const uint32_t cEntries)
Allocate and construct a U_EMR_RESIZEPALETTE record.
Definition: uemf.c:4125
int emf_htable_insert(uint32_t *ih, EMFHANDLES *eht)
Returns the index of the first free slot. Call realloc() if needed. The slot is set to handle (indica...
Definition: uemf.c:1432
struct U_EMRFILLPATH * PU_EMRSTROKEANDFILLPATH
EMF manual 2.3.5.38.
char * U_EMRSETMAPPERFLAGS_set(void)
Allocate and construct a U_EMR_SETMAPPERFLAGS record.
Definition: uemf.c:3526
struct U_EMRARC * PU_EMRARC
EMF manual 2.3.5.2.
PU_BITMAPINFO bitmapinfo_set(U_BITMAPINFOHEADER BmiHeader, PU_RGBQUAD BmiColors)
Allocate and construct a U_BITMAPINFO structure.
Definition: uemf.c:2046
Definition: uemf.h:2846
uint32_t biClrImportant
Number of bmciColors needed (0 means all).
Definition: uemf.h:416
Definition: uemf.h:2473
For U_EMR[POLY]EXTTEXTOUT[A|W] emrtext field.
Definition: uemf.h:1708
char * U_EMRPOLYBEZIER16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
Allocate and construct a U_EMR_POLYBEZIER16 record.
Definition: uemf.c:4969
uint8_t Green
Green color (0-255)
Definition: uemf.h:572
struct U_EMRSETMAPMODE U_EMRSETROP2
EMF manual 2.3.11.23 Binary Raster Operation Enumeration.
U_XFORM xform_set(U_FLOAT eM11, U_FLOAT eM12, U_FLOAT eM21, U_FLOAT eM22, U_FLOAT eDx, U_FLOAT eDy)
Construct a U_XFORM structure.
Definition: uemf.c:1748
PU_RGNDATA rgndata_set(U_RGNDATAHEADER rdh, PU_RECTL Buffer)
Allocate and construct a U_RGNDATA structure.
Definition: uemf.c:2208
char * U_EMRALPHABLEND_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const U_BLEND Blend, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
Allocate and construct a U_EMR_ALPHABLEND record.
Definition: uemf.c:5409
uint32_t biSize
Structure size in bytes.
Definition: uemf.h:402
char * U_EMRSETMETARGN_set(void)
Allocate and construct a U_EMR_SETMETARGN record.
Definition: uemf.c:3687
int emr_arc_points_common(PU_RECTL rclBox, PU_POINTL ArcStart, PU_POINTL ArcEnd, int *f1, int f2, PU_PAIRF center, PU_PAIRF start, PU_PAIRF end, PU_PAIRF size)
Derive from bounding rect, start and end radials, for arc, chord, or pie, the center, start, and end points, and the bounding rectangle.
Definition: uemf.c:496
uint32_t U_NUM_POLYCOUNTS
Number of U_POLYCOUNTS.
Definition: uemf.h:212
struct U_EMRCREATEBRUSHINDIRECT * PU_EMRCREATEBRUSHINDIRECT
EMF manual 2.3.7.1.
char * U_EMRCOMMENT_set(const U_CBDATA cbData, const char *Data)
Allocate and construct a U_EMR_COMMENT record.
Definition: uemf.c:4384
Definition: uemf.h:2958
char * U_EMRFRAMERGN_set(const U_RECTL rclBounds, const uint32_t ihBrush, const U_SIZEL szlStroke, const PU_RGNDATA RgnData)
Allocate and construct a U_EMR_FRAMERGN record. Use framegrn_set() instead of calling this function d...
Definition: uemf.c:4452
Definition: uemf.h:2512
char * U_EMRDELETECOLORSPACE_set(const uint32_t ihCS)
Allocate and construct a U_EMR_DELETECOLORSPACE record.
Definition: uemf.c:5294
struct U_EMRDELETEOBJECT * PU_EMRDELETEOBJECT
EMF manual 2.3.8.3.
For U_LOGFONT_PANOSE elfLogFont field.
Definition: uemf.h:1806
struct U_EMRSCALEVIEWPORTEXTEX * PU_EMRSCALEVIEWPORTEXTEX
EMF manual 2.3.11.7.
int32_t ciexyzY
CIE color space Y component.
Definition: uemf.h:427
uint32_t U_NUM_POINT16
Number of U_POINT16.
Definition: uemf.h:210
For U_EMREXTCREATEFONTINDIRECTW elfw field.
Definition: uemf.h:1855
char * U_EMRCHORD_set(const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd)
Allocate and construct a U_EMR_CHORD record.
Definition: uemf.c:4021
char * U_EMREXTFLOODFILL_set(const U_POINTL ptlStart, const U_COLORREF crColor, const uint32_t iMode)
Allocate and construct a U_EMR_EXTFLOODFILL record.
Definition: uemf.c:4149
char * U_EMRSELECTOBJECT_set(const uint32_t ihObject)
Allocate and construct a U_EMR_SELECTOBJECT record. Use selectobject_set() instead of calling this fu...
Definition: uemf.c:3827
Definition: uemf.h:2576
struct U_EMRSETWINDOWEXTEX * PU_EMRSETVIEWPORTEXTEX
EMF manual manual 2.3.11.28.
struct U_EMRGLSRECORD * PU_EMRGLSRECORD
EMF manual 2.3.9.2.
Definition: uemf.h:2874
char * U_EMRPOLYLINETO16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
Allocate and construct a U_EMR_POLYLINETO record.
Definition: uemf.c:5033
struct U_EMRPOLYBEZIER * PU_EMRPOLYGON
EMF manual 2.3.5.22.
struct U_EMREXCLUDECLIPRECT * PU_EMREXCLUDECLIPRECT
EMF manual 2.3.2.1.
Coordinates of the upper left, lower right corner.
Definition: uemf.h:554
char * U_EMREXTTEXTOUTW_set(const U_RECTL rclBounds, const uint32_t iGraphicsMode, const U_FLOAT exScale, const U_FLOAT eyScale, const PU_EMRTEXT emrtext)
Allocate and construct a U_EMR_EXTTEXTOUTW record.
Definition: uemf.c:4951
char * U_EMRPOLYDRAW16_set(const U_RECTL rclBounds, const U_NUM_POINT16 cpts, const U_POINT16 *aptl, const uint8_t *abTypes)
Allocate and construct a U_EMR_POLYDRAW16 record.
Definition: uemf.c:5091
Definition: uemf.h:2701
struct U_EMRFILLPATH * PU_EMRSTROKEPATH
EMF manual 2.3.5.39.
char * U_EMRSETTEXTCOLOR_set(const U_COLORREF crColor)
Allocate and construct a U_EMR_SETTEXTCOLOR record.
Definition: uemf.c:3640
uint32_t U_NUM_TRIVERTEX
Number of U_TRIVERTEX.
Definition: uemf.h:215
struct U_EMRPOLYBEZIER * PU_EMRPOLYBEZIER
EMF manual 2.3.5.16.
int32_t y
Y value.
Definition: uemf.h:526
struct U_EMRARC * PU_EMRARCTO
EMF manual 2.3.5.3.
U_LOGPLTNTRY logpltntry_set(uint8_t peReserved, uint8_t peRed, uint8_t peGreen, uint8_t peBlue)
Construct a U_LOGPLTNTRY structure.
Definition: uemf.c:2144
struct U_COLORREF * PU_COLORREF
WMF manual 2.2.2.8.
uint32_t U_CBNAME
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:180
struct U_PANOSE * PU_PANOSE
EMF manual 2.2.21.
Definition: uemf.h:2045
U_POINT16 point16_set(int16_t x, int16_t y)
Set point16 objects with 16 bit X,Y values.
Definition: uemf.c:1650
U_CIEXYZ ciexyzRed
CIE XYZ coord of red endpoint of colorspace.
Definition: uemf.h:440
struct U_EMRSETWINDOWEXTEX U_EMRSETVIEWPORTEXTEX
EMF manual manual 2.3.11.28.
uint32_t U_NUM_POINTL
Number of U_POINTL.
Definition: uemf.h:209
struct U_EMRHEADER * PU_EMRHEADER
EMF manual 2.2.9.
uint32_t U_NUM_FNTAXES
Number of U_FNTAXES.
Definition: uemf.h:206
char * U_EMREOF_set(const U_CBPLENTRIES cbPalEntries, const PU_LOGPLTNTRY PalEntries, EMFTRACK *et)
Allocate and construct a U_EMR_EOF record.
Definition: uemf.c:3460
char * createpen_set(uint32_t *ihPen, EMFHANDLES *eht, U_LOGPEN lopn)
Allocate and construct a U_EMRCREATEPEN structure, create a handle and returns it Use this function i...
Definition: uemf.c:2514
uint32_t lcsSignature
must be U_LCS_SIGNATURE
Definition: uemf.h:491
char * U_EMRSELECTCLIPPATH_set(const uint32_t iMode)
Allocate and construct a U_EMR_SELECTCLIPPATH record.
Definition: uemf.c:4360
U_POINTL point32_set(int32_t x, int32_t y)
Set pointl objects with X,Y values.
Definition: uemf.c:1635
struct U_EMRPOLYPOLYLINE16 * PU_EMRPOLYPOLYGON16
EMF manual 2.3.5.29.
Definition: uemf.h:2249
char * U_EMRSETICMMODE_set(const uint32_t iMode)
Allocate and construct a U_EMR_SETICMMODE record.
Definition: uemf.c:5244
struct U_EMRARC U_EMRARCTO
EMF manual 2.3.5.3.
void dumpeht(char *string, unsigned int *handle, EMFHANDLES *eht)
Dump an EMFHANDLES structure. Not for use in production code.
Definition: uemf.c:279
Used for any generic pair of uint32_t.
Definition: uemf.h:524
struct U_EMRPLGBLT * PU_EMRPLGBLT
EMF manual 2.3.1.4.
Definition: uemf.h:2371
void wchartshow(const wchar_t *src)
Dump a wchar_t string. Not for use in production code.
Definition: uemf_utf.c:103
struct U_EMRSETMITERLIMIT * PU_EMRSETMITERLIMIT
EMF manual 2.3.11.21.
Definition: uemf.h:2057
struct U_EMRPOLYBEZIER * PU_EMRPOLYBEZIERTO
EMF manual 2.3.5.18.
char * U_EMRCREATEPALETTE_set(const uint32_t ihPal, const U_LOGPALETTE lgpl)
Allocate and construct a U_EMR_CREATEPALETTE record. Use createpalette_set() instead of calling this ...
Definition: uemf.c:4065
char * U_EMRPIXELFORMAT_set(const U_PIXELFORMATDESCRIPTOR pfd)
Allocate and construct a U_EMR_PIXELFORMAT record.
Definition: uemf.c:5308
Definition: uemf.h:2204
struct U_EMR * PU_EMR
First two fields of all EMF records,.
For U_EMRCREATEBRUSHINDIRECT lb field.
Definition: uemf.h:1792
Definition: uemf.h:2160
struct U_EMRPOLYBEZIER16 U_EMRPOLYLINETO16
EMF manual 2.3.5.27.
struct U_CIEXYZTRIPLE * PU_CIEXYZTRIPLE
WMF manual 2.2.2.7.
char * U_EMRPOLYBEZIERTO16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
Allocate and construct a U_EMR_POLYBEZIERTO record.
Definition: uemf.c:5017
char * U_EMRRECTANGLE_set(const U_RECTL rclBox)
Allocate and construct a U_EMR_RECTANGLE record.
Definition: uemf.c:3966
int32_t x
X value.
Definition: uemf.h:525
char * U_EMRPOLYLINE16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
Allocate and construct a U_EMR_POLYLINE16 record.
Definition: uemf.c:5001
PU_POINT16 point_to_point16(PU_POINT points, int count)
Allocate and construct an array of U_POINT16 objects from a set of U_POINT objects.
Definition: uemf.c:2822
char * U_EMRTRANSPARENTBLT_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t TColor, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
Allocate and construct a U_EMR_TRANSPARENTBLT record.
Definition: uemf.c:5453
For U_LOGFONT_PANOSE elfPanose field.
Definition: uemf.h:1833
struct U_EMREXTSELECTCLIPRGN * PU_EMREXTSELECTCLIPRGN
EMF manual 2.3.2.2.
For U_EMRCREATEPEN lopn field.
Definition: uemf.h:1904
int32_t lcsCSType
LCS_CSType Enumeration.
Definition: uemf.h:494
Definition: uemf.h:3130
int emr_arc_points(PU_ENHMETARECORD record, int *f1, int f2, PU_PAIRF center, PU_PAIRF start, PU_PAIRF end, PU_PAIRF size)
Derive from an EMF arc, chord, or pie the center, start, and end points, and the bounding rectangle...
Definition: uemf.c:593
struct U_EMREXTCREATEFONTINDIRECTW * PU_EMREXTCREATEFONTINDIRECTW
EMF manual 2.3.7.8.
struct U_EMRSETMAPMODE * PU_EMRSETLAYOUT
EMF manual 2.3.11.17 Mirroring Enumeration.
char * U_EMRANGLEARC_set(const U_POINTL ptlCenter, const uint32_t nRadius, const U_FLOAT eStartAngle, const U_FLOAT eSweepAngle)
Allocate and construct a U_EMR_ANGLEARC record.
Definition: uemf.c:3926
uint32_t biSizeImage
Image size in bytes or 0 = &quot;default size (calculated from geometry?)&quot;.
Definition: uemf.h:412
U_LOGCOLORSPACEW logcolorspacew_set(int32_t lcsCSType, int32_t lcsIntent, U_CIEXYZTRIPLE lcsEndpoints, U_LCS_GAMMARGB lcsGammaRGB, uint16_t *lcsFilename)
Construct a U_LOGCOLORSPACEW structure.
Definition: uemf.c:1858
Definition: uemf.h:2171
uint8_t Reserved
Not used.
Definition: uemf.h:456
U_LOGPEN logpen_set(uint32_t lopnStyle, U_POINT lopnWidth, U_COLORREF lopnColor)
Construct a U_LOGPEN structure.
Definition: uemf.c:2124
struct U_EMRPOLYBEZIER U_EMRPOLYLINETO
EMF manual 2.3.5.26.
char * U_EMRMASKBLT_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const U_POINTL Mask, const uint32_t iUsageMask, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_BITMAPINFO MskBmi, const uint32_t cbMsk, char *Msk)
Allocate and construct a U_EMR_MASKBLT record.
Definition: uemf.c:4671
char * U_EMREXCLUDECLIPRECT_set(const U_RECTL rclClip)
Allocate and construct a U_EMR_EXCLUDECLIPRECT record.
Definition: uemf.c:3697
Definition: uemf.h:2904
Definition: uemf.h:2827
U_RECT findbounds16(uint32_t count, PU_POINT16 pts, uint32_t width)
Find the bounding rectangle from a polyline of a given width.
Definition: uemf.c:1697
char * U_EMRLINETO_set(const U_POINTL ptl)
Allocate and construct a U_EMR_LINETO record.
Definition: uemf.c:4175
U_BITMAPINFOHEADER bitmapinfoheader_set(int32_t biWidth, int32_t biHeight, uint16_t biPlanes, uint16_t biBitCount, uint32_t biCompression, uint32_t biSizeImage, int32_t biXPelsPerMeter, int32_t biYPelsPerMeter, U_NUM_RGBQUAD biClrUsed, uint32_t biClrImportant)
Construct a U_BITMAPINFOHEADER structure.
Definition: uemf.c:2012
struct U_LCS_GAMMA * PU_LCS_GAMMA
WMF manual 2.2.2.11.
Point type for 16 bit EMR drawing functions.
Definition: uemf.h:541
For U_EMRCREATECOLORSPACE lcs field.
Definition: uemf.h:490
int emf_readdata(const char *filename, char **contents, size_t *length)
Retrieve contents of an EMF file by name.
Definition: uemf.c:1281
struct U_EMRSETMAPMODE U_EMRSETBKMODE
EMF manual 2.3.11.11 BackgroundMode Enumeration.
int32_t right
right coordinate
Definition: uemf.h:557
char * U_EMRSETLAYOUT_set(uint32_t iMode)
Allocate and construct a U_EMR_SETLAYOUT record.
Definition: uemf.c:5432
For GRADIENT_[TRIANGLE|U_RECT].
Definition: uemf.h:1745
char * U_EMRGRADIENTFILL_set(const U_RECTL rclBounds, const U_NUM_TRIVERTEX nTriVert, const U_NUM_GRADOBJ nGradObj, const uint32_t ulMode, const PU_TRIVERTEX TriVert, const uint32_t *GradObj)
Allocate and construct a U_EMR_TRANSPARENTBLT record.
Definition: uemf.c:5481
U_CIEXYZTRIPLE lcsEndpoints
CIE XYZ color space endpoints.
Definition: uemf.h:496
struct U_EMRSETTEXTCOLOR * PU_EMRSETBKCOLOR
EMF manual 2.3.11.10.
For U_EMRPIXELFORMAT pfd field.
Definition: uemf.h:1919
char * U_EMRARCTO_set(U_RECTL rclBox, U_POINTL ptlStart, U_POINTL ptlEnd)
Allocate and construct a U_EMR_ARCTO record.
Definition: uemf.c:4192
char * U_EMRSTRETCHDIBITS_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const uint32_t iUsageSrc, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
Allocate and construct a U_EMR_EMRSTRETCHDIBITS record.
Definition: uemf.c:4850
struct U_EMRSETMETARGN U_EMRWIDENPATH
EMF manual 2.3.10.
struct U_EMRCREATEDIBPATTERNBRUSHPT * PU_EMRCREATEDIBPATTERNBRUSHPT
EMF manual 2.3.7.4.
#define U_LF_FULLFACESIZE
U_LOGFONT_PANOSE elfFullName field maximum width.
Definition: uemf.h:607
struct U_BITMAPINFO * PU_BITMAPINFO
WMF Manual 2.2.2.9.
For ? (not implemented yet)
Definition: uemf.h:1667
struct U_ENHMETARECORD * PU_ENHMETARECORD
General form of an EMF record.
struct U_LOGBRUSH U_PATTERN
EMF manual 2.2.12.
struct U_EMRSETMAPMODE U_EMRSETTEXTALIGN
EMF manual 2.3.11.25 TextAlignment enumeration.
Definition: uemf.h:2566
struct U_EMROFFSETCLIPRGN * PU_EMROFFSETCLIPRGN
EMF manual 2.3.2.4.
uint32_t lcsSize
Size in bytes of this structure.
Definition: uemf.h:493
Definition: uemf.h:2382
char * U_EMRWIDENPATH_set(void)
Allocate and construct a U_EMR_WIDENPATH record.
Definition: uemf.c:4350
uint32_t U_CBBITSMSK
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:174
char * U_EMRPOLYPOLYLINE_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cptl, const U_POINTL *points)
Allocate and construct a U_EMR_POLYPOLYLINE record.
Definition: uemf.c:3356
Definition: uemf.h:2497
char * U_EMRCREATECOLORSPACEW_set(const uint32_t ihCS, const U_LOGCOLORSPACEW lcs, const uint32_t dwFlags, const U_CBDATA cbData, const uint8_t *Data)
Allocate and construct a U_EMR_CREATECOLORSPACEW record. Use createcolorspacew_set() instead of calli...
Definition: uemf.c:5531
char * U_EMRHEADER_set(const U_RECTL rclBounds, const U_RECTL rclFrame, U_PIXELFORMATDESCRIPTOR *const pfmtDesc, U_CBSTR nDesc, uint16_t *const Description, const U_SIZEL szlDevice, const U_SIZEL szlMillimeters, const uint32_t bOpenGL)
Allocate and construct a U_EMRHEADER record.
Definition: uemf.c:3206
struct U_EMRSETMETARGN U_EMRABORTPATH
EMF manual 2.3.10.
Definition: uemf.h:2437
char * U_EMRSAVEDC_set(void)
Allocate and construct a U_EMR_SAVEDC record.
Definition: uemf.c:3757
int32_t bottom
bottom coordinate
Definition: uemf.h:558
struct U_EMRSTRETCHDIBITS * PU_EMRSTRETCHDIBITS
EMF manual 2.3.1.7.
struct U_EMRFILLPATH U_EMRSTROKEPATH
EMF manual 2.3.5.39.
struct U_EMRSETMAPMODE * PU_EMRSELECTCLIPPATH
EMF manual 2.3.2.5 RegionMode Enumeration.
uint32_t U_OFFBMI
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:189
For U_EMR_* OffBmi* fields.
Definition: uemf.h:2020
struct U_MAT2X2 * PU_MAT2X2
2 x 2 matrix, used by xform_alt_set() function.
int32_t lcsIntent
lcsIntent Enumeration
Definition: uemf.h:512
U_LOGFONT_PANOSE logfont_panose_set(U_LOGFONT elfLogFont, uint16_t *elfFullName, uint16_t *elfStyle, uint32_t elfStyleSize, U_PANOSE elfPanose)
Construct a U_LOGFONT_PANOSE structure.
Definition: uemf.c:1981
struct U_LOGBRUSH * PU_LOGBRUSH
EMF manual 2.2.12.
struct U_EMRSETMAPMODE U_EMRSELECTCLIPPATH
EMF manual 2.3.2.5 RegionMode Enumeration.
struct U_RGNDATAHEADER * PU_RGNDATAHEADER
EMF manual 2.2.25.
struct U_EMRPOLYDRAW * PU_EMRPOLYDRAW
EMF manual 2.3.5.20.
char * U_EMRSCALEWINDOWEXTEX_set(const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom)
Allocate and construct a U_EMR_SCALEWINDOWEXTEX record.
Definition: uemf.c:3743
struct U_EMRFORMAT * PU_EMRFORMAT
EMF manual 2.2.4.
struct U_SIZE * PU_SIZE
WMF manual 2.2.2.22.
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYLINE16
EMF manual 2.3.5.25.
struct U_EMRTEXT * PU_EMRTEXT
EMF manual 2.2.5.
struct U_EMRSETMAPMODE * PU_EMRSETICMMODE
EMF manual 2.3.11.14 ICMMode Enumeration.
Definition: uemf.h:2794
struct U_EMRPOLYBEZIER U_EMRPOLYBEZIERTO
EMF manual 2.3.5.18.
char * U_EMRPOLYBEZIERTO_set(const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
Allocate and construct a U_EMR_POLYBEZIERTO record.
Definition: uemf.c:3322
uint8_t Red
Red color (0-255)
Definition: uemf.h:453
char * U_EMRSETPIXELV_set(const U_POINTL ptlPixel, const U_COLORREF crColor)
Allocate and construct a U_EMR_SETPIXELV record.
Definition: uemf.c:3502
struct U_EMRSCALEVIEWPORTEXTEX * PU_EMRSCALEWINDOWEXTEX
EMF manual 2.3.11.8.
struct U_EMRFILLPATH U_EMRSTROKEANDFILLPATH
EMF manual 2.3.5.38.
struct U_EMRSETMETARGN * PU_EMRABORTPATH
EMF manual 2.3.10.
struct U_EMRSETMAPMODE * PU_EMRSETSTRETCHBLTMODE
EMF manual 2.3.11.24 StretchMode Enumeration.
char * createmonobrush_set(uint32_t *ihBrush, EMFHANDLES *eht, const uint32_t iUsage, PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px)
Allocate and construct a U_EMRCREATEMONOBRUSH_set structure, create a handle and returns it Use this ...
Definition: uemf.c:2575
struct U_EMRSETWINDOWEXTEX * PU_EMRSETWINDOWEXTEX
EMF manual manual 2.3.11.30.
struct U_LOGFONT * PU_LOGFONT
EMF manual 2.2.13.
Definition: uemf.h:2812
uint32_t biCompression
BI_Compression Enumeration.
Definition: uemf.h:411
uint32_t U_NUM_STR
Number of 8 or 16 bit characters in string.
Definition: uemf.h:214
U_LOGFONT logfont_set(int32_t lfHeight, int32_t lfWidth, int32_t lfEscapement, int32_t lfOrientation, int32_t lfWeight, uint8_t lfItalic, uint8_t lfUnderline, uint8_t lfStrikeOut, uint8_t lfCharSet, uint8_t lfOutPrecision, uint8_t lfClipPrecision, uint8_t lfQuality, uint8_t lfPitchAndFamily, uint16_t *lfFaceName)
Construct a U_LOGFONT structure.
Definition: uemf.c:1937
struct U_LOGCOLORSPACEA * PU_LOGCOLORSPACEA
WMF manual 2.2.2.11.
For U_LCS_GAMMARGB lcsGamma* fields.
Definition: uemf.h:465
char * U_EMRPOLYBEZIER_set(const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
Allocate and construct a U_EMR_POLYBEZIER record.
Definition: uemf.c:3274
uint8_t U_DATA
any binary sort of data, not otherwise classified.
Definition: uemf.h:198
For U_BITMAPINFO bmiHeader field.
Definition: uemf.h:401
struct U_EMRBITBLT * PU_EMRBITBLT
EMF manual 2.3.1.2.
struct U_EMRSETTEXTCOLOR * PU_EMRSETTEXTCOLOR
EMF manual 2.3.11.26.
int32_t cx
X size.
Definition: uemf.h:587
char * U_EMRCREATECOLORSPACE_set(const uint32_t ihCS, const U_LOGCOLORSPACEA lcs)
Allocate and construct a U_EMR_CREATECOLORSPACE record. Use createcolorspace_set() instead of calling...
Definition: uemf.c:5258
uint32_t U_POLYCOUNTS
aPolyCounts For U_EMRPOLYPOLYLINE etc.
Definition: uemf.h:203
PU_POINT points_transform(PU_POINT points, int count, U_XFORM xform)
Allocate and construct an array of U_POINT objects which has been subjected to a U_XFORM.
Definition: uemf.c:2735
struct U_EMRGLSBOUNDEDRECORD * PU_EMRGLSBOUNDEDRECORD
EMF manual 2.3.9.1.
Definition: uemf.h:3049
uint32_t U_CBDATA
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:179
struct U_EMRSELECTPALETTE * PU_EMRSELECTPALETTE
EMF manual 2.3.8.6.
char * U_EMRINTERSECTCLIPRECT_set(const U_RECTL rclClip)
Allocate and construct a U_EMR_INTERSECTCLIPRECT record.
Definition: uemf.c:3709
struct U_EMRSETMAPMODE U_EMRSETLAYOUT
EMF manual 2.3.11.17 Mirroring Enumeration.
char * U_EMRSETCOLORSPACE_set(const uint32_t ihCS)
Allocate and construct a U_EMR_SETCOLORSPACE record.
Definition: uemf.c:5282
char * U_EMROFFSETCLIPRGN_set(const U_POINTL ptl)
Allocate and construct a U_EMR_OFFSETCLIPRGN record.
Definition: uemf.c:3664
char * U_EMRPOLYPOLYGON_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cptl, const U_POINTL *points)
Allocate and construct a U_EMR_POLYPOLYGON record.
Definition: uemf.c:3376
U_CIEXYZ ciexyzBlue
CIE XYZ coord of blue endpoint of colorspace.
Definition: uemf.h:442
uint32_t U_NUM_RGBQUAD
Number of U_RGBQUAD (in bmciColors in U_BITMAPCOREINFO)
Definition: uemf.h:217
char * U_EMRARC_set(const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd)
Allocate and construct a U_EMR_ARC record.
Definition: uemf.c:4005
Definition: uemf.h:2524
char * U_emr_names(unsigned int idx)
Look up the name of the EMR record by type. Returns U_EMR_INVALID if out of range.
Definition: uemf.c:60
int emf_free(EMFTRACK **et)
Release memory for an emf structure in memory. Call this after emf_finish().
Definition: uemf.c:1234
PU_POINT point16_to_point(PU_POINT16 points, int count)
Allocate and construct an array of U_POINT objects from a set of U_POINT16 objects.
Definition: uemf.c:2803
int32_t ciexyzZ
CIE color space Z component.
Definition: uemf.h:428
Definition: uemf.h:1617
PU_LOGPALETTE logpalette_set(U_NUM_LOGPLTNTRY palNumEntries, PU_LOGPLTNTRY *palPalEntry)
Allocate and construct a U_LOGPALETTE structure.
Definition: uemf.c:2164
char * U_EMRENDPATH_set(void)
Allocate and construct a U_EMR_ENDPATH record.
Definition: uemf.c:4279
char * U_EMRRESTOREDC_set(const int32_t iRelative)
Allocate and construct a U_EMR_RESTOREDC record.
Definition: uemf.c:3767
U_LCS_GAMMA lcsGammaBlue
Blue Gamma.
Definition: uemf.h:481
Definition: uemf.h:2392
struct U_EMRSETMAPMODE * PU_EMRSETTEXTALIGN
EMF manual 2.3.11.25 TextAlignment enumeration.
uint32_t lcsSize
Size in bytes of this structure.
Definition: uemf.h:510
struct U_EMRSTRETCHBLT * PU_EMRSTRETCHBLT
EMF manual 2.3.1.6.
uint32_t U_NUM_RECTL
Number of U_RECTL.
Definition: uemf.h:208
U_SIZEL sizel_set(int32_t x, int32_t y)
Set sizel objects with X,Y values.
Definition: uemf.c:1620
struct U_EMREXTFLOODFILL * PU_EMREXTFLOODFILL
EMF manual 2.3.5.6.
uint32_t U_OFFDATA
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:192
char * U_EMRCREATEBRUSHINDIRECT_set(const uint32_t ihBrush, const U_LOGBRUSH lb)
Allocate and construct a U_EMR_CREATEBRUSHINDIRECT record. Use createbrushindirect_set() instead of c...
Definition: uemf.c:3876
struct U_EMRPOLYPOLYLINE * PU_EMRPOLYPOLYLINE
EMF manual 2.3.5.30.
struct U_EMRDELETEOBJECT U_EMRSELECTOBJECT
EMF manual 2.3.8.5.
char * U_EMRSMALLTEXTOUT_set(const U_POINTL Dest, const U_NUM_STR cChars, const uint32_t fuOptions, const uint32_t iGraphicsMode, const U_FLOAT exScale, const U_FLOAT eyScale, const U_RECTL rclBounds, const char *TextString)
Allocate and construct a U_EMR_SMALLTEXTOUT record.
Definition: uemf.c:5340
Defintions and prototype for function for converting EMF records between Big Endian and Little Endian...
Definition: uemf.h:2194
char * U_EMRPOLYGON16_set(const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
Allocate and construct a U_EMR_POLYGON16 record.
Definition: uemf.c:4985
uint32_t U_OFFDESC
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:193
int emf_append(U_ENHMETARECORD *rec, EMFTRACK *et, int freerec)
Append an EMF record to an emf in memory. This may reallocate buf memory.
Definition: uemf.c:1327
Definition: uemf.h:2327
uint32_t lcsVersion
must be U_LCS_VERSION
Definition: uemf.h:509
uint8_t Green
Green color (0-255)
Definition: uemf.h:454
char * extcreatefontindirectw_set(uint32_t *ihFont, EMFHANDLES *eht, const char *elf, const char *elfw)
Allocate and construct a U_EMREXTCREATEFONTINDIRECTW structure, create a handle and returns it Use th...
Definition: uemf.c:2638
struct U_EMRPOLYTEXTOUTA * PU_EMRPOLYTEXTOUTW
EMF manual 2.3.5.33.
struct U_LOGPALETTE * PU_LOGPALETTE
EMF manual 2.2.17.
struct U_EMRPOLYPOLYLINE16 * PU_EMRPOLYPOLYLINE16
EMF manual 2.3.5.31.
struct U_EMRSMALLTEXTOUT * PU_EMRSMALLTEXTOUT
EMF manual 2.3.5.37.
Definition: uemf.h:3031
For U_RGNDATA rdb field.
Definition: uemf.h:1957
U_CIEXYZTRIPLE lcsEndpoints
CIE XYZ color space endpoints.
Definition: uemf.h:513
struct U_EMRANGLEARC * PU_EMRANGLEARC
EMF manual 2.3.5.1.
struct U_EMRPOLYPOLYLINE16 U_EMRPOLYPOLYGON16
EMF manual 2.3.5.29.
char * U_EMRSETBKMODE_set(const uint32_t iMode)
Allocate and construct a U_EMR_SETBKMODE record.
Definition: uemf.c:3558
Definition: uemf.h:2416
Definition: uemf.h:2968
struct U_EMRSETMAPPERFLAGS * PU_EMRSETMAPPERFLAGS
EMF manual 2.3.11.20.
struct U_EMRSETMETARGN U_EMRREALIZEPALETTE
EMF manual 2.3.10.
char * U_EMRSETPOLYFILLMODE_set(const uint32_t iMode)
Allocate and construct a U_EMR_SETPOLYFILLMODE record.
Definition: uemf.c:3570
uint32_t U_CBBITS
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:173
char * RGBA_to_RGBA(char *rgba_px, int w, int h, int sl, int st, int *eew, int *eeh)
Extract a subset of an RGBA bitmap array. Frees the incoming bitmap array IF a subset is extracted...
Definition: uemf.c:1079
struct U_EMRDELETECOLORSPACE * PU_EMRSETCOLORSPACE
EMF manual 2.3.8.7.
int32_t left
left coordinate
Definition: uemf.h:555
int RGBA_to_DIB(char **px, uint32_t *cbPx, PU_RGBQUAD *ct, int *numCt, const char *rgba_px, int w, int h, int stride, uint32_t colortype, int use_ct, int invert)
Convert a U_RGBA 32 bit pixmap to one of many different types of DIB pixmaps.
Definition: uemf.c:626
Definition: uemf.h:2774
struct U_EMRSETMETARGN U_EMRENDPATH
EMF manual 2.3.10.
int32_t lcsIntent
LCS_Intent Enumeration.
Definition: uemf.h:495
char * U_EMRCREATEMONOBRUSH_set(const uint32_t ihBrush, const uint32_t iUsage, const PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px)
Allocate and construct a U_EMR_CREATEMONOBRUSH record.
Definition: uemf.c:5132
char * U_EMRPOLYLINETO_set(const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
Allocate and construct a U_EMR_POLYLINETO record.
Definition: uemf.c:3338
U_LCS_GAMMA lcsGammaRed
Red Gamma.
Definition: uemf.h:479
For U_LOGCOLORSPACEA and U_LOGCOLORSPACEW lcsGammaRGB field.
Definition: uemf.h:478
struct U_EMRPOLYBEZIER * PU_EMRPOLYLINETO
EMF manual 2.3.5.26.
Definition: uemf.h:2647
int32_t biXPelsPerMeter
X Resolution in pixels/meter.
Definition: uemf.h:413
uint32_t lcsVersion
must be U_LCS_VERSION
Definition: uemf.h:492
struct U_EMREXCLUDECLIPRECT U_EMRINTERSECTCLIPRECT
EMF manual 2.3.2.3.
Definition: uemf.h:3097
For U_EMRGRADIENTFILL GradObj field.
Definition: uemf.h:1776
struct U_EMRSETMETARGN * PU_EMRFLATTENPATH
EMF manual 2.3.10.
Pair of values indicating x and y sizes.
Definition: uemf.h:586
char * U_EMRSETBRUSHORGEX_set(const U_POINTL ptlOrigin)
Allocate and construct a U_EMR_SETBRUSHORGEX record.
Definition: uemf.c:3446
U_PIXELFORMATDESCRIPTOR pixelformatdescriptor_set(uint32_t dwFlags, uint8_t iPixelType, uint8_t cColorBits, uint8_t cRedBits, uint8_t cRedShift, uint8_t cGreenBits, uint8_t cGreenShift, uint8_t cBlueBits, uint8_t cBlueShift, uint8_t cAlphaBits, uint8_t cAlphaShift, uint8_t cAccumBits, uint8_t cAccumRedBits, uint8_t cAccumGreenBits, uint8_t cAccumBlueBits, uint8_t cAccumAlphaBits, uint8_t cDepthBits, uint8_t cStencilBits, uint8_t cAuxBuffers, uint8_t iLayerType, uint8_t bReserved, uint32_t dwLayerMask, uint32_t dwVisibleMask, uint32_t dwDamageMask)
Construct a U_PIXELFORMATDESCRIPTOR structure.
Definition: uemf.c:2303
struct U_EMRSETMETARGN U_EMRFLATTENPATH
EMF manual 2.3.10.
PU_POINT16 point16_transform(PU_POINT16 points, int count, U_XFORM xform)
Allocate and construct an array of U_POINT16 objects which has been subjected to a U_XFORM...
Definition: uemf.c:2758
char * U_EMRSTRETCHBLT_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
Allocate and construct a U_EMR_STRETCHBLT record.
Definition: uemf.c:4610
char * createpalette_set(uint32_t *ihPal, EMFHANDLES *eht, U_LOGPALETTE lgpl)
Allocate and construct a U_EMRCREATEPALETTE structure, create a handle and returns it Use this functi...
Definition: uemf.c:2656
struct U_LOGPLTNTRY * PU_LOGPLTNTRY
EMF manual 2.2.18.
char * U_EMRPIE_set(const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd)
Allocate and construct a U_EMR_PIE record.
Definition: uemf.c:4037
struct U_EMRFILLPATH * PU_EMRFILLPATH
EMF manual 2.3.5.9.
struct U_EMRCOMMENT_EMFPLUS * PU_EMRCOMMENT_EMFPLUS
EMF manual 2.3.3.2, EMF Plus comment.
char * U_EMRINVERTRGN_set(const PU_RGNDATA RgnData)
Allocate and construct a U_EMR_INVERTRGN record.
Definition: uemf.c:4488
struct U_RECT * PU_RECTL
WMF manual 2.2.2.19.
U_LOGCOLORSPACEA logcolorspacea_set(int32_t lcsCSType, int32_t lcsIntent, U_CIEXYZTRIPLE lcsEndpoints, U_LCS_GAMMARGB lcsGammaRGB, char *lcsFilename)
Construct a U_LOGCOLORSPACEA structure.
Definition: uemf.c:1828
Definition: uemf.h:3167
char * deleteobject_set(uint32_t *ihObject, EMFHANDLES *eht)
Allocate and construct a U_EMRDELETEOBJECT structure and also delete the requested object from the ta...
Definition: uemf.c:2456
The first U_ENHMETARECORD record in the metafile.
Definition: uemf.h:2097
#define U_LF_FACESIZE
U_LOGFONT lfFaceName and U_LOGFONT_PANOSE elfStyle fields maximum width.
Definition: uemf.h:606
struct U_EMRCOMMENT * PU_EMRCOMMENT
EMF manual 2.3.3.1, AKA GDICOMMENT.
uint32_t U_CBSTR
Count of Bytes in an 8 or 16 bit string.
Definition: uemf.h:184
struct U_EMRFILLRGN * PU_EMRFILLRGN
EMF manual 2.3.5.10.
struct U_EMRCOLORMATCHTOTARGETW * PU_EMRCOLORMATCHTOTARGETW
EMF manual 2.3.11.1.
struct U_PAIR U_POINT
WMF manual 2.2.2.15.
For U_EPS_DATA Points field.
Definition: uemf.h:1721
uint32_t U_NUM_STYLEENTRY
Number of U_STYLEENTRY.
Definition: uemf.h:211
U_LCS_GAMMARGB lcsGammaRGB
Gamma For RGB.
Definition: uemf.h:514
char * U_EMRCREATEDIBPATTERNBRUSHPT_set(const uint32_t ihBrush, const uint32_t iUsage, const PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px)
Allocate and construct a U_EMR_CREATEDIBPATTERNBRUSHPT record. Use createdibpatternbrushpt_set() inst...
Definition: uemf.c:5153
struct U_LOGPEN * PU_LOGPEN
EMF manual 2.2.19.
char * U_EMRSETPALETTEENTRIES_set(const uint32_t ihPal, const uint32_t iStart, const U_NUM_LOGPLTNTRY cEntries, const PU_LOGPLTNTRY aPalEntries)
Allocate and construct a U_EMR_SETPALETTEENTRIES record. Use setpaletteentries_set() instead of calli...
Definition: uemf.c:4093
Definition: uemf.h:2343
Definition: uemf.h:2889
For U_EMRCREATECOLORSPACEW lcs field.
Definition: uemf.h:507
uint32_t U_NUM_GRADOBJ
Number of U_GRADIENT4 OR U_GRADIENT3 (determined at run time)
Definition: uemf.h:216
struct U_EMRARC * PU_EMRPIE
EMF manual 2.3.5.15.
struct U_PAIR * PU_PAIR
WMF manual 2.2.2.15.
For U_BITMAPINFO crColor field.
Definition: uemf.h:452
struct U_EMRCREATECOLORSPACEW * PU_EMRCREATECOLORSPACEW
EMF manual 2.3.7.3.
int emf_htable_delete(uint32_t *ih, EMFHANDLES *eht)
Delete an entry from the handle table. Move it back onto the stack. The specified slot is filled with...
Definition: uemf.c:1406
struct U_EMRSETMAPMODE * PU_EMRSETROP2
EMF manual 2.3.11.23 Binary Raster Operation Enumeration.
struct U_LOGBRUSH * PU_PATTERN
EMF manual 2.2.12.
struct U_EMRPOLYTEXTOUTA * PU_EMRPOLYTEXTOUTA
EMF manual 2.3.5.32.
char * U_EMRSETMITERLIMIT_set(const uint32_t eMiterLimit)
Allocate and construct a U_EMR_SETMITERLIMIT record.
Definition: uemf.c:4258
char * U_EMRMOVETOEX_set(const U_POINTL ptl)
Allocate and construct a U_EMR_MOVETOEX record.
Definition: uemf.c:3676
char * createbrushindirect_set(uint32_t *ihBrush, EMFHANDLES *eht, U_LOGBRUSH lb)
Allocate and construct a U_EMRCREATEBRUSHINDIRECT structure, create a handle and returns it Use this ...
Definition: uemf.c:2531
uint32_t U_CBBMI
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:176
uint32_t U_CBBMISRC
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:178
char * U_EMRSETDIBITSTODEVICE_set(const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL Src, const U_POINTL cSrc, const uint32_t iUsageSrc, const uint32_t iStartScan, const uint32_t cScans, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
Allocate and construct a U_EMR_SETDIBITSTODEVICE record.
Definition: uemf.c:4799
Definition: uemf.h:2979
uint32_t U_STYLEENTRY
StyleEntry For U_EXTLOGPEN.
Definition: uemf.h:202
float U_FLOAT
32 bit float
Definition: uemf.h:171
uint32_t U_FNTAXES
Font Axes For U_DESIGNVECTOR.
Definition: uemf.h:201
uint32_t U_OFFBITSSRC
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:188
char * U_EMRMODIFYWORLDTRANSFORM_set(const U_XFORM xform, const uint32_t iMode)
Allocate and construct a U_EMR_MODIFYWORLDTRANSFORM record.
Definition: uemf.c:3802
int32_t biYPelsPerMeter
Y Resolution in pixels/meter.
Definition: uemf.h:414
struct U_EMRSETPIXELV * PU_EMRSETPIXELV
EMF manual 2.3.5.36.
Definition: uemf.h:3180
struct U_EMRPOLYDRAW16 * PU_EMRPOLYDRAW16
EMF manual 2.3.5.21.
char * setpaletteentries_set(uint32_t *ihPal, EMFHANDLES *eht, const uint32_t iStart, const U_NUM_LOGPLTNTRY cEntries, const PU_LOGPLTNTRY aPalEntries)
Allocate and construct a U_EMRSETPALETTEENTRIES structure, create a handle and returns it Use this fu...
Definition: uemf.c:2675
struct U_EMRCOMMENT_PUBLIC * PU_EMRCOMMENT_PUBLIC
EMF manual 2.3.3.4, EMF Public comment.
U_CIEXYZ ciexyzGreen
CIE XYZ coord of green endpoint of colorspace.
Definition: uemf.h:441
struct U_EMRSETMETARGN U_EMRSAVEDC
EMF manual 2.3.11.
struct U_EXTLOGPEN * PU_EXTLOGPEN
EMF manual 2.2.20.
uint16_t biBitCount
BitCount Enumeration (determines number of RBG colors)
Definition: uemf.h:410
struct U_CIEXYZ * PU_CIEXYZ
WMF manual 2.2.2.6.
struct U_EMREXTCREATEPEN * PU_EMREXTCREATEPEN
EMF manual 2.3.7.9.
int emf_htable_create(uint32_t initsize, uint32_t chunksize, EMFHANDLES **eht)
Create a handle table. Entries filled with 0 are empty, entries &gt;0 hold a handle. ...
Definition: uemf.c:1363
struct U_EMRSETMAPMODE * PU_EMRSETBKMODE
EMF manual 2.3.11.11 BackgroundMode Enumeration.
struct U_EMRPOLYBEZIER16 U_EMRPOLYGON16
EMF manual 2.3.5.23.
struct U_EMRMASKBLT * PU_EMRMASKBLT
EMF manual 2.3.1.3.
U_RECT findbounds(uint32_t count, PU_POINT pts, uint32_t width)
Find the bounding rectangle from a polyline of a given width.
Definition: uemf.c:1667
struct U_EMRSETMETARGN * PU_EMRWIDENPATH
EMF manual 2.3.10.
int get_real_color_count(const char *Bmih)
Get the actual number of colors in the color table from the BitMapInfoHeader.
Definition: uemf.c:810
char * U_EMRDELETEOBJECT_set(const uint32_t ihObject)
Allocate and construct a U_EMR_DELETEOBJECT record. Use deleteobject_set() instead of calling this fu...
Definition: uemf.c:3901
struct U_EMRSETMETARGN * PU_EMRCLOSEFIGURE
EMF manual 2.3.10.
struct U_EMRDRAWESCAPE * PU_EMRDRAWESCAPE
EMF manual 2.3.6.1.
char * U_EMRPOLYPOLYGON16_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cpts, const U_POINT16 *points)
Allocate and construct a U_EMR_POLYPOLYGON16 record.
Definition: uemf.c:5071
char * U_EMRSTROKEPATH_set(const U_RECTL rclBox)
Allocate and construct a U_EMR_STROKEPATH record.
Definition: uemf.c:4330
struct U_GRADIENT3 * PU_GRADIENT3
EMF manual 2.2.8.
For U_BITMAPINFO bmiColors field.
Definition: uemf.h:570
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYBEZIERTO16
EMF manual 2.3.5.19.
struct U_EMRSETDIBITSTODEVICE * PU_EMRSETDIBITSTODEVICE
EMF manual 2.3.1.5.
Definition: uemf.h:2728
uint32_t U_OFFSTR
Byte offset to string of either 8 or 16 bit characters.
Definition: uemf.h:197
PU_EXTLOGPEN extlogpen_set(uint32_t elpPenStyle, uint32_t elpWidth, uint32_t elpBrushStyle, U_COLORREF elpColor, int32_t elpHatch, U_NUM_STYLEENTRY elpNumEntries, U_STYLEENTRY *elpStyleEntry)
Allocate and construct a U_EXTLOGPEN structure.
Definition: uemf.c:2081
struct U_PAIR U_POINTL
WMF manual 2.2.2.15.
U_LCS_GAMMARGB lcsGammaRGB
Gamma For RGB.
Definition: uemf.h:497
char * fillrgn_set(uint32_t *ihBrush, EMFHANDLES *eht, const U_RECTL rclBounds, const PU_RGNDATA RgnData)
Allocate and construct a U_EMRFILLRGN structure, create a handle and returns it Use this function ins...
Definition: uemf.c:2695
Definition: uemf.h:2316
Definition: uemf.h:2947
Definition: uemf.h:2214
struct U_SIZE U_SIZEL
WMF manual 2.2.2.22.
int32_t ciexyzX
CIE color space X component.
Definition: uemf.h:426
char * emr_dup(const char *emr)
Duplicate an EMR record.
Definition: uemf.c:1137
char * U_EMRSELECTPALETTE_set(const uint32_t ihPal)
Allocate and construct a U_EMR_SELECTPALETTE record.
Definition: uemf.c:4051
uint32_t U_OFFBITSMSK
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:187
uint32_t emr_properties(uint32_t type)
Look up the properties (a bit map) of a type of EMR record. Bits that may be set are defined in &quot;Draw...
Definition: uemf.c:339
struct U_EMRSETMETARGN U_EMRCLOSEFIGURE
EMF manual 2.3.10.
char * U_EMRPOLYPOLYLINE16_set(const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cpts, const U_POINT16 *points)
Allocate and construct a U_EMR_POLYPOLYLINE16 record.
Definition: uemf.c:5051
char * createcolorspacew_set(uint32_t *ihCS, EMFHANDLES *eht, U_LOGCOLORSPACEW lcs, uint32_t dwFlags, U_CBDATA cbData, uint8_t *Data)
Allocate and construct a U_EMRCREATECOLORSPACEW structure, create a handle and returns it Use this fu...
Definition: uemf.c:2617
struct U_EMRARC * PU_EMRCHORD
EMF manual 2.3.5.4.
struct U_EMRINVERTRGN * PU_EMRPAINTRGN
EMF manual 2.3.5.14.
Definition: uemf.h:3146
For U_EMR_COMMENT_MULTIFORMATS record, where an array of these is used.
Definition: uemf.h:1679
Definition: uemf.h:2536
char * U_EMRROUNDRECT_set(const U_RECTL rclBox, const U_SIZEL szlCorner)
Allocate and construct a U_EMR_ROUNDRECT record.
Definition: uemf.c:3979
struct U_EMREXTTEXTOUTA * PU_EMREXTTEXTOUTA
EMF manual 2.3.5.7.
Definition: uemf.h:2988
struct U_EMRCREATEMONOBRUSH * PU_EMRCREATEMONOBRUSH
EMF manual 2.3.7.5.
uint32_t U_OFFBMIMSK
Byte offset to TYPE, always measured from the start of the RECORD (not the struct) ...
Definition: uemf.h:190
FILE * emf_fopen(const char *filename, const int mode)
wrapper for fopen, works on any platform
Definition: uemf.c:1253
struct U_EMRSETMAPMODE U_EMRSETPOLYFILLMODE
EMF manual 2.3.11.22 PolygonFillMode Enumeration.
uint32_t U_NUM_EMRTEXT
Number of U_EMRTEXT.
Definition: uemf.h:213
struct U_EMRDELETECOLORSPACE U_EMRSETCOLORSPACE
EMF manual 2.3.8.7.
char * U_EMREXTSELECTCLIPRGN_set(const uint32_t iMode, const PU_RGNDATA RgnData)
Allocate and construct a U_EMR_EXTSELECTCLIPRGN record.
Definition: uemf.c:4513
int16_t x
X size (16 bit)
Definition: uemf.h:542
char * emrtext_set(U_POINTL ptlReference, U_NUM_STR NumString, uint32_t cbChar, void *String, uint32_t fOptions, U_RECTL rcl, uint32_t *Dx)
Allocate and create a U_EMRTEXT structure followed by its variable pieces via a char* pointer...
Definition: uemf.c:2371
char * U_EMRSETSTRETCHBLTMODE_set(const uint32_t iMode)
Allocate and construct a U_EMR_SETSTRETCHBLTMODE record.
Definition: uemf.c:3594
char * U_EMRSETWINDOWEXTEX_set(const U_SIZEL szlExtent)
Allocate and construct a U_EMR_SETWINDOWEXTEX record.
Definition: uemf.c:3392
int32_t biHeight
Definition: uemf.h:404
char * U_EMRSETARCDIRECTION_set(const uint32_t iArcDirection)
Allocate and construct a U_EMR_SETARCDIRECTION record.
Definition: uemf.c:4246
For U_CIEXYZTRIPLE (all) fields.
Definition: uemf.h:425
For U_EMRGRADIENTFILL GradObj field.
Definition: uemf.h:1760
Definition: uemf.h:2547
char * U_EMRELLIPSE_set(const U_RECTL rclBox)
Allocate and construct a U_EMR_ELLIPSE record.
Definition: uemf.c:3954
For U_EMRCREATEPALETTE lgpl field.
Definition: uemf.h:1890
struct U_EMRSETCOLORADJUSTMENT * PU_EMRSETCOLORADJUSTMENT
EMF manual 2.3.11.13.
uint8_t Reserved
Not used.
Definition: uemf.h:574
struct U_EPS_DATA * PU_EPS_DATA
EMF manual 2.2.6.
char * U_EMRPAINTRGN_set(const PU_RGNDATA RgnData)
Allocate and construct a U_EMR_PAINTRGN record.
Definition: uemf.c:4500
Definition: uemf.h:3010
struct U_EMRCREATECOLORSPACE * PU_EMRCREATECOLORSPACE
EMF manual 2.3.7.2.
int DIB_to_RGBA(const char *px, const U_RGBQUAD *ct, int numCt, char **rgba_px, int w, int h, uint32_t colortype, int use_ct, int invert)
Convert one of many different types of DIB pixmaps to an RGBA 32 bit pixmap.
Definition: uemf.c:925
struct U_LOGFONT_PANOSE * PU_LOGFONT_PANOSE
EMF manual 2.2.16.
int16_t y
Y size (16 bit)
Definition: uemf.h:543
U_XFORM xform_alt_set(U_FLOAT scale, U_FLOAT ratio, U_FLOAT rot, U_FLOAT axisrot, U_FLOAT eDx, U_FLOAT eDy)
Construct a U_XFORM structure.
Definition: uemf.c:1781
uint32_t U_CBPXLFMT
Count of Bytes in object at corresponding U_OFF*.
Definition: uemf.h:182
char * textcomment_set(const char *string)
Allocate and construct a U_EMRCOMMENT structure with a UTF8 string. A U_EMRCOMMENT contains applicati...
Definition: uemf.c:2435
U_COLORREF colorref3_set(uint8_t red, uint8_t green, uint8_t blue)
Set a U_COLORREF value from separate R,G,B values.
Definition: uemf.c:1553
uint8_t Blue
Blue color (0-255)
Definition: uemf.h:571
struct U_EMRMODIFYWORLDTRANSFORM * PU_EMRMODIFYWORLDTRANSFORM
EMF manual 2.3.12.1.
For embedding EPS in EMF via U_EMRFORMAT offData array in U_EMR_COMMENT_MULTIFORMATS.
Definition: uemf.h:1732
struct U_EMRELLIPSE * PU_EMRRECTANGLE
EMF manual 2.3.5.34.
char * U_EMRSETCOLORADJUSTMENT_set(const U_COLORADJUSTMENT ColorAdjustment)
Allocate and construct a U_EMR_SETCOLORADJUSTMENT record.
Definition: uemf.c:3618
char * U_EMRABORTPATH_set(void)
Allocate and construct a U_EMR_ABORTPATH record.
Definition: uemf.c:4371
struct U_GRADIENT4 * PU_GRADIENT4
EMF manual 2.2.7.
struct U_EMRSETMETARGN * PU_EMRSETMETARGN
EMF manual 2.3.2.
char * U_EMRPOLYDRAW_set(const U_RECTL rclBounds, const U_NUM_POINTL cptl, const U_POINTL *aptl, const uint8_t *abTypes)
Allocate and construct a U_EMR_POLYDRAW record.
Definition: uemf.c:4209
uint32_t * dx_set(int32_t height, uint32_t weight, uint32_t members)
Make up an approximate dx array to pass to emrtext_set(), based on character height and weight...
Definition: uemf.c:316
struct U_EMRSETWINDOWORGEX * PU_EMRSETBRUSHORGEX
EMF manual 2.3.11.12.
struct U_EMRPOLYTEXTOUTA U_EMRPOLYTEXTOUTW
EMF manual 2.3.5.33.
struct U_EMRDELETECOLORSPACE * PU_EMRDELETECOLORSPACE
EMF manual 2.3.8.2.
struct U_RECT * PU_RECT
WMF manual 2.2.2.19.
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYBEZIER16
EMF manual 2.3.5.17.
Definition: uemf.h:2586
struct U_EMRRESIZEPALETTE * PU_EMRRESIZEPALETTE
EMF manual 2.3.8.4.
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYLINETO16
EMF manual 2.3.5.27.
struct U_EMREXCLUDECLIPRECT * PU_EMRINTERSECTCLIPRECT
EMF manual 2.3.2.3.
For U_EMR[FILLRGN|STRETCHBLT|MASKBLT|PLGBLT] xformSrc field.
Definition: uemf.h:1987
U_RGNDATAHEADER rgndataheader_set(U_NUM_RECTL nCount, U_RECTL rclBounds)
Construct a U_RGNDATAHEADER structure.
Definition: uemf.c:2189