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
71cca07f
Kaydet (Commit)
71cca07f
authored
May 12, 2013
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove old scale convolution methods from Bitmap.
Change-Id: I0265a4b4c7b2fda267eb56ef719fd6a53d49d460
üst
baebeb7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
112 deletions
+0
-112
bitmap.hxx
include/vcl/bitmap.hxx
+0
-9
bitmap3.cxx
vcl/source/gdi/bitmap3.cxx
+0
-103
No files found.
include/vcl/bitmap.hxx
Dosyayı görüntüle @
71cca07f
...
...
@@ -345,15 +345,6 @@ public:
SAL_DLLPRIVATE
sal_Bool
ImplScaleInterpolate
(
const
double
&
rScaleX
,
const
double
&
rScaleY
);
SAL_DLLPRIVATE
sal_Bool
ImplScaleSuper
(
const
double
&
rScaleX
,
const
double
&
rScaleY
);
SAL_DLLPRIVATE
sal_Bool
ImplScaleConvolution
(
const
double
&
rScaleX
,
const
double
&
rScaleY
,
const
Kernel
&
aKernel
);
SAL_DLLPRIVATE
bool
ImplScaleConvolution
(
const
double
&
rScaleX
,
const
double
&
rScaleY
,
Kernel
&
aKernel
);
SAL_DLLPRIVATE
bool
ImplTransformAveraging
(
const
double
&
rScaleX
,
const
double
&
rScaleY
,
const
Rectangle
&
rRotatedRectangle
,
const
long
nAngle10
,
const
Color
&
rFillColor
);
SAL_DLLPRIVATE
bool
ImplTransformBilinearFiltering
(
const
double
&
rScaleX
,
const
double
&
rScaleY
,
const
Rectangle
&
rRotatedRectangle
,
const
long
nAngle10
,
const
Color
&
rFillColor
);
SAL_DLLPRIVATE
static
void
ImplCalculateContributions
(
const
int
aSourceSize
,
const
int
aDestinationSize
,
int
&
aNumberOfContributions
,
double
*&
pWeights
,
int
*&
pPixels
,
int
*&
pCount
,
Kernel
&
aKernel
);
SAL_DLLPRIVATE
bool
ImplConvolutionPass
(
Bitmap
&
aNewBitmap
,
const
int
nNewSize
,
BitmapReadAccess
*
pReadAcc
,
int
aNumberOfContributions
,
double
*
pWeights
,
int
*
pPixels
,
int
*
pCount
);
...
...
vcl/source/gdi/bitmap3.cxx
Dosyayı görüntüle @
71cca07f
...
...
@@ -3396,109 +3396,6 @@ sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
return
bRet
;
}
bool
Bitmap
::
ImplScaleConvolution
(
const
double
&
rScaleX
,
const
double
&
rScaleY
,
Kernel
&
aKernel
)
{
const
long
nWidth
=
GetSizePixel
().
Width
();
const
long
nHeight
=
GetSizePixel
().
Height
();
const
long
nNewWidth
=
FRound
(
nWidth
*
rScaleX
);
const
long
nNewHeight
=
FRound
(
nHeight
*
rScaleY
);
bool
bResult
;
BitmapReadAccess
*
pReadAcc
;
Bitmap
aNewBitmap
;
int
aNumberOfContributions
;
double
*
pWeights
;
int
*
pPixels
;
int
*
pCount
;
// Handle negative scales safely cf. other ImplScale methods
if
(
(
nNewWidth
<
1L
)
||
(
nNewHeight
<
1L
)
)
return
false
;
// Do horizontal filtering
ImplCalculateContributions
(
nWidth
,
nNewWidth
,
aNumberOfContributions
,
pWeights
,
pPixels
,
pCount
,
aKernel
);
pReadAcc
=
AcquireReadAccess
();
aNewBitmap
=
Bitmap
(
Size
(
nHeight
,
nNewWidth
),
24
);
bResult
=
ImplConvolutionPass
(
aNewBitmap
,
nNewWidth
,
pReadAcc
,
aNumberOfContributions
,
pWeights
,
pPixels
,
pCount
);
ReleaseAccess
(
pReadAcc
);
delete
[]
pWeights
;
delete
[]
pCount
;
delete
[]
pPixels
;
if
(
!
bResult
)
return
bResult
;
// Swap Bitmaps
ImplAssignWithSize
(
aNewBitmap
);
// Do vertical filtering
ImplCalculateContributions
(
nHeight
,
nNewHeight
,
aNumberOfContributions
,
pWeights
,
pPixels
,
pCount
,
aKernel
);
pReadAcc
=
AcquireReadAccess
();
aNewBitmap
=
Bitmap
(
Size
(
nNewWidth
,
nNewHeight
),
24
);
bResult
=
ImplConvolutionPass
(
aNewBitmap
,
nNewHeight
,
pReadAcc
,
aNumberOfContributions
,
pWeights
,
pPixels
,
pCount
);
ReleaseAccess
(
pReadAcc
);
delete
[]
pWeights
;
delete
[]
pCount
;
delete
[]
pPixels
;
if
(
!
bResult
)
return
bResult
;
ImplAssignWithSize
(
aNewBitmap
);
return
true
;
}
void
Bitmap
::
ImplCalculateContributions
(
const
int
aSourceSize
,
const
int
aDestinationSize
,
int
&
aNumberOfContributions
,
double
*&
pWeights
,
int
*&
pPixels
,
int
*&
pCount
,
Kernel
&
aKernel
)
{
const
double
aSamplingRadius
=
aKernel
.
GetWidth
();
const
double
aScale
=
aDestinationSize
/
(
double
)
aSourceSize
;
const
double
aScaledRadius
=
(
aScale
<
1.0
)
?
aSamplingRadius
/
aScale
:
aSamplingRadius
;
const
double
aFilterFactor
=
(
aScale
<
1.0
)
?
aScale
:
1.0
;
aNumberOfContributions
=
(
int
)
(
2
*
ceil
(
aScaledRadius
)
+
1
);
pWeights
=
new
double
[
aDestinationSize
*
aNumberOfContributions
];
pPixels
=
new
int
[
aDestinationSize
*
aNumberOfContributions
];
pCount
=
new
int
[
aDestinationSize
];
double
aWeight
,
aCenter
;
int
aIndex
,
aLeft
,
aRight
;
int
aPixelIndex
,
aCurrentCount
;
for
(
int
i
=
0
;
i
<
aDestinationSize
;
i
++
)
{
aIndex
=
i
*
aNumberOfContributions
;
aCurrentCount
=
0
;
aCenter
=
i
/
aScale
;
aLeft
=
(
int
)
floor
(
aCenter
-
aScaledRadius
);
aRight
=
(
int
)
ceil
(
aCenter
+
aScaledRadius
);
for
(
int
j
=
aLeft
;
j
<=
aRight
;
j
++
)
{
aWeight
=
aKernel
.
Calculate
(
aFilterFactor
*
(
aCenter
-
(
double
)
j
)
);
// Reduce calculations with ignoring weights of 0.0
if
(
fabs
(
aWeight
)
<
0.0001
)
continue
;
// Handling on edges
aPixelIndex
=
MinMax
(
j
,
0
,
aSourceSize
-
1
);
pWeights
[
aIndex
+
aCurrentCount
]
=
aWeight
;
pPixels
[
aIndex
+
aCurrentCount
]
=
aPixelIndex
;
aCurrentCount
++
;
}
pCount
[
i
]
=
aCurrentCount
;
}
}
bool
Bitmap
::
ImplConvolutionPass
(
Bitmap
&
aNewBitmap
,
const
int
nNewSize
,
BitmapReadAccess
*
pReadAcc
,
int
aNumberOfContributions
,
double
*
pWeights
,
int
*
pPixels
,
int
*
pCount
)
{
BitmapWriteAccess
*
pWriteAcc
=
aNewBitmap
.
AcquireWriteAccess
();
...
...
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