RemoteDesktop: support 16 bits color space

This commit is contained in:
DanyLE
2022-08-17 22:23:09 +02:00
parent f3a8f17ef1
commit 55787b135b
13 changed files with 46 additions and 37 deletions

View File

@@ -138,13 +138,11 @@ class WVNC
initCanvas: (w, h , d) ->
me = @
@depth = d
@canvas.width = w
@canvas.height = h
@resolution =
w: w,
h: h,
depth: @depth
@decoder.postMessage @resolution
#me.canvas.style.cursor = "none"
@setScale @scale
@@ -193,13 +191,15 @@ class WVNC
initConnection: (vncserver, params) ->
#vncserver = "192.168.1.20:5901"
data = new Uint8Array vncserver.length + 1
data[0] = 50 # jpeg quality
data = new Uint8Array vncserver.length + 2
data[0] = 16 # bbp
data[1] = 50 # jpeg quality
if params
data[0] = params.quality if params.quality
data[0] = params.bbp if params.bbp
data[1] = params.quality if params.quality
## rate in milisecond
data.set (new TextEncoder()).encode(vncserver), 1
data.set (new TextEncoder()).encode(vncserver), 2
@socket.send(@buildCommand 0x01, data)
resetModifierKeys: () ->
@@ -308,8 +308,7 @@ class WVNC
when 0x83
w = data[1] | (data[2]<<8)
h = data[3] | (data[4]<<8)
depth = 32
@initCanvas w, h, depth
@initCanvas w, h
# status command for ack
@socket.send(@buildCommand 0x04, 1)
@enableEvent = true

View File

@@ -5,12 +5,17 @@ class ConnectionDialog extends this.OS.GUI.BasicDialog
main: () ->
super.main()
@find("bbp").data = [
{ text: "16 bits", value: 16, selected: true },
{ text: "32 bits", value: 32 }
]
@find("jq").value = 40
@find("bt-ok").onbtclick = (e) =>
return unless @handle
data =
wvnc: (@find "txtWVNC").value
server: (@find "txtServer").value
bbp: (@find "bbp").selectedItem.data.value,
quality:(@find "jq").value
@handle data
@quit()
@@ -19,7 +24,7 @@ class ConnectionDialog extends this.OS.GUI.BasicDialog
@quit()
ConnectionDialog.scheme = """
<afx-app-window width='350' height='220'>
<afx-app-window width='350' height='270'>
<afx-hbox>
<div data-width="5"></div>
<afx-vbox>
@@ -28,6 +33,9 @@ ConnectionDialog.scheme = """
<afx-label text="__(VNC Server)" data-height="25" class="header" ></afx-label>
<input data-height="25" data-id="txtServer" value="192.168.1.27:5900"></input>
<div data-height="5"></div>
<afx-label text="__(Bits per pixel)" data-height="25" class="header" ></afx-label>
<afx-list-view dropdown = "true" data-id ="bbp" data-height="25" ></afx-list-view>
<div data-height="5"></div>
<afx-label text="__(JPEG quality)" data-height="25" class="header" ></afx-label>
<afx-slider data-id ="jq" data-height="25" ></afx-slider>
<afx-hbox data-height = '30'>