Commit Graph

17 Commits

Author SHA1 Message Date
Pierre Ossman 7f5b51acf3 Consistently use "sentence case" style
Try to be more consistent in how we capitalize things. Both the "Title
Case" and "Sentence case" styles are popular, so either would work.
Google and Mozilla both prefer "Sentence case", so let's follow them.
2024-11-27 14:40:40 +01:00
Jiang XueQian c187b2e5e0 Implement gradient filter of tight decoder, fixing issue #1767
This commit is a basic implementation of the gradient filter required by
qemu `lossy` option.
2024-05-02 20:41:38 +08:00
Pierre Ossman d0203a5995 Always return copy of data from socket
We don't know how long the caller will hang on to this data, so we need
to be safe by default and assume it will kept indefinitely. That means
we can't return a reference to the internal buffer, as that will get
overwritten with future messages.

We want to avoid unnecessary copying in performance critical code,
though. So allow code to explicitly ask for a shared buffer, assuming
they know the data needs to be consumed immediately.
2023-06-04 19:12:02 +02:00
Pierre Ossman 0180bc81c1 Stop direct access to socket buffer
Use proper accessor functions instead of poking around in internal
buffers.
2023-06-04 19:00:33 +02:00
Pierre Ossman 113fa27ebc Handle empty rects from the server
These are very pointless for the server to send, but not a violation of
the protocol so we need to be able to handle them. We've seen this
happen in real world scenarios a few times.
2020-09-04 16:16:44 +02:00
Pierre Ossman 6a19390baa Switch to RGBx pixel format
This is what the browser wants so it avoids having to spend time
converting everything. Unfortunately it usually means the server instead
needs to convert it for us, but we assume it has more power than we do.
2020-06-08 07:57:17 +02:00
Pierre Ossman f5b5767c98 Standardise on a single blit function
Keep everything simpler by always blitting in the same pixel format.
It's up to the decoders to convert if they need to.
2020-06-08 07:53:41 +02:00
Pierre Ossman 34f52a8f41 Fix bad BasicCompression check in Tight decoder 2020-06-08 07:53:41 +02:00
Niko Lehto 2cee106eee Split api of inflate
Added ability to read data chunk wise.
2020-02-17 11:29:41 +01:00
Niko Lehto f6669ff7b2 Move error handling to Inflate class
Every call wants this check so this should be done inside the class.
2020-02-17 11:29:41 +01:00
Niko Lehto 183cab0eca Remove unused inflate argument
The value true was an invalid flush argument so it was in practice
unused.
2020-02-17 11:29:40 +01:00
Pierre Ossman 4babdf33bd Validate decoded image dimensions
They are expected to be a certain size, so verify this so no server
tries to do something broken.
2019-12-23 15:42:02 +01:00
Samuel Mannehed 412d93060d Update copyright to 2019 for modified files 2019-09-30 15:35:33 +02:00
Juanjo Diaz 8a189a6291 Add getters/setter to websock 2018-12-08 17:31:20 +02:00
Juanjo Diaz d3ed883a8f Use `new` when constructing errors 2018-11-24 21:44:11 +02:00
Pierre Ossman 9881899e7b Merge branch 'style' of https://github.com/CendioOssman/noVNC 2018-09-17 13:54:04 +02:00
Pierre Ossman 923cd22083 Move decoders to separate classes
Makes things a lot clearer by letting each encoding handle its own
details and state.
2018-08-22 15:12:34 +02:00