RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
MefDecoder.cpp
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#include "decoders/MefDecoder.h"
23#include "adt/Point.h"
25#include "common/RawImage.h"
29#include "io/Buffer.h"
30#include "io/ByteStream.h"
31#include "io/Endianness.h"
32#include "tiff/TiffIFD.h"
33#include <string>
34
35namespace rawspeed {
36
38 [[maybe_unused]] Buffer file) {
39 const auto id = rootIFD->getID();
40 const std::string& make = id.make;
41
42 // FIXME: magic
43
44 return make == "Mamiya-OP Co.,Ltd.";
45}
46
48 if (width > 4016 || height > 5344)
49 ThrowRDE("Unexpected image dimensions found: (%u; %u)", width, height);
50}
51
54
57 iRectangle2D({0, 0}, iPoint2D(width, height)), 12 * width / 8, 12,
59 mRaw->createData();
60 u.readUncompressedRaw();
61
62 return mRaw;
63}
64
66 setMetaData(meta, "", 0);
67}
68
69} // namespace rawspeed
#define ThrowRDE(...)
void setMetaData(const CameraMetaData *meta, const TiffID &id, const std::string &mode, int iso_speed)
static bool isAppropriateDecoder(const TiffRootIFD *rootIFD, Buffer file)
RawImage decodeRawInternal() override
void checkImageDimensions() override
void decodeMetaDataInternal(const CameraMetaData *meta) override
TiffID getID() const
Definition TiffIFD.cpp:325
std::string make
Definition TiffIFD.h:134