Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
eacd6b0e
Kaydet (Commit)
eacd6b0e
authored
Tem 23, 2011
tarafından
Joseph Powers
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unusedcode.easy: AlphaMask
üst
18d18c8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
159 deletions
+85
-159
alpha.hxx
vcl/inc/vcl/alpha.hxx
+85
-40
alpha.cxx
vcl/source/gdi/alpha.cxx
+0
-119
No files found.
vcl/inc/vcl/alpha.hxx
Dosyayı görüntüle @
eacd6b0e
...
...
@@ -59,45 +59,82 @@ public:
~
AlphaMask
();
AlphaMask
&
operator
=
(
const
Bitmap
&
rBitmap
);
AlphaMask
&
operator
=
(
const
AlphaMask
&
rAlphaMask
)
{
return
(
AlphaMask
&
)
Bitmap
::
operator
=
(
rAlphaMask
);
}
sal_Bool
operator
!
()
const
{
return
Bitmap
::
operator
!
();
}
sal_Bool
operator
==
(
const
AlphaMask
&
rAlphaMask
)
const
{
return
Bitmap
::
operator
==
(
rAlphaMask
);
}
sal_Bool
operator
!=
(
const
AlphaMask
&
rAlphaMask
)
const
{
return
Bitmap
::
operator
!=
(
rAlphaMask
);
}
const
MapMode
&
GetPrefMapMode
()
const
{
return
Bitmap
::
GetPrefMapMode
();
}
void
SetPrefMapMode
(
const
MapMode
&
rMapMode
)
{
Bitmap
::
SetPrefMapMode
(
rMapMode
);
}
const
Size
&
GetPrefSize
()
const
{
return
Bitmap
::
GetPrefSize
();
}
void
SetPrefSize
(
const
Size
&
rSize
)
{
Bitmap
::
SetPrefSize
(
rSize
);
}
Size
GetSizePixel
()
const
{
return
Bitmap
::
GetSizePixel
();
}
void
SetSizePixel
(
const
Size
&
rNewSize
)
{
Bitmap
::
SetSizePixel
(
rNewSize
);
}
sal_uLong
GetSizeBytes
()
const
{
return
Bitmap
::
GetSizeBytes
();
}
sal_uLong
GetChecksum
()
const
{
return
Bitmap
::
GetChecksum
();
}
AlphaMask
&
operator
=
(
const
AlphaMask
&
rAlphaMask
)
{
return
(
AlphaMask
&
)
Bitmap
::
operator
=
(
rAlphaMask
);
}
sal_Bool
operator
!
()
const
{
return
Bitmap
::
operator
!
();
}
sal_Bool
operator
==
(
const
AlphaMask
&
rAlphaMask
)
const
{
return
Bitmap
::
operator
==
(
rAlphaMask
);
}
sal_Bool
operator
!=
(
const
AlphaMask
&
rAlphaMask
)
const
{
return
Bitmap
::
operator
!=
(
rAlphaMask
);
}
const
MapMode
&
GetPrefMapMode
()
const
{
return
Bitmap
::
GetPrefMapMode
();
}
void
SetPrefMapMode
(
const
MapMode
&
rMapMode
)
{
Bitmap
::
SetPrefMapMode
(
rMapMode
);
}
const
Size
&
GetPrefSize
()
const
{
return
Bitmap
::
GetPrefSize
();
}
void
SetPrefSize
(
const
Size
&
rSize
)
{
Bitmap
::
SetPrefSize
(
rSize
);
}
Size
GetSizePixel
()
const
{
return
Bitmap
::
GetSizePixel
();
}
void
SetSizePixel
(
const
Size
&
rNewSize
)
{
Bitmap
::
SetSizePixel
(
rNewSize
);
}
sal_uLong
GetSizeBytes
()
const
{
return
Bitmap
::
GetSizeBytes
();
}
sal_uLong
GetChecksum
()
const
{
return
Bitmap
::
GetChecksum
();
}
Bitmap
GetBitmap
()
const
;
public
:
sal_Bool
Crop
(
const
Rectangle
&
rRectPixel
);
sal_Bool
Expand
(
sal_uLong
nDX
,
sal_uLong
nDY
,
sal_uInt8
*
pInitTransparency
=
NULL
);
sal_Bool
CopyPixel
(
const
Rectangle
&
rRectDst
,
const
Rectangle
&
rRectSrc
,
const
AlphaMask
*
pAlphaSrc
=
NULL
);
sal_Bool
Erase
(
sal_uInt8
cTransparency
);
sal_Bool
Invert
();
sal_Bool
Mirror
(
sal_uLong
nMirrorFlags
);
sal_Bool
Scale
(
const
Size
&
rNewSize
,
sal_uLong
nScaleFlag
=
BMP_SCALE_FAST
);
sal_Bool
Scale
(
const
double
&
rScaleX
,
const
double
&
rScaleY
,
sal_uLong
nScaleFlag
=
BMP_SCALE_FAST
);
sal_Bool
Rotate
(
long
nAngle10
,
sal_uInt8
cFillTransparency
);
sal_Bool
Replace
(
const
Bitmap
&
rMask
,
sal_uInt8
rReplaceTransparency
);
sal_Bool
Replace
(
sal_uInt8
cSearchTransparency
,
sal_uInt8
cReplaceTransparency
,
sal_uLong
nTol
=
0UL
);
sal_Bool
Replace
(
sal_uInt8
*
pSearchTransparencies
,
sal_uInt8
*
pReplaceTransparencies
,
sal_uLong
nColorCount
,
sal_uLong
*
pTols
=
NULL
);
public
:
BitmapReadAccess
*
AcquireReadAccess
()
{
return
Bitmap
::
AcquireReadAccess
();
}
BitmapWriteAccess
*
AcquireWriteAccess
()
{
return
Bitmap
::
AcquireWriteAccess
();
}
sal_Bool
CopyPixel
(
const
Rectangle
&
rRectDst
,
const
Rectangle
&
rRectSrc
,
const
AlphaMask
*
pAlphaSrc
=
NULL
);
sal_Bool
Erase
(
sal_uInt8
cTransparency
);
sal_Bool
Replace
(
const
Bitmap
&
rMask
,
sal_uInt8
rReplaceTransparency
);
sal_Bool
Replace
(
sal_uInt8
cSearchTransparency
,
sal_uInt8
cReplaceTransparency
,
sal_uLong
nTol
=
0UL
);
BitmapReadAccess
*
AcquireReadAccess
()
{
return
Bitmap
::
AcquireReadAccess
();
}
BitmapWriteAccess
*
AcquireWriteAccess
()
{
return
Bitmap
::
AcquireWriteAccess
();
}
void
ReleaseAccess
(
BitmapReadAccess
*
pAccess
);
typedef
vcl
::
ScopedBitmapAccess
<
BitmapReadAccess
,
AlphaMask
,
&
AlphaMask
::
AcquireReadAccess
>
...
...
@@ -105,10 +142,18 @@ public:
typedef
vcl
::
ScopedBitmapAccess
<
BitmapWriteAccess
,
AlphaMask
,
&
AlphaMask
::
AcquireWriteAccess
>
ScopedWriteAccess
;
public
:
sal_Bool
Read
(
SvStream
&
rIStm
,
sal_Bool
bFileHeader
=
sal_True
)
{
return
Bitmap
::
Read
(
rIStm
,
bFileHeader
);
}
sal_Bool
Write
(
SvStream
&
rOStm
,
sal_Bool
bCompressed
=
sal_True
,
sal_Bool
bFileHeader
=
sal_True
)
const
{
return
Bitmap
::
Write
(
rOStm
,
bCompressed
,
bFileHeader
);
}
sal_Bool
Read
(
SvStream
&
rIStm
,
sal_Bool
bFileHeader
=
sal_True
)
{
return
Bitmap
::
Read
(
rIStm
,
bFileHeader
);
}
sal_Bool
Write
(
SvStream
&
rOStm
,
sal_Bool
bCompressed
=
sal_True
,
sal_Bool
bFileHeader
=
sal_True
)
const
{
return
Bitmap
::
Write
(
rOStm
,
bCompressed
,
bFileHeader
);
}
friend
VCL_DLLPUBLIC
SvStream
&
operator
<<
(
SvStream
&
rOStm
,
const
BitmapEx
&
rBitmapEx
);
friend
VCL_DLLPUBLIC
SvStream
&
operator
>>
(
SvStream
&
rIStm
,
BitmapEx
&
rBitmapEx
);
...
...
vcl/source/gdi/alpha.cxx
Dosyayı görüntüle @
eacd6b0e
...
...
@@ -108,25 +108,6 @@ Bitmap AlphaMask::GetBitmap() const
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
Crop
(
const
Rectangle
&
rRectPixel
)
{
return
Bitmap
::
Crop
(
rRectPixel
);
}
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
Expand
(
sal_uLong
nDX
,
sal_uLong
nDY
,
sal_uInt8
*
pInitTransparency
)
{
Color
aColor
;
if
(
pInitTransparency
)
aColor
=
Color
(
*
pInitTransparency
,
*
pInitTransparency
,
*
pInitTransparency
);
return
Bitmap
::
Expand
(
nDX
,
nDY
,
pInitTransparency
?
&
aColor
:
NULL
);
}
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
CopyPixel
(
const
Rectangle
&
rRectDst
,
const
Rectangle
&
rRectSrc
,
const
AlphaMask
*
pAlphaSrc
)
{
...
...
@@ -245,79 +226,6 @@ sal_Bool AlphaMask::Erase( sal_uInt8 cTransparency )
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
Invert
()
{
BitmapWriteAccess
*
pAcc
=
AcquireWriteAccess
();
sal_Bool
bRet
=
sal_False
;
if
(
pAcc
&&
pAcc
->
GetBitCount
()
==
8
)
{
BitmapColor
aCol
(
0
);
const
long
nWidth
=
pAcc
->
Width
(),
nHeight
=
pAcc
->
Height
();
sal_uInt8
*
pMap
=
new
sal_uInt8
[
256
];
for
(
long
i
=
0
;
i
<
256
;
i
++
)
pMap
[
i
]
=
~
(
sal_uInt8
)
i
;
for
(
long
nY
=
0L
;
nY
<
nHeight
;
nY
++
)
{
for
(
long
nX
=
0L
;
nX
<
nWidth
;
nX
++
)
{
aCol
.
SetIndex
(
pMap
[
pAcc
->
GetPixel
(
nY
,
nX
).
GetIndex
()
]
);
pAcc
->
SetPixel
(
nY
,
nX
,
aCol
);
}
}
delete
[]
pMap
;
bRet
=
sal_True
;
}
if
(
pAcc
)
ReleaseAccess
(
pAcc
);
return
bRet
;
}
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
Mirror
(
sal_uLong
nMirrorFlags
)
{
return
Bitmap
::
Mirror
(
nMirrorFlags
);
}
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
Scale
(
const
Size
&
rNewSize
,
sal_uLong
nScaleFlag
)
{
sal_Bool
bRet
=
Bitmap
::
Scale
(
rNewSize
,
nScaleFlag
);
if
(
bRet
&&
(
nScaleFlag
==
BMP_SCALE_INTERPOLATE
)
)
Bitmap
::
Convert
(
BMP_CONVERSION_8BIT_GREYS
);
return
bRet
;
}
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
Scale
(
const
double
&
rScaleX
,
const
double
&
rScaleY
,
sal_uLong
nScaleFlag
)
{
sal_Bool
bRet
=
Bitmap
::
Scale
(
rScaleX
,
rScaleY
,
nScaleFlag
);
if
(
bRet
&&
(
nScaleFlag
==
BMP_SCALE_INTERPOLATE
)
)
Bitmap
::
Convert
(
BMP_CONVERSION_8BIT_GREYS
);
return
bRet
;
}
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
Rotate
(
long
nAngle10
,
sal_uInt8
cFillTransparency
)
{
return
Bitmap
::
Rotate
(
nAngle10
,
Color
(
cFillTransparency
,
cFillTransparency
,
cFillTransparency
)
);
}
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
Replace
(
const
Bitmap
&
rMask
,
sal_uInt8
cReplaceTransparency
)
{
BitmapReadAccess
*
pMaskAcc
=
(
(
Bitmap
&
)
rMask
).
AcquireReadAccess
();
...
...
@@ -398,33 +306,6 @@ nTol
// -----------------------------------------------------------------------------
sal_Bool
AlphaMask
::
Replace
(
sal_uInt8
*
pSearchTransparencies
,
sal_uInt8
*
pReplaceTransparencies
,
sal_uLong
nColorCount
,
sal_uLong
*
pTols
)
{
Color
*
pSearchColors
=
new
Color
[
nColorCount
];
Color
*
pReplaceColors
=
new
Color
[
nColorCount
];
sal_Bool
bRet
;
for
(
sal_uLong
i
=
0
;
i
<
nColorCount
;
i
++
)
{
const
sal_uInt8
cSearchTransparency
=
pSearchTransparencies
[
i
];
const
sal_uInt8
cReplaceTransparency
=
pReplaceTransparencies
[
i
];
pSearchColors
[
i
]
=
Color
(
cSearchTransparency
,
cSearchTransparency
,
cSearchTransparency
);
pReplaceColors
[
i
]
=
Color
(
cReplaceTransparency
,
cReplaceTransparency
,
cReplaceTransparency
);
}
bRet
=
Bitmap
::
Replace
(
pSearchColors
,
pReplaceColors
,
nColorCount
,
pTols
)
&&
Bitmap
::
Convert
(
BMP_CONVERSION_8BIT_GREYS
);
delete
[]
pSearchColors
;
delete
[]
pReplaceColors
;
return
bRet
;
}
// -----------------------------------------------------------------------------
void
AlphaMask
::
ReleaseAccess
(
BitmapReadAccess
*
pAccess
)
{
if
(
pAccess
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment