xref: /aoo41x/main/vcl/inc/impbmp.hxx (revision 161f4cd1)
1*161f4cd1SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*161f4cd1SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*161f4cd1SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*161f4cd1SAndrew Rist  * distributed with this work for additional information
6*161f4cd1SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*161f4cd1SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*161f4cd1SAndrew Rist  * "License"); you may not use this file except in compliance
9*161f4cd1SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*161f4cd1SAndrew Rist  *
11*161f4cd1SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*161f4cd1SAndrew Rist  *
13*161f4cd1SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*161f4cd1SAndrew Rist  * software distributed under the License is distributed on an
15*161f4cd1SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*161f4cd1SAndrew Rist  * KIND, either express or implied.  See the License for the
17*161f4cd1SAndrew Rist  * specific language governing permissions and limitations
18*161f4cd1SAndrew Rist  * under the License.
19*161f4cd1SAndrew Rist  *
20*161f4cd1SAndrew Rist  *************************************************************/
21*161f4cd1SAndrew Rist 
22*161f4cd1SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_IMPBMP_HXX
25cdf0e10cSrcweir #define _SV_IMPBMP_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/gen.hxx>
28cdf0e10cSrcweir #include <vcl/sv.h>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir // ---------------
31cdf0e10cSrcweir // - ImpBitmap -
32cdf0e10cSrcweir // ---------------
33cdf0e10cSrcweir 
34cdf0e10cSrcweir struct BitmapBuffer;
35cdf0e10cSrcweir class SalBitmap;
36cdf0e10cSrcweir class BitmapPalette;
37cdf0e10cSrcweir class SalGraphics;
38cdf0e10cSrcweir class ImplServerBitmap;
39cdf0e10cSrcweir class Bitmap;
40cdf0e10cSrcweir class OutputDevice;
41cdf0e10cSrcweir class Color;
42cdf0e10cSrcweir class AlphaMask;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir class ImpBitmap
45cdf0e10cSrcweir {
46cdf0e10cSrcweir private:
47cdf0e10cSrcweir 
48cdf0e10cSrcweir     sal_uLong				mnRefCount;
49cdf0e10cSrcweir 	sal_uLong				mnChecksum;
50cdf0e10cSrcweir     SalBitmap*			mpSalBitmap;
51cdf0e10cSrcweir 	Size				maSourceSize;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir public:
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 						ImpBitmap();
56cdf0e10cSrcweir 						~ImpBitmap();
57cdf0e10cSrcweir 
58cdf0e10cSrcweir #if _SOLAR__PRIVATE
59cdf0e10cSrcweir 
60cdf0e10cSrcweir public:
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 	void				ImplSetSalBitmap( SalBitmap* pSalBitmap );
ImplGetSalBitmap() const63cdf0e10cSrcweir     SalBitmap*			ImplGetSalBitmap() const { return mpSalBitmap; }
64cdf0e10cSrcweir 
65cdf0e10cSrcweir public:
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     sal_Bool				ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
68cdf0e10cSrcweir     sal_Bool				ImplCreate( const ImpBitmap& rImpBitmap );
69cdf0e10cSrcweir     sal_Bool				ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics );
70cdf0e10cSrcweir     sal_Bool				ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount );
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     void				ImplDestroy();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     Size				ImplGetSize() const;
75cdf0e10cSrcweir     Size				ImplGetSourceSize() const;
76cdf0e10cSrcweir     void				ImplSetSourceSize( const Size&);
77cdf0e10cSrcweir     sal_uInt16				ImplGetBitCount() const;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     BitmapBuffer*		ImplAcquireBuffer( sal_Bool bReadOnly );
80cdf0e10cSrcweir     void				ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir public:
83cdf0e10cSrcweir 
ImplGetRefCount() const84cdf0e10cSrcweir     sal_uLong				ImplGetRefCount() const { return mnRefCount; }
ImplIncRefCount()85cdf0e10cSrcweir     void				ImplIncRefCount() { mnRefCount++; }
ImplDecRefCount()86cdf0e10cSrcweir     void				ImplDecRefCount() { mnRefCount--; }
87cdf0e10cSrcweir 
ImplSetChecksum(sal_uLong nChecksum)88cdf0e10cSrcweir 	inline void			ImplSetChecksum( sal_uLong nChecksum ) { mnChecksum = nChecksum; }
ImplGetChecksum() const89cdf0e10cSrcweir 	inline sal_uLong		ImplGetChecksum() const { return mnChecksum; }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir #endif // PRIVATE
92cdf0e10cSrcweir };
93cdf0e10cSrcweir 
ImplGetSourceSize() const94cdf0e10cSrcweir inline Size ImpBitmap::ImplGetSourceSize() const
95cdf0e10cSrcweir {
96cdf0e10cSrcweir 	return maSourceSize;
97cdf0e10cSrcweir }
98cdf0e10cSrcweir 
ImplSetSourceSize(const Size & rSize)99cdf0e10cSrcweir inline void ImpBitmap::ImplSetSourceSize( const Size& rSize)
100cdf0e10cSrcweir {
101cdf0e10cSrcweir 	maSourceSize = rSize;
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir #endif // _SV_IMPBMP_HXX
105