LibreOffice Module vcl (master)  1
Exif.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX
21 #define INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX
22 
23 #include <tools/stream.hxx>
24 
26  TOP_LEFT = 1,
27  TOP_RIGHT = 2,
30  LEFT_TOP = 5,
31  RIGHT_TOP = 6,
34 };
35 
36 enum Tag {
37  ORIENTATION = 0x0112
38 };
39 
40 class Exif final
41 {
42 private:
45 
46  bool processJpeg(SvStream& rStream, bool bSetValue);
47  bool processExif(SvStream& rStream, sal_uInt16 aLength, bool bSetValue);
48  void processIFD(sal_uInt8* pExifData, sal_uInt16 aLength, sal_uInt16 aOffset, sal_uInt16 aNumberOfTags, bool bSetValue, bool bLittleEndian);
49 
50  struct ExifIFD {
55  };
56 
57  struct TiffHeader {
58  sal_uInt16 const byteOrder;
59  sal_uInt16 tagAlign;
60  sal_uInt32 offset;
61  };
62 
63  static Orientation convertToOrientation(sal_Int32 value);
64 
65 public:
66  Exif();
67  ~Exif();
68 
69  bool hasExif() const { return mbExifPresent;}
70 
72  sal_Int32 getRotation() const;
73 
75 
76  bool read(SvStream& rStream);
77  void write(SvStream& rStream);
78 
79 };
80 
81 #endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX
82 
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool processJpeg(SvStream &rStream, bool bSetValue)
Definition: Exif.cxx:87
Orientation
Definition: Exif.hxx:25
sal_uInt8 type[2]
Definition: Exif.hxx:52
void setOrientation(Orientation orientation)
Definition: Exif.cxx:34
sal_uInt8 offset[4]
Definition: Exif.hxx:54
void write(SvStream &rStream)
Definition: Exif.cxx:80
sal_uInt16 tagAlign
Definition: Exif.hxx:59
bool read(SvStream &rStream)
Definition: Exif.cxx:71
Orientation maOrientation
Definition: Exif.hxx:43
~Exif()
Definition: Exif.cxx:30
Tag
Definition: Exif.hxx:36
sal_uInt8 tag[2]
Definition: Exif.hxx:51
bool mbExifPresent
Definition: Exif.hxx:44
sal_uInt32 offset
Definition: Exif.hxx:60
Orientation getOrientation() const
Definition: Exif.hxx:71
static Orientation convertToOrientation(sal_Int32 value)
Definition: Exif.cxx:38
unsigned char sal_uInt8
orientation
Definition: jobdata.hxx:27
void processIFD(sal_uInt8 *pExifData, sal_uInt16 aLength, sal_uInt16 aOffset, sal_uInt16 aNumberOfTags, bool bSetValue, bool bLittleEndian)
Definition: Exif.cxx:198
Definition: Exif.hxx:40
Exif()
Definition: Exif.cxx:25
bool processExif(SvStream &rStream, sal_uInt16 aLength, bool bSetValue)
Definition: Exif.cxx:227
sal_uInt16 const byteOrder
Definition: Exif.hxx:58
sal_Int32 getRotation() const
Definition: Exif.cxx:53
sal_uInt8 count[4]
Definition: Exif.hxx:53
bool hasExif() const
Definition: Exif.hxx:69