Exiv2
orfimage.hpp
Go to the documentation of this file.
1 // ***************************************************************** -*- C++ -*-
2 /*
3  * Copyright (C) 2004-2018 Exiv2 authors
4  * This program is part of the Exiv2 distribution.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program 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
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
19  */
27 #ifndef ORFIMAGE_HPP_
28 #define ORFIMAGE_HPP_
29 
30 // *****************************************************************************
31 #include "exiv2lib_export.h"
32 
33 // included header files
34 #include "tiffimage.hpp"
35 
36 // *****************************************************************************
37 // namespace extensions
38 namespace Exiv2 {
39 
40 // *****************************************************************************
41 // class definitions
42 
43  // Add ORF to the supported image formats
44  namespace ImageType {
45  const int orf = 9;
46  }
47 
52  class EXIV2API OrfImage : public TiffImage {
53  public:
55 
56 
71  OrfImage(BasicIo::AutoPtr io, bool create);
73 
75 
76  void printStructure(std::ostream& out, PrintStructureOption option,int depth);
77  void readMetadata();
78  void writeMetadata();
83  void setComment(const std::string& comment);
85 
87 
88  std::string mimeType() const;
89  int pixelWidth() const;
90  int pixelHeight() const;
92 
93  private:
95 
96  OrfImage(const OrfImage& rhs);
99  OrfImage& operator=(const OrfImage& rhs);
101 
102  }; // class OrfImage
103 
109  class EXIV2API OrfParser {
110  public:
116  static ByteOrder decode(
117  ExifData& exifData,
118  IptcData& iptcData,
119  XmpData& xmpData,
120  const byte* pData,
121  uint32_t size
122  );
127  static WriteMethod encode(
128  BasicIo& io,
129  const byte* pData,
130  uint32_t size,
131  ByteOrder byteOrder,
132  const ExifData& exifData,
133  const IptcData& iptcData,
134  const XmpData& xmpData
135  );
136  }; // class OrfParser
137 
138 // *****************************************************************************
139 // template, inline and free functions
140 
141  // These could be static private functions on Image subclasses but then
142  // ImageFactory needs to be made a friend.
148  EXIV2API Image::AutoPtr newOrfInstance(BasicIo::AutoPtr io, bool create);
149 
151  EXIV2API bool isOrfType(BasicIo& iIo, bool advance);
152 
153 } // namespace Exiv2
154 
155 #endif // #ifndef ORFIMAGE_HPP_
An interface for simple binary IO.
Definition: basicio.hpp:55
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition: xmp_exiv2.hpp:173
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:113
uint8_t byte
1 byte unsigned integer type.
Definition: types.hpp:105
PrintStructureOption
Options for printStructure.
Definition: image.hpp:67
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:173
Stateless parser class for data in ORF format. Images use this class to decode and encode ORF data...
Definition: orfimage.hpp:109
WriteMethod
Type to indicate write method used by TIFF parsers.
Definition: types.hpp:116
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
Class to access raw Olympus ORF images. Exif metadata is supported directly, IPTC is read from the Ex...
Definition: orfimage.hpp:52
const int orf
ORF image type (see class OrfImage)
Definition: orfimage.hpp:45
IPTC string type.
Definition: types.hpp:147
Class to access TIFF images. Exif metadata is supported directly, IPTC is read from the Exif data...
Definition: tiffimage.hpp:55
EXIV2API Image::AutoPtr newOrfInstance(BasicIo::AutoPtr io, bool create)
Create a new OrfImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: orfimage.cpp:213
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
Exiv2 type for the Exif user comment.
Definition: types.hpp:150
EXIV2API bool isOrfType(BasicIo &iIo, bool advance)
Check if the file iIo is an ORF image.
Definition: orfimage.cpp:222