libopenraw
lib
jfifcontainer.hpp
1
/* -*- Mode: C++ -*- */
2
/*
3
* libopenraw - jfifcontainer.h
4
*
5
* Copyright (C) 2006-2015 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
25
26
#ifndef OR_INTERNALS_JFIFCONTAINER_H_
27
#define OR_INTERNALS_JFIFCONTAINER_H_
28
29
#include <stdint.h>
30
#include <sys/types.h>
31
#include <setjmp.h>
32
33
#include <memory>
34
35
#include "ifddir.hpp"
36
#include "io/stream.hpp"
37
#include "rawcontainer.hpp"
38
39
extern
"C"
{
40
#include <jpeglib.h>
41
}
42
43
namespace
OpenRaw
{
44
45
class
BitmapData
;
46
47
namespace
Internals {
48
49
class
IfdFileContainer
;
50
51
class
JfifContainer
52
:
public
RawContainer
53
{
54
public
:
55
JfifContainer(
const
IO::Stream::Ptr &file, off_t offset);
57
virtual
~JfifContainer
();
58
59
bool
getDimensions(uint32_t &x, uint32_t &y);
60
bool
getDecompressedData(
BitmapData
&data);
61
63
IfdDir::Ref
mainIfd
();
65
IfdDir::Ref
getIfdDirAt
(
int
idx);
67
IfdDir::Ref
exifIfd
();
69
std::unique_ptr<IfdFileContainer> &
ifdContainer
();
70
71
jmp_buf & jpegjmp() {
72
return
m_jpegjmp;
73
}
74
private
:
75
int
_loadHeader();
76
77
struct
jpeg_decompress_struct m_cinfo;
78
struct
jpeg_error_mgr m_jerr;
79
jmp_buf m_jpegjmp;
80
bool
m_headerLoaded;
81
std::unique_ptr<IfdFileContainer> m_ifd;
82
};
83
84
}
85
}
86
87
#endif
OpenRaw::BitmapData
Definition
bitmapdata.hpp:32
OpenRaw::Internals::IfdFileContainer
Definition
ifdfilecontainer.hpp:49
OpenRaw::Internals::JfifContainer::~JfifContainer
virtual ~JfifContainer()
Definition
jfifcontainer.cpp:109
OpenRaw::Internals::JfifContainer::mainIfd
IfdDir::Ref mainIfd()
Definition
jfifcontainer.cpp:251
OpenRaw::Internals::JfifContainer::exifIfd
IfdDir::Ref exifIfd()
Definition
jfifcontainer.cpp:268
OpenRaw::Internals::JfifContainer::getIfdDirAt
IfdDir::Ref getIfdDirAt(int idx)
Definition
jfifcontainer.cpp:259
OpenRaw::Internals::JfifContainer::ifdContainer
std::unique_ptr< IfdFileContainer > & ifdContainer()
Definition
jfifcontainer.cpp:228
OpenRaw::Internals::RawContainer::RawContainer
RawContainer(const IO::Stream::Ptr &_file, off_t offset)
Definition
rawcontainer.cpp:37
OpenRaw
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard....
Definition
arwfile.cpp:30
Generated by
1.14.0