API Documentation
Loading...
Searching...
No Matches
TightDecoder.h
Go to the documentation of this file.
1#pragma once
2#ifndef TIGHT_VNC
3#define TIGHT_VNC
5#include <QRect>
6#include <QImage>
7struct z_stream_s;
8class QTcpSocket;
9namespace NDEVR
10{
11 struct PixelFormat;
12 // Compression control
14 {
15 public:
17 : underlying(0)
18 , zs(NULL)
19 {
20 init();
21 }
22
24 {
25 deinit();
26 }
27
28 void setUnderlying(const uint01* is, size_t bytesIn_)
29 {
30 underlying.addAll(is, bytesIn_);
31 }
32
34 {
35 setUnderlying(NULL, 0);
36 }
37
38 void reset()
39 {
40 underlying.clear();
41 deinit();
42 init();
43 }
44
45 void init();
46
47 void deinit();
48 bool readBytes(uint01* data, size_t length);
49 private:
50 Buffer<uint01> underlying;
51 z_stream_s* zs;
52 //size_t bytesIn;
53
54 };
56 {
57
58 public:
60 {
61
62 }
63 virtual ~TightDecoder()
64 {
65
66 }
67 static void ReadAll(QTcpSocket* is, uint01* os, uint04 size);
68 static void CopyToBuffer(uint01*& buffer, void* value, uint04 size, uint04& total_size)
69 {
70 memcpy(buffer, value, size);
71 buffer += size;
72 total_size += size;
73 }
74 static bool ReadRect(const QRect& r, QTcpSocket* is, const PixelFormat& pf, QImage& pb);
75
76
77 private:
78 static uint04 ReadCompact(QTcpSocket* is);
79 static void FilterGradient(const uint01* inbuf, const PixelFormat& pf, uint04* outbuf, int stride, const QRect& r);
80
81 static void FilterPalette(const uint01* palette, uint04 palSize, const uint01* inbuf, uint01* outbuf, int stride, const QRect& r, uint04 pixel_size);
82
83 private:
84 static ZlibInStream zis[4];
85 };
86}
87#endif
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
void addAll(const Buffer< t_type, t_other_index_type, t_other_memory_allocator, t_other_memory_manager > &buffer)
Definition Buffer.hpp:248
void clear()
Definition Buffer.hpp:572
Definition TightDecoder.h:56
static void CopyToBuffer(uint01 *&buffer, void *value, uint04 size, uint04 &total_size)
Definition TightDecoder.h:68
static void ReadAll(QTcpSocket *is, uint01 *os, uint04 size)
Definition TightDecoder.cpp:74
TightDecoder()
Definition TightDecoder.h:59
virtual ~TightDecoder()
Definition TightDecoder.h:63
static bool ReadRect(const QRect &r, QTcpSocket *is, const PixelFormat &pf, QImage &pb)
Definition TightDecoder.cpp:88
Definition TightDecoder.h:14
void init()
Definition TightDecoder.cpp:23
void flushUnderlying()
Definition TightDecoder.h:33
ZlibInStream()
Definition TightDecoder.h:16
~ZlibInStream()
Definition TightDecoder.h:23
void deinit()
Definition TightDecoder.cpp:37
bool readBytes(uint01 *data, size_t length)
Definition TightDecoder.cpp:45
void setUnderlying(const uint01 *is, size_t bytesIn_)
Definition TightDecoder.h:28
void reset()
Definition TightDecoder.h:38
Definition ACIColor.h:37
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
Definition VncDefines.h:1680