update dev300-m58
[ooovba.git] / svtools / inc / sgfbram.hxx
blob1fde9f9884d52515935306fa7edab69120f775a9
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.4 $
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 #include <tools/solar.h>
36 #define SgfBitImag0 1 /* Bitmap */
37 #define SgfBitImag1 4 /* Bitmap */
38 #define SgfBitImag2 5 /* Bitmap */
39 #define SgfBitImgMo 6 /* Monochrome Bitmap */
40 #define SgfSimpVect 2 /* Einfaches Vectorformat */
41 #define SgfPostScrp 3 /* Postscript file */
42 #define SgfStarDraw 7 /* StarDraw SGV-Datei */
43 #define SgfDontKnow 255 /* Unbekannt oder kein SGF/SGV */
45 // Konstanten f�r SgfHeader.SwGrCol
46 #define SgfBlckWhit 1 /* Schwarz/Weiá Bild Ä¿ SimpVector, */
47 #define SgfGrayscal 2 /* Bild mit Graustufen ³ StarDraw und */
48 #define Sgf16Colors 3 /* Farbbild (16 Farben) ÄÙ Bit Image */
49 #define SgfVectFarb 4 /* Farben f�r Linien verwenden Ä¿ */
50 #define SgfVectGray 5 /* Graustufen f�r Linien verwenden ³ Nur f�r */
51 #define SgfVectWdth 6 /* Strichst„rken f�r Linien verwenden ÄÙ SimpVector */
54 #define SgfHeaderSize 42
55 class SgfHeader
57 public:
58 UINT16 Magic;
59 UINT16 Version;
60 UINT16 Typ;
61 UINT16 Xsize;
62 UINT16 Ysize;
63 INT16 Xoffs;
64 INT16 Yoffs;
65 UINT16 Planes; // Layer
66 UINT16 SwGrCol;
67 char Autor[10];
68 char Programm[10];
69 UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) !
71 UINT32 GetOffset();
72 friend SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead);
73 BOOL ChkMagic();
76 #define SgfEntrySize 22
77 class SgfEntry
79 public:
80 UINT16 Typ;
81 UINT16 iFrei;
82 UINT16 lFreiLo,lFreiHi;
83 char cFrei[10];
84 UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) !
86 UINT32 GetOffset();
87 friend SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr);
90 #define SgfVectorSize 10
91 class SgfVector
93 public:
94 UINT16 Flag;
95 INT16 x;
96 INT16 y;
97 UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) !
99 friend SvStream& operator>>(SvStream& rIStream, SgfVector& rEntr);
102 extern long SgfVectXofs;
103 extern long SgfVectYofs;
104 extern long SgfVectXmul;
105 extern long SgfVectYmul;
106 extern long SgfVectXdiv;
107 extern long SgfVectYdiv;
108 extern BOOL SgfVectScal;
110 ////////////////////////////////////////////////////////////////////////////////////////////////////
111 // Windows BMP /////////////////////////////////////////////////////////////////////////////////////
112 ////////////////////////////////////////////////////////////////////////////////////////////////////
114 #define BmpFileHeaderSize 14
115 class BmpFileHeader
117 public:
118 UINT16 Typ; // = "BM"
119 UINT16 SizeLo,SizeHi; // Filesize in Bytes
120 UINT16 Reserve1; // Reserviert
121 UINT16 Reserve2; // Reserviert
122 UINT16 OfsLo,OfsHi; // Offset?
124 void SetSize(UINT32 Size);
125 void SetOfs(UINT32 Size);
126 UINT32 GetOfs();
127 friend SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead);
130 #define BmpInfoHeaderSize 40
131 class BmpInfoHeader
133 public:
134 UINT32 Size; // GrӇe des BmpInfoHeaders
135 INT32 Width; // Breite in Pixel
136 INT32 Hight; // H”he in Pixel
137 UINT16 Planes; // Anzahl der Planes (immer 1)
138 UINT16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24)
139 UINT32 Compress; // Datenkompression
140 UINT32 ImgSize; // GrӇe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt.
141 INT32 xDpmm; // Dot per Meter (0 ist erlaubt)
142 INT32 yDpmm; // Dot per Meter (0 ist erlaubt)
143 UINT32 ColUsed; // Anzahl der verwendeten Farben (0=alle)
144 UINT32 ColMust; // Anzahl der wichtigen Farben (0=alle)
146 friend SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rHead);
149 #define RGBQuadSize 4
150 class RGBQuad {
151 private:
152 BYTE Red;
153 BYTE Grn;
154 BYTE Blu;
155 BYTE Fil;
156 public:
157 RGBQuad(BYTE R, BYTE G, BYTE B) { Red=R; Grn=G; Blu=B; Fil=0; }
160 #endif //_SGFBRAM_HXX