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
1d4bbe7b
Kaydet (Commit)
1d4bbe7b
authored
May 13, 2013
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl: attempt to fix high quality scaling to get aspect ratio right.
Change-Id: Ic62c6a16c39dd4e4e19bf9a96503ecf6ac50f292
üst
d97732f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
filters-test.cxx
vcl/qa/cppunit/graphicfilter/filters-test.cxx
+20
-0
bitmap3.cxx
vcl/source/gdi/bitmap3.cxx
+14
-5
No files found.
vcl/qa/cppunit/graphicfilter/filters-test.cxx
Dosyayı görüntüle @
1d4bbe7b
...
@@ -38,8 +38,12 @@ public:
...
@@ -38,8 +38,12 @@ public:
*/
*/
void
testCVEs
();
void
testCVEs
();
/// test scaling
void
testScaling
();
CPPUNIT_TEST_SUITE
(
VclFiltersTest
);
CPPUNIT_TEST_SUITE
(
VclFiltersTest
);
CPPUNIT_TEST
(
testCVEs
);
CPPUNIT_TEST
(
testCVEs
);
CPPUNIT_TEST
(
testScaling
);
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
};
};
...
@@ -53,6 +57,22 @@ bool VclFiltersTest::load(const OUString &,
...
@@ -53,6 +57,22 @@ bool VclFiltersTest::load(const OUString &,
return
aGraphicFilter
.
ImportGraphic
(
aGraphic
,
rURL
,
aFileStream
)
==
0
;
return
aGraphicFilter
.
ImportGraphic
(
aGraphic
,
rURL
,
aFileStream
)
==
0
;
}
}
void
VclFiltersTest
::
testScaling
()
{
for
(
unsigned
int
i
=
BMP_SCALE_FAST
;
i
<=
BMP_SCALE_BOX
;
i
++
)
{
Bitmap
aBitmap
(
Size
(
413
,
409
),
24
);
BitmapEx
aBitmapEx
(
aBitmap
);
fprintf
(
stderr
,
"scale with type %d
\n
"
,
i
);
CPPUNIT_ASSERT
(
aBitmapEx
.
Scale
(
0.1937046
,
0.193154
,
i
)
);
Size
aAfter
(
aBitmapEx
.
GetSizePixel
()
);
fprintf
(
stderr
,
"size %ld, %ld
\n
"
,
(
long
)
aAfter
.
Width
(),
aAfter
.
Height
()
);
CPPUNIT_ASSERT
(
labs
(
aAfter
.
Height
()
-
aAfter
.
Width
())
<=
1
);
}
}
void
VclFiltersTest
::
testCVEs
()
void
VclFiltersTest
::
testCVEs
()
{
{
#ifndef DISABLE_CVE_TESTS
#ifndef DISABLE_CVE_TESTS
...
...
vcl/source/gdi/bitmap3.cxx
Dosyayı görüntüle @
1d4bbe7b
...
@@ -2368,7 +2368,7 @@ namespace
...
@@ -2368,7 +2368,7 @@ namespace
}
}
// #i121233# Added BMP_SCALE_LANCZOS, BMP_SCALE_BICUBIC, BMP_SCALE_BILINEAR and
// #i121233# Added BMP_SCALE_LANCZOS, BMP_SCALE_BICUBIC, BMP_SCALE_BILINEAR and
// BMP_SCALE_BOX derived from the original commit from Toma Vajngerl (see
// BMP_SCALE_BOX derived from the original commit from Toma
s
Vajngerl (see
// bugzilla task for deitails) Thanks!
// bugzilla task for deitails) Thanks!
sal_Bool
Bitmap
::
ImplScaleConvolution
(
sal_Bool
Bitmap
::
ImplScaleConvolution
(
const
double
&
rScaleX
,
const
double
&
rScaleX
,
...
@@ -2426,29 +2426,38 @@ sal_Bool Bitmap::ImplScaleConvolution(
...
@@ -2426,29 +2426,38 @@ sal_Bool Bitmap::ImplScaleConvolution(
const
sal_uInt32
nInBetweenSizeHorFirst
(
nHeight
*
nNewWidth
);
const
sal_uInt32
nInBetweenSizeHorFirst
(
nHeight
*
nNewWidth
);
const
sal_uInt32
nInBetweenSizeVerFirst
(
nNewHeight
*
nWidth
);
const
sal_uInt32
nInBetweenSizeVerFirst
(
nNewHeight
*
nWidth
);
Bitmap
aInterm
;
if
(
nInBetweenSizeHorFirst
<
nInBetweenSizeVerFirst
)
if
(
nInBetweenSizeHorFirst
<
nInBetweenSizeVerFirst
)
{
{
if
(
bScaleHor
)
if
(
bScaleHor
)
{
{
bResult
=
ImplScaleConvolutionHor
(
*
this
,
a
Result
,
fScaleX
,
aKernel
);
bResult
=
ImplScaleConvolutionHor
(
*
this
,
a
Interm
,
fScaleX
,
aKernel
);
}
}
else
aInterm
=
*
this
;
if
(
bResult
&&
bScaleVer
)
if
(
bResult
&&
bScaleVer
)
{
{
bResult
=
ImplScaleConvolutionVer
(
*
this
,
aResult
,
fScaleY
,
aKernel
);
bResult
=
ImplScaleConvolutionVer
(
aInterm
,
aResult
,
fScaleY
,
aKernel
);
}
}
else
aResult
=
aInterm
;
}
}
else
else
{
{
if
(
bScaleVer
)
if
(
bScaleVer
)
{
{
bResult
=
ImplScaleConvolutionVer
(
*
this
,
a
Result
,
fScaleY
,
aKernel
);
bResult
=
ImplScaleConvolutionVer
(
*
this
,
a
Interm
,
fScaleY
,
aKernel
);
}
}
else
aInterm
=
*
this
;
if
(
bResult
&&
bScaleHor
)
if
(
bResult
&&
bScaleHor
)
{
{
bResult
=
ImplScaleConvolutionHor
(
*
this
,
aResult
,
fScaleX
,
aKernel
);
bResult
=
ImplScaleConvolutionHor
(
aInterm
,
aResult
,
fScaleX
,
aKernel
);
}
}
else
aResult
=
aInterm
;
}
}
}
}
...
...
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