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
aa620864
Kaydet (Commit)
aa620864
authored
Agu 18, 2015
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sal_uLong to sal_uInt16 as return type of BitmapColor::GetColorError
Change-Id: I62c0d073d6b22346b65e3560303d7fc9373bfc7e
üst
e28c9ccb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
util.cxx
filter/source/msfilter/util.cxx
+2
-2
salbtype.hxx
include/vcl/salbtype.hxx
+9
-8
No files found.
filter/source/msfilter/util.cxx
Dosyayı görüntüle @
aa620864
...
...
@@ -1392,8 +1392,8 @@ static bool HasSimilarScheme(const BitmapColor& rBitmapColor1, const BitmapColor
static
sal_uInt16
GetBestIndex
(
const
BitmapPalette
&
rPalette
,
const
BitmapColor
&
rBitmapColor
)
{
sal_uInt16
nReturn
=
0
;
sal_uInt16
nLastErr
=
SAL_MAX_UINT16
;
bool
bFound
=
false
;
sal_uLong
nLastErr
=
3
*
255
+
1
;
// Prefer those colors which have similar scheme as the input
// Allow bigger and bigger variance of the schemes until we find
...
...
@@ -1404,7 +1404,7 @@ static sal_uInt16 GetBestIndex(const BitmapPalette& rPalette, const BitmapColor&
{
if
(
HasSimilarScheme
(
rBitmapColor
,
rPalette
[
i
],
nVariance
)
)
{
sal_uLong
nActErr
=
rBitmapColor
.
GetColorError
(
rPalette
[
i
]
);
const
sal_uInt16
nActErr
=
rBitmapColor
.
GetColorError
(
rPalette
[
i
]
);
if
(
nActErr
<
nLastErr
)
{
nLastErr
=
nActErr
;
...
...
include/vcl/salbtype.hxx
Dosyayı görüntüle @
aa620864
...
...
@@ -138,7 +138,7 @@ public:
inline
BitmapColor
&
Merge
(
const
BitmapColor
&
rColor
,
sal_uInt8
cTransparency
);
inline
sal_u
Long
GetColorError
(
const
BitmapColor
&
rBitmapColor
)
const
;
inline
sal_u
Int16
GetColorError
(
const
BitmapColor
&
rBitmapColor
)
const
;
};
// - BitmapPalette -
...
...
@@ -398,13 +398,14 @@ inline BitmapColor& BitmapColor::Merge( const BitmapColor& rBitmapColor, sal_uIn
inline
sal_u
Long
BitmapColor
::
GetColorError
(
const
BitmapColor
&
rBitmapColor
)
const
inline
sal_u
Int16
BitmapColor
::
GetColorError
(
const
BitmapColor
&
rBitmapColor
)
const
{
DBG_ASSERT
(
!
mbIndex
,
"Pixel represents index into colortable!"
);
DBG_ASSERT
(
!
rBitmapColor
.
mbIndex
,
"Pixel represents index into colortable!"
);
return
(
(
sal_uLong
)
(
labs
(
mcBlueOrIndex
-
rBitmapColor
.
mcBlueOrIndex
)
+
labs
(
mcGreen
-
rBitmapColor
.
mcGreen
)
+
labs
(
mcRed
-
rBitmapColor
.
mcRed
)
)
);
return
static_cast
<
sal_uInt16
>
(
abs
(
static_cast
<
int
>
(
mcBlueOrIndex
)
-
static_cast
<
int
>
(
rBitmapColor
.
mcBlueOrIndex
)
)
+
abs
(
static_cast
<
int
>
(
mcGreen
)
-
static_cast
<
int
>
(
rBitmapColor
.
mcGreen
)
)
+
abs
(
static_cast
<
int
>
(
mcRed
)
-
static_cast
<
int
>
(
rBitmapColor
.
mcRed
)
)
);
}
inline
BitmapPalette
::
BitmapPalette
()
:
...
...
@@ -550,10 +551,10 @@ inline sal_uInt16 BitmapPalette::GetBestIndex( const BitmapColor& rCol ) const
return
j
;
}
sal_u
Long
nLastErr
=
rCol
.
GetColorError
(
mpBitmapColor
[
nRetIndex
]
)
;
for
(
sal_uInt16
i
=
1
;
i
<
mnCount
;
++
i
)
sal_u
Int16
nLastErr
=
SAL_MAX_UINT16
;
for
(
sal_uInt16
i
=
0
;
i
<
mnCount
;
++
i
)
{
const
sal_u
Long
nActErr
=
rCol
.
GetColorError
(
mpBitmapColor
[
i
]
);
const
sal_u
Int16
nActErr
=
rCol
.
GetColorError
(
mpBitmapColor
[
i
]
);
if
(
nActErr
<
nLastErr
)
{
nLastErr
=
nActErr
;
...
...
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