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