xref: /aoo41x/main/vcl/inc/vcl/alpha.hxx (revision ce40ec59)
10d63794cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
30d63794cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
40d63794cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
50d63794cSAndrew Rist  * distributed with this work for additional information
60d63794cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
70d63794cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
80d63794cSAndrew Rist  * "License"); you may not use this file except in compliance
90d63794cSAndrew Rist  * with the License.  You may obtain a copy of the License at
100d63794cSAndrew Rist  *
110d63794cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
120d63794cSAndrew Rist  *
130d63794cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
140d63794cSAndrew Rist  * software distributed under the License is distributed on an
150d63794cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
160d63794cSAndrew Rist  * KIND, either express or implied.  See the License for the
170d63794cSAndrew Rist  * specific language governing permissions and limitations
180d63794cSAndrew Rist  * under the License.
190d63794cSAndrew Rist  *
200d63794cSAndrew Rist  *************************************************************/
210d63794cSAndrew Rist 
220d63794cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_ALPHA_HXX
25cdf0e10cSrcweir #define _SV_ALPHA_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vcl/dllapi.h>
28cdf0e10cSrcweir #include <vcl/bitmap.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir // -------------
31cdf0e10cSrcweir // - AlphaMask -
32cdf0e10cSrcweir // -------------
33cdf0e10cSrcweir 
34cdf0e10cSrcweir class ImageList;
35cdf0e10cSrcweir class BitmapEx;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class VCL_DLLPUBLIC AlphaMask : private Bitmap
38cdf0e10cSrcweir {
3945fd3b9aSArmin Le Grand private:
40cdf0e10cSrcweir 	friend class BitmapEx;
41cdf0e10cSrcweir 	friend class OutputDevice;
4245fd3b9aSArmin Le Grand     friend bool VCL_DLLPUBLIC ReadDIBBitmapEx(BitmapEx& rTarget, SvStream& rIStm);
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 	SAL_DLLPRIVATE const Bitmap&    ImplGetBitmap() const;
45cdf0e10cSrcweir 	SAL_DLLPRIVATE void             ImplSetBitmap( const Bitmap& rBitmap );
46cdf0e10cSrcweir 
47cdf0e10cSrcweir public:
48cdf0e10cSrcweir 
49cdf0e10cSrcweir                             AlphaMask();
50cdf0e10cSrcweir 							AlphaMask( const Bitmap& rBitmap );
51cdf0e10cSrcweir                             AlphaMask( const AlphaMask& rAlphaMask );
52cdf0e10cSrcweir                             AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency = NULL );
53*ce40ec59SHerbert Dürr     virtual                 ~AlphaMask();
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     AlphaMask&				operator=( const Bitmap& rBitmap );
operator =(const AlphaMask & rAlphaMask)56cdf0e10cSrcweir 	AlphaMask&				operator=( const AlphaMask& rAlphaMask ) { return (AlphaMask&) Bitmap::operator=( rAlphaMask ); }
operator !() const57cdf0e10cSrcweir 	sal_Bool					operator!() const { return Bitmap::operator!(); }
operator ==(const AlphaMask & rAlphaMask) const58cdf0e10cSrcweir     sal_Bool					operator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==( rAlphaMask ); }
operator !=(const AlphaMask & rAlphaMask) const59cdf0e10cSrcweir     sal_Bool					operator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=( rAlphaMask ); }
60cdf0e10cSrcweir 
GetPrefMapMode() const61cdf0e10cSrcweir     const MapMode&			GetPrefMapMode() const { return Bitmap::GetPrefMapMode(); }
SetPrefMapMode(const MapMode & rMapMode)62cdf0e10cSrcweir     void					SetPrefMapMode( const MapMode& rMapMode ) { Bitmap::SetPrefMapMode( rMapMode ); }
63cdf0e10cSrcweir 
GetPrefSize() const64cdf0e10cSrcweir     const Size&				GetPrefSize() const { return Bitmap::GetPrefSize(); }
SetPrefSize(const Size & rSize)65cdf0e10cSrcweir     void					SetPrefSize( const Size& rSize ) { Bitmap::SetPrefSize( rSize ); }
66cdf0e10cSrcweir 
GetSizePixel() const67cdf0e10cSrcweir     Size					GetSizePixel() const { return Bitmap::GetSizePixel(); }
SetSizePixel(const Size & rNewSize,sal_uInt32 nScaleFlag=BMP_SCALE_FASTESTINTERPOLATE)6854628ca4SArmin Le Grand 	void					SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag = BMP_SCALE_FASTESTINTERPOLATE )
6954628ca4SArmin Le Grand     {
7054628ca4SArmin Le Grand         Bitmap::SetSizePixel( rNewSize, nScaleFlag );
7154628ca4SArmin Le Grand     }
72cdf0e10cSrcweir 
GetSizeBytes() const73cdf0e10cSrcweir     sal_uLong					GetSizeBytes() const { return Bitmap::GetSizeBytes(); }
GetChecksum() const74cdf0e10cSrcweir 	sal_uLong					GetChecksum() const { return Bitmap::GetChecksum(); }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	Bitmap					GetBitmap() const;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir public:
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     sal_Bool                    Crop( const Rectangle& rRectPixel );
81cdf0e10cSrcweir     sal_Bool                    Expand( sal_uLong nDX, sal_uLong nDY, sal_uInt8* pInitTransparency = NULL );
82cdf0e10cSrcweir     sal_Bool                    CopyPixel( const Rectangle& rRectDst, const Rectangle& rRectSrc, const AlphaMask* pAlphaSrc = NULL );
83cdf0e10cSrcweir     sal_Bool                    Erase( sal_uInt8 cTransparency );
84cdf0e10cSrcweir     sal_Bool                    Invert();
85cdf0e10cSrcweir     sal_Bool                    Mirror( sal_uLong nMirrorFlags );
8654628ca4SArmin Le Grand     sal_Bool                    Scale( const Size& rNewSize, sal_uInt32 nScaleFlag = BMP_SCALE_FASTESTINTERPOLATE );
8754628ca4SArmin Le Grand     sal_Bool                    Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag = BMP_SCALE_FASTESTINTERPOLATE );
88cdf0e10cSrcweir     sal_Bool                    Rotate( long nAngle10, sal_uInt8 cFillTransparency );
89cdf0e10cSrcweir     sal_Bool                    Replace( const Bitmap& rMask, sal_uInt8 rReplaceTransparency );
90cdf0e10cSrcweir     sal_Bool                    Replace( sal_uInt8 cSearchTransparency, sal_uInt8 cReplaceTransparency, sal_uLong nTol = 0UL );
91cdf0e10cSrcweir     sal_Bool                    Replace( sal_uInt8* pSearchTransparencies, sal_uInt8* pReplaceTransparencies,
92cdf0e10cSrcweir 									 sal_uLong nColorCount, sal_uLong* pTols = NULL );
93cdf0e10cSrcweir 
94cdf0e10cSrcweir public:
95cdf0e10cSrcweir 
AcquireReadAccess()96cdf0e10cSrcweir     BitmapReadAccess*		AcquireReadAccess() { return Bitmap::AcquireReadAccess(); }
AcquireWriteAccess()97cdf0e10cSrcweir     BitmapWriteAccess*		AcquireWriteAccess() { return Bitmap::AcquireWriteAccess(); }
98cdf0e10cSrcweir     void					ReleaseAccess( BitmapReadAccess* pAccess );
99cdf0e10cSrcweir };
100cdf0e10cSrcweir 
101cdf0e10cSrcweir #endif // _SV_ALPHA_HXX
10245fd3b9aSArmin Le Grand // eof
103