|
18 | 18 | #include <iostream> |
19 | 19 |
|
20 | 20 | // JPEG-2000 box types |
21 | | -const uint32_t kJp2BoxTypeJp2Header = 0x6a703268; // 'jp2h' |
22 | | -const uint32_t kJp2BoxTypeImageHeader = 0x69686472; // 'ihdr' |
23 | | -const uint32_t kJp2BoxTypeColorHeader = 0x636f6c72; // 'colr' |
24 | | -const uint32_t kJp2BoxTypeUuid = 0x75756964; // 'uuid' |
25 | | -const uint32_t kJp2BoxTypeClose = 0x6a703263; // 'jp2c' |
| 21 | +static constexpr uint32_t kJp2BoxTypeJp2Header = 0x6a703268; // 'jp2h' |
| 22 | +static constexpr uint32_t kJp2BoxTypeImageHeader = 0x69686472; // 'ihdr' |
| 23 | +static constexpr uint32_t kJp2BoxTypeColorHeader = 0x636f6c72; // 'colr' |
| 24 | +static constexpr uint32_t kJp2BoxTypeUuid = 0x75756964; // 'uuid' |
| 25 | +static constexpr uint32_t kJp2BoxTypeClose = 0x6a703263; // 'jp2c' |
26 | 26 |
|
27 | 27 | // from openjpeg-2.1.2/src/lib/openjp2/jp2.h |
28 | 28 | /*#define JPIP_JPIP 0x6a706970*/ |
@@ -53,30 +53,31 @@ const uint32_t kJp2BoxTypeClose = 0x6a703263; // 'jp2c' |
53 | 53 | // |
54 | 54 | // See http://www.jpeg.org/public/wg1n2600.doc for information about embedding IPTC-NAA data in JPEG-2000 files |
55 | 55 | // See http://www.adobe.com/devnet/xmp/pdfs/xmp_specification.pdf for information about embedding XMP data in JPEG-2000 files |
56 | | -const unsigned char kJp2UuidExif[] = "JpgTiffExif->JP2"; |
57 | | -const unsigned char kJp2UuidIptc[] = "\x33\xc7\xa4\xd2\xb8\x1d\x47\x23\xa0\xba\xf1\xa3\xe0\x97\xad\x38"; |
58 | | -const unsigned char kJp2UuidXmp[] = "\xbe\x7a\xcf\xcb\x97\xa9\x42\xe8\x9c\x71\x99\x94\x91\xe3\xaf\xac"; |
| 56 | +static constexpr unsigned char kJp2UuidExif[] = "JpgTiffExif->JP2"; |
| 57 | +static constexpr unsigned char kJp2UuidIptc[] = "\x33\xc7\xa4\xd2\xb8\x1d\x47\x23\xa0\xba\xf1\xa3\xe0\x97\xad\x38"; |
| 58 | +static constexpr unsigned char kJp2UuidXmp[] = "\xbe\x7a\xcf\xcb\x97\xa9\x42\xe8\x9c\x71\x99\x94\x91\xe3\xaf\xac"; |
59 | 59 |
|
60 | 60 | // See section B.1.1 (JPEG 2000 Signature box) of JPEG-2000 specification |
61 | | -const unsigned char Jp2Signature[12] = { 0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a }; |
62 | | - |
63 | | -const unsigned char Jp2Blank[] = { 0x00,0x00,0x00,0x0c,0x6a,0x50,0x20,0x20,0x0d,0x0a,0x87,0x0a,0x00,0x00,0x00,0x14, |
64 | | - 0x66,0x74,0x79,0x70,0x6a,0x70,0x32,0x20,0x00,0x00,0x00,0x00,0x6a,0x70,0x32,0x20, |
65 | | - 0x00,0x00,0x00,0x2d,0x6a,0x70,0x32,0x68,0x00,0x00,0x00,0x16,0x69,0x68,0x64,0x72, |
66 | | - 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x07,0x07,0x00,0x00,0x00,0x00, |
67 | | - 0x00,0x0f,0x63,0x6f,0x6c,0x72,0x01,0x00,0x00,0x00,0x00,0x00,0x11,0x00,0x00,0x00, |
68 | | - 0x00,0x6a,0x70,0x32,0x63,0xff,0x4f,0xff,0x51,0x00,0x29,0x00,0x00,0x00,0x00,0x00, |
69 | | - 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
70 | | - 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07, |
71 | | - 0x01,0x01,0xff,0x64,0x00,0x23,0x00,0x01,0x43,0x72,0x65,0x61,0x74,0x6f,0x72,0x3a, |
72 | | - 0x20,0x4a,0x61,0x73,0x50,0x65,0x72,0x20,0x56,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20, |
73 | | - 0x31,0x2e,0x39,0x30,0x30,0x2e,0x31,0xff,0x52,0x00,0x0c,0x00,0x00,0x00,0x01,0x00, |
74 | | - 0x05,0x04,0x04,0x00,0x01,0xff,0x5c,0x00,0x13,0x40,0x40,0x48,0x48,0x50,0x48,0x48, |
75 | | - 0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0xff,0x90,0x00,0x0a,0x00,0x00, |
76 | | - 0x00,0x00,0x00,0x2d,0x00,0x01,0xff,0x5d,0x00,0x14,0x00,0x40,0x40,0x00,0x00,0x00, |
77 | | - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x93,0xcf,0xb4, |
78 | | - 0x04,0x00,0x80,0x80,0x80,0x80,0x80,0xff,0xd9 |
79 | | - }; |
| 61 | +static constexpr unsigned char Jp2Signature[] = { |
| 62 | + 0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a, |
| 63 | +}; |
| 64 | + |
| 65 | +static constexpr unsigned char Jp2Blank[] = { |
| 66 | + 0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a, 0x00, 0x00, 0x00, 0x14, 0x66, 0x74, |
| 67 | + 0x79, 0x70, 0x6a, 0x70, 0x32, 0x20, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x70, 0x32, 0x20, 0x00, 0x00, 0x00, 0x2d, |
| 68 | + 0x6a, 0x70, 0x32, 0x68, 0x00, 0x00, 0x00, 0x16, 0x69, 0x68, 0x64, 0x72, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, |
| 69 | + 0x00, 0x01, 0x00, 0x01, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x63, 0x6f, 0x6c, 0x72, 0x01, 0x00, |
| 70 | + 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x70, 0x32, 0x63, 0xff, 0x4f, 0xff, 0x51, 0x00, |
| 71 | + 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 72 | + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 73 | + 0x01, 0x07, 0x01, 0x01, 0xff, 0x64, 0x00, 0x23, 0x00, 0x01, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3a, |
| 74 | + 0x20, 0x4a, 0x61, 0x73, 0x50, 0x65, 0x72, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e, |
| 75 | + 0x39, 0x30, 0x30, 0x2e, 0x31, 0xff, 0x52, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x04, 0x04, 0x00, |
| 76 | + 0x01, 0xff, 0x5c, 0x00, 0x13, 0x40, 0x40, 0x48, 0x48, 0x50, 0x48, 0x48, 0x50, 0x48, 0x48, 0x50, 0x48, 0x48, |
| 77 | + 0x50, 0x48, 0x48, 0x50, 0xff, 0x90, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x01, 0xff, 0x5d, |
| 78 | + 0x00, 0x14, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 79 | + 0x00, 0x00, 0xff, 0x93, 0xcf, 0xb4, 0x04, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0xff, 0xd9, |
| 80 | +}; |
80 | 81 |
|
81 | 82 | //! @cond IGNORE |
82 | 83 | struct Jp2BoxHeader |
|
0 commit comments