~ubuntu-branches/ubuntu/natty/digikam/natty

« back to all changes in this revision

Viewing changes to libs/3rdparty/libpgf/PGFtypes.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-07-26 22:11:35 UTC
  • mfrom: (1.2.22 upstream) (3.2.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090726221135-890tb3z3dqr2lkr6
Tags: 2:1.0.0~beta3-1ubuntu1
* Merge with debian unstable, remaining changes:
  - Export .pot name and copy to plugins in debian/rules
  - Remove liblqr-1-0-dev from build-deps, not in main

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
// Version 3:   INT32 instead of INT16, allows 31 bit per pixel and channel
39
39
// Version 5:   ROI, new block-reordering scheme
40
40
//-------------------------------------------------------------------------------
41
 
#define PGFCodecVersion         "5.08.22"                       // Major number
 
41
#define PGFCodecVersion         "6.09.24"                       // Major number
42
42
                                                                                                // Minor number: Year (2) Week (2)
43
43
 
44
44
//-------------------------------------------------------------------------------
59
59
#define PGF32                           0                                       // 16 bit values are used -> allows at maximum 15 bits
60
60
#endif
61
61
#define PGFROI                          8                                       // supports Regions Of Interest
62
 
#define Version5                        16                                      // coding scheme of major version 5
 
62
#define Version5                        16                                      // new coding scheme since major version 5
 
63
#define Version6                        32                                      // new HeaderSize: 32 bits instead of 16 bits 
63
64
// version numbers
64
 
#define PGFVersion                      (Version2 | Version5 | PGF32)   // current standard version
 
65
#define PGFVersion                      (Version2 | Version5 | Version6 | PGF32)        // current standard version
65
66
 
66
67
//-------------------------------------------------------------------------------
67
68
//      Coder constants
84
85
enum Orientation { LL=0, HL=1, LH=2, HH=3 };
85
86
 
86
87
// general file structure
87
 
// PGFPreHeader PGFHeader PGFPostHeader LevelLengths Level_n-1 Level_n-2 ... Level_0
 
88
// PGFPreHeaderV6 PGFHeader PGFPostHeader LevelLengths Level_n-1 Level_n-2 ... Level_0
88
89
// PGFPostHeader ::= [ColorTable] [UserData]
89
90
// LevelLengths  ::= UINT32[nLevels]
90
91
 
91
92
#pragma pack(1)
92
 
struct PGFPreHeader {
 
93
struct PGFMagicVersion {
93
94
        char magic[3];                          // PGF identification = "PGF"
94
95
        UINT8 version;                          // PGF version
95
 
        UINT16 hSize;                           // total size of PGFHeader, [ColorTable], and [UserData] in bytes
96
 
        // total: 6 Bytes
 
96
        // total: 4 Bytes
 
97
};
 
98
 
 
99
struct PGFPreHeader : PGFMagicVersion {
 
100
        UINT32 hSize;                           // total size of PGFHeader, [ColorTable], and [UserData] in bytes
 
101
        // total: 8 Bytes
97
102
};
98
103
 
99
104
struct PGFHeader {
111
116
struct PGFPostHeader {
112
117
        RGBQUAD clut[ColorTableLen];// color table for indexed color images
113
118
        UINT8 *userData;                        // user data of size userDataLen
114
 
        UINT16 userDataLen;                     // user data size in bytes
115
 
        // total: at least 258 Bytes
 
119
        UINT32 userDataLen;                     // user data size in bytes
116
120
};
117
121
 
118
122
union ROIBlockHeader {
119
123
        ROIBlockHeader(UINT16 v) { val = v; }
120
 
        ROIBlockHeader(UINT32 size, bool end)
121
 
        { 
122
 
            ASSERT(size < (1 << RLblockSizeLen));
123
 
            bufferSize = size; 
124
 
            tileEnd = end;
125
 
        }
 
124
        ROIBlockHeader(UINT32 size, bool end)   { ASSERT(size < (1 << RLblockSizeLen)); bufferSize = size; tileEnd = end; }
126
125
 
127
126
        UINT16 val;
128
127
        struct {
163
162
//-------------------------------------------------------------------------------
164
163
// Image constants
165
164
//-------------------------------------------------------------------------------
 
165
#define MagicVersionSize        sizeof(PGFMagicVersion)
166
166
#define PreHeaderSize           sizeof(PGFPreHeader)
167
167
#define HeaderSize                      sizeof(PGFHeader)
168
168
#define ColorTableSize          ColorTableLen*sizeof(RGBQUAD)