RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
Cr2sRawInterpolator.h
Go to the documentation of this file.
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 "adt/Array2DRef.h"
25#include <array>
26#include <cstdint>
27
28namespace rawspeed {
29
30class RawImage;
31
33 const RawImage& mRaw;
34
36 std::array<int, 3> sraw_coeffs;
37 int hue;
38
39 struct YCbCr;
40
41public:
43 std::array<int, 3> sraw_coeffs_, int hue_)
44 : mRaw(mRaw_), input(input_), sraw_coeffs(sraw_coeffs_), hue(hue_) {}
45
46 void interpolate(int version);
47
48private:
49 template <int version>
50 inline void YUV_TO_RGB(const YCbCr& p, CroppedArray1DRef<uint16_t> out);
51
52 static inline void STORE_RGB(CroppedArray1DRef<uint16_t> out, int r, int g,
53 int b);
54
55 template <int version> void interpolate_422_row(int row);
56 template <int version> void interpolate_422();
57
58 template <int version> void interpolate_420_row(int row);
59 template <int version> void interpolate_420();
60};
61
62} // namespace rawspeed
Cr2sRawInterpolator(const RawImage &mRaw_, Array2DRef< const uint16_t > input_, std::array< int, 3 > sraw_coeffs_, int hue_)
static void STORE_RGB(CroppedArray1DRef< uint16_t > out, int r, int g, int b)
const Array2DRef< const uint16_t > input
void YUV_TO_RGB(const YCbCr &p, CroppedArray1DRef< uint16_t > out)
Cr2sRawInterpolator(const RawImage &mRaw_, Array2DRef< const uint16_t > input_, std::array< int, 3 > sraw_coeffs_, int hue_)