RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
IiqDecoder.h
Go to the documentation of this file.
1/*
2 RawSpeed - RAW file decoder.
3
4 Copyright (C) 2009-2014 Klaus Post
5 Copyright (C) 2014 Pedro CĂ´rte-Real
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20*/
21
22#pragma once
23
24#include "common/RawImage.h"
26#include "io/Buffer.h"
27#include "tiff/TiffIFD.h"
28#include <cstdint>
29#include <utility>
30#include <vector>
31
32namespace rawspeed {
33
34class Buffer;
35class ByteStream;
36class CameraMetaData;
37struct PhaseOneStrip;
38
39class IiqDecoder final : public AbstractTiffDecoder {
40 struct IiqOffset final {
43
44 IiqOffset() = default;
45 IiqOffset(uint32_t block, uint32_t offset_) : n(block), offset(offset_) {}
46 };
47
48 static std::vector<PhaseOneStrip>
49 computeSripes(Buffer raw_data, std::vector<IiqOffset> offsets,
50 uint32_t height);
51
52public:
53 static bool isAppropriateDecoder(Buffer file);
54 static bool isAppropriateDecoder(const TiffRootIFD* rootIFD, Buffer file);
55
57 : AbstractTiffDecoder(std::move(rootIFD), file) {}
58
59 RawImage decodeRawInternal() override;
60 void checkSupportInternal(const CameraMetaData* meta) override;
61 void decodeMetaDataInternal(const CameraMetaData* meta) override;
62
63private:
64 [[nodiscard]] int getDecoderVersion() const override { return 0; }
66 void CorrectPhaseOneC(ByteStream meta_data, uint32_t split_row,
67 uint32_t split_col) const;
69 uint32_t split_col) const;
70 enum class IiqCorr : uint8_t;
71 void PhaseOneFlatField(ByteStream data, IiqCorr corr) const;
72 void correctSensorDefects(ByteStream data) const;
73 void correctBadColumn(uint16_t col) const;
74 void handleBadPixel(uint16_t col, uint16_t row) const;
75};
76
77} // namespace rawspeed
AbstractTiffDecoder(TiffRootIFDOwner &&root, Buffer file)
RawImage decodeRawInternal() override
void handleBadPixel(uint16_t col, uint16_t row) const
void decodeMetaDataInternal(const CameraMetaData *meta) override
static bool isAppropriateDecoder(Buffer file)
void checkSupportInternal(const CameraMetaData *meta) override
static std::vector< PhaseOneStrip > computeSripes(Buffer raw_data, std::vector< IiqOffset > offsets, uint32_t height)
void correctSensorDefects(ByteStream data) const
void PhaseOneFlatField(ByteStream data, IiqCorr corr) const
void CorrectQuadrantMultipliersCombined(ByteStream data, uint32_t split_row, uint32_t split_col) const
IiqDecoder(TiffRootIFDOwner &&rootIFD, Buffer file)
Definition IiqDecoder.h:56
int getDecoderVersion() const override
Definition IiqDecoder.h:64
void correctBadColumn(uint16_t col) const
void CorrectPhaseOneC(ByteStream meta_data, uint32_t split_row, uint32_t split_col) const
std::unique_ptr< TiffRootIFD > TiffRootIFDOwner
Definition TiffIFD.h:46
IiqOffset(uint32_t block, uint32_t offset_)
Definition IiqDecoder.h:45