Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_goodies / b3dtex.hxx
blob721cfd06c581094104e7d2cfa14188a18c7f630e
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: b3dtex.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 _B3D_B3DTEX_HXX
32 #define _B3D_B3DTEX_HXX
34 //#ifndef _SV_OPENGL_HXX
35 //#include <vcl/opengl.hxx>
36 //#endif
38 //#ifndef _SV_BITMAPEX_HXX
39 //#include <vcl/bitmapex.hxx>
40 //#endif
42 #ifndef _TOOLS_COLOR_HXX
43 #include <tools/color.hxx>
44 #endif
46 #ifndef _SV_SALBTYPE_HXX
47 #include <vcl/salbtype.hxx>
48 #endif
50 //#ifndef _TOOLS_TIME_HXX
51 //#include <tools/time.hxx>
52 //#endif
54 // Vorausdeklarationen
55 //class BitmapReadAccess;
56 //class BitmapColor;
58 namespace binfilter {
60 /*************************************************************************
62 |* define for lifetime of a texture in texture cache.
63 |* Parameter of Time(...) call, so hrs, min, sec, 100thsec.
64 |* Timer for cache uses ten secs delays
66 \************************************************************************/
68 #define B3D_TEXTURE_LIFETIME 0, 1, 0
70 /*************************************************************************
72 |* Long-Zeiger fuer OpenGL Texturdatenuebergabe
74 \************************************************************************/
76 #ifdef WIN
77 typedef UINT8 huge* GL_UINT8;
78 #else
79 typedef UINT8* GL_UINT8;
80 #endif
82 /*************************************************************************
84 |* Art der Pixeldaten der Textur
86 \************************************************************************/
88 enum Base3DTextureKind
90 Base3DTextureLuminance = 1,
91 Base3DTextureIntensity,
92 Base3DTextureColor
95 /*************************************************************************
97 |* Modus der Textur
99 \************************************************************************/
101 enum Base3DTextureMode
103 Base3DTextureReplace = 1,
104 Base3DTextureModulate,
105 Base3DTextureBlend
108 /*************************************************************************
110 |* Filtermodus der Textur
112 \************************************************************************/
114 enum Base3DTextureFilter
116 Base3DTextureNearest = 1,
117 Base3DTextureLinear
120 /*************************************************************************
122 |* Wrapping-Modus
124 \************************************************************************/
126 enum Base3DTextureWrap
128 Base3DTextureClamp = 1,
129 Base3DTextureRepeat,
130 Base3DTextureSingle
133 /*************************************************************************
135 |* Defines fuer Maskenbildung um Entscheidung innerhalb von ModifyColor
136 |* zu beschleunigen
138 \************************************************************************/
140 #define B3D_TXT_KIND_LUM 0x00
141 #define B3D_TXT_KIND_INT 0x01
142 #define B3D_TXT_KIND_COL 0x02
144 #define B3D_TXT_MODE_REP 0x04
145 #define B3D_TXT_MODE_MOD 0x08
146 #define B3D_TXT_MODE_BND 0x0C
148 #define B3D_TXT_FLTR_NEA 0x10
150 /*************************************************************************
152 |* Klassen fuer TexturAttribute beim Anfordern von Texturen
154 \************************************************************************/
156 #define TEXTURE_ATTRIBUTE_TYPE_COLOR 0x0000
157 #define TEXTURE_ATTRIBUTE_TYPE_BITMAP 0x0001
158 #define TEXTURE_ATTRIBUTE_TYPE_GRADIENT 0x0002
159 #define TEXTURE_ATTRIBUTE_TYPE_HATCH 0x0003
161 //class TextureAttributes
163 //private:
164 // void* mpFloatTrans;
165 // BOOL mbGhosted;
167 //public:
168 // TextureAttributes(BOOL bGhosted, void* pFT);
170 // virtual BOOL operator==(const TextureAttributes&) const;
171 // virtual UINT16 GetTextureAttributeType() const =0;
173 // BOOL GetGhostedAttribute() { return mbGhosted; }
174 // void* GetFloatTransAttribute() { return mpFloatTrans; }
175 //};
177 //class TextureAttributesColor : public TextureAttributes
179 //private:
180 // Color maColorAttribute;
182 //public:
183 // TextureAttributesColor(BOOL bGhosted, void* pFT, Color aColor);
185 // virtual BOOL operator==(const TextureAttributes&) const;
186 // virtual UINT16 GetTextureAttributeType() const;
188 // Color GetColorAttribute() { return maColorAttribute; }
189 //};
191 //class TextureAttributesBitmap : public TextureAttributes
193 //private:
194 // Bitmap maBitmapAttribute;
196 //public:
197 // TextureAttributesBitmap(BOOL bGhosted, void* pFT, Bitmap aBmp);
199 // virtual BOOL operator==(const TextureAttributes&) const;
200 // virtual UINT16 GetTextureAttributeType() const;
202 // Bitmap GetBitmapAttribute() { return maBitmapAttribute; }
203 //};
205 //class TextureAttributesGradient : public TextureAttributes
207 //private:
208 // void* mpFill;
209 // void* mpStepCount;
211 //public:
212 // TextureAttributesGradient(BOOL bGhosted, void* pFT, void* pF, void *pSC);
214 // virtual BOOL operator==(const TextureAttributes&) const;
215 // virtual UINT16 GetTextureAttributeType() const;
217 // void* GetFillAttribute() { return mpFill; }
218 // void* GetStepCountAttribute() { return mpStepCount; }
219 //};
221 //class TextureAttributesHatch : public TextureAttributes
223 //private:
224 // void* mpFill;
226 //public:
227 // TextureAttributesHatch(BOOL bGhosted, void* pFT, void* pF);
229 // virtual BOOL operator==(const TextureAttributes&) const;
230 // virtual UINT16 GetTextureAttributeType() const;
232 // void* GetHatchFillAttribute() { return mpFill; }
233 //};
235 /*************************************************************************
237 |* Klasse fuer Texturen in Base3D
239 \************************************************************************/
241 //class B3dTexture
243 //protected:
244 // // Die Bitmap(s) der Textur
245 // Bitmap aBitmap;
246 // AlphaMask aAlphaMask;
247 // BitmapReadAccess* pReadAccess;
248 // BitmapReadAccess* pAlphaReadAccess;
250 // // Attribute bei der Generierung
251 // TextureAttributes* pAttributes;
253 // // Gibt die Haeufigkeit der Benutzung wieder
254 // Time maTimeStamp;
256 // // Farbe fuer Base3DTextureBlend - Modus
257 // BitmapColor aColBlend;
259 // // Farbe, wenn keine Textur an einer Stelle liegt
260 // BitmapColor aColTexture;
262 // // Art der Textur
263 // Base3DTextureKind eKind;
265 // // Modus der Textur
266 // Base3DTextureMode eMode;
268 // // Filter
269 // Base3DTextureFilter eFilter;
271 // // Wrapping-Modes fuer beide Freiheitsgrade
272 // Base3DTextureWrap eWrapS;
273 // Base3DTextureWrap eWrapT;
275 // // Entscheidungsvariable
276 // UINT8 nSwitchVal;
278 // // Vorbestimmbare interne booleans
279 // unsigned bTextureKindChanged : 1;
281 // // Konstruktor / Destruktor
282 // B3dTexture(TextureAttributes& rAtt,
283 // BitmapEx& rBmpEx,
284 // Base3DTextureKind=Base3DTextureColor,
285 // Base3DTextureMode=Base3DTextureReplace,
286 // Base3DTextureFilter=Base3DTextureNearest,
287 // Base3DTextureWrap eS=Base3DTextureSingle,
288 // Base3DTextureWrap eT=Base3DTextureSingle);
289 // virtual ~B3dTexture();
291 // // Interne Zugriffsfunktion auf die BitMapFarben
292 // inline const BitmapColor GetBitmapColor(long nX, long nY);
293 // inline const sal_uInt8 GetBitmapTransparency(long nX, long nY);
295 // // Generate switch val for optimized own texture mapping
296 // void SetSwitchVal();
298 // // time stamp and texture cache methods
299 // void Touch() { maTimeStamp = Time() + Time(B3D_TEXTURE_LIFETIME); }
300 // const Time& GetTimeStamp() const { return maTimeStamp; }
302 //public:
303 // // Zugriff auf die Attribute der Textur
304 // TextureAttributes& GetAttributes();
306 // // Zugriff auf Bitmap
307 // Bitmap& GetBitmap() { return aBitmap; }
308 // AlphaMask& GetAlphaMask() { return aAlphaMask; }
309 // BitmapEx GetBitmapEx() { return BitmapEx(aBitmap, aAlphaMask); }
310 // const Size GetBitmapSize() { return aBitmap.GetSizePixel(); }
312 // // Texturfunktion
313 // void ModifyColor(Color& rCol, double fS, double fT);
315 // // Art der Pixeldaten lesen/bestimmen
316 // void SetTextureKind(Base3DTextureKind eNew);
317 // Base3DTextureKind GetTextureKind() { return eKind; }
319 // // Texturmodus lesen/bestimmen
320 // void SetTextureMode(Base3DTextureMode eNew);
321 // Base3DTextureMode GetTextureMode() { return eMode; }
323 // // Filtermodus lesen/bestimmen
324 // void SetTextureFilter(Base3DTextureFilter eNew);
325 // Base3DTextureFilter GetTextureFilter() { return eFilter; }
327 // // Wrapping fuer beide Freiheitsgrade lesen/bestimmen
328 // void SetTextureWrapS(Base3DTextureWrap eNew);
329 // Base3DTextureWrap GetTextureWrapS() { return eWrapS; }
330 // void SetTextureWrapT(Base3DTextureWrap eNew);
331 // Base3DTextureWrap GetTextureWrapT() { return eWrapT; }
333 // // Blend-Color lesen/bestimmen
334 // void SetBlendColor(Color rNew);
335 // Color GetBlendColor();
337 // // Textur-Ersatz-Color lesen/bestimmen
338 // void SetTextureColor(Color rNew);
339 // Color GetTextureColor();
341 //protected:
342 // // Zugriff auf Konstruktor/Destruktor nur fuer die verwaltenden Klassen
343 // friend class Base3D;
344 // friend class Base3DOpenGL;
345 // friend class B3dGlobalData;
346 // friend class B3dTextureStore;
347 //};
349 /*************************************************************************
351 |* erweiterte Klasse fuer Texturen in Base3DOpenGL
353 \************************************************************************/
355 //class B3dTextureOpenGL : public B3dTexture
357 //private:
358 // // Name dieser Textur in OpenGL
359 // GLuint nTextureName;
361 // // Konstruktor / Destruktor
362 // B3dTextureOpenGL(TextureAttributes& rAtt,
363 // BitmapEx& rBmpEx,
364 // OpenGL& rOGL,
365 // Base3DTextureKind=Base3DTextureColor,
366 // Base3DTextureMode=Base3DTextureReplace,
367 // Base3DTextureFilter=Base3DTextureNearest,
368 // Base3DTextureWrap eS=Base3DTextureClamp,
369 // Base3DTextureWrap eT=Base3DTextureClamp);
370 // virtual ~B3dTextureOpenGL();
372 // // In OpenGL die Textur zerstoeren
373 // void DestroyOpenGLTexture(OpenGL&);
375 //public:
376 // // Setze diese Textur in OpenGL als aktuelle Textur
377 // void MakeCurrentTexture(OpenGL&);
379 // // Erzeuge diese Textur als OpenGL-Textur
380 // void CreateOpenGLTexture(OpenGL&);
382 //protected:
383 // // Zugriff auf Konstruktor/Destruktor nur fuer die verwaltenden Klassen
384 // friend class Base3D;
385 // friend class Base3DOpenGL;
386 // friend class B3dTextureStore;
387 //};
388 }//end of namespace binfilter
390 #endif // _B3D_B3DTEX_HXX