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
"
24
#include "
bitstreams/BitStreams.h
"
25
#include "
common/RawImage.h
"
26
#include "
decoders/RawDecoderException.h
"
27
#include "
decoders/SimpleTiffDecoder.h
"
28
#include "
decompressors/UncompressedDecompressor.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
35
namespace
rawspeed
{
36
37
bool
MefDecoder::isAppropriateDecoder
(
const
TiffRootIFD
* rootIFD,
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
47
void
MefDecoder::checkImageDimensions
() {
48
if
(
width
> 4016 ||
height
> 5344)
49
ThrowRDE
(
"Unexpected image dimensions found: (%u; %u)"
,
width
,
height
);
50
}
51
52
RawImage
MefDecoder::decodeRawInternal
() {
53
SimpleTiffDecoder::prepareForRawDecoding
();
54
55
UncompressedDecompressor
u(
56
ByteStream
(
DataBuffer
(
mFile
.getSubView(
off
),
Endianness::little
)),
mRaw
,
57
iRectangle2D
({0, 0},
iPoint2D
(
width
,
height
)), 12 *
width
/ 8, 12,
58
BitOrder::MSB
);
59
mRaw
->createData();
60
u.readUncompressedRaw();
61
62
return
mRaw
;
63
}
64
65
void
MefDecoder::decodeMetaDataInternal
(
const
CameraMetaData
* meta) {
66
setMetaData
(meta,
""
, 0);
67
}
68
69
}
// namespace rawspeed
BitStreams.h
Buffer.h
ByteStream.h
Endianness.h
MefDecoder.h
Point.h
RawDecoderException.h
ThrowRDE
#define ThrowRDE(...)
Definition
RawDecoderException.h:37
RawImage.h
SimpleTiffDecoder.h
TiffIFD.h
UncompressedDecompressor.h
rawspeed::AbstractTiffDecoder::setMetaData
void setMetaData(const CameraMetaData *meta, const TiffID &id, const std::string &mode, int iso_speed)
Definition
AbstractTiffDecoder.h:55
rawspeed::Buffer
Definition
Buffer.h:47
rawspeed::ByteStream
Definition
ByteStream.h:43
rawspeed::CameraMetaData
Definition
CameraMetaData.h:47
rawspeed::DataBuffer
Definition
Buffer.h:133
rawspeed::MefDecoder::isAppropriateDecoder
static bool isAppropriateDecoder(const TiffRootIFD *rootIFD, Buffer file)
Definition
MefDecoder.cpp:37
rawspeed::MefDecoder::decodeRawInternal
RawImage decodeRawInternal() override
Definition
MefDecoder.cpp:52
rawspeed::MefDecoder::checkImageDimensions
void checkImageDimensions() override
Definition
MefDecoder.cpp:47
rawspeed::MefDecoder::decodeMetaDataInternal
void decodeMetaDataInternal(const CameraMetaData *meta) override
Definition
MefDecoder.cpp:65
rawspeed::RawDecoder::mFile
Buffer mFile
Definition
RawDecoder.h:154
rawspeed::RawDecoder::mRaw
RawImage mRaw
Definition
RawDecoder.h:74
rawspeed::RawImage
Definition
RawImage.h:247
rawspeed::SimpleTiffDecoder::off
uint32_t off
Definition
SimpleTiffDecoder.h:50
rawspeed::SimpleTiffDecoder::prepareForRawDecoding
void prepareForRawDecoding()
Definition
SimpleTiffDecoder.cpp:39
rawspeed::SimpleTiffDecoder::height
uint32_t height
Definition
SimpleTiffDecoder.h:49
rawspeed::SimpleTiffDecoder::width
uint32_t width
Definition
SimpleTiffDecoder.h:48
rawspeed::TiffRootIFD
Definition
TiffIFD.h:138
rawspeed::TiffRootIFD::getID
TiffID getID() const
Definition
TiffIFD.cpp:325
rawspeed::UncompressedDecompressor
Definition
UncompressedDecompressor.h:37
rawspeed::iPoint2D
Definition
Point.h:35
rawspeed::iRectangle2D
Definition
Point.h:107
rawspeed
Definition
CoalescingOutputIteratorBenchmark.cpp:35
rawspeed::BitOrder::MSB
@ MSB
Definition
BitStreams.h:30
rawspeed::Endianness::little
@ little
Definition
Endianness.h:32
rawspeed::TiffID::make
std::string make
Definition
TiffIFD.h:134
librawspeed
decoders
MefDecoder.cpp
Generated by
1.15.0