1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
23 #include <vcl/dllapi.h>
24 #include <vcl/bitmap.hxx>
33 class VCL_DLLPUBLIC AlphaMask
: private Bitmap
35 friend class BitmapEx
;
36 friend class OutputDevice
;
37 friend VCL_DLLPUBLIC SvStream
& operator<<( SvStream
&, const ImageList
& );
41 SAL_DLLPRIVATE
const Bitmap
& ImplGetBitmap() const;
42 SAL_DLLPRIVATE
void ImplSetBitmap( const Bitmap
& rBitmap
);
47 AlphaMask( const Bitmap
& rBitmap
);
48 AlphaMask( const AlphaMask
& rAlphaMask
);
49 AlphaMask( const Size
& rSizePixel
, sal_uInt8
* pEraseTransparency
= NULL
);
52 AlphaMask
& operator=( const Bitmap
& rBitmap
);
53 AlphaMask
& operator=( const AlphaMask
& rAlphaMask
)
55 return (AlphaMask
&) Bitmap::operator=( rAlphaMask
);
58 sal_Bool
operator!() const
60 return Bitmap::operator!();
63 sal_Bool
operator==( const AlphaMask
& rAlphaMask
) const
65 return Bitmap::operator==( rAlphaMask
);
68 sal_Bool
operator!=( const AlphaMask
& rAlphaMask
) const
70 return Bitmap::operator!=( rAlphaMask
);
73 const MapMode
& GetPrefMapMode() const
75 return Bitmap::GetPrefMapMode();
78 void SetPrefMapMode( const MapMode
& rMapMode
)
80 Bitmap::SetPrefMapMode( rMapMode
);
83 const Size
& GetPrefSize() const
85 return Bitmap::GetPrefSize();
88 void SetPrefSize( const Size
& rSize
)
90 Bitmap::SetPrefSize( rSize
);
93 Size
GetSizePixel() const
95 return Bitmap::GetSizePixel();
98 sal_uLong
GetSizeBytes() const
100 return Bitmap::GetSizeBytes();
102 sal_uLong
GetChecksum() const
104 return Bitmap::GetChecksum();
107 Bitmap
GetBitmap() const;
109 sal_Bool
CopyPixel( const Rectangle
& rRectDst
, const Rectangle
& rRectSrc
,
110 const AlphaMask
* pAlphaSrc
= NULL
);
112 sal_Bool
Erase( sal_uInt8 cTransparency
);
113 sal_Bool
Replace( const Bitmap
& rMask
, sal_uInt8 rReplaceTransparency
);
114 sal_Bool
Replace( sal_uInt8 cSearchTransparency
, sal_uInt8 cReplaceTransparency
,
115 sal_uLong nTol
= 0UL );
117 BitmapReadAccess
* AcquireReadAccess()
119 return Bitmap::AcquireReadAccess();
122 BitmapWriteAccess
* AcquireWriteAccess()
124 return Bitmap::AcquireWriteAccess();
127 void ReleaseAccess( BitmapReadAccess
* pAccess
);
129 typedef vcl::ScopedBitmapAccess
< BitmapReadAccess
, AlphaMask
, &AlphaMask::AcquireReadAccess
>
131 typedef vcl::ScopedBitmapAccess
< BitmapWriteAccess
, AlphaMask
, &AlphaMask::AcquireWriteAccess
>
134 sal_Bool
Read( SvStream
& rIStm
, sal_Bool bFileHeader
= sal_True
)
136 return Bitmap::Read( rIStm
, bFileHeader
);
138 sal_Bool
Write( SvStream
& rOStm
, sal_Bool bCompressed
= sal_True
, sal_Bool bFileHeader
= sal_True
) const
140 return Bitmap::Write( rOStm
, bCompressed
, bFileHeader
);
143 friend VCL_DLLPUBLIC SvStream
& operator<<( SvStream
& rOStm
, const BitmapEx
& rBitmapEx
);
144 friend VCL_DLLPUBLIC SvStream
& operator>>( SvStream
& rIStm
, BitmapEx
& rBitmapEx
);
147 #endif // _SV_ALPHA_HXX
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */