Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX
21 : #define INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX
22 :
23 : #define SgfBitImag0 1 /* Bitmap */
24 : #define SgfBitImag1 4 /* Bitmap */
25 : #define SgfBitImag2 5 /* Bitmap */
26 : #define SgfBitImgMo 6 /* Monochrome bitmap */
27 : #define SgfSimpVect 2 /* Simple vectorformat */
28 : #define SgfPostScrp 3 /* Postscript file */
29 : #define SgfStarDraw 7 /* StarDraw SGV-file */
30 : #define SgfDontKnow 255 /* Unknown or no SGF/SGV */
31 :
32 : // constants for SgfHeader.SwGrCol
33 : #define SgfBlckWhit 1 /* black/white image SimpVector, */
34 : #define SgfGrayscal 2 /* image with greyscale StarDraw and */
35 : #define Sgf16Colors 3 /* colour image (16 colours) Bit Image */
36 : #define SgfVectFarb 4 /* use colours in lines */
37 : #define SgfVectGray 5 /* use greyscale for lines only for */
38 : #define SgfVectWdth 6 /* use line widths for lines SimpVector */
39 :
40 : #define SgfHeaderSize 42
41 : class SgfHeader
42 : {
43 : public:
44 : sal_uInt16 Magic;
45 : sal_uInt16 Version;
46 : sal_uInt16 Typ;
47 : sal_uInt16 Xsize;
48 : sal_uInt16 Ysize;
49 : sal_Int16 Xoffs;
50 : sal_Int16 Yoffs;
51 : sal_uInt16 Planes; // Layer
52 : sal_uInt16 SwGrCol;
53 : char Autor[10];
54 : char Programm[10];
55 : sal_uInt16 OfsLo,OfsHi; // DWord allignment is necessary (38 mod 4 =2) !
56 :
57 : sal_uInt32 GetOffset();
58 : friend SvStream& ReadSgfHeader(SvStream& rIStream, SgfHeader& rHead);
59 : bool ChkMagic();
60 : SgfHeader();
61 : };
62 :
63 : #define SgfEntrySize 22
64 : class SgfEntry
65 : {
66 : public:
67 : sal_uInt16 Typ;
68 : sal_uInt16 iFrei;
69 : sal_uInt16 lFreiLo,lFreiHi;
70 : char cFrei[10];
71 : sal_uInt16 OfsLo,OfsHi; // DWord allignment is necessary (18 mod 4 =2) !
72 :
73 : sal_uInt32 GetOffset();
74 : friend SvStream& ReadSgfEntry(SvStream& rIStream, SgfEntry& rEntr);
75 : SgfEntry();
76 : };
77 :
78 : #define SgfVectorSize 10
79 : class SgfVector
80 : {
81 : public:
82 : sal_uInt16 Flag;
83 : sal_Int16 x;
84 : sal_Int16 y;
85 : sal_uInt16 OfsLo,OfsHi; // DWord allignment is necessary (6 mod 4 =2) !
86 :
87 : friend SvStream& ReadSgfVector(SvStream& rIStream, SgfVector& rEntr);
88 : };
89 :
90 : extern long SgfVectXofs;
91 : extern long SgfVectYofs;
92 : extern long SgfVectXmul;
93 : extern long SgfVectYmul;
94 : extern long SgfVectXdiv;
95 : extern long SgfVectYdiv;
96 : extern bool SgfVectScal;
97 :
98 : #define BmpFileHeaderSize 14
99 : class BmpFileHeader
100 : {
101 : public:
102 : sal_uInt16 Typ; // = "BM"
103 : sal_uInt16 SizeLo,SizeHi; // filesize in bytes
104 : sal_uInt16 Reserve1; // reserved
105 : sal_uInt16 Reserve2; // reserved
106 : sal_uInt16 OfsLo,OfsHi; // Offset?
107 :
108 : void SetSize(sal_uInt32 Size);
109 : void SetOfs(sal_uInt32 Size);
110 : sal_uInt32 GetOfs();
111 : friend SvStream& WriteBmpFileHeader(SvStream& rOStream, BmpFileHeader& rHead);
112 : };
113 :
114 : #define BmpInfoHeaderSize 40
115 : class BmpInfoHeader
116 : {
117 : public:
118 : sal_uInt32 Size; // size of BmpInfoHeaders
119 : sal_Int32 Width; // width in Pixel
120 : sal_Int32 Hight; // height in Pixel
121 : sal_uInt16 Planes; // number of planes (always 1)
122 : sal_uInt16 PixBits; // number of bits per pixel (1,4,8 or 24)
123 : sal_uInt32 Compress; // datakompression
124 : sal_uInt32 ImgSize; // size of image in bytes. Without compression also 0 is allowed.
125 : sal_Int32 xDpmm; // Dot per Meter (0 is allowed)
126 : sal_Int32 yDpmm; // Dot per Meter (0 is allowed)
127 : sal_uInt32 ColUsed; // number of colours used (0=all
128 : sal_uInt32 ColMust; // number of important colours (0=all)
129 :
130 : friend SvStream& WriteBmpInfoHeader(SvStream& rOStream, BmpInfoHeader& rHead);
131 : };
132 :
133 : #define RGBQuadSize 4
134 : class RGBQuad {
135 : private:
136 : sal_uInt8 Red;
137 : sal_uInt8 Grn;
138 : sal_uInt8 Blu;
139 : sal_uInt8 Fil;
140 : public:
141 0 : RGBQuad(sal_uInt8 R, sal_uInt8 G, sal_uInt8 B) { Red=R; Grn=G; Blu=B; Fil=0; }
142 : };
143 :
144 : #endif // INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX
145 :
146 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|