Skip to content

Commit

Permalink
add encoding support for TightPNG
Browse files Browse the repository at this point in the history
  • Loading branch information
leslie-wang authored and leslie-qiwa committed Feb 23, 2018
1 parent e91a095 commit 2c813a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/encodings.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export var encodings = {
encodingRRE: 2,
encodingHextile: 5,
encodingTight: 7,
encodingTightPNG: -260,

pseudoEncodingQualityLevel9: -23,
pseudoEncodingQualityLevel0: -32,
pseudoEncodingDesktopSize: -223,
pseudoEncodingLastRect: -224,
pseudoEncodingCursor: -239,
pseudoEncodingQEMUExtendedKeyEvent: -258,
pseudoEncodingTightPNG: -260,
pseudoEncodingExtendedDesktopSize: -308,
pseudoEncodingXvp: -309,
pseudoEncodingFence: -312,
Expand All @@ -35,6 +35,7 @@ export function encodingName(num) {
case encodings.encodingRRE: return "RRE";
case encodings.encodingHextile: return "Hextile";
case encodings.encodingTight: return "Tight";
case encodings.encodingTightPNG: return "Tight";
default: return "[unknown encoding " + num + "]";
}
}
3 changes: 2 additions & 1 deletion core/rfb.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export default function RFB(target, url, options) {
this._encHandlers[encodings.encodingRRE] = RFB.encodingHandlers.RRE.bind(this);
this._encHandlers[encodings.encodingHextile] = RFB.encodingHandlers.HEXTILE.bind(this);
this._encHandlers[encodings.encodingTight] = RFB.encodingHandlers.TIGHT.bind(this);
this._encHandlers[encodings.encodingTightPNG] = RFB.encodingHandlers.TIGHT.bind(this);

this._encHandlers[encodings.pseudoEncodingDesktopSize] = RFB.encodingHandlers.DesktopSize.bind(this);
this._encHandlers[encodings.pseudoEncodingLastRect] = RFB.encodingHandlers.last_rect.bind(this);
Expand Down Expand Up @@ -1256,13 +1257,13 @@ RFB.prototype = {
// Only supported with full depth support
if (this._fb_depth == 24) {
encs.push(encodings.encodingTight);
encs.push(encodings.encodingTightPNG);
encs.push(encodings.encodingHextile);
encs.push(encodings.encodingRRE);
}
encs.push(encodings.encodingRaw);

// Psuedo-encoding settings
encs.push(encodings.pseudoEncodingTightPNG);
encs.push(encodings.pseudoEncodingQualityLevel0 + 6);
encs.push(encodings.pseudoEncodingCompressLevel0 + 2);

Expand Down

0 comments on commit 2c813a3

Please sign in to comment.