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
46d44286
Kaydet (Commit)
46d44286
authored
May 21, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ZCodec instances can be allocated on the stack just fine
Change-Id: I4b185f9a0ecaa74ca3f1e93b3bfe504e9778a8ca
üst
2993c7c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
pngwrite.cxx
vcl/source/gdi/pngwrite.cxx
+13
-20
No files found.
vcl/source/gdi/pngwrite.cxx
Dosyayı görüntüle @
46d44286
...
@@ -49,7 +49,6 @@ public:
...
@@ -49,7 +49,6 @@ public:
PNGWriterImpl
(
const
BitmapEx
&
BmpEx
,
PNGWriterImpl
(
const
BitmapEx
&
BmpEx
,
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
beans
::
PropertyValue
>*
pFilterData
=
NULL
);
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
beans
::
PropertyValue
>*
pFilterData
=
NULL
);
~
PNGWriterImpl
();
bool
Write
(
SvStream
&
rOStm
);
bool
Write
(
SvStream
&
rOStm
);
...
@@ -66,7 +65,7 @@ private:
...
@@ -66,7 +65,7 @@ private:
BitmapReadAccess
*
mpAccess
;
BitmapReadAccess
*
mpAccess
;
BitmapReadAccess
*
mpMaskAccess
;
BitmapReadAccess
*
mpMaskAccess
;
ZCodec
*
mpZCodec
;
ZCodec
mpZCodec
;
sal_uInt8
*
mpDeflateInBuf
;
// as big as the size of a scanline + alphachannel + 1
sal_uInt8
*
mpDeflateInBuf
;
// as big as the size of a scanline + alphachannel + 1
sal_uInt8
*
mpPreviousScan
;
// as big as mpDeflateInBuf
sal_uInt8
*
mpPreviousScan
;
// as big as mpDeflateInBuf
...
@@ -102,7 +101,6 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
...
@@ -102,7 +101,6 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
,
mbStatus
(
true
)
,
mbStatus
(
true
)
,
mpAccess
(
NULL
)
,
mpAccess
(
NULL
)
,
mpMaskAccess
(
NULL
)
,
mpMaskAccess
(
NULL
)
,
mpZCodec
(
new
ZCodec
)
,
mpDeflateInBuf
(
NULL
)
,
mpDeflateInBuf
(
NULL
)
,
mpPreviousScan
(
NULL
)
,
mpPreviousScan
(
NULL
)
,
mpCurrentScan
(
NULL
)
,
mpCurrentScan
(
NULL
)
...
@@ -240,11 +238,6 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
...
@@ -240,11 +238,6 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
}
}
}
}
PNGWriterImpl
::~
PNGWriterImpl
()
{
delete
mpZCodec
;
}
bool
PNGWriterImpl
::
Write
(
SvStream
&
rOStm
)
bool
PNGWriterImpl
::
Write
(
SvStream
&
rOStm
)
{
{
/* png signature is always an array of 8 bytes */
/* png signature is always an array of 8 bytes */
...
@@ -386,56 +379,56 @@ void PNGWriterImpl::ImplWriteIDAT ()
...
@@ -386,56 +379,56 @@ void PNGWriterImpl::ImplWriteIDAT ()
mpCurrentScan
=
new
sal_uInt8
[
mnDeflateInSize
];
mpCurrentScan
=
new
sal_uInt8
[
mnDeflateInSize
];
ImplClearFirstScanline
();
ImplClearFirstScanline
();
}
}
mpZCodec
->
BeginCompression
(
mnCompLevel
,
true
);
mpZCodec
.
BeginCompression
(
mnCompLevel
,
true
);
mpZCodec
->
SetCRC
(
mnCRC
);
mpZCodec
.
SetCRC
(
mnCRC
);
SvMemoryStream
aOStm
;
SvMemoryStream
aOStm
;
if
(
mnInterlaced
==
0
)
if
(
mnInterlaced
==
0
)
{
{
for
(
sal_uLong
nY
=
0
;
nY
<
mnHeight
;
nY
++
)
for
(
sal_uLong
nY
=
0
;
nY
<
mnHeight
;
nY
++
)
mpZCodec
->
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
)
);
mpZCodec
.
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
)
);
}
}
else
else
{
{
// interlace mode
// interlace mode
sal_uLong
nY
;
sal_uLong
nY
;
for
(
nY
=
0
;
nY
<
mnHeight
;
nY
+=
8
)
// pass 1
for
(
nY
=
0
;
nY
<
mnHeight
;
nY
+=
8
)
// pass 1
mpZCodec
->
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
0
,
8
)
);
mpZCodec
.
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
0
,
8
)
);
ImplClearFirstScanline
();
ImplClearFirstScanline
();
for
(
nY
=
0
;
nY
<
mnHeight
;
nY
+=
8
)
// pass 2
for
(
nY
=
0
;
nY
<
mnHeight
;
nY
+=
8
)
// pass 2
mpZCodec
->
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
4
,
8
)
);
mpZCodec
.
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
4
,
8
)
);
ImplClearFirstScanline
();
ImplClearFirstScanline
();
if
(
mnHeight
>=
5
)
// pass 3
if
(
mnHeight
>=
5
)
// pass 3
{
{
for
(
nY
=
4
;
nY
<
mnHeight
;
nY
+=
8
)
for
(
nY
=
4
;
nY
<
mnHeight
;
nY
+=
8
)
mpZCodec
->
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
0
,
4
)
);
mpZCodec
.
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
0
,
4
)
);
ImplClearFirstScanline
();
ImplClearFirstScanline
();
}
}
for
(
nY
=
0
;
nY
<
mnHeight
;
nY
+=
4
)
// pass 4
for
(
nY
=
0
;
nY
<
mnHeight
;
nY
+=
4
)
// pass 4
mpZCodec
->
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
2
,
4
)
);
mpZCodec
.
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
2
,
4
)
);
ImplClearFirstScanline
();
ImplClearFirstScanline
();
if
(
mnHeight
>=
3
)
// pass 5
if
(
mnHeight
>=
3
)
// pass 5
{
{
for
(
nY
=
2
;
nY
<
mnHeight
;
nY
+=
4
)
for
(
nY
=
2
;
nY
<
mnHeight
;
nY
+=
4
)
mpZCodec
->
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
0
,
2
)
);
mpZCodec
.
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
0
,
2
)
);
ImplClearFirstScanline
();
ImplClearFirstScanline
();
}
}
for
(
nY
=
0
;
nY
<
mnHeight
;
nY
+=
2
)
// pass 6
for
(
nY
=
0
;
nY
<
mnHeight
;
nY
+=
2
)
// pass 6
mpZCodec
->
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
1
,
2
)
);
mpZCodec
.
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
1
,
2
)
);
ImplClearFirstScanline
();
ImplClearFirstScanline
();
if
(
mnHeight
>=
2
)
// pass 7
if
(
mnHeight
>=
2
)
// pass 7
{
{
for
(
nY
=
1
;
nY
<
mnHeight
;
nY
+=
2
)
for
(
nY
=
1
;
nY
<
mnHeight
;
nY
+=
2
)
mpZCodec
->
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
0
,
1
)
);
mpZCodec
.
Write
(
aOStm
,
mpDeflateInBuf
,
ImplGetFilter
(
nY
,
0
,
1
)
);
}
}
}
}
mpZCodec
->
EndCompression
();
mpZCodec
.
EndCompression
();
mnCRC
=
mpZCodec
->
GetCRC
();
mnCRC
=
mpZCodec
.
GetCRC
();
if
(
mnFilterType
)
// using filter type 4 we need memory for the scanline 3 times
if
(
mnFilterType
)
// using filter type 4 we need memory for the scanline 3 times
{
{
...
...
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