summaryrefslogtreecommitdiff
path: root/src/lib/PictHeader.h
blob: da07efbbd17aadbb0a46c4ffb4234554ef1ed80d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
 * This file is part of the libpict project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef __PICTHEADER_H__
#define __PICTHEADER_H__

#include <librevenge-stream/librevenge-stream.h>

class PictHeader
{
public:
  PictHeader();

  bool load(librevenge::RVNGInputStream *input);

  unsigned long startOfDocument() const
  {
    return m_dataStart;
  }

  int getVersion() const
  {
    return m_pictVersion;
  }

  unsigned getTop() const
  {
    return m_top;
  }
  unsigned getLeft() const
  {
    return m_left;
  }
  unsigned getBottom() const
  {
    return m_bottom;
  }
  unsigned getRight() const
  {
    return m_right;
  }
  unsigned getHorizontalResolution() const
  {
    return m_horizontalResolution;
  }
  unsigned getVerticalResolution() const
  {
    return m_verticalResolution;
  }


private:
  unsigned short m_fileSize;
  unsigned short m_top;
  unsigned short m_left;
  unsigned short m_bottom;
  unsigned short m_right;
  unsigned char m_pictVersion;
  unsigned long m_horizontalResolution;
  unsigned long m_verticalResolution;
  unsigned long m_pictureSize;
  unsigned long m_dataStart;

  bool loadPict1Header(librevenge::RVNGInputStream *input);
  bool loadPict2Header(librevenge::RVNGInputStream *input);
};

#endif // PictHEADER
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */