libopenraw
arwfile.hpp
1/* -*- Mode: C++ -*- */
2/*
3 * libopenraw - arwfile.h
4 *
5 * Copyright (C) 2006-2016 Hubert Figuiere
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 License
9 * as published by the Free Software Foundation, either version 3 of
10 * 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, see
19 * <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef OR_INTERNALS_ARWFILE_H_
23#define OR_INTERNALS_ARWFILE_H_
24
25#include <libopenraw/cameraids.h>
26#include <libopenraw/consts.h>
27
28#include "rawfile.hpp"
29#include "io/stream.hpp"
30#include "ifddir.hpp"
31#include "ifdfile.hpp"
32#include "tiffepfile.hpp"
33
34namespace OpenRaw {
35
36class RawData;
37
38namespace Internals {
39
41 : public TiffEpFile
42{
43public:
44 static RawFile *factory(const IO::Stream::Ptr & s);
45 ArwFile(const IO::Stream::Ptr & s);
46 virtual ~ArwFile();
47
48 ArwFile(const ArwFile&) = delete;
49 ArwFile & operator=(const ArwFile&) = delete;
50
51 // this is the value for "compression" for ARW
52 enum {
53 ARW_RAW_COMPRESSION = 32767
54 };
55
56protected:
57 virtual IfdDir::Ref _locateCfaIfd() override;
58 virtual IfdDir::Ref _locateMainIfd() override;
59
60 virtual ::or_error _getRawData(RawData & data, uint32_t options) override;
61private:
62 // first version of ARW. Different from the rest.
63 bool isA100()
64 {
65 return typeId() == OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_SONY,
66 OR_TYPEID_SONY_A100);
67 }
68
69 static const IfdFile::camera_ids_t s_def[];
70};
71
72}
73}
74
75#endif
virtual ::or_error _getRawData(RawData &data, uint32_t options) override
Definition: arwfile.cpp:228
TypeId typeId()
Definition: rawfile.cpp:335
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard....
Definition: arwfile.cpp:30