~ubuntu-branches/ubuntu/vivid/rawstudio/vivid

« back to all changes in this revision

Viewing changes to plugins/load-rawspeed/rawspeed/NikonDecompressor.h

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2011-07-28 17:36:32 UTC
  • mfrom: (2.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110728173632-5czluz9ye3c83zc5
Tags: 2.0-1
* [3750b2cf] Merge commit 'upstream/2.0'
* [63637468] Removing Patch, not necessary anymore.
* [2fb580dc] Add new build-dependencies.
* [c57d953b] Run dh_autoreconf due to patches in configure.in
* [13febe39] Add patch to remove the libssl requirement.
* [5ae773fe] Replace libjpeg62-dev by libjpeg8-dev :)
* [1969d755] Don't build static libraries.
* [7cfe0a2e] Add a patch to fix the plugin directory path.
  As plugins are shared libraries, they need to go into /usr/lib,
  not into /usr/share.
  Thanks to Andrew McMillan
* [c1d0d9dd] Don't install .la files for all plugins and libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef NIKON_DECOMPRESSOR_H
 
2
#define NIKON_DECOMPRESSOR_H
 
3
 
 
4
#include "LJpegDecompressor.h"
 
5
#include "BitPumpMSB.h"
 
6
/* 
 
7
    RawSpeed - RAW file decoder.
 
8
 
 
9
    Copyright (C) 2009 Klaus Post
 
10
 
 
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.
 
15
 
 
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.
 
20
 
 
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
 
24
 
 
25
    http://www.klauspost.com
 
26
*/
 
27
 
 
28
namespace RawSpeed {
 
29
 
 
30
class NikonDecompressor :
 
31
  public LJpegDecompressor
 
32
{
 
33
public:
 
34
  NikonDecompressor(FileMap* file, RawImage img );
 
35
public:
 
36
  virtual ~NikonDecompressor(void);
 
37
  void DecompressNikon(ByteStream *meta, uint32 w, uint32 h, uint32 bitsPS, uint32 offset, uint32 size);
 
38
private:
 
39
  void initTable(uint32 huffSelect);
 
40
  int HuffDecodeNikon();
 
41
  uint32 curve[0xffff];
 
42
  BitPumpMSB *bits;
 
43
};
 
44
 
 
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 } };
 
58
  
 
59
} // namespace RawSpeed
 
60
 
 
61
#endif