summaryrefslogtreecommitdiffstats
path: root/common/rfb/JpegCompressor.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-01-15 13:23:43 +0100
committerPierre Ossman <ossman@cendio.se>2014-07-07 13:27:09 +0200
commitb948a9172f7cc1fd24761221bc1e2d8d10648c10 (patch)
tree050bb91b53744a9d16c4225139e8811f904fcb9a /common/rfb/JpegCompressor.cxx
parent947b48de71e03df2df7010c5760766b93483c9e5 (diff)
downloadtigervnc-b948a9172f7cc1fd24761221bc1e2d8d10648c10.tar.gz
tigervnc-b948a9172f7cc1fd24761221bc1e2d8d10648c10.zip
Make the subsampling setting follow the common style
Diffstat (limited to 'common/rfb/JpegCompressor.cxx')
-rw-r--r--common/rfb/JpegCompressor.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/common/rfb/JpegCompressor.cxx b/common/rfb/JpegCompressor.cxx
index 47f09d81..7dbb7d94 100644
--- a/common/rfb/JpegCompressor.cxx
+++ b/common/rfb/JpegCompressor.cxx
@@ -21,6 +21,7 @@
#include <rdr/Exception.h>
#include <rfb/Rect.h>
#include <rfb/PixelFormat.h>
+#include <rfb/ConnParams.h>
#include <os/print.h>
#include <stdio.h>
@@ -142,7 +143,7 @@ JpegCompressor::~JpegCompressor(void)
}
void JpegCompressor::compress(const rdr::U8 *buf, int pitch, const Rect& r,
- const PixelFormat& pf, int quality, JPEG_SUBSAMP subsamp)
+ const PixelFormat& pf, int quality, int subsamp)
{
int w = r.width();
int h = r.height();
@@ -217,15 +218,18 @@ void JpegCompressor::compress(const rdr::U8 *buf, int pitch, const Rect& r,
}
switch (subsamp) {
- case SUBSAMP_420:
+ case subsample16X:
+ case subsample8X:
+ // FIXME (fall through)
+ case subsample4X:
cinfo->comp_info[0].h_samp_factor = 2;
cinfo->comp_info[0].v_samp_factor = 2;
break;
- case SUBSAMP_422:
+ case subsample2X:
cinfo->comp_info[0].h_samp_factor = 2;
cinfo->comp_info[0].v_samp_factor = 1;
break;
- case SUBSAMP_GRAY:
+ case subsampleGray:
jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
default:
cinfo->comp_info[0].h_samp_factor = 1;