~ubuntu-branches/ubuntu/saucy/darktable/saucy

« back to all changes in this revision

Viewing changes to src/rawspeed/RawSpeed/Rw2Decoder.h

  • Committer: Bazaar Package Importer
  • Author(s): David Bremner
  • Date: 2011-04-14 23:42:12 UTC
  • Revision ID: james.westby@ubuntu.com-20110414234212-kuffcz5wiu18v6ra
Tags: upstream-0.8
ImportĀ upstreamĀ versionĀ 0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma once
 
2
#include "RawDecoder.h"
 
3
#include "TiffIFD.h"
 
4
#include "BitPumpPlain.h"
 
5
#include "TiffParser.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 PanaBitpump {
 
31
  public:
 
32
  PanaBitpump(ByteStream* input);
 
33
  virtual ~PanaBitpump();
 
34
  ByteStream* input;
 
35
  uchar8 buf[0x4000];
 
36
  int vbits;
 
37
  uint32 load_flags;
 
38
  uint32 getBits(int nbits);
 
39
  void skipBytes(int bytes);
 
40
};
 
41
 
 
42
class Rw2Decoder :
 
43
  public RawDecoder
 
44
{
 
45
public:
 
46
  Rw2Decoder(TiffIFD *rootIFD, FileMap* file);
 
47
  virtual ~Rw2Decoder(void);
 
48
  RawImage decodeRaw();
 
49
  virtual void decodeMetaData(CameraMetaData *meta);
 
50
  virtual void checkSupport(CameraMetaData *meta);
 
51
  TiffIFD *mRootIFD;
 
52
protected:
 
53
  virtual void decodeThreaded(RawDecoderThread* t);
 
54
private:
 
55
  string getMode(const string model);
 
56
  void DecodeRw2();
 
57
  bool almostEqualRelative(float A, float B, float maxRelativeError);
 
58
  ByteStream* input_start;
 
59
  uint32 load_flags;
 
60
};
 
61
 
 
62
} // namespace RawSpeed