forked from jmerdich/aeo-light
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDPXHeader.h
2282 lines (1882 loc) · 53.9 KB
/
DPXHeader.h
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
// -*- mode: C++; tab-width: 4 -*-
// vi: ts=4
/*! \file DPXHeader.h */
/*
* Copyright (c) 2009, Patrick A. Palmer.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Patrick A. Palmer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
// SMPTE DPX graphic file format v2.0
#ifndef _DPX_DPXHEADER_H
#define _DPX_DPXHEADER_H 1
#include <cstring>
#include "DPXStream.h"
/*!
* \def SMPTE_VERSION
* \brief SMPTE 268M-2003 DPX Version
*/
#define SMPTE_VERSION "V2.0"
/*!
* \def MAX_ELEMENTS
* \brief Maximum number of image elements
*/
#define MAX_ELEMENTS 8
/*!
* \def MAX_COMPONENTS
* \brief Maximum number of components per image element
*/
#define MAX_COMPONENTS 8
/*!
* \def MAGIC_COOKIE
* \brief HEX value of "SDPX"
*/
#define MAGIC_COOKIE 0x53445058
namespace dpx
{
// DPX data types
/*!
* \typedef unsigned char U8
* \brief Unsigned 8 bit integer
*/
typedef unsigned char U8;
/*!
* \typedef unsigned char U16
* \brief Unsigned 16 bit integer
*/
typedef unsigned short U16;
/*!
* \typedef unsigned char U32
* \brief Unsigned 32 bit integer
*/
typedef unsigned int U32;
/*!
* \typedef float R32
* \brief 32 bit floating point number
*/
typedef float R32;
/*!
* \typedef float R64
* \brief 64 bit floating point number
*/
typedef double R64;
/*!
* \typedef char ASCII
* \brief ASCII character
*/
typedef char ASCII;
/*!
* \enum DataSize
* \brief Component Data Storage Data Type
*/
enum DataSize
{
kByte, //!< 8-bit size component
kWord, //!<
kInt, //!<
kFloat, //!<
kDouble //!<
};
/*!
* \enum Orientation
* \brief Image Orientation Code
*/
enum Orientation
{
kLeftToRightTopToBottom = 0, //!< Oriented left to right, top to bottom
kRightToLeftTopToBottom = 1, //!< Oriented right to left, top to bottom
kLeftToRightBottomToTop = 2, //!< Oriented left to right, bottom to top
kRightToLeftBottomToTop = 3, //!< Oriented right to left, bottom to top
kTopToBottomLeftToRight = 4, //!< Oriented top to bottom, left to right
kTopToBottomRightToLeft = 5, //!< Oriented top to bottom, right to left
kBottomToTopLeftToRight = 6, //!< Oriented bottom to top, left to right
kBottomToTopRightToLeft = 7, //!< Oriented bottom to top, right to left
kUndefinedOrientation = 0xffff //!< Undefined orientation
};
/*!
* \enum Descriptor
* \brief Image element Descriptor
*/
enum Descriptor
{
kUserDefinedDescriptor = 0, //!< User defined descriptor
kRed = 1, //!< Red
kGreen = 2, //!< Green
kBlue = 3, //!< Blue
kAlpha = 4, //!< Alpha
kLuma = 6, //!< Luma (Y)
kColorDifference = 7, //!< Color difference
kDepth = 8, //!< Depth
kCompositeVideo = 9, //!< Composite video
kRGB = 50, //!< R,G,B
kRGBA = 51, //!< R,G,B,A
kABGR = 52, //!< A,B,G,R
kCbYCrY = 100, //!< Cb,Y,Cr,Y (4:2:2)
kCbYACrYA = 101, //!< Cb,Y,A,Cr,Y,A (4:2:2:4)
kCbYCr = 102, //!< Cb,Y,Cr (4:4:4)
kCbYCrA = 103, //!< Cb,Y,Cr,A (4:4:4:4)
kUserDefined2Comp = 150, //!< User defined 2 component element
kUserDefined3Comp = 151, //!< User defined 3 component element
kUserDefined4Comp = 152, //!< User defined 4 component element
kUserDefined5Comp = 153, //!< User defined 5 component element
kUserDefined6Comp = 154, //!< User defined 6 component element
kUserDefined7Comp = 155, //!< User defined 7 component element
kUserDefined8Comp = 156, //!< User defined 8 component element
kUndefinedDescriptor = 0xff //!< Undefined descriptor
};
/*!
* \enum Characteristic
* \brief Transfer Characteristic and Colorimetric Specification
*/
enum Characteristic
{
kUserDefined = 0, //!< User defined
kPrintingDensity, //!< Printing density
kLinear, //!< Linear, transfer only
kLogarithmic, //!< Logarithmic, transfer only
kUnspecifiedVideo, //!< Unspecified video
kSMPTE274M, //!< SMPTE 274M
kITUR709, //!< ITU-R 709-4
kITUR601, //!< ITU-R 601-5 system B or G
kITUR602, //!< ITU-R 601-5 system M
kNTSCCompositeVideo, //!< NTSC composite video
kPALCompositeVideo, //!< PAL composite video
kZLinear, //!< Z depth linear, transfer only
kZHomogeneous, //!< Z depth homogeneous, transfer only
kUndefinedCharacteristic = 0xff //!< Undefined
};
/*!
* \enum VideoSignal
* \brief Video Signal Standard
*/
enum VideoSignal
{
kUndefined = 0, //!< Undefined
kNTSC = 1, //!< NTSC
kPAL = 2, //!< PAL
kPAL_M = 3, //!< PAL-M
kSECAM = 4, //!< SECAM
k525LineInterlace43AR = 50, //!< YCbCr ITU-R 601-5 525-line, 2:1 interlace, 4:3 aspect ratio
k625LineInterlace43AR = 51, //!< YCbCr ITU-R 601-5 625-line, 2:1 interlace, 4:3 aspect ratio
k525LineInterlace169AR = 100, //!< YCbCr ITU-R 601-5 525-line, 2:1 interlace, 16:9 aspect ratio
k625LineInterlace169AR = 101, //!< YCbCr ITU-R 601-5 625-line, 2:1 interlace, 16:9 aspect ratio
k1050LineInterlace169AR = 150, //!< YCbCr 1050-line, 2:1 interlace, 16:9 aspect ratio
k1125LineInterlace169AR_274 = 151, //!< YCbCr 1125-line, 2:1 interlace, 16:9 aspect ratio (SMPTE 274M)
k1250LineInterlace169AR = 152, //!< YCbCr 1250-line, 2:1 interlace, 16:9 aspect ratio
k1125LineInterlace169AR_240 = 153, //!< YCbCr 1125-line, 2:1 interlace, 16:9 aspect ratio (SMPTE 240M)
k525LineProgressive169AR = 200, //!< YCbCr 525-line, 1:1 progressive, 16:9 aspect ratio
k625LineProgressive169AR = 201, //!< YCbCr 625-line, 1:1 progressive, 16:9 aspect ratio
k750LineProgressive169AR = 202, //!< YCbCr 750-line, 1:1 progressive, 16:9 aspect ratio (SMPTE 296M)
k1125LineProgressive169AR = 203 //!< YCbCr 1125-line, 1:1 progressive, 16:9 aspect ratio (SMPTE 274M)
};
/*!
* \enum Packing
* \brief Component data packing method
*/
enum Packing
{
kPacked = 0, //!< Packed into 32-bit words
kFilledMethodA = 1, //!< Filled to 32-bit words, method A
kFilledMethodB = 2 //!< Filled to 32-bit words, method B
};
/*!
* \enum Encoding
* \brief Component data encoding method
*/
enum Encoding
{
kNone = 0, //<! No encoding
kRLE = 1 //<! Run length encoding
};
/*!
* \struct ImageElement
* \brief Data Structure for Image Element
*/
struct ImageElement
{
U32 dataSign; //!< Data sign (0 = unsigned, 1 = signed)
U32 lowData; //!< Reference low data code value
R32 lowQuantity; //!< Reference low quantity represented
U32 highData; //!< Reference high data code value
R32 highQuantity; //!< Reference high quantity represented
U8 descriptor; //!< Descriptor \see Descriptor
U8 transfer; //!< Transfer characteristic \see Characteristic
U8 colorimetric; //!< Colorimetric Specification \see Characteristic
U8 bitDepth; //!< Bit depth, valid values are 8,10,12,16,32,64
U16 packing; //!< Packing \see Packing
U16 encoding; //!< Encoding \see Encoding
U32 dataOffset; //!< Offset to data
U32 endOfLinePadding; //!< End-of-Line Padding
U32 endOfImagePadding; //!< End-of-Image Padding
ASCII description[32]; //!< Description of Image Element
/*!
* \brief Constructor
*/
ImageElement();
};
/*!
* \struct GenericHeader
* \brief Generic File and Image Header Information
*/
struct GenericHeader
{
/*!
* \name File Information Members
*/
//@{
U32 magicNumber; //!< Indicates start of DPX image file and is used to determine byte order.
U32 imageOffset; //!< Offset to image data (in bytes)
ASCII version[8]; //!< Version number of header format
U32 fileSize; //!< Total file size (in bytes)
U32 dittoKey; //!< Ditto Key (0 = same as previous frame, 1 = new)
U32 genericSize; //!< Generic Header length (in bytes)
U32 industrySize; //!< Industry Header length (in bytes)
U32 userSize; //!< User defined header length (in bytes)
ASCII fileName[100]; //!< File name
ASCII creationTimeDate[24]; //!< Create date time /see DateTimeFormat
ASCII creator[100]; //!< Creator
ASCII project[200]; //!< Project name
ASCII copyright[200]; //!< Copyright statement
U32 encryptKey; //!< Encryption Key (0xffffffff if unencrypted)
ASCII reserved1[104]; //!< Reserved
/* end of group */
//@}
/*!
* \name Image Information Members
*/
//@{
U16 imageOrientation; //!< Image orientation \see Orientation
U16 numberOfElements; //!< Number of elements (1-8)
U32 pixelsPerLine; //!< Pixels per line
U32 linesPerElement; //!< Lines per element
ImageElement chan[MAX_ELEMENTS]; //!< Image element data structures
ASCII reserved2[52]; //!< Reserved
/* end of group */
//@}
/*!
* \name Image Origination Members
*/
//@{
U32 xOffset; //!< X offset
U32 yOffset; //!< Y offset
R32 xCenter; //!< X center
R32 yCenter; //!< Y center
U32 xOriginalSize; //!< X original size
U32 yOriginalSize; //!< Y original size
ASCII sourceImageFileName[100]; //!< Source image file name
ASCII sourceTimeDate[24]; //!< Source date and time /see DateTimeFormat
ASCII inputDevice[32]; //!< Input device name
ASCII inputDeviceSerialNumber[32]; //!< Input device serial number
U16 border[4]; //!< Border validity
U32 aspectRatio[2]; //!< Pixel aspect ratio (horizontal:vertical)
R32 xScannedSize; //!< X scanned size
R32 yScannedSize; //!< Y scanned size
ASCII reserved3[20]; //!< Reserved
/* end of group */
//@}
/*!
* \brief Constructor
*/
GenericHeader();
/*!
* \brief Reset class to initial state
*/
void Reset();
/*!
* \name File Information Methods
*/
//@{
/*!
* \brief Get magic number, used for byte ordering identification
* \return magic number
*/
inline U32 MagicNumber() const;
/*!
* \brief Get the offset in bytes to the start of the first image element
* \return offset
*/
inline U32 ImageOffset() const;
/*!
* \brief Set the offset in bytes to the start of the first image element
* \param offset offset in bytes
*/
inline void SetImageOffset(const U32 offset);
/*!
* \brief Get current version string of header
* \param v buffer to place string, needs to be at least 8+1 bytes long
*/
inline void Version(char *v) const;
/*!
* \brief Set the version string
* \param v version string
*/
inline void SetVersion(const char *v);
/*!
* \brief Get the size of the entire file
* \return file size in bytes
*/
inline U32 FileSize() const;
/*!
* \brief Set the size of the entire file
* \param fs file size in bytes
*/
inline void SetFileSize(const U32 fs);
/*!
* \brief Get the ditto key
* \return ditto key
*/
inline U32 DittoKey() const;
/*!
* \brief Set the ditto key
* \param key ditto key
*/
inline void SetDittoKey(const U32 key);
/*!
* \brief Get the size of the generic section within the header
* \return generic header size in bytes
*/
inline U32 GenericSize() const;
/*!
* \brief Get the size of the industry section within the header
* \return industry header size in bytes
*/
inline U32 IndustrySize() const;
/*!
* \brief Get the size of the user data
* \return user data size in bytes
*/
inline U32 UserSize() const;
/*!
* \brief Set the size of the user data
* \param size user data size in bytes
*/
inline void SetUserSize(const U32 size);
/*!
* \brief Get the file name
* \param fn buffer to store filename (100+1 chars)
*/
inline void FileName(char *fn) const;
/*!
* \brief Set the file name
* \param fn buffer with filename
*/
inline void SetFileName(const char *fn);
/*!
* \brief Get the creation time/date
* \param ct buffer to store creation time/date (24+1 chars)
*/
inline void CreationTimeDate(char *ct) const;
/*!
* \brief Set the creation time/date
* \param ct buffer with creation time/date
*/
inline void SetCreationTimeDate(const char *ct);
/*!
* \brief Set the creation time/date
* \param secs number of seconds since January 1, 1970 00:00
*/
void SetCreationTimeDate(const long secs);
/*!
* \brief Get the creator
* \param creat buffer to store creator (100+1 chars)
*/
inline void Creator(char *creat) const;
/*!
* \brief Set the creator
* \param creat buffer with creator
*/
inline void SetCreator(const char *creat);
/*!
* \brief Get the project
* \param prj buffer to store project (200+1 chars)
*/
inline void Project(char *prj) const;
/*!
* \brief Set the project
* \param prj buffer with project
*/
inline void SetProject(const char *prj);
/*!
* \brief Get the copyright information
* \param copy buffer to store copyright string (200+1 chars)
*/
inline void Copyright(char *copy) const;
/*!
* \brief Set the copyright information
* \param copy buffer with copyright string
*/
inline void SetCopyright(const char *copy);
/*!
* \brief Get the encryption key (no encryption is 0xffffffff)
* \return encryption key
*/
inline U32 EncryptKey() const;
/*!
* \brief Set the encryption key (no encryption is 0xffffffff)
* \param key encryption key
*/
inline void SetEncryptKey(const U32 key);
/* end of group */
//@}
/*!
* \name Image Information Methods
*/
//@{
/*!
* \brief Get the image orientation
* \return orientation enum
*/
inline Orientation ImageOrientation() const;
/*!
* \brief Set the image orientation
* \param orient orientation
*/
inline void SetImageOrientation(const Orientation orient);
/*!
* \brief Get the number of elements
* \return element count
*/
inline U16 NumberOfElements() const;
/*!
* \brief Set the number of elements
* \param num element count
*/
inline void SetNumberOfElements(const U16 num);
/*!
* \brief Get the pixels per line
* \return pixel count
*/
inline U32 PixelsPerLine() const;
/*!
* \brief Set the pixels per line
* \param ppl pixel count
*/
inline void SetPixelsPerLine(const U32 ppl);
/*!
* \brief Get the lines per element
* \return lines count
*/
inline U32 LinesPerElement() const;
/*!
* \brief Set the lines per element
* \param lpe lines count
*/
inline void SetLinesPerElement(const U32 lpe);
/*!
* \brief Get the data sign (0 = unsigned, 1 = signed)
* \param i element index (0-7)
* \return data sign
*/
inline U32 DataSign(const int i) const;
/*!
* \brief Set the data sign (0 = unsigned, 1 = signed)
* \param i element index (0-7)
* \param sign data sign
*/
inline void SetDataSign(const int i, const U32 sign);
/*!
* \brief Get the minimum data value
* \param i element index (0-7)
* \return minimum value
*/
inline U32 LowData(const int i) const;
/*!
* \brief Set the minimum data value
* \param i element index (0-7)
* \param data minimum value
*/
inline void SetLowData(const int i, const U32 data);
/*!
* \brief Get the quantity of minimum data value
* \param i element index (0-7)
* \return quantity
*/
inline R32 LowQuantity(const int i) const;
/*!
* \brief Set the quantity of minimum data value
* \param i element index (0-7)
* \param quant quantity
*/
inline void SetLowQuantity(const int i, const R32 quant);
/*!
* \brief Get the maximum data value
* \param i element index (0-7)
* \return maximum value
*/
inline U32 HighData(const int i) const;
/*!
* \brief Set the maximum data value
* \param i element index (0-7)
* \param data maximum value
*/
inline void SetHighData(const int i, const U32 data);
/*!
* \brief Get the quantity of maximum data value
* \param i element index (0-7)
* \return quantity
*/
inline R32 HighQuantity(const int i) const;
/*!
* \brief Set the quantity of maximum data value
* \param i element index (0-7)
* \param quant quantity
*/
inline void SetHighQuantity(const int i, const R32 quant);
/*!
* \brief Get the component defintion
* \param i element index (0-7)
* \return component descriptor
*/
inline Descriptor ImageDescriptor(const int i) const;
/*!
* \brief Set the component defintion
* \param i element index (0-7)
* \param desc component descriptor
*/
inline void SetImageDescriptor(const int i, const Descriptor desc);
/*!
* \brief Get the amplitude transfer function
* \param i element index (0-7)
* \return transfer characteristic
*/
inline Characteristic Transfer(const int i) const;
/*!
* \brief Set the amplitude transfer function
* \param i element index (0-7)
* \param ch transfer characteristic
*/
inline void SetTransfer(const int i, const Characteristic ch);
/*!
* \brief Get the color reference
* \param i element index (0-7)
* \return colorimetric specification
*/
inline Characteristic Colorimetric(const int i) const;
/*!
* \brief Set the color reference
* \param i element index (0-7)
* \param c colorimetric specification
*/
inline void SetColorimetric(const int i, const Characteristic c);
/*!
* \brief Get the bit size of each component
* \param i element index (0-7)
* \return bit size
*/
inline U8 BitDepth(const int i) const;
/*!
* \brief Set the bit size of each component
* \param i element index (0-7)
* \param depth bit size
*/
inline void SetBitDepth(const int i, const U8 depth);
/*!
* \brief Get the data packing mode
* \param i element index (0-7)
* \return packing method
*/
inline Packing ImagePacking(const int i) const;
/*!
* \brief Set the data packing mode
* \param i element index (0-7)
* \param pack packing method
*/
inline void SetImagePacking(const int i, const Packing pack);
/*!
* \brief Get the encoding method
* \param i element index (0-7)
* \return encoding method
*/
inline Encoding ImageEncoding(const int i) const;
/*!
* \brief Set the encoding method
* \param i element index (0-7)
* \param enc encoding method
*/
inline void SetImageEncoding(const int i, const Encoding enc);
/*!
* \brief Get the offset to element
* \param i element index (0-7)
* \return offset in bytes from the start of the file
*/
inline U32 DataOffset(const int i) const;
/*!
* \brief Set the offset to element
* \param i element index (0-7)
* \param offset offset in bytes from the start of the file
*/
inline void SetDataOffset(const int i, const U32 offset);
/*!
* \brief Get the number of bytes padding the end of each line
* \param i element index (0-7)
* \return count
*/
inline U32 EndOfLinePadding(const int i) const;
/*!
* \brief Set the number of bytes padding the end of each line
* \param i element index (0-7)
* \param eolp count
*/
inline void SetEndOfLinePadding(const int i, const U32 eolp);
/*!
* \brief Get the number of bytes padding the end of the image element
* \param i element index (0-7)
* \return count
*/
inline U32 EndOfImagePadding(const int i) const;
/*!
* \brief Set the number of bytes padding the end of the image element
* \param i element index (0-7)
* \param eoip count
*/
inline void SetEndOfImagePadding(const int i, const U32 eoip);
/*!
* \brief Get the element description
* \param i element index (0-7)
* \param desc buffer to write description string (32+1 chars)
*/
inline void Description(const int i, char *desc) const;
/*!
* \brief Set the element description
* \param i element index (0-7)
* \param desc buffer
*/
inline void SetDescription(const int i, const char *desc);
/* end of group */
//@}
/*!
* \name Image Origination Methods
*/
//@{
/*!
* \brief Get the line offset (in pixels) from the first pixel in original image
* \return offset count
*/
inline U32 XOffset() const;
/*!
* \brief Set the line offset (in pixels) from the first pixel in original image
* \param offset offset count
*/
inline void SetXOffset(const U32 offset);
/*!
* \brief Get the frame offset (in lines) from the first line in original image
* \return offset count
*/
inline U32 YOffset() const;
/*!
* \brief Set the frame offset (in lines) from the first line in original image
* \param offset offset count
*/
inline void SetYOffset(const U32 offset);
/*!
* \brief Get the X image center in pixels
* \return pixel position
*/
inline R32 XCenter() const;
/*!
* \brief Set the X image center in pixels
* \param center pixel position
*/
inline void SetXCenter(const R32 center);
/*!
* \brief Get the Y image center in pixels
* \return pixel position
*/
inline R32 YCenter() const;
/*!
* \brief Set the Y image center in pixels
* \param center pixel position
*/
inline void SetYCenter(const R32 center);
/*!
* \brief Get the number of pixels per line in the original image
* \return size
*/
inline U32 XOriginalSize() const;
/*!
* \brief GSt the number of pixels per line in the original image
* \param size size
*/
inline void SetXOriginalSize(const U32 size);
/*!
* \brief Get the number of lines per image in the original image
* \return size
*/
inline U32 YOriginalSize() const;
/*!
* \brief Set the number of lines per image in the original image
* \param size size
*/
inline void SetYOriginalSize(const U32 size);
/*!
* \brief Get the source image file name that this image was extracted
* \param fn buffer to write source file name (100+1)
*/
inline void SourceImageFileName(char *fn) const;
/*!
* \brief Set the source image file name that this image was extracted
* \param fn buffer with source file name
*/
inline void SetSourceImageFileName(const char *fn);
/*!
* \brief Get the source image time and date that this image was extracted
* \param td buffer to write time/date string (24+1)
*/
inline void SourceTimeDate(char *td) const;
/*!
* \brief Set the source image time and date that this image was extracted
* \param td buffer with time/date string
*/
inline void SetSourceTimeDate(const char *td);
/*!
* \brief Set the source image time and date that this image was extracted
* \param secs number of seconds since January 1, 1970 00:00
*/
void SetSourceTimeDate(const long secs);
/*!
* \brief Get the input device name
* \param dev buffer to write device (32+1)
*/
inline void InputDevice(char *dev) const;
/*!
* \brief Set the input device name
* \param dev buffer with device name
*/
inline void SetInputDevice(const char *dev);
/*!
* \brief Get the input device serial number
* \param sn buffer to write device serial number (32+1)
*/
inline void InputDeviceSerialNumber(char *sn) const;
/*!
* \brief Set the input device serial number
* \param sn buffer with device serial number
*/
inline void SetInputDeviceSerialNumber(const char *sn);
/*!
* \brief Get the pixel offset for the border region
*
* There are 4 border pixel offsets that define a region -- X-left, X-right, Y-top, Y-bottom
*
* \param i border index (0-3)
* \return offset in pixels
*/
inline U16 Border(const int i) const;
/*!
* \brief Set the pixel offset for the border region
*
* There are 4 border pixel offsets that define a region -- X-left, X-right, Y-top, Y-bottom
*
* \param i border index (0-3)
* \param bord offset in pixels
*/
inline void SetBorder(const int i, const U16 bord);
/*!
* \brief Get the pixel aspect ratio (horizontal:vertical)
* \param i aspect ratio index (0-1)
* \return ratio quantity
*/
inline U32 AspectRatio(const int i) const;
/*!
* \brief Set the pixel aspect ratio (horizontal:vertical)
* \param i aspect ratio index (0-1)
* \param ar ratio quantity
*/
inline void SetAspectRatio(const int i, const U32 ar);
/*!
* \brief Get the horizontal size of the original scanned optical image
* \return size in millimeters
*/
inline R32 XScannedSize() const;
/*!
* \brief Set the horizontal size of the original scanned optical image
* \param size size in millimeters
*/
inline void SetXScannedSize(const R32 size);
/*!
* \brief Get the vertical size of the original scanned optical image
* \return size in millimeters
*/
inline R32 YScannedSize() const;
/*!
* \brief Set the vertical size of the original scanned optical image
* \param size size in millimeters
*/
inline void SetYScannedSize(const R32 size);
/* end of group */
//@}
/*!
* \brief Number of Active Elements in the Image
* \return element count
*/
int ImageElementCount() const;
/*!
* \brief Set member numberOfElements based on channel structure
*/
void CalculateNumberOfElements();
/*!