RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
AbstractTiffDecoder.h
Go to the documentation of this file.
1/*
2 RawSpeed - RAW file decoder.
3
4 Copyright (C) 2017 Axel Waggershauser
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 "decoders/RawDecoder.h"
24#include "io/Buffer.h"
25#include "tiff/TiffIFD.h"
26#include "tiff/TiffTag.h"
27#include <memory>
28#include <string>
29#include <utility>
30
31namespace rawspeed {
32
33class Buffer;
34class CameraMetaData;
35
37 virtual void anchor() const;
38
39protected:
41
42public:
44 : RawDecoder(file), mRootIFD(std::move(root)) {}
45
46 TiffIFD* getRootIFD() final { return mRootIFD.get(); }
47
48 bool checkCameraSupported(const CameraMetaData* meta, const TiffID& id,
49 const std::string& mode) {
50 return RawDecoder::checkCameraSupported(meta, id.make, id.model, mode);
51 }
52
54
55 void setMetaData(const CameraMetaData* meta, const TiffID& id,
56 const std::string& mode, int iso_speed) {
57 setMetaData(meta, id.make, id.model, mode, iso_speed);
58 }
59
60 void setMetaData(const CameraMetaData* meta, const std::string& mode,
61 int iso_speed) {
62 setMetaData(meta, mRootIFD->getID(), mode, iso_speed);
63 }
64
65 void checkSupportInternal(const CameraMetaData* meta) override {
66 checkCameraSupported(meta, mRootIFD->getID(), "");
67 }
68
69 [[nodiscard]] const TiffIFD*
71};
72
73} // namespace rawspeed
void checkSupportInternal(const CameraMetaData *meta) override
void setMetaData(const CameraMetaData *meta, const std::string &mode, int iso_speed)
bool checkCameraSupported(const CameraMetaData *meta, const TiffID &id, const std::string &mode)
void setMetaData(const CameraMetaData *meta, const TiffID &id, const std::string &mode, int iso_speed)
const TiffIFD * getIFDWithLargestImage(TiffTag filter=TiffTag::IMAGEWIDTH) const
AbstractTiffDecoder(TiffRootIFDOwner &&root, Buffer file)
virtual void setMetaData(const CameraMetaData *meta, const std::string &make, const std::string &model, const std::string &mode, int iso_speed=0)
RawDecoder(Buffer file)
bool checkCameraSupported(const CameraMetaData *meta, const std::string &make, const std::string &model, const std::string &mode)
std::unique_ptr< TiffRootIFD > TiffRootIFDOwner
Definition TiffIFD.h:46