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
dc10b3d7
Kaydet (Commit)
dc10b3d7
authored
Mar 29, 2013
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add Chroma subsampling options to jpeg writer.
Change-Id: I247a261bb96b0c437a43922070777892cdcbc1f6
üst
47ebfd83
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
6 deletions
+24
-6
jpeg.cxx
vcl/source/filter/jpeg/jpeg.cxx
+2
-1
jpeg.h
vcl/source/filter/jpeg/jpeg.h
+1
-1
jpeg.hxx
vcl/source/filter/jpeg/jpeg.hxx
+3
-2
jpegc.c
vcl/source/filter/jpeg/jpegc.c
+18
-2
No files found.
vcl/source/filter/jpeg/jpeg.cxx
Dosyayı görüntüle @
dc10b3d7
...
...
@@ -562,6 +562,7 @@ JPEGWriter::JPEGWriter( SvStream& rStm, const uno::Sequence< beans::PropertyValu
FilterConfigItem
aConfigItem
(
(
uno
::
Sequence
<
beans
::
PropertyValue
>*
)
pFilterData
);
bGreys
=
aConfigItem
.
ReadInt32
(
"ColorMode"
,
0
)
!=
0
;
nQuality
=
aConfigItem
.
ReadInt32
(
"Quality"
,
75
);
aChromaSubsampling
=
aConfigItem
.
ReadInt32
(
"ChromaSubsamplingMode"
,
0
);
if
(
pFilterData
)
{
...
...
@@ -676,7 +677,7 @@ sal_Bool JPEGWriter::Write( const Graphic& rGraphic )
JPEGCallbackStruct
aCallbackData
;
aCallbackData
.
xStatusIndicator
=
xStatusIndicator
;
bRet
=
(
sal_Bool
)
WriteJPEG
(
this
,
&
rOStm
,
pAcc
->
Width
(),
pAcc
->
Height
(),
bGreys
,
nQuality
,
&
aCallbackData
);
bRet
=
(
sal_Bool
)
WriteJPEG
(
this
,
&
rOStm
,
pAcc
->
Width
(),
pAcc
->
Height
(),
bGreys
,
nQuality
,
aChromaSubsampling
,
&
aCallbackData
);
delete
[]
pBuffer
;
pBuffer
=
NULL
;
...
...
vcl/source/filter/jpeg/jpeg.h
Dosyayı görüntüle @
dc10b3d7
...
...
@@ -49,7 +49,7 @@ void JPEGFree( void *ptr );
long
JPEGCallback
(
void
*
pCallbackData
,
long
nPercent
);
long
WriteJPEG
(
void
*
pJPEGWriter
,
void
*
pOStm
,
long
nWidth
,
long
nHeight
,
long
bGreyScale
,
long
nQualityPercent
,
void
*
pCallbackData
);
long
nQualityPercent
,
long
aChromaSubsampling
,
void
*
pCallbackData
);
void
*
GetScanline
(
void
*
pJPEGWriter
,
long
nY
);
void
ReadJPEG
(
void
*
pJPEGReader
,
void
*
pIStm
,
long
*
pLines
);
...
...
vcl/source/filter/jpeg/jpeg.hxx
Dosyayı görüntüle @
dc10b3d7
...
...
@@ -71,11 +71,12 @@ class JPEGWriter
SvStream
&
rOStm
;
Bitmap
aBmp
;
BitmapReadAccess
*
pAcc
;
sal_uInt8
*
pBuffer
;
sal_Bool
bNative
;
sal_uInt8
*
pBuffer
;
sal_Bool
bNative
;
sal_Bool
bGreys
;
sal_Int32
nQuality
;
sal_Int32
aChromaSubsampling
;
bool
*
pExpWasGrey
;
...
...
vcl/source/filter/jpeg/jpegc.c
Dosyayı görüntüle @
dc10b3d7
...
...
@@ -91,7 +91,7 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines )
jpeg_create_decompress
(
&
cinfo
);
bDecompCreated
=
1
;
jpeg_svstream_src
(
&
cinfo
,
pIStm
);
jpeg_svstream_src
(
&
cinfo
,
pIStm
);
jpeg_read_header
(
&
cinfo
,
sal_True
);
cinfo
.
scale_num
=
1
;
...
...
@@ -215,7 +215,7 @@ Exit:
long
WriteJPEG
(
void
*
pJPEGWriter
,
void
*
pOStm
,
long
nWidth
,
long
nHeight
,
long
bGreys
,
long
nQualityPercent
,
void
*
pCallbackData
)
long
nQualityPercent
,
long
aChromaSubsampling
,
void
*
pCallbackData
)
{
struct
jpeg_compress_struct
cinfo
;
struct
my_error_mgr
jerr
;
...
...
@@ -257,6 +257,22 @@ long WriteJPEG( void* pJPEGWriter, void* pOStm,
if
(
(
nWidth
>
128
)
||
(
nHeight
>
128
)
)
jpeg_simple_progression
(
&
cinfo
);
if
(
aChromaSubsampling
==
1
)
// YUV 4:4:4
{
cinfo
.
comp_info
[
0
].
h_samp_factor
=
1
;
cinfo
.
comp_info
[
0
].
v_samp_factor
=
1
;
}
else
if
(
aChromaSubsampling
==
2
)
// YUV 4:2:2
{
cinfo
.
comp_info
[
0
].
h_samp_factor
=
2
;
cinfo
.
comp_info
[
0
].
v_samp_factor
=
1
;
}
else
if
(
aChromaSubsampling
==
3
)
// YUV 4:2:0
{
cinfo
.
comp_info
[
0
].
h_samp_factor
=
2
;
cinfo
.
comp_info
[
0
].
v_samp_factor
=
2
;
}
jpeg_start_compress
(
&
cinfo
,
sal_True
);
for
(
nY
=
0
;
nY
<
nHeight
;
nY
++
)
...
...
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