forked from mathog/libUEMF
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuemf.h
More file actions
3653 lines (3277 loc) · 188 KB
/
uemf.h
File metadata and controls
3653 lines (3277 loc) · 188 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
@file uemf.h
@brief Structures, definitions, and function prototypes for EMF files.
EMF file Record structure information has been derived from Mingw, Wine, and libEMF header files, and from
Microsoft's EMF Information pdf, release date March 28,2012, link from here:
http://msdn2.microsoft.com/en-us/library/cc230514.aspx
If the direct link fails the document may be found
by searching for: "[MS-EMF]: Enhanced Metafile Format"
*/
/** \mainpage libUEMF overview
\section ov Overview
Microsoft's WMF, EMF, and EMF+ metafile types are supported. In each case functions are provided for reading, constructing, writing, and printing
metafile records. The methods used to do that differ somewhat between metafiles, and the simplest
way to get started is to have a look at the example programs provided. The WMF, EMF, and EMF+ structs and functions are
marked with U_WMF, U_EMF, U_PMF and U_WMR, U_EMR, and U_PMR prefixes. (PMF because "+" is a reserved character
in many contexts, so U_EMF+NAME would be a problem.) Please be aware that normally both EMF and EMF+ files have the ".emf"
file extension, and that it is very common for such files to contain both an EMF and an EMF+ representation of the
drawing.
\section example_sec Example Programs
testbed_emf.c Creates an EMF file test_libuemf.emf.\n
testbed_wmf.c Creates a WMF file test_libuemf.wmf.\n
testbed_pmf.c Creates an EMF+ file test_libuemf_p.emf.\n
reademf.c Reads an EMF or EMF+ file and emits a text summary of its records.\n
readwmf.c Reads a WMF file and emits a text summary of its records.\n
emf-inout.cpp.example Example code from Inkscape to convert graphics from EMF to SVG.\n
emf-print.cpp.example Example code from Inkscape to print a drawing to EMF.\n
wmf-inout.cpp.example Example code from Inkscape to convert graphics from WMF to SVG.\n
wmf-print.cpp.example Example code from Inkscape to print a drawing to WMF.
\section doxy_limits Documentation issues
There are currently some unresolved issues with Doxygen that result in some structs
not being "defined". This comes up when several different types of structs have the same
layout. When this occurs the first one listed on the "typedef struct" is defined but all the
others will only be shown under "typedef struct" referring to the first one. This is why
clicking on U_RECTL in a function parameter jumps to a typedef struct page, why U_RECTL is shown
as plain text here, but U_RECT is shown as a link here, and clicking on it jumps directly
to its structure definition.
An additional issue is that the Enumeration names used in WMF are different from those
used in EMF, even when the values are either identical or differ only slightly, and no method
has been found yet to link one to the other in Doxygen. At present the only way to look up
these WMF enumerations is by referencing the following table:
EMF WMF WMF Manual
EMF Binary Raster Operation Enumeration BinaryRasterOperation Enumeration 2.1.1.2
EMF Bitcount Enumeration BitCount Enumeration 2.1.1.3
EMF LB_Style Enumeration BrushStyle Enumeration 2.1.1.4
EMF LF_CharSet Enumeration CharacterSet Enumeration 2.1.1.5
EMF DIBColors Enumeration ColorUsage Enumeration [has 1 extra value] 2.1.1.6
EMF BI_Compression Enumeration Compression Enumeration [has 3 extra values] 2.1.1.7
- FamilyFont Enumeration 2.1.1.8
EMF FloodFill Enumeration FloodFill Enumeration 2.1.1.9
EMF LF_Quality Enumeration FontQuality Enumeration 2.1.1.10
EMF LCS_Intent Enumeration GamutMappingIntent Enumeration 2.1.1.11
EMF HatchStyle Enumeration HatchStyle Enumeration 2.1.1.12
EMF Mirroring Enumeration LayoutEnumeration 2.1.1.13
- LogicalColorSpace Enumeration 2.1.1.14
EMF Profile Enumeration LogicalColorSpaceV5 Enumeration 2.1.1.15
EMF MapMode Enumeration MapModeEnumeration 2.1.1.16
- MetaFilesEscape Enumeration 2.1.1.17
- MetafileType Enumeration 2.1.1.18
- MetafileVersion Enumeration 2.1.1.19
EMF BackgroundMode Enumeration MixModeEnumeration 2.1.1.20
EMF LF_OutPrecision Enumeration OutPrecision Enumeration 2.1.1.21
- PaletteEntryFlag Enumeration 2.1.1.22
EMF PenStyle Enumeration PenStyle Enumeration [not values >0xFFFF] 2.1.1.23
- PitchFont Enumeration 2.1.1.24
EMF PolygonFillMode Enumeration PolyFillMode Enumeration [first 2 only] 2.1.1.25
- PostScriptCap Enumeration 2.1.1.26
- PostScriptClipping Enumeration 2.1.1.27
- PostFeatureSetting Enumeration 2.1.1.28
- PostScrioptJoin Enumeration 2.1.1.29
EMF StretchMode Enumeration StretchMode Enumeration 2.1.1.30
EMF Ternary Raster Operation Enumeration TernaryRasterOperation Enumeration 2.1.1.31
EMF LF_ClipPrecision Enumeration ClipPrecision Flags 2.1.2.1
EMF ExtTextOutOptions Enumeration ExtTextOutOptions Flags [subset] 2.1.2.2
EMF TextAlignment Enumeration TextAlignment Enumeration 2.1.2.3
EMF TextAlignment Enumeration VertialTextAlignment Enumeration 2.1.2.4
EMF LF_PitchAndFamily Enumeration PitchAndFamily Enumerations 2.2.2.14
\section refs Reference documentation
Manual Date Link
EMF 3/28/2012 http://msdn2.microsoft.com/en-us/library/cc230514.aspx
EMF+ 7/5/2012 http://msdn.microsoft.com/en-us/library/cc230724.aspx
WMF 7/5/2012 http://msdn2.microsoft.com/en-us/library/cc250370.aspx
*/
/*
File: uemf.h
Version: 0.0.34
Date: 03-JAN-2017
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2017 David Mathog and California Institute of Technology (Caltech)
*/
#ifndef _UEMF_
#define _UEMF_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "uemf_utf.h"
#include "uemf_endian.h"
/** \cond */
// ***********************************************************************************
// defines not placed yet
#define U_PAN_CULTURE_LATIN 0
#define U_SYSPAL_ERROR 0
#define U_SYSPAL_STATIC 1
#define U_SYSPAL_NOSTATIC 2
#define U_ELF_VENDOR_SIZE 4
#define UNUSED_PARAMETER(x) (void)(x)
/** \endcond */
// ***************************************************************************
/** \defgroup U_EMF_Miscellaneous_values EMF Miscellaneous Values
@{
*/
#define U_NONE 0 //!< Generic for nothing selected for all flag fields
#define U_PI 3.14159265358979323846 //!< pi
#define U_READ 1 //!< open file as "rb"
#define U_WRITE 0 //!< open file as "wb"
#define U_DV_SGNTR 0x08007664 //!< For U_DESIGNVECTOR Signature field
#define U_LP_VERSION 0x0300 //!< For U_LOGPALETTE palVersion field
#define U_RDH_RECTANGLES 1 //!< For U_RGNDATAHEADER iType field
#define U_RDH_OBJSIZE 0x20 //!< For U_RGNDATAHEADER dwSIze field
#define U_RGB_GAMMA_MIN (uint16_t)02500 //!< For U_COLORADJUSTMENT ca[Red|Green|Blue]Gamma fields
#define U_RGB_GAMMA_MAX (uint16_t)65000 //!< For U_COLORADJUSTMENT ca[Red|Green|Blue]Gamma fields
#define U_REFERENCE_WHITE_MIN (uint16_t)6000 //!< For U_COLORADJUSTMENT caReferenceWhite field
#define U_REFERENCE_WHITE_MAX (uint16_t)10000 //!< For U_COLORADJUSTMENT caReferenceWhite field
#define U_REFERENCE_BLACK_MIN (uint16_t)0 //!< For U_COLORADJUSTMENT caReferenceBlack field
#define U_REFERENCE_BLACK_MAX (uint16_t)4000 //!< For U_COLORADJUSTMENT caReferenceBlack field
#define U_COLOR_ADJ_MIN ((int16_t)-100) //!< For U_COLORADJUSTMENT ca[Contrast|Brightness|Colorfulness|RedGreenTint] fields
#define U_COLOR_ADJ_MAX (int16_t) 100 //!< For U_COLORADJUSTMENT ca[Contrast|Brightness|Colorfulness|RedGreenTint] fields
#define U_MAX_PATH 1024 //!< longest path name for a file
#define U_LCS_SIGNATURE 0x50534F43 //!< logColorSpace Signature
#define U_LCS_VERSION 0x400 //!< logColorSpace Version
#define U_REC_FREE 1 //!< use with emf_append
#define U_REC_KEEP 0 //!< use with emf_append
#define U_ROW_ORDER_INVERT 1 //!< For RGBA_to_DIB, invert row order in DIB relative to pixel array
#define U_ROW_ORDER_SAME 0 //!< For RGBA_to_DIB, same row order in DIB as in pixel array
#define U_CT_NO 0 //!< For RGBA_to_DIB, do not use color table
#define U_CT_BGRA 1 //!< For RGBA_to_DIB, use color table (16 bits or less only) BGRA colors, compatible with EMF+ ARGB
#define U_CT_ARGB 1 //!< For RGBA_to_DIB, use color table (16 bits or less only) BGRA colors, compatible with EMF+ ARGB
#define U_EMR_COMMENT_SPOOLFONTDEF 0x544F4E46 //!< For U_EMRCOMMENT record that is U_EMR_COMMENT_SPOOL, comment holds font definition informtion.
/** Solaris 8 has problems with round/roundf, just use this everywhere */
#define U_ROUND(A) ( (A) > 0 ? floor((A)+0.5) : ( (A) < 0 ? -floor(-(A)+0.5) : (A) ) )
#define MAKE_MIN_PTR(A,B) ( A < B ? A : B)
/* IS_MEM_UNSAFE takes 3 parameters:
A start address of a block of allocated memory
B offset into this block starting at A
C address of final byte of a block of allocated memory.
Returns
1 if B cannot be an int or size_t
1 if C > A
1 if A+B is not in the range A to C, inclusive
0 otherwise.
B may be an int, an unsigned int, or a size_t. An int can be negative,
which is obviously wrong, but testing for that means that the size
of B cannot be more than INT_MAX/2. Accept that limitation since
no reasonable EMF record or file should ever be that large.
If B is a uint16_t gcc complains about the first test.
This Macro must not be used where B needs more than 32 bits!
*/
#define IS_MEM_UNSAFE(A,B,C) ( (sizeof(B) < sizeof(int) || (int)(B) < 0) ? 1 : ((int8_t *)(A) > (int8_t *)(C) ? 1 : ((int8_t *)(C) - (int8_t *)(A) >= (int)(B) ? 0 : 1 ))) //!< Return 1 when a region of memory starting at A of B bytes extends beyond pointer C
/** @} */
typedef float U_FLOAT; //!< 32 bit float
typedef uint32_t U_CBBITS; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBBITSMSK; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBBITSSRC; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBBMI; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBBMIMSK; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBBMISRC; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBDATA; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBNAME; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBPLENTRIES; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBPXLFMT; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBRGNDATA; //!< Count of Bytes in object at corresponding U_OFF*
typedef uint32_t U_CBSTR; //!< Count of Bytes in an 8 or 16 bit string
typedef uint32_t U_OFFBITS; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBITSMSK; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBITSSRC; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBMI; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBMIMSK; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFBMISRC; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFDATA; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFDESC; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFDX; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFPLENTRIES; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFPXLFMT; //!< Byte offset to TYPE, always measured from the start of the RECORD (not the struct)
typedef uint32_t U_OFFSTR; //!< Byte offset to string of either 8 or 16 bit characters
typedef uint8_t U_DATA; //!< any binary sort of data, not otherwise classified.
// "Types" For array components in structures, where not otherwise defined as a structure
typedef uint32_t U_FNTAXES; //!< Font Axes For U_DESIGNVECTOR
typedef uint32_t U_STYLEENTRY; //!< StyleEntry For U_EXTLOGPEN
typedef uint32_t U_POLYCOUNTS; //!< aPolyCounts For U_EMRPOLYPOLYLINE etc.
// "Counts" for array components in structures
typedef uint32_t U_NUM_FNTAXES; //!< Number of U_FNTAXES
typedef uint32_t U_NUM_LOGPLTNTRY; //!< Number of U_LOGPLTENTRY
typedef uint32_t U_NUM_RECTL; //!< Number of U_RECTL
typedef uint32_t U_NUM_POINTL; //!< Number of U_POINTL
typedef uint32_t U_NUM_POINT16; //!< Number of U_POINT16
typedef uint32_t U_NUM_STYLEENTRY; //!< Number of U_STYLEENTRY
typedef uint32_t U_NUM_POLYCOUNTS; //!< Number of U_POLYCOUNTS
typedef uint32_t U_NUM_EMRTEXT; //!< Number of U_EMRTEXT
typedef uint32_t U_NUM_STR; //!< Number of 8 or 16 bit characters in string
typedef uint32_t U_NUM_TRIVERTEX; //!< Number of U_TRIVERTEX
typedef uint32_t U_NUM_GRADOBJ; //!< Number of U_GRADIENT4 OR U_GRADIENT3 (determined at run time)
typedef uint32_t U_NUM_RGBQUAD; //!< Number of U_RGBQUAD (in bmciColors in U_BITMAPCOREINFO)
/* ************************ WMF pieces used in EMF or EMF+ ****************************** */
/** \defgroup U_EMF_EMRSETROP2_iMode_Qualifiers EMF Binary Raster Operation Enumeration
For U_EMRSETROP2 iMode field
Microsoft name: Binary Raster Operation Enumeration
WMF manual 2.1.1.2
These codes specify:
1. an order of operands (composed of various orders and combinations of: Dest, Pen)
(There are 2, hence "Binary Raster Operation")
2. an order of operators to apply to the operands (composed of Not, Xor, Or, And)
Only a few of the more common operations are provided here.
The default is U_R2_COPYPEN. If this value is changed to something else all subsequenty
draw operations will use the altered logic. For instance, if it is set to U_R2_BLACK and
a red rectangle is drawn it will appear as a black rectangle.
@{
*/
#define U_R2_BLACK 1 //!< BLACK
#define U_R2_NOTMERGEPEN 2 //!< NOTMERGEPEN
#define U_R2_MASKNOTPEN 3 //!< MASKNOTPEN
#define U_R2_NOTCOPYPEN 4 //!< NOTCOPYPEN
#define U_R2_MASKPENNOT 5 //!< MASKPENNOT
#define U_R2_NOT 6 //!< NOT
#define U_R2_XORPEN 7 //!< XORPEN
#define U_R2_NOTMASKPEN 8 //!< NOTMASKPEN
#define U_R2_MASKPEN 9 //!< MASKPEN
#define U_R2_NOTXORPEN 10 //!< NOTXORPEN
#define U_R2_NOP 11 //!< NOP
#define U_R2_MERGENOTPEN 12 //!< MERGENOTPEN
#define U_R2_COPYPEN 13 //!< COPYPEN
#define U_R2_MERGEPENNOT 14 //!< MERGEPENNOT
#define U_R2_MERGEPEN 15 //!< MERGEPEN
#define U_R2_WHITE 16 //!< WHITE
#define U_R2_LAST 16 //!< LAST
/** @} */
/** \defgroup U_EMF_BITMAPINFOHEADER_biBitCount_Qualifiers EMF BitCount Enumeration
For U_BITMAPINFOHEADER biBitCount field.
Microsoft name: Bitcount Enumeration
WMF manual 2.1.1.3
@{
*/
#define U_BCBM_EXPLICIT 0 //!< Derived from JPG or PNG compressed image or ?
#define U_BCBM_MONOCHROME 1 //!< 2 colors. bmiColors array has two entries
#define U_BCBM_COLOR4 4 //!< 2^4 colors. bmiColors array has 16 entries
#define U_BCBM_COLOR8 8 //!< 2^8 colors. bmiColors array has 256 entries
#define U_BCBM_COLOR16 16 //!< 2^16 colors. bmiColors is not used. Pixels are 5 bits B,G,R with 1 unused bit
#define U_BCBM_COLOR24 24 //!< 2^24 colors. bmiColors is not used. Pixels are U_RGBTRIPLE.
#define U_BCBM_COLOR32 32 //!< 2^32 colors. bmiColors is not used. Pixels are U_RGBQUAD. Also use for EMF+ ARGB
/** @} */
/** \defgroup U_EMF_BITMAPINFOHEADER_biCompression_Qualifiers EMF BI_Compression Enumeration
For U_BITMAPINFOHEADER biCompression field
Microsoft name: Compression Enumeration
WMF manual 2.1.1.7
@{
*/
#define U_BI_UNKNOWN -1 //!< not defined in EMF standard, not to be used in EMF files
#define U_BI_RGB 0 //!< Supported by libUEMF
#define U_BI_RLE8 1 //!< NOT supported by libUEMF
#define U_BI_RLE4 2 //!< NOT supported by libUEMF
#define U_BI_BITFIELDS 3 //!< Supported by libUEMF
#define U_BI_JPEG 4 //!< Supported by libUEMF
#define U_BI_PNG 5 //!< Supported by libUEMF
/** @} */
/** \defgroup U_EMF_LOGCOLORSPACE_lcsIntent_Qualifiers EMF LCS_Intent Enumeration
For U_LOGCOLORSPACEA/U_LOGCOLORSPACEW lcsIntent field
Microsoft name: LCS_Intent Enumeration
WMF manual 2.1.1.11
@{
*/
#define U_LCS_GM_BUSINESS 0x00000001L //!< BUSINESS
#define U_LCS_GM_GRAPHICS 0x00000002L //!< GRAPHICS
#define U_LCS_GM_IMAGES 0x00000004L //!< IMAGES
#define U_LCS_GM_ABS_COLORIMETRIC 0x00000008L //!< ABS_COLORIMETRIC
/** @} */
/** \defgroup U_EMF_LOGCOLORSPACE_lcsCSType_Qualifiers EMF LCS_CSType Enumeration
For U_LOGCOLORSPACEA/U_LOGCOLORSPACEW lcsCSType field
Microsoft name: LCS_CSType Enumeration
WMF manual 2.1.1.14
@{
*/
#define U_LCS_CALIBRATED_RGB 0x00000000L //!< CALIBRATED_RGB
#define U_LCS_DEVICE_RGB 0x00000001L //!< DEVICE_RGB
#define U_LCS_DEVICE_CMYK 0x00000002L //!< DEVICE_CMYK
/** @} */
/** \defgroup U_EMF_EMR_dwROP_Qualifiers EMF Ternary Raster Operation enumeration
For U_EMR* dwROP fields.
Microsoft name: Ternary Raster Operation enumeration
WMF manual 2.1.1.31
These codes specify:
1. an order of operands (composed of various orders and combinations of: Dest, Src, Pen)
(There are 3, hence "Ternary Raster Operation")
2. an order of operators to apply to the operands (composed of Not, Xor, Or, And)
Only a few of the more common operations are provided here.
When the Operation does not use a Src operand the corresponding source bitmap may be
omitted from the record.
For more details see:
http://wiki.winehq.org/TernaryRasterOps
@{
*/
#define U_SRCCOPY 0x00cc0020 //!< SRCCOPY
#define U_SRCPAINT 0x00ee0086 //!< SRCPAINT
#define U_SRCAND 0x008800c6 //!< SRCAND
#define U_SRCINVERT 0x00660046 //!< SRCINVERT
#define U_SRCERASE 0x00440328 //!< SRCERASE
#define U_NOTSRCCOPY 0x00330008 //!< NOTSRCCOPY
#define U_NOTSRCERASE 0x001100a6 //!< NOTSRCERASE
#define U_MERGECOPY 0x00c000ca //!< MERGECOPY
#define U_MERGEPAINT 0x00bb0226 //!< MERGEPAINT
#define U_PATCOPY 0x00f00021 //!< PATCOPY
#define U_PATPAINT 0x00fb0a09 //!< PATPAINT
#define U_PATINVERT 0x005a0049 //!< PATINVERT
#define U_DSTINVERT 0x00550009 //!< DSTINVERT
#define U_BLACKNESS 0x00000042 //!< BLACKNESS
#define U_WHITENESS 0x00ff0062 //!< WHITENESS
#define U_NOOP 0x00aa0029 //!< Many GDI programs end with a bitblt with this ROP == "D". Seems to work like flush()
#define U_NOMIRRORBITMAP 0x80000000 //!< If bit set, disable horizontal reflection of bitmap.
/** @} */
/** \defgroup U_EMF_EMRSETTEXTALIGN_iMode_Qualifiers EMF TextAlignment Enumeration
For U_EMRSETTEXTALIGN iMode field
Microsoft name: TextAlignment Enumeration
WMF Manual 2.1.2.3
WMF Manual 2.1.2.4
Recall that EMF coordinates have UL closest to {0,0}, LR is below and to the right of UL and so has LARGER
{x,y} coordinates. In the following "TOP" is on the horizontal line defined by LR, as it has larger y coordinates,
which when viewing the EMF file, would actually be on the BOTTOM of the bounding rectangle. Similarly, left and right
are reversed.
Microsoft documentation (WMF manual, section 2.1.2.3) says that the text starts on certain edges of the bounding rectangle.
That is apparently not true, whether the bounding rectangle is {0,0,-1,-1}, which is effectively no bounding rectangle,
or if a valid bounding rectangle is specified. In all cases the text (in Windows XP Preview) starts, has center at, or ends
at the center point. Vertical offsets seem to be defined analogously, but with respect to the height of the font. The bounding
rectangle defined for the U_EMRTEXT record appears to be ignored.
Microsoft documentation (EMF manual,section 2.2.5) says that the same rectangle is used for "clipping or opaquing" by ExtTextOutA/W.
That does not seem to occur either.
@{
*/
// Horizontal text flags
#define U_TA_DEFAULT 0x00 //!< default alignment
#define U_TA_NOUPDATECP 0x00 //!< Reference point does not move
#define U_TA_UPDATECP 0x01 //!< Reference point moves to end of next text drawn.
#define U_TA_LEFT 0x00 //!< Reference point is on left edge of bounding rectangle
#define U_TA_RIGHT 0x02 //!< Reference point is on right edge of bounding rectangle
#define U_TA_CENTER 0x06 //!< Reference point is on center vertical line of bounding rectangle
#define U_TA_TOP 0x00 //!< Reference point is on top edge of bounding rectangle
#define U_TA_BOTTOM 0x08 //!< Reference point is on bottom edge of bounding rectangle
#define U_TA_BASEBIT 0x10 //!< Reference point is on baseline of text if this bit is set, for 0x10 <-> 0x18
#define U_TA_BASELINE 0x18 //!< Reference point is on baseline of text
#define U_TA_RTLREADING 0x100 //!< Set for Right to Left languages like Hebrew and Arabic
#define U_TA_MASK U_TA_BASELINE+U_TA_CENTER+U_TA_UPDATECP+U_TA_RTLREADING //!< Mask for these bits
// Vertical text flags
#define U_VTA_BASELINE U_TA_BASELINE //!< same meaning, but for vertical text
#define U_VTA_LEFT U_TA_BOTTOM //!< same meaning, but for vertical text
#define U_VTA_RIGHT U_TA_TOP //!< same meaning, but for vertical text
#define U_VTA_CENTER U_TA_CENTER //!< same meaning, but for vertical text
#define U_VTA_BOTTOM U_TA_RIGHT //!< same meaning, but for vertical text
#define U_VTA_TOP U_TA_LEFT //!< same meaning, but for vertical text
/** @} */
/** WMF manual 2.2.2.3
\brief For U_BITMAPINFO bmiHeader field
Microsoft name: BITMAPINFOHEADER Object
*/
typedef struct {
uint32_t biSize; //!< Structure size in bytes
int32_t biWidth; //!< Bitmap width in pixels
int32_t biHeight; //!< Bitmap height in pixels, may be negative.
//!< abs(biHeight) is bitmap height
//!< bitmap may appear in two orientations:
//!< biHeight > 0 origin is LL corner, may be compressed, this is height after decompression.
//!< biHeight < 0 origin is UL corner, may not be compressed
uint16_t biPlanes; //!< Planes (must be 1)
uint16_t biBitCount; //!< BitCount Enumeration (determines number of RBG colors)
uint32_t biCompression; //!< BI_Compression Enumeration
uint32_t biSizeImage; //!< Image size in bytes or 0 = "default size (calculated from geometry?)"
int32_t biXPelsPerMeter; //!< X Resolution in pixels/meter
int32_t biYPelsPerMeter; //!< Y Resolution in pixels/meter
U_NUM_RGBQUAD biClrUsed; //!< Number of bmciColors in U_BITMAPINFO/U_BITMAPCOREINFO that are used by the bitmap
uint32_t biClrImportant; //!< Number of bmciColors needed (0 means all).
} U_BITMAPINFOHEADER,
*PU_BITMAPINFOHEADER; //!< WMF manual 2.2.2.3
#define U_SIZE_BITMAPINFOHEADER (sizeof(U_BITMAPINFOHEADER))
/** WMF manual 2.2.2.6
\brief For U_CIEXYZTRIPLE (all) fields
Microsoft name: CIEXYZ Object
*/
typedef struct {
int32_t ciexyzX; //!< CIE color space X component
int32_t ciexyzY; //!< CIE color space Y component
int32_t ciexyzZ; //!< CIE color space Z component
} U_CIEXYZ,
*PU_CIEXYZ; //!< WMF manual 2.2.2.6
/** WMF manual 2.2.2.7
\brief For U_LOGCOLORSPACEA and U_LOGCOLORSPACEW lcsEndpints field
defines a CIE colorspace.
Microsoft name: CIEXYZTRIPLE Object
*/
typedef struct {
U_CIEXYZ ciexyzRed; //!< CIE XYZ coord of red endpoint of colorspace
U_CIEXYZ ciexyzGreen; //!< CIE XYZ coord of green endpoint of colorspace
U_CIEXYZ ciexyzBlue; //!< CIE XYZ coord of blue endpoint of colorspace
} U_CIEXYZTRIPLE,
*PU_CIEXYZTRIPLE; //!< WMF manual 2.2.2.7
/** WMF manual 2.2.2.8
\brief For U_BITMAPINFO crColor field
NOTE that the color order is RGB reserved, flipped around from the preceding.
Microsoft name: COLORREF Object
*/
typedef struct {
uint8_t Red; //!< Red color (0-255)
uint8_t Green; //!< Green color (0-255)
uint8_t Blue; //!< Blue color (0-255)
uint8_t Reserved; //!< Not used
} U_COLORREF,
*PU_COLORREF; //!< WMF manual 2.2.2.8
/** WMF manual 2.2.2.11
\brief For U_LCS_GAMMARGB lcsGamma* fields
Microsoft name:(unknown)
*/
typedef struct {
unsigned ignoreHi :8; //!< not used
unsigned intPart :8; //!< integer part
unsigned fracPart :8; //!< fraction part
unsigned ignoreLo :8; //!< not used
} U_LCS_GAMMA,
*PU_LCS_GAMMA; //!< WMF manual 2.2.2.11
/** WMF manual 2.2.2.11
\brief For U_LOGCOLORSPACEA and U_LOGCOLORSPACEW lcsGammaRGB field
Microsoft name:(unknown)
*/
typedef struct {
U_LCS_GAMMA lcsGammaRed; //!< Red Gamma
U_LCS_GAMMA lcsGammaGreen; //!< Green Gamma
U_LCS_GAMMA lcsGammaBlue; //!< Blue Gamma
} U_LCS_GAMMARGB,
*PU_LCS_GAMMARGB; //!< WMF manual 2.2.2.11
/** WMF manual 2.2.2.11
\brief For U_EMRCREATECOLORSPACE lcs field
Microsoft name: LOGCOLORSPACEA Object
*/
typedef struct {
uint32_t lcsSignature; //!< must be U_LCS_SIGNATURE
uint32_t lcsVersion; //!< must be U_LCS_VERSION
uint32_t lcsSize; //!< Size in bytes of this structure
int32_t lcsCSType; //!< LCS_CSType Enumeration
int32_t lcsIntent; //!< LCS_Intent Enumeration
U_CIEXYZTRIPLE lcsEndpoints; //!< CIE XYZ color space endpoints
U_LCS_GAMMARGB lcsGammaRGB; //!< Gamma For RGB
char lcsFilename[U_MAX_PATH]; //!< Names an external color profile file, otherwise empty string
} U_LOGCOLORSPACEA,
*PU_LOGCOLORSPACEA; //!< WMF manual 2.2.2.11
/** WMF manual 2.2.2.12
\brief For U_EMRCREATECOLORSPACEW lcs field
Microsoft name: LOGCOLORSPACEW Object
*/
typedef struct {
uint32_t lcsSignature; //!< must be U_LCS_SIGNATURE
uint32_t lcsVersion; //!< must be U_LCS_VERSION
uint32_t lcsSize; //!< Size in bytes of this structure
int32_t lcsCSType; //!< lcsCSType Enumeration
int32_t lcsIntent; //!< lcsIntent Enumeration
U_CIEXYZTRIPLE lcsEndpoints; //!< CIE XYZ color space endpoints
U_LCS_GAMMARGB lcsGammaRGB; //!< Gamma For RGB
uint16_t lcsFilename[U_MAX_PATH]; //!< Could name an external color profile file, otherwise empty string
} U_LOGCOLORSPACEW,
*PU_LOGCOLORSPACEW; //!< WMF manual 2.2.2.12
/** WMF manual 2.2.2.15
\brief Used for any generic pair of uint32_t
Microsoft name: POINTL Object
*/
typedef struct {
int32_t x; //!< X value
int32_t y; //!< Y value
} U_PAIR,
U_POINT, //!< WMF manual 2.2.2.15
U_POINTL, //!< WMF manual 2.2.2.15
*PU_PAIR, //!< WMF manual 2.2.2.15
*PU_POINT, //!< WMF manual 2.2.2.15
*PU_POINTL; //!< WMF manual 2.2.2.15
/** WMF manual 2.2.2.16
\brief Point type for 16 bit EMR drawing functions.
Microsoft name: POINTS Object.
Microsoft name: POINTS16 Object.
*/
typedef struct {
int16_t x; //!< X size (16 bit)
int16_t y; //!< Y size (16 bit)
} U_POINT16,
*PU_POINT16; //!< WMF manual 2.2.2.16
/** WMF manual 2.2.2.19
\brief Coordinates of the upper left, lower right corner.
Note that the coordinate system is 0,0 in the upper left corner
of the screen an N,M in the lower right corner.
Microsoft name: RECTL Object
*/
typedef struct {
int32_t left; //!< left coordinate
int32_t top; //!< top coordinate
int32_t right; //!< right coordinate
int32_t bottom; //!< bottom coordinate
} U_RECT,
U_RECTL, //!< WMF manual 2.2.2.19
*PU_RECT, //!< WMF manual 2.2.2.19
*PU_RECTL; //!< WMF manual 2.2.2.19
/** WMF manual 2.2.2.20
\brief For U_BITMAPINFO bmiColors field
NOTE that the color order is BGR, even though the name is RGB!
Microsoft name: RGBQUAD Object
*/
typedef struct {
uint8_t Blue; //!< Blue color (0-255)
uint8_t Green; //!< Green color (0-255)
uint8_t Red; //!< Red color (0-255)
uint8_t Reserved; //!< Not used
} U_RGBQUAD,
*PU_RGBQUAD; //!< WMF manual 2.2.2.20
#define U_RCL_DEF (U_RECTL){0,0,-1,-1} //!< Use this when no bounds are needed.
/** WMF manual 2.2.2.22
\brief Pair of values indicating x and y sizes.
Microsoft name: SIZE Object
Microsoft name: SIZEL Object
*/
typedef struct {
int32_t cx; //!< X size
int32_t cy; //!< Y size
} U_SIZE,
U_SIZEL, //!< WMF manual 2.2.2.22
*PU_SIZE, //!< WMF manual 2.2.2.22
*PU_SIZEL; //!< WMF manual 2.2.2.22
/* ************************ EMF or common to EMF and EMF+ ****************************** */
// ***********************************************************************************
// Value enumerations and other predefined constants, alphabetical order by group
/** \defgroup U_EMF_FONT_STRUCT_WIDTHS EMF Font name and style widths in characters
For U_LOGFONT and U_LOGFONT_PANOSE,
@{
*/
#define U_LF_FACESIZE 32 //!< U_LOGFONT lfFaceName and U_LOGFONT_PANOSE elfStyle fields maximum width
#define U_LF_FULLFACESIZE 64 //!< U_LOGFONT_PANOSE elfFullName field maximum width
/** @} */
/** \defgroup U_EMF_EMR_Qualifiers EMF RecordType Enumeration
(RecordType Enumeration, EMF manual 2.1.1 )
For U_EMR iType field
EMF manual 2.1.1
@{
*/
#define U_EMR_HEADER 1 //!< U_EMRHEADER record
#define U_EMR_POLYBEZIER 2 //!< U_EMRPOLYBEZIER record
#define U_EMR_POLYGON 3 //!< U_EMRPOLYGON record
#define U_EMR_POLYLINE 4 //!< U_EMRPOLYLINE record
#define U_EMR_POLYBEZIERTO 5 //!< U_EMRPOLYBEZIERTO record
#define U_EMR_POLYLINETO 6 //!< U_EMRPOLYLINETO record
#define U_EMR_POLYPOLYLINE 7 //!< U_EMRPOLYPOLYLINE record
#define U_EMR_POLYPOLYGON 8 //!< U_EMRPOLYPOLYGON record
#define U_EMR_SETWINDOWEXTEX 9 //!< U_EMRSETWINDOWEXTEX record
#define U_EMR_SETWINDOWORGEX 10 //!< U_EMRSETWINDOWORGEX record
#define U_EMR_SETVIEWPORTEXTEX 11 //!< U_EMRSETVIEWPORTEXTEX record
#define U_EMR_SETVIEWPORTORGEX 12 //!< U_EMRSETVIEWPORTORGEX record
#define U_EMR_SETBRUSHORGEX 13 //!< U_EMRSETBRUSHORGEX record
#define U_EMR_EOF 14 //!< U_EMREOF record
#define U_EMR_SETPIXELV 15 //!< U_EMRSETPIXELV record
#define U_EMR_SETMAPPERFLAGS 16 //!< U_EMRSETMAPPERFLAGS record
#define U_EMR_SETMAPMODE 17 //!< U_EMRSETMAPMODE record
#define U_EMR_SETBKMODE 18 //!< U_EMRSETBKMODE record
#define U_EMR_SETPOLYFILLMODE 19 //!< U_EMRSETPOLYFILLMODE record
#define U_EMR_SETROP2 20 //!< U_EMRSETROP2 record
#define U_EMR_SETSTRETCHBLTMODE 21 //!< U_EMRSETSTRETCHBLTMODE record
#define U_EMR_SETTEXTALIGN 22 //!< U_EMRSETTEXTALIGN record
#define U_EMR_SETCOLORADJUSTMENT 23 //!< U_EMRSETCOLORADJUSTMENT record
#define U_EMR_SETTEXTCOLOR 24 //!< U_EMRSETTEXTCOLOR record
#define U_EMR_SETBKCOLOR 25 //!< U_EMRSETBKCOLOR record
#define U_EMR_OFFSETCLIPRGN 26 //!< U_EMROFFSETCLIPRGN record
#define U_EMR_MOVETOEX 27 //!< U_EMRMOVETOEX record
#define U_EMR_SETMETARGN 28 //!< U_EMRSETMETARGN record
#define U_EMR_EXCLUDECLIPRECT 29 //!< U_EMREXCLUDECLIPRECT record
#define U_EMR_INTERSECTCLIPRECT 30 //!< U_EMRINTERSECTCLIPRECT record
#define U_EMR_SCALEVIEWPORTEXTEX 31 //!< U_EMRSCALEVIEWPORTEXTEX record
#define U_EMR_SCALEWINDOWEXTEX 32 //!< U_EMRSCALEWINDOWEXTEX record
#define U_EMR_SAVEDC 33 //!< U_EMRSAVEDC record
#define U_EMR_RESTOREDC 34 //!< U_EMRRESTOREDC record
#define U_EMR_SETWORLDTRANSFORM 35 //!< U_EMRSETWORLDTRANSFORM record
#define U_EMR_MODIFYWORLDTRANSFORM 36 //!< U_EMRMODIFYWORLDTRANSFORM record
#define U_EMR_SELECTOBJECT 37 //!< U_EMRSELECTOBJECT record
#define U_EMR_CREATEPEN 38 //!< U_EMRCREATEPEN record
#define U_EMR_CREATEBRUSHINDIRECT 39 //!< U_EMRCREATEBRUSHINDIRECT record
#define U_EMR_DELETEOBJECT 40 //!< U_EMRDELETEOBJECT record
#define U_EMR_ANGLEARC 41 //!< U_EMRANGLEARC record
#define U_EMR_ELLIPSE 42 //!< U_EMRELLIPSE record
#define U_EMR_RECTANGLE 43 //!< U_EMRRECTANGLE record
#define U_EMR_ROUNDRECT 44 //!< U_EMRROUNDRECT record
#define U_EMR_ARC 45 //!< U_EMRARC record
#define U_EMR_CHORD 46 //!< U_EMRCHORD record
#define U_EMR_PIE 47 //!< U_EMRPIE record
#define U_EMR_SELECTPALETTE 48 //!< U_EMRSELECTPALETTE record
#define U_EMR_CREATEPALETTE 49 //!< U_EMRCREATEPALETTE record
#define U_EMR_SETPALETTEENTRIES 50 //!< U_EMRSETPALETTEENTRIES record
#define U_EMR_RESIZEPALETTE 51 //!< U_EMRRESIZEPALETTE record
#define U_EMR_REALIZEPALETTE 52 //!< U_EMRREALIZEPALETTE record
#define U_EMR_EXTFLOODFILL 53 //!< U_EMREXTFLOODFILL record
#define U_EMR_LINETO 54 //!< U_EMRLINETO record
#define U_EMR_ARCTO 55 //!< U_EMRARCTO record
#define U_EMR_POLYDRAW 56 //!< U_EMRPOLYDRAW record
#define U_EMR_SETARCDIRECTION 57 //!< U_EMRSETARCDIRECTION record
#define U_EMR_SETMITERLIMIT 58 //!< U_EMRSETMITERLIMIT record
#define U_EMR_BEGINPATH 59 //!< U_EMRBEGINPATH record
#define U_EMR_ENDPATH 60 //!< U_EMRENDPATH record
#define U_EMR_CLOSEFIGURE 61 //!< U_EMRCLOSEFIGURE record
#define U_EMR_FILLPATH 62 //!< U_EMRFILLPATH record
#define U_EMR_STROKEANDFILLPATH 63 //!< U_EMRSTROKEANDFILLPATH record
#define U_EMR_STROKEPATH 64 //!< U_EMRSTROKEPATH record
#define U_EMR_FLATTENPATH 65 //!< U_EMRFLATTENPATH record
#define U_EMR_WIDENPATH 66 //!< U_EMRWIDENPATH record
#define U_EMR_SELECTCLIPPATH 67 //!< U_EMRSELECTCLIPPATH record
#define U_EMR_ABORTPATH 68 //!< U_EMRABORTPATH record
#define U_EMR_UNDEF69 69 //!< U_EMRUNDEF69 record
#define U_EMR_COMMENT 70 //!< U_EMRCOMMENT record
#define U_EMR_FILLRGN 71 //!< U_EMRFILLRGN record
#define U_EMR_FRAMERGN 72 //!< U_EMRFRAMERGN record
#define U_EMR_INVERTRGN 73 //!< U_EMRINVERTRGN record
#define U_EMR_PAINTRGN 74 //!< U_EMRPAINTRGN record
#define U_EMR_EXTSELECTCLIPRGN 75 //!< U_EMREXTSELECTCLIPRGN record
#define U_EMR_BITBLT 76 //!< U_EMRBITBLT record
#define U_EMR_STRETCHBLT 77 //!< U_EMRSTRETCHBLT record
#define U_EMR_MASKBLT 78 //!< U_EMRMASKBLT record
#define U_EMR_PLGBLT 79 //!< U_EMRPLGBLT record
#define U_EMR_SETDIBITSTODEVICE 80 //!< U_EMRSETDIBITSTODEVICE record
#define U_EMR_STRETCHDIBITS 81 //!< U_EMRSTRETCHDIBITS record
#define U_EMR_EXTCREATEFONTINDIRECTW 82 //!< U_EMREXTCREATEFONTINDIRECTW record
#define U_EMR_EXTTEXTOUTA 83 //!< U_EMREXTTEXTOUTA record
#define U_EMR_EXTTEXTOUTW 84 //!< U_EMREXTTEXTOUTW record
#define U_EMR_POLYBEZIER16 85 //!< U_EMRPOLYBEZIER16 record
#define U_EMR_POLYGON16 86 //!< U_EMRPOLYGON16 record
#define U_EMR_POLYLINE16 87 //!< U_EMRPOLYLINE16 record
#define U_EMR_POLYBEZIERTO16 88 //!< U_EMRPOLYBEZIERTO16 record
#define U_EMR_POLYLINETO16 89 //!< U_EMRPOLYLINETO16 record
#define U_EMR_POLYPOLYLINE16 90 //!< U_EMRPOLYPOLYLINE16 record
#define U_EMR_POLYPOLYGON16 91 //!< U_EMRPOLYPOLYGON16 record
#define U_EMR_POLYDRAW16 92 //!< U_EMRPOLYDRAW16 record
#define U_EMR_CREATEMONOBRUSH 93 //!< U_EMRCREATEMONOBRUSH record
#define U_EMR_CREATEDIBPATTERNBRUSHPT 94 //!< U_EMRCREATEDIBPATTERNBRUSHPT record
#define U_EMR_EXTCREATEPEN 95 //!< U_EMREXTCREATEPEN record
#define U_EMR_POLYTEXTOUTA 96 //!< U_EMRPOLYTEXTOUTA record
#define U_EMR_POLYTEXTOUTW 97 //!< U_EMRPOLYTEXTOUTW record
#define U_EMR_SETICMMODE 98 //!< U_EMRSETICMMODE record
#define U_EMR_CREATECOLORSPACE 99 //!< U_EMRCREATECOLORSPACE record
#define U_EMR_SETCOLORSPACE 100 //!< U_EMRSETCOLORSPACE record
#define U_EMR_DELETECOLORSPACE 101 //!< U_EMRDELETECOLORSPACE record
#define U_EMR_GLSRECORD 102 //!< U_EMRGLSRECORD record
#define U_EMR_GLSBOUNDEDRECORD 103 //!< U_EMRGLSBOUNDEDRECORD record
#define U_EMR_PIXELFORMAT 104 //!< U_EMRPIXELFORMAT record
#define U_EMR_DRAWESCAPE 105 //!< U_EMRDRAWESCAPE record
#define U_EMR_EXTESCAPE 106 //!< U_EMREXTESCAPE record
#define U_EMR_UNDEF107 107 //!< U_EMRUNDEF107 record
#define U_EMR_SMALLTEXTOUT 108 //!< U_EMRSMALLTEXTOUT record
#define U_EMR_FORCEUFIMAPPING 109 //!< U_EMRFORCEUFIMAPPING record
#define U_EMR_NAMEDESCAPE 110 //!< U_EMRNAMEDESCAPE record
#define U_EMR_COLORCORRECTPALETTE 111 //!< U_EMRCOLORCORRECTPALETTE record
#define U_EMR_SETICMPROFILEA 112 //!< U_EMRSETICMPROFILEA record
#define U_EMR_SETICMPROFILEW 113 //!< U_EMRSETICMPROFILEW record
#define U_EMR_ALPHABLEND 114 //!< U_EMRALPHABLEND record
#define U_EMR_SETLAYOUT 115 //!< U_EMRSETLAYOUT record
#define U_EMR_TRANSPARENTBLT 116 //!< U_EMRTRANSPARENTBLT record
#define U_EMR_UNDEF117 117 //!< U_EMRUNDEF117 record
#define U_EMR_GRADIENTFILL 118 //!< U_EMRGRADIENTFILL record
#define U_EMR_SETLINKEDUFIS 119 //!< U_EMRSETLINKEDUFIS record
#define U_EMR_SETTEXTJUSTIFICATION 120 //!< U_EMRSETTEXTJUSTIFICATION record
#define U_EMR_COLORMATCHTOTARGETW 121 //!< U_EMRCOLORMATCHTOTARGETW record
#define U_EMR_CREATECOLORSPACEW 122 //!< U_EMRCREATECOLORSPACEW record
#define U_EMR_MIN 1 //!< Minimum U_EMR_ value.
#define U_EMR_MAX 122 //!< Maximum U_EMR_ value. Not much beyond 104 is implemented
#define U_EMR_INVALID 0xFFFFFFFF //!< Not any valid U_EMF_ value
/** @} */
/** \defgroup U_EMF_DRAW_PROPERTIES EMF draw properties
Used in emr_properties() and wmr_properties. These are the bit definitions.
@{
*/
#define U_DRAW_NOTEMPTY 0x001 //!< Path has at least a MOVETO in it
#define U_DRAW_VISIBLE 0x002 //!< Path has at least a LINE in it
#define U_DRAW_CLOSED 0x004 //!< Path has been closed
#define U_DRAW_ONLYTO 0x008 //!< Path so far contains only *TO operations
#define U_DRAW_FORCE 0x010 //!< Path MUST be drawn
#define U_DRAW_ALTERS 0x020 //!< Alters draw parameters (pen, brush, coordinates...)
#define U_DRAW_PATH 0x040 //!< An explicit path is being used (with a BEGIN and END)
#define U_DRAW_TEXT 0x080 //!< Current record forces all pending text to be drawn first.
#define U_DRAW_OBJECT 0x100 //!< Creates an Object (only used in WMF)
#define U_DRAW_NOFILL 0x200 //!< Object is not fillable (lines and arc, only used in WMF)
/** @} */
/** \defgroup U_EMF_EMRSETARCDIRECTION_Qualifiers EMF ArcDirection Enumeration
For U_EMRSETARCDIRECTION iArcDirection field
Microsoft name: ArcDirection Enumeration
EMF manual 2.1.2
@{
*/
#define U_AD_COUNTERCLOCKWISE 1 //!< Draw arc counterclockwise.
#define U_AD_CLOCKWISE 2 //!< Draw arc clockwise.
/** @} */
/** \defgroup U_EMF_PANOSE_bArmStyle_Qualifiers EMF ArmStyle Enumeration
For U_PANOSE bArmStyle field
Microsoft name: ArmStyle Enumeration
EMF manual 2.1.3
@{
*/
#define U_PAN_STRAIGHT_ARMS_HORZ 2 //!< straight arms horizontal
#define U_PAN_STRAIGHT_ARMS_WEDGE 3 //!< straight arms wedge
#define U_PAN_STRAIGHT_ARMS_VERT 4 //!< straight arms vertical
#define U_PAN_STRAIGHT_ARMS_SINGLE_SERIF 5 //!< straight arms singleserif
#define U_PAN_STRAIGHT_ARMS_DOUBLE_SERIF 6 //!< straight arms doubleserif
#define U_PAN_BENT_ARMS_HORZ 7 //!< bent arms horizontal
#define U_PAN_BENT_ARMS_WEDGE 8 //!< bent arms wedge
#define U_PAN_BENT_ARMS_VERT 9 //!< bent arms vertical
#define U_PAN_BENT_ARMS_SINGLE_SERIF 10 //!< bent arms singleserif
#define U_PAN_BENT_ARMS_DOUBLE_SERIF 11 //!< bent arms doubleserif
/** @} */
/** \defgroup U_EMF_EMRSETBKMODE_iMode_Qualifiers EMF BackgroundMode enumeration
For U_EMRSETBKMODE iMode field
Microsoft name: BackgroundMode enumeration
EMF manual 2.1.4
@{
*/
#define U_TRANSPARENT 1 //!< Transparent background mode
#define U_OPAQUE 2 //!< Opaque background mode
/** @} */
/** \defgroup U_EMF_COLORADJUSTMENT_caFlags_Qualifiers EMF ColorAdjustment Enumeration
For U_COLORADJUSTMENT caFlags field
Microsoft name: ColorAdjustment Enumeration
EMF manual 2.1.5
@{
*/
#define U_CA_NEGATIVE 0x0001 //!< display Negative of image
#define U_CA_LOG_FILTER 0x0002 //!< display Logarithmi filter of image
/** @} */
/** \defgroup U_EMF_EMRCOLORMATCHTOTARGETW_dwFlags_Qualifiers EMF ColorMatchToTarget Enumeration
For U_EMRCOLORMATCHTOTARGETW dwFlags field
Microsoft name: ColorMatchToTarget Enumeration
EMF manual 2.1.6
@{
*/
#define U_COLORMATCHTOTARGET_NOTEMBEDDED 0 //!< Color match profile is not embedded in metafile
#define U_COLORMATCHTOTARGET_EMBEDDED 1 //!< Color match profile is embedded in metafile
/** @} */
/** \defgroup U_EMF_EMRCOLORMATCHTOTARGETW_dwAction_Qualifiers EMF ColorSpace Enumeration
For U_EMRCOLORMATCHTOTARGETW dwAction field
Microsoft name: ColorSpace Enumeration
EMF manual 2.1.7
@{
*/
#define U_CS_ENABLE 1 //!< Enable color proofing.
#define U_CS_DISABLE 2 //!< Disable color proofing.
#define U_CS_DELETE_TRANSFORM 3 //!< Disable proofing and delete color transform.
/** @} */
/** \defgroup U_EMF_PANOSE_common_Qualifiers EMF PanoseCommon Enumeration
Used by all PAN_* enumerations, but only defined once here.
See also U_PAN_ALL1 after the U_PANOSE structure
@{
*/
#define U_PAN_ANY 0 //!< Any (for any type of Panose enumeration)
#define U_PAN_NO_FIT 1 //!< No fit (for any type of Panose enumeration)
/** @} */
/** \defgroup U_EMF_PANOSE_bContrast_Qualifiers EMF Contrast Enumeration
For U_PANOSE bContrast field
Microsoft name: Contrast Enumeration
EMF manual 2.1.8
@{
*/
#define U_PAN_CONTRAST_NONE 2 //!< None
#define U_PAN_CONTRAST_VERY_LOW 3 //!< Very low
#define U_PAN_CONTRAST_LOW 4 //!< Low
#define U_PAN_CONTRAST_MEDIUM_LOW 5 //!< Medium low
#define U_PAN_CONTRAST_MEDIUM 6 //!< Medium
#define U_PAN_CONTRAST_MEDIUM_HIGH 7 //!< Medium high
#define U_PAN_CONTRAST_HIGH 8 //!< High
#define U_PAN_CONTRAST_VERY_HIGH 9 //!< Very high
/** @} */
/** \defgroup U_EMF_DIBITS_iUsageSrc_Qualifiers EMF DIBColors Enumeration
For U_EMRSETDIBITSTODEIVCE and U_EMRSTRETCHDIBITS iUsageSrc fields.
Microsoft name: DIBColors Enumeration
EMF manual 2.1.9
@{
*/
#define U_DIB_RGB_COLORS 0 //!< color table contains colors
#define U_DIB_PAL_COLORS 1 //!< color table contains 16 bit indices into logical palette
#define U_DIB_PAL_INDICES 2 //!< no color table, pixel values are indices into logical palette
/** @} */
/** \defgroup U_EMF_EMR_COMMENT_PUBLIC EMF EMRComment Enumeration
For U_EMRCOMMENT_PUBLIC pcIdent fields
Microsoft name: EMRComment Enumeration
EMF manual 2.1.10
@{
*/
#define U_EMR_COMMENT_WINDOWS_METAFILE 0x80000001 //!< Comment contains WMF
#define U_EMR_COMMENT_BEGINGROUP 0x00000002 //!< Comment begins group of EMF records
#define U_EMR_COMMENT_ENDGROUP 0x00000003 //!< Comment ends group of EMF records
#define U_EMR_COMMENT_MULTIFORMATS 0x40000004 //!< Comment contains some other representation of drawing
#define U_EMR_COMMENT_UNICODE_STRING 0x00000040 //!< Reserved
#define U_EMR_COMMENT_UNICODE_END 0x00000080 //!< Reserved
/** @} */
/** \defgroup U_EMF_EMRTEXT_foptions_Qualifiers EMF ExtTextOutOptions Enumeration
For U_EMRTEXT foptions field
Microsoft name: ExtTextOutOptions Enumeration
EMF manual 2.1.11
@{
*/
#define U_ETO_NONE 0x00000000 //!< None
#define U_ETO_GRAYED 0x00000001 //!< Grayed
#define U_ETO_OPAQUE 0x00000002 //!< Fill rectangle with background color.
#define U_ETO_CLIPPED 0x00000004 //!< Clip text to rectangle.
#define U_ETO_GLYPH_INDEX 0x00000010 //!< Characters are glyph indices for the font.
#define U_ETO_RTLREADING 0x00000080 //!< Right to left text.
#define U_ETO_NO_RECT 0x00000100 //!< No bounding rectangle is specified.
#define U_ETO_SMALL_CHARS 0x00000200 //!< 8 bit characters instead of 16 bit. For EMRSMALLTEXTOUT ONLY, does not affect EMRTEXTOUTA or EMRTEXTOUTW
#define U_ETO_NUMERICSLOCAL 0x00000400 //!< Show numbers for the current locale.
#define U_ETO_NUMERICSLATIN 0x00000800 //!< Show numbers using European digits.
#define U_ETO_IGNORELANGUAGE 0x00001000 //!< Process Right to Left languages exactly as specified in the metafile.
#define U_ETO_PDY 0x00002000 //!< Both horizontal and vertical displacements are provided.
#define U_ETO_REVERSE_INDEX_MAP 0x00010000 //!< Reverse_index_map
/** @} */
/** \defgroup U_EMF_PANOSE_bFamilyType_Qualifiers EMF FamilyType Enumeration
For U_PANOSE bFamilyType field
Microsoft name: FamilyType Enumeration
EMF manual 2.1.12
@{
*/
#define U_PAN_FAMILY_TEXT_DISPLAY 2 //!< Text display
#define U_PAN_FAMILY_SCRIPT 3 //!< Script
#define U_PAN_FAMILY_DECORATIVE 4 //!< Decorative
#define U_PAN_FAMILY_PICTORIAL 5 //!< Pictorial
/** @} */
/** \defgroup U_EMF_EMREXTFLOODFILL_iMode_Qualifiers EMF FloodFill Enumeration
For U_EMREXTFLOODFILL iMode field
Microsoft name: FloodFill Enumeration
EMF manual 2.1.13
@{
*/
#define U_FLOODFILLBORDER 0x00000000 //!< Color specified must be the same as the border - brush fill stops at this color
#define U_FLOODFILLSURFACE 0x00000001 //!< Color specified must be different from the border - brush fills only this color
/** @} */
/** \defgroup U_EMF_DESIGNVECTOR_Signature_Qualifiers EMF Signature Enumeration
For U_DESIGNVECTOR Signature field
Microsoft name: Signature Enumeration
EMF manual 2.1.14
@{
*/
#define U_ENHMETA_SIGNATURE 0x464D4520 //!< "EMF" signature also for U_EMRHEADER dSignature field.
#define U_EPS_SIGNATURE 0x46535045 //!< "FSPE" signature, indicates encapsulated postscript.
/** @} */
/** \defgroup U_EMF_EMRGRADIENTFILL_ulMode_Qualifiers EMF GradientFill Enumeration
For U_EMRGRADIENTFILL ulMode field
Microsoft name: GradientFill Enumeration
EMF manual 2.1.15
@{
*/
#define U_GRADIENT_FILL_RECT_H 0x00000000 //!< Gradient is left to right.
#define U_GRADIENT_FILL_RECT_V 0x00000001 //!< Grident is top to bottom.
#define U_GRADIENT_FILL_TRIANGLE 0x00000002 //!< Gradient is between 3 vertices of a triangle.
/** @} */
/** \defgroup U_EMF_EMREXTTEXTOUT_iGraphicsMode_Qualifiers EMF GraphicsMode Enumeration
For U_EMREXTTEXTOUTA/U_EMREXTTEXTOUTW and all other iGraphicsMode fields
Microsoft name: GraphicsMode Enumeration
EMF manual 2.1.16
@{
*/
#define U_GM_COMPATIBLE 1 //!< TrueType text ignores world to device transform except for Scale. Arcs ignore transform
#define U_GM_ADVANCED 2 //!< TrueType text and Arcs must conform to all of world to device transform.
#define U_GM_LAST 2 //!< Number of GraphicsMode Enumeration entries.
/** @} */
/** \defgroup U_EMF_LOGBRUSH_lbHatch_Qualifiers EMF HatchStyle Enumeration
For U_LOGBRUSH lbHatch field
Microsoft name: HatchStyle Enumeration
EMF manual 2.1.17
@{
*/
#define U_HS_HORIZONTAL 0 //!< Horizontal.
#define U_HS_VERTICAL 1 //!< Vertical.
#define U_HS_FDIAGONAL 2 //!< Forward diagonal.
#define U_HS_BDIAGONAL 3 //!< Back diagonal.
#define U_HS_CROSS 4 //!< Cross.
#define U_HS_DIAGCROSS 5 //!< Diagonal cross.
#define U_HS_SOLIDCLR 6 //!< Solid color.
#define U_HS_DITHEREDCLR 7 //!< Dithered color.
#define U_HS_SOLIDTEXTCLR 8 //!< Solid text color.
#define U_HS_DITHEREDTEXTCLR 9 //!< Dithered text color.
#define U_HS_SOLIDBKCLR 10 //!< Solid background color.
#define U_HS_DITHEREDBKCLR 11 //!< Dithered background color.
/** @} */
/** \defgroup U_EMF_EMRSETICMMODE_iMode_Qualifiers EMF ICMMode Enumeration
For EMF U_EMR_SETICMMODE iMode field
Microsoft name: ICMMode Enumeration