Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
5ca5e2d8
Commit
5ca5e2d8
authored
Jan 29, 2012
by
Mike Tinglof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement tight indexed rectangle; remove some debug code
parent
6fbc3748
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
18 deletions
+46
-18
jsunzip.js
include/jsunzip.js
+2
-2
rfb.js
include/rfb.js
+44
-16
No files found.
include/jsunzip.js
View file @
5ca5e2d8
...
@@ -355,7 +355,7 @@ this.read_bits = function(d, num, base)
...
@@ -355,7 +355,7 @@ this.read_bits = function(d, num, base)
return
base
;
return
base
;
var
val
=
0
;
var
val
=
0
;
while
(
d
.
bitcount
<
num
)
{
while
(
d
.
bitcount
<
24
)
{
d
.
tag
=
d
.
tag
|
(
d
.
source
[
d
.
sourceIndex
++
]
&
0xff
)
<<
d
.
bitcount
;
d
.
tag
=
d
.
tag
|
(
d
.
source
[
d
.
sourceIndex
++
]
&
0xff
)
<<
d
.
bitcount
;
d
.
bitcount
+=
8
;
d
.
bitcount
+=
8
;
}
}
...
@@ -368,7 +368,7 @@ this.read_bits = function(d, num, base)
...
@@ -368,7 +368,7 @@ this.read_bits = function(d, num, base)
/* given a data stream and a tree, decode a symbol */
/* given a data stream and a tree, decode a symbol */
this
.
decode_symbol
=
function
(
d
,
t
)
this
.
decode_symbol
=
function
(
d
,
t
)
{
{
while
(
d
.
bitcount
<
1
0
)
{
while
(
d
.
bitcount
<
1
6
)
{
d
.
tag
=
d
.
tag
|
(
d
.
source
[
d
.
sourceIndex
++
]
&
0xff
)
<<
d
.
bitcount
;
d
.
tag
=
d
.
tag
|
(
d
.
source
[
d
.
sourceIndex
++
]
&
0xff
)
<<
d
.
bitcount
;
d
.
bitcount
+=
8
;
d
.
bitcount
+=
8
;
}
}
...
...
include/rfb.js
View file @
5ca5e2d8
...
@@ -1308,16 +1308,6 @@ encHandlers.TIGHT = function display_tight() {
...
@@ -1308,16 +1308,6 @@ encHandlers.TIGHT = function display_tight() {
Util
.
Warn
(
"Decompressed "
+
data
.
length
+
" to "
+
uncompressed
.
data
.
length
+
" checksums "
+
Util
.
Warn
(
"Decompressed "
+
data
.
length
+
" to "
+
uncompressed
.
data
.
length
+
" checksums "
+
checksum
(
data
)
+
":"
+
checksum
(
uncompressed
.
data
));
checksum
(
data
)
+
":"
+
checksum
(
uncompressed
.
data
));
/*
var i;
var uncompressed2 = zip_inflate(data);
for (i=0;i<uncompressed.length;i++)
if (uncompressed[i] !== uncompressed2[i]) {
Util.Warn("Decompression difference at " + i);
break;
}
*/
return
uncompressed
.
data
;
return
uncompressed
.
data
;
}
}
...
@@ -1345,14 +1335,54 @@ encHandlers.TIGHT = function display_tight() {
...
@@ -1345,14 +1335,54 @@ encHandlers.TIGHT = function display_tight() {
// Shift ctl, filter id, num colors, palette entries, and clength off
// Shift ctl, filter id, num colors, palette entries, and clength off
ws
.
rQshiftBytes
(
3
+
paletteSize
+
clength
[
0
]);
ws
.
rQshiftBytes
(
3
+
paletteSize
+
clength
[
0
]);
if
(
streamId
==
0
)
throw
(
"Wrong stream"
);
// Decompress data
// Process data
if
(
raw
)
if
(
raw
)
data
=
ws
.
rQshiftBytes
(
clength
[
1
]);
data
=
ws
.
rQshiftBytes
(
clength
[
1
]);
else
else
data
=
decompress
(
ws
.
rQshiftBytes
(
clength
[
1
]));
data
=
decompress
(
ws
.
rQshiftBytes
(
clength
[
1
]));
var
dest
=
[];
var
x
,
y
,
b
;
if
(
numColors
==
2
)
{
var
w
=
Math
.
floor
((
FBU
.
width
+
7
)
/
8
);
var
w1
=
Math
.
floor
(
FBU
.
width
/
8
);
for
(
y
=
0
;
y
<
FBU
.
height
;
y
++
)
{
for
(
x
=
0
;
x
<
w1
;
x
++
)
{
for
(
b
=
7
;
b
>=
0
;
b
--
)
{
var
dp
=
(
y
*
FBU
.
width
+
x
*
8
+
7
-
b
)
*
3
;
var
sp
=
(
data
[
y
*
w
+
x
]
>>
b
&
1
)
*
3
;
dest
[
dp
]
=
FBU
.
palette
[
sp
];
dest
[
dp
+
1
]
=
FBU
.
palette
[
sp
+
1
];
dest
[
dp
+
2
]
=
FBU
.
palette
[
sp
+
2
];
}
for
(
b
=
7
;
b
>=
8
-
FBU
.
width
%
8
;
b
--
)
{
var
dp
=
(
y
*
FBU
.
width
+
x
*
8
+
7
-
b
)
*
3
;
var
sp
=
(
data
[
y
*
w
+
x
]
>>
b
&
1
)
*
3
;
dest
[
dp
]
=
FBU
.
palette
[
sp
];
dest
[
dp
+
1
]
=
FBU
.
palette
[
sp
+
1
];
dest
[
dp
+
2
]
=
FBU
.
palette
[
sp
+
2
];
}
}
}
}
else
{
for
(
y
=
0
;
y
<
FBU
.
height
;
y
++
)
{
for
(
x
=
0
;
x
<
FBU
.
width
;
x
++
)
{
var
dp
=
(
y
*
FBU
.
width
+
x
)
*
3
;
var
sp
=
data
[
y
*
FBU
.
width
+
x
]
*
3
;
dest
[
dp
]
=
FBU
.
palette
[
sp
];
dest
[
dp
+
1
]
=
FBU
.
palette
[
sp
+
1
];
dest
[
dp
+
2
]
=
FBU
.
palette
[
sp
+
2
];
}
}
}
FBU
.
imgQ
.
push
({
'type'
:
'rgb'
,
'img'
:
{
'complete'
:
true
,
'data'
:
dest
},
'x'
:
FBU
.
x
,
'y'
:
FBU
.
y
,
'width'
:
FBU
.
width
,
'height'
:
FBU
.
height
});
return
true
;
return
true
;
}
}
...
@@ -1368,8 +1398,6 @@ encHandlers.TIGHT = function display_tight() {
...
@@ -1368,8 +1398,6 @@ encHandlers.TIGHT = function display_tight() {
FBU
.
bytes
=
1
+
clength
[
0
]
+
clength
[
1
];
// ctl + clength size + zlib-data
FBU
.
bytes
=
1
+
clength
[
0
]
+
clength
[
1
];
// ctl + clength size + zlib-data
if
(
ws
.
rQwait
(
"TIGHT "
+
cmode
,
FBU
.
bytes
))
{
return
false
;
}
if
(
ws
.
rQwait
(
"TIGHT "
+
cmode
,
FBU
.
bytes
))
{
return
false
;
}
if
(
streamId
!=
0
)
throw
(
"Wrong stream"
);
ws
.
rQshiftBytes
(
1
+
clength
[
0
]);
// ctl + clength
ws
.
rQshiftBytes
(
1
+
clength
[
0
]);
// ctl + clength
if
(
raw
)
if
(
raw
)
data
=
ws
.
rQshiftBytes
(
clength
[
1
]);
data
=
ws
.
rQshiftBytes
(
clength
[
1
]);
...
...
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