Version 4.2.0.1, tag libreoffice-4.2.0.1
[LibreOffice.git] / vcl / source / filter / sgfbram.hxx
blobb38d72d576068ab8d6e5977cf947457a3e5f6152
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX
21 #define INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX
23 #include <tools/solar.h>
25 #define SgfBitImag0 1 /* Bitmap */
26 #define SgfBitImag1 4 /* Bitmap */
27 #define SgfBitImag2 5 /* Bitmap */
28 #define SgfBitImgMo 6 /* Monochrome Bitmap */
29 #define SgfSimpVect 2 /* Einfaches Vectorformat */
30 #define SgfPostScrp 3 /* Postscript file */
31 #define SgfStarDraw 7 /* StarDraw SGV-Datei */
32 #define SgfDontKnow 255 /* Unbekannt oder kein SGF/SGV */
34 // Konstanten f�r SgfHeader.SwGrCol
35 #define SgfBlckWhit 1 /* Schwarz/Wei?Bild Ŀ SimpVector, */
36 #define SgfGrayscal 2 /* Bild mit Graustufen ?StarDraw und */
37 #define Sgf16Colors 3 /* Farbbild (16 Farben) ÄÙ Bit Image */
38 #define SgfVectFarb 4 /* Farben f�r Linien verwenden Ä¿ */
39 #define SgfVectGray 5 /* Graustufen f�r Linien verwenden ?Nur f�r */
40 #define SgfVectWdth 6 /* Strichst„rken f�r Linien verwenden ÄÙ SimpVector */
43 #define SgfHeaderSize 42
44 class SgfHeader
46 public:
47 sal_uInt16 Magic;
48 sal_uInt16 Version;
49 sal_uInt16 Typ;
50 sal_uInt16 Xsize;
51 sal_uInt16 Ysize;
52 sal_Int16 Xoffs;
53 sal_Int16 Yoffs;
54 sal_uInt16 Planes; // Layer
55 sal_uInt16 SwGrCol;
56 char Autor[10];
57 char Programm[10];
58 sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) !
60 sal_uInt32 GetOffset();
61 friend SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead);
62 bool ChkMagic();
65 #define SgfEntrySize 22
66 class SgfEntry
68 public:
69 sal_uInt16 Typ;
70 sal_uInt16 iFrei;
71 sal_uInt16 lFreiLo,lFreiHi;
72 char cFrei[10];
73 sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) !
75 sal_uInt32 GetOffset();
76 friend SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr);
79 #define SgfVectorSize 10
80 class SgfVector
82 public:
83 sal_uInt16 Flag;
84 sal_Int16 x;
85 sal_Int16 y;
86 sal_uInt16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) !
88 friend SvStream& operator>>(SvStream& rIStream, SgfVector& rEntr);
91 extern long SgfVectXofs;
92 extern long SgfVectYofs;
93 extern long SgfVectXmul;
94 extern long SgfVectYmul;
95 extern long SgfVectXdiv;
96 extern long SgfVectYdiv;
97 extern bool SgfVectScal;
99 ////////////////////////////////////////////////////////////////////////////////////////////////////
100 // Windows BMP /////////////////////////////////////////////////////////////////////////////////////
101 ////////////////////////////////////////////////////////////////////////////////////////////////////
103 #define BmpFileHeaderSize 14
104 class BmpFileHeader
106 public:
107 sal_uInt16 Typ; // = "BM"
108 sal_uInt16 SizeLo,SizeHi; // Filesize in Bytes
109 sal_uInt16 Reserve1; // Reserviert
110 sal_uInt16 Reserve2; // Reserviert
111 sal_uInt16 OfsLo,OfsHi; // Offset?
113 void SetSize(sal_uInt32 Size);
114 void SetOfs(sal_uInt32 Size);
115 sal_uInt32 GetOfs();
116 friend SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead);
119 #define BmpInfoHeaderSize 40
120 class BmpInfoHeader
122 public:
123 sal_uInt32 Size; // GrӇe des BmpInfoHeaders
124 sal_Int32 Width; // Breite in Pixel
125 sal_Int32 Hight; // H”he in Pixel
126 sal_uInt16 Planes; // Anzahl der Planes (immer 1)
127 sal_uInt16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24)
128 sal_uInt32 Compress; // Datenkompression
129 sal_uInt32 ImgSize; // GrӇe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt.
130 sal_Int32 xDpmm; // Dot per Meter (0 ist erlaubt)
131 sal_Int32 yDpmm; // Dot per Meter (0 ist erlaubt)
132 sal_uInt32 ColUsed; // Anzahl der verwendeten Farben (0=alle)
133 sal_uInt32 ColMust; // Anzahl der wichtigen Farben (0=alle)
135 friend SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rHead);
138 #define RGBQuadSize 4
139 class RGBQuad {
140 private:
141 sal_uInt8 Red;
142 sal_uInt8 Grn;
143 sal_uInt8 Blu;
144 sal_uInt8 Fil;
145 public:
146 RGBQuad(sal_uInt8 R, sal_uInt8 G, sal_uInt8 B) { Red=R; Grn=G; Blu=B; Fil=0; }
149 #endif // INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */