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#pragma once
21
22#include <tools/stream.hxx>
23#include <tools/degree.hxx>
24
25namespace exif {
26
35 LEFT_BOTTOM = 8
36};
37};
38
39enum Tag {
40 ORIENTATION = 0x0112
41};
42
43class Exif final
44{
45private:
48
49 bool processJpeg(SvStream& rStream, bool bSetValue);
50 bool processExif(SvStream& rStream, sal_uInt16 aLength, bool bSetValue);
51 void processIFD(sal_uInt8* pExifData, sal_uInt16 aLength, sal_uInt16 aOffset, sal_uInt16 aNumberOfTags, bool bSetValue, bool bLittleEndian);
52
53 struct ExifIFD {
58 };
59
60 struct TiffHeader {
61 sal_uInt16 byteOrder;
62 sal_uInt16 tagAlign;
63 sal_uInt32 offset;
64 };
65
66 static exif::Orientation convertToOrientation(sal_Int32 value);
67
68public:
69 Exif();
70
71 bool hasExif() const { return mbExifPresent;}
72
74 Degree10 getRotation() const;
75
77
78 bool read(SvStream& rStream);
79 void write(SvStream& rStream);
80
81};
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Tag
Definition: Exif.hxx:39
@ ORIENTATION
Definition: Exif.hxx:40
Definition: Exif.hxx:44
bool hasExif() const
Definition: Exif.hxx:71
bool read(SvStream &rStream)
Definition: Exif.cxx:66
bool processExif(SvStream &rStream, sal_uInt16 aLength, bool bSetValue)
Definition: Exif.cxx:214
void setOrientation(exif::Orientation orientation)
Definition: Exif.cxx:30
exif::Orientation maOrientation
Definition: Exif.hxx:46
Exif()
Definition: Exif.cxx:25
void processIFD(sal_uInt8 *pExifData, sal_uInt16 aLength, sal_uInt16 aOffset, sal_uInt16 aNumberOfTags, bool bSetValue, bool bLittleEndian)
Definition: Exif.cxx:183
bool mbExifPresent
Definition: Exif.hxx:47
static exif::Orientation convertToOrientation(sal_Int32 value)
Definition: Exif.cxx:34
Degree10 getRotation() const
Definition: Exif.cxx:49
exif::Orientation getOrientation() const
Definition: Exif.hxx:73
bool processJpeg(SvStream &rStream, bool bSetValue)
Definition: Exif.cxx:82
void write(SvStream &rStream)
Definition: Exif.cxx:75
Definition: Exif.hxx:25
Orientation
Definition: Exif.hxx:27
@ BOTTOM_LEFT
Definition: Exif.hxx:31
@ RIGHT_BOTTOM
Definition: Exif.hxx:34
@ LEFT_BOTTOM
Definition: Exif.hxx:35
@ BOTTOM_RIGHT
Definition: Exif.hxx:30
@ RIGHT_TOP
Definition: Exif.hxx:33
@ TOP_LEFT
Definition: Exif.hxx:28
@ TOP_RIGHT
Definition: Exif.hxx:29
@ LEFT_TOP
Definition: Exif.hxx:32
orientation
Definition: jobdata.hxx:27
sal_uInt8 count[4]
Definition: Exif.hxx:56
sal_uInt8 tag[2]
Definition: Exif.hxx:54
sal_uInt8 offset[4]
Definition: Exif.hxx:57
sal_uInt8 type[2]
Definition: Exif.hxx:55
sal_uInt32 offset
Definition: Exif.hxx:63
sal_uInt16 tagAlign
Definition: Exif.hxx:62
sal_uInt16 byteOrder
Definition: Exif.hxx:61
unsigned char sal_uInt8