2
* libopenraw - peffile.cpp
4
* Copyright (C) 2006-2008 Hubert Figuiere
6
* This library is free software: you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public License
8
* as published by the Free Software Foundation, either version 3 of
9
* the License, or (at your option) any later version.
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.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library. If not, see
18
* <http://www.gnu.org/licenses/>.
23
#include <libopenraw++/thumbnail.h>
24
#include <libopenraw++/rawdata.h>
28
#include "ifdfilecontainer.h"
34
using namespace Debug;
40
const struct IFDFile::camera_ids_t PEFFile::s_def[] = {
41
{ "PENTAX *ist D ", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_PENTAX,
42
OR_TYPEID_PENTAX_IST_D) },
43
{ "PENTAX *ist DL ", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_PENTAX,
44
OR_TYPEID_PENTAX_IST_DL) },
45
{ "PENTAX K10D ", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_PENTAX,
46
OR_TYPEID_PENTAX_K10D_PEF) },
47
{ "PENTAX K100D ", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_PENTAX,
48
OR_TYPEID_PENTAX_K100D_PEF) },
49
{ "PENTAX K100D Super ", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_PENTAX,
50
OR_TYPEID_PENTAX_K100D_PEF) },
55
RawFile *PEFFile::factory(IO::Stream *s)
57
return new PEFFile(s);
60
PEFFile::PEFFile(IO::Stream *s)
61
: IFDFile(s, OR_RAWFILE_TYPE_PEF)
71
IFDDir::Ref PEFFile::_locateCfaIfd()
73
// in PEF the CFA IFD is the main IFD
75
m_mainIfd = _locateMainIfd();
81
IFDDir::Ref PEFFile::_locateMainIfd()
83
return m_container->setDirectory(0);
86
::or_error PEFFile::_getRawData(RawData & data, uint32_t /*options*/)
90
m_cfaIfd = _locateCfaIfd();
92
err = _getRawDataFromDir(data, m_cfaIfd);
93
if(err == OR_ERROR_NONE) {
94
uint16_t compression = 0;
95
m_cfaIfd->getValue(IFD::EXIF_TAG_COMPRESSION, compression);
98
data.setDataType(OR_DATA_TYPE_CFA);