"Fossies" - the Fresh Open Source Software Archive

Member "darktable-3.6.1/src/external/rawspeed/src/librawspeed/decoders/AbstractTiffDecoder.h" (9 Sep 2021, 2414 Bytes) of package /linux/misc/darktable-3.6.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "AbstractTiffDecoder.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.6.0_vs_3.6.1.

    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" // for RawDecoder
   24 #include "tiff/TiffIFD.h"        // for TiffID, TiffRootIFD, TiffRootIFDOwner
   25 #include "tiff/TiffTag.h"        // for IMAGEWIDTH, TiffTag
   26 #include <memory>                // for unique_ptr
   27 #include <string>                // for string
   28 #include <utility>               // for move
   29 
   30 namespace rawspeed {
   31 
   32 class CameraMetaData;
   33 
   34 class Buffer;
   35 
   36 class AbstractTiffDecoder : public RawDecoder
   37 {
   38 protected:
   39   TiffRootIFDOwner mRootIFD;
   40 public:
   41   AbstractTiffDecoder(TiffRootIFDOwner&& root, const Buffer& file)
   42       : RawDecoder(file), mRootIFD(std::move(root)) {}
   43 
   44   TiffIFD* getRootIFD() final { return mRootIFD.get(); }
   45 
   46   inline bool checkCameraSupported(const CameraMetaData* meta, const TiffID& id,
   47                                    const std::string& mode) {
   48     return RawDecoder::checkCameraSupported(meta, id.make, id.model, mode);
   49   }
   50 
   51   using RawDecoder::setMetaData;
   52 
   53   inline void setMetaData(const CameraMetaData* meta, const TiffID& id,
   54                           const std::string& mode, int iso_speed) {
   55     setMetaData(meta, id.make, id.model, mode, iso_speed);
   56   }
   57 
   58   inline void setMetaData(const CameraMetaData* meta, const std::string& mode,
   59                           int iso_speed) {
   60     setMetaData(meta, mRootIFD->getID(), mode, iso_speed);
   61   }
   62 
   63   inline void checkSupportInternal(const CameraMetaData* meta) override {
   64     checkCameraSupported(meta, mRootIFD->getID(), "");
   65   }
   66 
   67   [[nodiscard]] const TiffIFD*
   68   getIFDWithLargestImage(TiffTag filter = IMAGEWIDTH) const;
   69 };
   70 
   71 } // namespace rawspeed