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