sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svtools / sgfbram.hxx
blobec75338106763c0178d6fa0b3de840e204cbe479
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sgfbram.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SGFBRAM_HXX
32 #define _SGFBRAM_HXX
34 #ifndef _SOLAR_H
35 #include <tools/solar.h>
36 #endif
38 namespace binfilter
41 #define SgfBitImag0 1 /* Bitmap */
42 #define SgfBitImag1 4 /* Bitmap */
43 #define SgfBitImag2 5 /* Bitmap */
44 #define SgfBitImgMo 6 /* Monochrome Bitmap */
45 #define SgfSimpVect 2 /* Einfaches Vectorformat */
46 #define SgfPostScrp 3 /* Postscript file */
47 #define SgfStarDraw 7 /* StarDraw SGV-Datei */
48 #define SgfDontKnow 255 /* Unbekannt oder kein SGF/SGV */
50 // Konstanten f�r SgfHeader.SwGrCol
51 #define SgfBlckWhit 1 /* Schwarz/Weiá Bild Ä¿ SimpVector, */
52 #define SgfGrayscal 2 /* Bild mit Graustufen ³ StarDraw und */
53 #define Sgf16Colors 3 /* Farbbild (16 Farben) ÄÙ Bit Image */
54 #define SgfVectFarb 4 /* Farben f�r Linien verwenden Ä¿ */
55 #define SgfVectGray 5 /* Graustufen f�r Linien verwenden ³ Nur f�r */
56 #define SgfVectWdth 6 /* Strichst„rken f�r Linien verwenden ÄÙ SimpVector */
59 #define SgfHeaderSize 42
60 class SgfHeader
62 public:
63 UINT16 Magic;
64 UINT16 Version;
65 UINT16 Typ;
66 UINT16 Xsize;
67 UINT16 Ysize;
68 INT16 Xoffs;
69 INT16 Yoffs;
70 UINT16 Planes; // Layer
71 UINT16 SwGrCol;
72 char Autor[10];
73 char Programm[10];
74 UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) !
76 UINT32 GetOffset();
77 friend SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead);
78 BOOL ChkMagic();
81 #define SgfEntrySize 22
82 class SgfEntry
84 public:
85 UINT16 Typ;
86 UINT16 iFrei;
87 UINT16 lFreiLo,lFreiHi;
88 char cFrei[10];
89 UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) !
91 UINT32 GetOffset();
92 friend SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr);
95 #define SgfVectorSize 10
96 class SgfVector
98 public:
99 UINT16 Flag;
100 INT16 x;
101 INT16 y;
102 UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) !
104 friend SvStream& operator>>(SvStream& rIStream, SgfVector& rEntr);
107 extern long SgfVectXofs;
108 extern long SgfVectYofs;
109 extern long SgfVectXmul;
110 extern long SgfVectYmul;
111 extern long SgfVectXdiv;
112 extern long SgfVectYdiv;
113 extern BOOL SgfVectScal;
115 ////////////////////////////////////////////////////////////////////////////////////////////////////
116 // Windows BMP /////////////////////////////////////////////////////////////////////////////////////
117 ////////////////////////////////////////////////////////////////////////////////////////////////////
119 #define BmpFileHeaderSize 14
120 class BmpFileHeader
122 public:
123 UINT16 Typ; // = "BM"
124 UINT16 SizeLo,SizeHi; // Filesize in Bytes
125 UINT16 Reserve1; // Reserviert
126 UINT16 Reserve2; // Reserviert
127 UINT16 OfsLo,OfsHi; // Offset?
129 void SetSize(UINT32 Size);
130 void SetOfs(UINT32 Size);
131 UINT32 GetOfs();
132 friend SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead);
135 #define BmpInfoHeaderSize 40
136 class BmpInfoHeader
138 public:
139 UINT32 Size; // GrӇe des BmpInfoHeaders
140 INT32 Width; // Breite in Pixel
141 INT32 Hight; // H”he in Pixel
142 UINT16 Planes; // Anzahl der Planes (immer 1)
143 UINT16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24)
144 UINT32 Compress; // Datenkompression
145 UINT32 ImgSize; // GrӇe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt.
146 INT32 xDpmm; // Dot per Meter (0 ist erlaubt)
147 INT32 yDpmm; // Dot per Meter (0 ist erlaubt)
148 UINT32 ColUsed; // Anzahl der verwendeten Farben (0=alle)
149 UINT32 ColMust; // Anzahl der wichtigen Farben (0=alle)
151 friend SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rHead);
154 #define RGBQuadSize 4
155 class RGBQuad {
156 private:
157 BYTE Red;
158 BYTE Grn;
159 BYTE Blu;
160 BYTE Fil;
161 public:
162 RGBQuad(BYTE R, BYTE G, BYTE B) { Red=R; Grn=G; Blu=B; Fil=0; }
168 #endif //_SGFBRAM_HXX