2
#include "LJpegDecompressor.h"
3
#include "BitPumpMSB.h"
5
RawSpeed - RAW file decoder.
7
Copyright (C) 2009 Klaus Post
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Lesser General Public
11
License as published by the Free Software Foundation; either
12
version 2 of the License, or (at your option) any later version.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
http://www.klauspost.com
28
class NikonDecompressor :
29
public LJpegDecompressor
32
NikonDecompressor(FileMap* file, RawImage img );
34
virtual ~NikonDecompressor(void);
35
void DecompressNikon(ByteStream *meta, uint32 w, uint32 h, uint32 bitsPS, uint32 offset, uint32 size);
37
void initTable(uint32 huffSelect);
38
int HuffDecodeNikon();
43
static const uchar8 nikon_tree[][32] = {
44
{ 0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0, /* 12-bit lossy */
45
5,4,3,6,2,7,1,0,8,9,11,10,12 },
46
{ 0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0, /* 12-bit lossy after split */
47
0x39,0x5a,0x38,0x27,0x16,5,4,3,2,1,0,11,12,12 },
48
{ 0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0, /* 12-bit lossless */
49
5,4,6,3,7,2,8,1,9,0,10,11,12 },
50
{ 0,1,4,3,1,1,1,1,1,2,0,0,0,0,0,0, /* 14-bit lossy */
51
5,6,4,7,8,3,9,2,1,0,10,11,12,13,14 },
52
{ 0,1,5,1,1,1,1,1,1,1,2,0,0,0,0,0, /* 14-bit lossy after split */
53
8,0x5c,0x4b,0x3a,0x29,7,6,5,4,3,2,1,0,13,14 },
54
{ 0,1,4,2,2,3,1,2,0,0,0,0,0,0,0,0, /* 14-bit lossless */
55
7,6,8,5,9,4,10,3,11,12,2,0,1,13,14 } };
57
} // namespace RawSpeed