1
/*
2
    RawSpeed - RAW file decoder.
3

4
    Copyright (C) 2017 Roman Lebedev
5

6
    This library is free software; you can redistribute it and/or
7
    modify it under the terms of the GNU Lesser General Public
8
    License as published by the Free Software Foundation; either
9
    version 2 of the License, or (at your option) any later version.
10

11
    This library is distributed in the hope that it will be useful,
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
    Lesser General Public License for more details.
15

16
    You should have received a copy of the GNU Lesser General Public
17
    License along with this library; if not, write to the Free Software
18
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20

21
#pragma once
22

23
#include "rawspeedconfig.h"
24

25
#ifdef HAVE_JPEG
26

27
#include "common/RawImage.h"                    // for RawImage
28
#include "decompressors/AbstractDecompressor.h" // for AbstractDecompressor
29
#include "io/ByteStream.h"                      // for ByteStream
30
#include "io/Endianness.h"                      // for Endianness, Endianne...
31
#include <cstdint>                              // for uint32_t
32
#include <utility>                              // for move
33

34
namespace rawspeed {
35

36
class JpegDecompressor final : public AbstractDecompressor {
37
  struct JpegDecompressStruct;
38
  ByteStream input;
39
  RawImage mRaw;
40

41
public:
42 0
  JpegDecompressor(ByteStream bs, const RawImage& img)
43 0
      : input(std::move(bs)), mRaw(img) {
44 0
    input.setByteOrder(Endianness::big);
45
  }
46

47
  void decode(uint32_t offsetX, uint32_t offsetY);
48
};
49

50
} // namespace rawspeed
51

52
#else
53

54
#pragma message                                                                \
55
    "JPEG is not present! Lossy JPEG compression will not be supported!"
56

57
#endif

Read our documentation on viewing source code .

Loading