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 :
31 : // constants for SgfHeader.SwGrCol
32 : #define SgfVectFarb 4 /* use colours in lines */
33 : #define SgfVectGray 5 /* use greyscale for lines only for */
34 : #define SgfVectWdth 6 /* use line widths for lines SimpVector */
35 :
36 : #define SgfHeaderSize 42
37 : class SgfHeader
38 : {
39 : public:
40 : sal_uInt16 Magic;
41 : sal_uInt16 Version;
42 : sal_uInt16 Typ;
43 : sal_uInt16 Xsize;
44 : sal_uInt16 Ysize;
45 : sal_Int16 Xoffs;
46 : sal_Int16 Yoffs;
47 : sal_uInt16 Planes; // Layer
48 : sal_uInt16 SwGrCol;
49 : char Autor[10];
50 : char Programm[10];
51 : sal_uInt16 OfsLo,OfsHi; // DWord allignment is necessary (38 mod 4 =2) !
52 :
53 : sal_uInt32 GetOffset();
54 : friend SvStream& ReadSgfHeader(SvStream& rIStream, SgfHeader& rHead);
55 : bool ChkMagic();
56 : SgfHeader();
57 : };
58 :
59 : #define SgfEntrySize 22
60 : class SgfEntry
61 : {
62 : public:
63 : sal_uInt16 Typ;
64 : sal_uInt16 iFrei;
65 : sal_uInt16 lFreiLo,lFreiHi;
66 : char cFrei[10];
67 : sal_uInt16 OfsLo,OfsHi; // DWord allignment is necessary (18 mod 4 =2) !
68 :
69 : sal_uInt32 GetOffset();
70 : friend SvStream& ReadSgfEntry(SvStream& rIStream, SgfEntry& rEntr);
71 : SgfEntry();
72 : };
73 :
74 : #define SgfVectorSize 10
75 : class SgfVector
76 : {
77 : public:
78 : sal_uInt16 Flag;
79 : sal_Int16 x;
80 : sal_Int16 y;
81 : sal_uInt16 OfsLo,OfsHi; // DWord allignment is necessary (6 mod 4 =2) !
82 :
83 : friend SvStream& ReadSgfVector(SvStream& rIStream, SgfVector& rEntr);
84 : };
85 :
86 : extern long SgfVectXofs;
87 : extern long SgfVectYofs;
88 : extern long SgfVectXmul;
89 : extern long SgfVectYmul;
90 : extern long SgfVectXdiv;
91 : extern long SgfVectYdiv;
92 : extern bool SgfVectScal;
93 :
94 : #define BmpFileHeaderSize 14
95 : class BmpFileHeader
96 : {
97 : public:
98 : sal_uInt16 Typ; // = "BM"
99 : sal_uInt16 SizeLo,SizeHi; // filesize in bytes
100 : sal_uInt16 Reserve1; // reserved
101 : sal_uInt16 Reserve2; // reserved
102 : sal_uInt16 OfsLo,OfsHi; // Offset?
103 :
104 : void SetSize(sal_uInt32 Size);
105 : void SetOfs(sal_uInt32 Size);
106 : sal_uInt32 GetOfs();
107 : friend SvStream& WriteBmpFileHeader(SvStream& rOStream, BmpFileHeader& rHead);
108 : };
109 :
110 : #define BmpInfoHeaderSize 40
111 : class BmpInfoHeader
112 : {
113 : public:
114 : sal_uInt32 Size; // size of BmpInfoHeaders
115 : sal_Int32 Width; // width in Pixel
116 : sal_Int32 Hight; // height in Pixel
117 : sal_uInt16 Planes; // number of planes (always 1)
118 : sal_uInt16 PixBits; // number of bits per pixel (1,4,8 or 24)
119 : sal_uInt32 Compress; // datakompression
120 : sal_uInt32 ImgSize; // size of image in bytes. Without compression also 0 is allowed.
121 : sal_Int32 xDpmm; // Dot per Meter (0 is allowed)
122 : sal_Int32 yDpmm; // Dot per Meter (0 is allowed)
123 : sal_uInt32 ColUsed; // number of colours used (0=all
124 : sal_uInt32 ColMust; // number of important colours (0=all)
125 :
126 : friend SvStream& WriteBmpInfoHeader(SvStream& rOStream, BmpInfoHeader& rHead);
127 : };
128 :
129 : #define RGBQuadSize 4
130 : class RGBQuad {
131 : private:
132 : sal_uInt8 Red;
133 : sal_uInt8 Grn;
134 : sal_uInt8 Blu;
135 : sal_uInt8 Fil;
136 : public:
137 0 : RGBQuad(sal_uInt8 R, sal_uInt8 G, sal_uInt8 B) { Red=R; Grn=G; Blu=B; Fil=0; }
138 : };
139 :
140 : #endif // INCLUDED_VCL_SOURCE_FILTER_SGFBRAM_HXX
141 :
142 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|