aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/TightEncoder.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2012-01-30 13:58:44 +0000
committerPierre Ossman <ossman@cendio.se>2012-01-30 13:58:44 +0000
commit311a2b47cb39567953dad8170b63f3bb4eb7639e (patch)
tree1abe5ee007ec2791fda7d7fd400e82b3c5d41310 /common/rfb/TightEncoder.cxx
parent654e3f906c7e1467f4ec7af06382aa1f4662964a (diff)
downloadtigervnc-311a2b47cb39567953dad8170b63f3bb4eb7639e.tar.gz
tigervnc-311a2b47cb39567953dad8170b63f3bb4eb7639e.zip
The Tight encoder uses the pixel buffer as a scratch pad, which doesn't
work so well with the new optimisation to feed it the raw frame buffer. Reorganise and clean up the code to handle this, and make the raw frame buffer pointer const so that we might avoid such bugs in the future. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4841 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/TightEncoder.cxx')
-rw-r--r--common/rfb/TightEncoder.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/rfb/TightEncoder.cxx b/common/rfb/TightEncoder.cxx
index 9be4581e..fcd9d9b0 100644
--- a/common/rfb/TightEncoder.cxx
+++ b/common/rfb/TightEncoder.cxx
@@ -418,3 +418,19 @@ void TightEncoder::writeSubrect(const Rect& r, bool forceSolid)
os->writeBytes(mos.data(), mos.length());
writer->endRect();
}
+
+void TightEncoder::encodeJpegRect(const Rect& r, rdr::OutStream *os)
+{
+ const rdr::U8 *buf;
+ int stride;
+
+ buf = ig->getRawPixelsR(r, &stride);
+
+ jc.clear();
+ jc.compress(buf, stride * serverpf.bpp / 8, r, serverpf,
+ jpegQuality, jpegSubsampling);
+
+ os->writeU8(0x09 << 4);
+ os->writeCompactLength(jc.length());
+ os->writeBytes(jc.data(), jc.length());
+}
id='n120' href='#n120'>120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298