Documentation ¶
Index ¶
- Constants
- Variables
- func IsCPixelSpecific(pf *rfb.PixelFormat) bool
- func ReadBytes(count int, r io.Reader) ([]byte, error)
- func ReadPixel(c io.Reader, pf *rfb.PixelFormat) ([]byte, error)
- func ReadUint16(r io.Reader) (uint16, error)
- func ReadUint32(r io.Reader) (uint32, error)
- func ReadUint8(r io.Reader) (uint8, error)
- type CoRREEncoding
- func (that *CoRREEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *CoRREEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *CoRREEncoding) Supported(session rfb.ISession) bool
- func (that *CoRREEncoding) Type() rfb.EncodingType
- func (that *CoRREEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) (err error)
- type CopyRectEncoding
- func (that *CopyRectEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *CopyRectEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *CopyRectEncoding) Supported(session rfb.ISession) bool
- func (that *CopyRectEncoding) Type() rfb.EncodingType
- func (that *CopyRectEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type CursorPosPseudoEncoding
- func (that *CursorPosPseudoEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *CursorPosPseudoEncoding) Draw(img draw.Image, rect *rfb.Rectangle) error
- func (that *CursorPosPseudoEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *CursorPosPseudoEncoding) Supported(session rfb.ISession) bool
- func (that *CursorPosPseudoEncoding) Type() rfb.EncodingType
- func (that *CursorPosPseudoEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type CursorPseudoEncoding
- func (that *CursorPseudoEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *CursorPseudoEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *CursorPseudoEncoding) Supported(session rfb.ISession) bool
- func (that *CursorPseudoEncoding) Type() rfb.EncodingType
- func (that *CursorPseudoEncoding) Write(sess rfb.ISession, rect *rfb.Rectangle) error
- type CursorWithAlphaPseudoEncoding
- func (that *CursorWithAlphaPseudoEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *CursorWithAlphaPseudoEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *CursorWithAlphaPseudoEncoding) Supported(session rfb.ISession) bool
- func (that *CursorWithAlphaPseudoEncoding) Type() rfb.EncodingType
- func (that *CursorWithAlphaPseudoEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type DesktopNamePseudoEncoding
- func (that *DesktopNamePseudoEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *DesktopNamePseudoEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *DesktopNamePseudoEncoding) Supported(session rfb.ISession) bool
- func (that *DesktopNamePseudoEncoding) Type() rfb.EncodingType
- func (that *DesktopNamePseudoEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type DesktopSizePseudoEncoding
- func (that *DesktopSizePseudoEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *DesktopSizePseudoEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *DesktopSizePseudoEncoding) Supported(session rfb.ISession) bool
- func (that *DesktopSizePseudoEncoding) Type() rfb.EncodingType
- func (that *DesktopSizePseudoEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type ExtendedDesktopSizePseudo
- func (that *ExtendedDesktopSizePseudo) Clone(data ...bool) rfb.IEncoding
- func (that *ExtendedDesktopSizePseudo) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *ExtendedDesktopSizePseudo) Supported(rfb.ISession) bool
- func (that *ExtendedDesktopSizePseudo) Type() rfb.EncodingType
- func (that *ExtendedDesktopSizePseudo) Write(session rfb.ISession, rect *rfb.Rectangle) (err error)
- type FencePseudo
- func (that *FencePseudo) Clone(_ ...bool) rfb.IEncoding
- func (that *FencePseudo) Read(_ rfb.ISession, _ *rfb.Rectangle) error
- func (that *FencePseudo) Supported(_ rfb.ISession) bool
- func (that *FencePseudo) Type() rfb.EncodingType
- func (that *FencePseudo) Write(_ rfb.ISession, _ *rfb.Rectangle) error
- type H264Encoding
- func (that *H264Encoding) Clone(data ...bool) rfb.IEncoding
- func (that *H264Encoding) Read(session rfb.ISession, rectangle *rfb.Rectangle) error
- func (that *H264Encoding) Supported(session rfb.ISession) bool
- func (that *H264Encoding) Type() rfb.EncodingType
- func (that *H264Encoding) Write(session rfb.ISession, rectangle *rfb.Rectangle) error
- type HexTileEncoding
- func (that *HexTileEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *HexTileEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *HexTileEncoding) Supported(_ rfb.ISession) bool
- func (that *HexTileEncoding) Type() rfb.EncodingType
- func (that *HexTileEncoding) Write(sess rfb.ISession, rect *rfb.Rectangle) error
- type LastRectPseudo
- func (that *LastRectPseudo) Clone(_ ...bool) rfb.IEncoding
- func (that *LastRectPseudo) Read(_ rfb.ISession, _ *rfb.Rectangle) error
- func (that *LastRectPseudo) Supported(_ rfb.ISession) bool
- func (that *LastRectPseudo) Type() rfb.EncodingType
- func (that *LastRectPseudo) Write(_ rfb.ISession, _ *rfb.Rectangle) error
- type LedStatePseudo
- func (that *LedStatePseudo) Clone(data ...bool) rfb.IEncoding
- func (that *LedStatePseudo) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *LedStatePseudo) Supported(session rfb.ISession) bool
- func (that *LedStatePseudo) Type() rfb.EncodingType
- func (that *LedStatePseudo) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type RREEncoding
- func (that *RREEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *RREEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *RREEncoding) Supported(session rfb.ISession) bool
- func (that *RREEncoding) Type() rfb.EncodingType
- func (that *RREEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type RawEncoding
- func (that *RawEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *RawEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *RawEncoding) Supported(rfb.ISession) bool
- func (that *RawEncoding) Type() rfb.EncodingType
- func (that *RawEncoding) Write(sess rfb.ISession, rect *rfb.Rectangle) error
- type TightEncoding
- func (that *TightEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *TightEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *TightEncoding) ReadCompactLen(session rfb.ISession) (int, error)
- func (that *TightEncoding) ReadTightData(dataSize int, session rfb.ISession) error
- func (that *TightEncoding) Supported(session rfb.ISession) bool
- func (that *TightEncoding) Type() rfb.EncodingType
- func (that *TightEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type TightPngEncoding
- func (that *TightPngEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *TightPngEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *TightPngEncoding) ReadCompactLen(session rfb.ISession) (int, error)
- func (that *TightPngEncoding) Supported(session rfb.ISession) bool
- func (that *TightPngEncoding) Type() rfb.EncodingType
- func (that *TightPngEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type XCursorPseudoEncoding
- func (that *XCursorPseudoEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *XCursorPseudoEncoding) Read(session rfb.ISession, rect *rfb.Rectangle) error
- func (that *XCursorPseudoEncoding) Supported(session rfb.ISession) bool
- func (that *XCursorPseudoEncoding) Type() rfb.EncodingType
- func (that *XCursorPseudoEncoding) Write(session rfb.ISession, rect *rfb.Rectangle) error
- type ZLibEncoding
- func (that *ZLibEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *ZLibEncoding) Read(sess rfb.ISession, rect *rfb.Rectangle) error
- func (that *ZLibEncoding) Supported(c rfb.ISession) bool
- func (that *ZLibEncoding) Type() rfb.EncodingType
- func (that *ZLibEncoding) Write(sess rfb.ISession, rect *rfb.Rectangle) error
- type ZRLEEncoding
- func (that *ZRLEEncoding) Clone(data ...bool) rfb.IEncoding
- func (that *ZRLEEncoding) Read(sess rfb.ISession, rect *rfb.Rectangle) error
- func (that *ZRLEEncoding) Supported(session rfb.ISession) bool
- func (that *ZRLEEncoding) Type() rfb.EncodingType
- func (that *ZRLEEncoding) Write(sess rfb.ISession, rect *rfb.Rectangle) error
Constants ¶
const ( HexTileRaw = 1 << 0 // Raw数据:不压缩,直接传送,一般此位置1时其它位都置0 HexTileBackgroundSpecified = 1 << 1 // 包含背景色数据:标志位之后需要接收背景色数据 HexTileForegroundSpecified = 1 << 2 // 包含前景色数据:背景色之后需要接收前景色数据 HexTileAnySubRects = 1 << 3 // 是否含有子块:只要该块中含有两种及两种以上颜色,则此位置1 HexTileSubRectsColoured = 1 << 4 // 子块的颜色:如果含有两种颜色,此位置0,子块颜色用前景色;若该块中含有两种以上的颜色,此位置1,子块颜色需要单独指明 )
const ( TightFilterCopy = 0 TightFilterPalette = 1 TightFilterGradient = 2 )
const ( ZRLERawPixelData = 0 ZRLESingleColour = 1 )
Variables ¶
var ( DefaultEncodings = []rfb.IEncoding{ &ZRLEEncoding{}, &TightEncoding{}, &HexTileEncoding{}, &TightPngEncoding{}, &RREEncoding{}, &ZLibEncoding{}, &CopyRectEncoding{}, &CoRREEncoding{}, &RawEncoding{}, &CursorPseudoEncoding{}, &DesktopNamePseudoEncoding{}, &DesktopSizePseudoEncoding{}, &CursorPosPseudoEncoding{}, &ExtendedDesktopSizePseudo{}, &CursorWithAlphaPseudoEncoding{}, &LedStatePseudo{}, &LastRectPseudo{}, &FencePseudo{}, &XCursorPseudoEncoding{}, } )
var TightMinToCompress int = 12
Functions ¶
func IsCPixelSpecific ¶
func IsCPixelSpecific(pf *rfb.PixelFormat) bool
Types ¶
type CoRREEncoding ¶
type CoRREEncoding struct {
// contains filtered or unexported fields
}
CoRREEncoding CoRRE是RRE的变体,它把发送的最大矩形限制在255×255个像素以内,用一个字节就能表示子矩形的维度。 如果服务器想要发送一个超出限制的矩形,则只要把它划分成几个更小的RFB矩形即可。 “对于通常的桌面,这样的方式具有比RRE更好的压缩度”。 实际上,如果进一步限制矩形的大小,就能够获得最好的压缩度。“矩形的最大值越小,决策的尺度就越好”。 但是,如果把矩形的最大值限制得太小,就增加了矩形的数量,而由于每个RFB矩形都会有一定的开销,结果反而会使压缩度变差。 所以应该选择一个比较恰当的数字。在目前的实现中,采用的最大值为48×48。
func (*CoRREEncoding) Type ¶
func (that *CoRREEncoding) Type() rfb.EncodingType
type CopyRectEncoding ¶
type CopyRectEncoding struct {
SX, SY uint16
}
CopyRectEncoding 该编码方式对于客户端在某些已经有了相同的象素数据的时候是非常简单和有效的。 这种编码方式在网络中表现为x,y 坐标。让客户端知道去拷贝那一个矩形的象素数据。 它可以应用于很多种情况。最明显的就是当用户在屏幕上移动某一个窗口的时候,还有在窗口内容滚动的时候。 在优化画的时候不是很明显,一个比较智能的服务器可能只会发送一次,因为它知道在客户端的帧缓存里已经存在了。 复制矩形编码并不是完全独立地发送所有的数据矩形,而是对于像素值完全相同的一组矩形, 只发送第一个矩形全部数据,随后的矩形则只需要发送左上角X、Y坐标。 实际上,复制矩形编码主要指的就是随后的这一系列X、Y坐标,而对于第一个矩形具体采用何种编码类型并没有限制, 仅仅需要知道第一个矩形在帧缓冲区中的位置,以便于完成复制操作。 因此,往往是把复制矩形编码和其它针对某一个矩形的编码类型结合使用。
func (*CopyRectEncoding) Supported ¶
func (that *CopyRectEncoding) Supported(session rfb.ISession) bool
func (*CopyRectEncoding) Type ¶
func (that *CopyRectEncoding) Type() rfb.EncodingType
type CursorPosPseudoEncoding ¶
type CursorPosPseudoEncoding struct { }
func (*CursorPosPseudoEncoding) Clone ¶
func (that *CursorPosPseudoEncoding) Clone(data ...bool) rfb.IEncoding
func (*CursorPosPseudoEncoding) Supported ¶
func (that *CursorPosPseudoEncoding) Supported(session rfb.ISession) bool
func (*CursorPosPseudoEncoding) Type ¶
func (that *CursorPosPseudoEncoding) Type() rfb.EncodingType
type CursorPseudoEncoding ¶
type CursorPseudoEncoding struct {
// contains filtered or unexported fields
}
CursorPseudoEncoding 如果客户端请求指针/鼠标伪编码,那么就是说它有能力进行本地绘制鼠标。 这样就可以明显改善传输性能。服务器通过发送带有伪鼠标编码的伪矩形来设置鼠标的形状作为更新的一部分。 伪矩形的x 和y 表示鼠标的热点,宽和高表示用像素来表示鼠标的宽和高。包含宽X高像素值的数据带有位掩码。 位掩码是由从左到右,从上到下的扫描线组成,而每一扫描线被填充为floor((width +7) / 8)。 对应每一字节最重要的位表示最左边像素,对应1 位表示相应指针的像素是正确的。
func (*CursorPseudoEncoding) Clone ¶
func (that *CursorPseudoEncoding) Clone(data ...bool) rfb.IEncoding
func (*CursorPseudoEncoding) Supported ¶
func (that *CursorPseudoEncoding) Supported(session rfb.ISession) bool
func (*CursorPseudoEncoding) Type ¶
func (that *CursorPseudoEncoding) Type() rfb.EncodingType
type CursorWithAlphaPseudoEncoding ¶
type CursorWithAlphaPseudoEncoding struct {
// contains filtered or unexported fields
}
func (*CursorWithAlphaPseudoEncoding) Clone ¶
func (that *CursorWithAlphaPseudoEncoding) Clone(data ...bool) rfb.IEncoding
func (*CursorWithAlphaPseudoEncoding) Supported ¶
func (that *CursorWithAlphaPseudoEncoding) Supported(session rfb.ISession) bool
func (*CursorWithAlphaPseudoEncoding) Type ¶
func (that *CursorWithAlphaPseudoEncoding) Type() rfb.EncodingType
type DesktopNamePseudoEncoding ¶
type DesktopNamePseudoEncoding struct {
Name []byte
}
DesktopNamePseudoEncoding 服务端设置桌面名字的消息
func (*DesktopNamePseudoEncoding) Clone ¶
func (that *DesktopNamePseudoEncoding) Clone(data ...bool) rfb.IEncoding
func (*DesktopNamePseudoEncoding) Supported ¶
func (that *DesktopNamePseudoEncoding) Supported(session rfb.ISession) bool
func (*DesktopNamePseudoEncoding) Type ¶
func (that *DesktopNamePseudoEncoding) Type() rfb.EncodingType
type DesktopSizePseudoEncoding ¶
type DesktopSizePseudoEncoding struct { }
DesktopSizePseudoEncoding 如果客户端请求桌面大小伪编码,那么就是说它能处理帧缓存宽/高的改变。 服务器通过发送带有桌面大小伪编码的伪矩形作为上一个矩形来完成一次更新。 伪矩形的x 和y 被忽略,而宽和高表示帧缓存新的宽和高。没有其他的数据与伪矩形有关。
func (*DesktopSizePseudoEncoding) Clone ¶
func (that *DesktopSizePseudoEncoding) Clone(data ...bool) rfb.IEncoding
func (*DesktopSizePseudoEncoding) Supported ¶
func (that *DesktopSizePseudoEncoding) Supported(session rfb.ISession) bool
func (*DesktopSizePseudoEncoding) Type ¶
func (that *DesktopSizePseudoEncoding) Type() rfb.EncodingType
type ExtendedDesktopSizePseudo ¶
type ExtendedDesktopSizePseudo struct {
// contains filtered or unexported fields
}
ExtendedDesktopSizePseudo 扩展适应客户端桌面分辨率
func (*ExtendedDesktopSizePseudo) Clone ¶
func (that *ExtendedDesktopSizePseudo) Clone(data ...bool) rfb.IEncoding
func (*ExtendedDesktopSizePseudo) Supported ¶
func (that *ExtendedDesktopSizePseudo) Supported(rfb.ISession) bool
func (*ExtendedDesktopSizePseudo) Type ¶
func (that *ExtendedDesktopSizePseudo) Type() rfb.EncodingType
type FencePseudo ¶ added in v1.1.1
type FencePseudo struct { }
func (*FencePseudo) Supported ¶ added in v1.1.1
func (that *FencePseudo) Supported(_ rfb.ISession) bool
func (*FencePseudo) Type ¶ added in v1.1.1
func (that *FencePseudo) Type() rfb.EncodingType
type H264Encoding ¶ added in v1.1.1
type H264Encoding struct {
// contains filtered or unexported fields
}
func (*H264Encoding) Clone ¶ added in v1.1.1
func (that *H264Encoding) Clone(data ...bool) rfb.IEncoding
func (*H264Encoding) Supported ¶ added in v1.1.1
func (that *H264Encoding) Supported(session rfb.ISession) bool
func (*H264Encoding) Type ¶ added in v1.1.1
func (that *H264Encoding) Type() rfb.EncodingType
type HexTileEncoding ¶
type HexTileEncoding struct {
// contains filtered or unexported fields
}
HexTileEncoding 是RRE编码的变种,把屏幕分成16x16象素的小块,每块用Raw或RRE方式转送. 通过解释HexTile算法,说明了简单而常用的屏幕传送和压缩算法,希望对屏幕监测、传送相关的工作有所启发
func (*HexTileEncoding) Read ¶
- 分割 a. 传送的图像区域被分为若干个大小为16×16象素的块,如果整个矩形不是16的倍数,则最后1行(或列)的块宽度(或高度)变小 b. 这些块按从左到右,从上到下的顺序排列,屏幕中变化的块被传送,不变的不被传送. c. 由于块大小是16x16,所以块内坐标XY可用一字节表示,WH可用一个字节表示
- 块内部的编码 a. 计算块内部的颜色数:一种、两种、多种,并记录出现频率最多的颜色为背景色,如果仅有两种颜色,则另一颜色记为前景色 b. 判断块内颜色数是否为一种,如果是,则先修改传送标志位,然后传送整块大小(0,0,w,h)和背景色,此块传送即完成. c. 如果不是一种,则把块拆分成颜色不同的小矩形,方法如下:
- 先把块复制到一块内存区中,以免破坏原始数据,暂称tmpBuf
- 从第一个象素开始判断,该点颜色是否与背景色相同.
- 如果不同,则分别向右和向下求得与该点颜色连续的色块.
- 对比右色块和下色块,取出其中较大的一个,做为一个矩形色块
- 在tmpBuf中把此矩形填成背景色,以避免重复判断
- 继续判断下一象素点…… d. 记录各个矩形色块的位置(x,y,w,h),如果块内含两种以上颜色,还要记录矩形色块的颜色值 e. 一边取得矩形色块,一边判断矩形色块描述数据的总长是否大于原始数据,如果大于原始数据,则放弃取色块,标志字节Raw(HexTileRaw)位置
- 以Raw方式直接传送原始数据,此块传送完成 f. 如果块含两种以上颜色,则将标志位的子块位(HexTileSubRectsColoured)置1,否则置0 g. 传送标志位,传送矩形色块个数,然后传送各矩形块数据,块中颜色数为2时不需要传送每个矩形块的颜色数据,只传位置即可. h. 注意:如果背景色或前景色与前一块(16x16块)相同,则可以不传送背景色或前景色,客户端会默认延用前一块的
func (*HexTileEncoding) Type ¶
func (that *HexTileEncoding) Type() rfb.EncodingType
type LastRectPseudo ¶ added in v1.1.1
type LastRectPseudo struct { }
func (*LastRectPseudo) Clone ¶ added in v1.1.1
func (that *LastRectPseudo) Clone(_ ...bool) rfb.IEncoding
func (*LastRectPseudo) Supported ¶ added in v1.1.1
func (that *LastRectPseudo) Supported(_ rfb.ISession) bool
func (*LastRectPseudo) Type ¶ added in v1.1.1
func (that *LastRectPseudo) Type() rfb.EncodingType
type LedStatePseudo ¶
type LedStatePseudo struct {
LedState uint8
}
LedStatePseudo 切换客户端本地小键盘锁定的led灯 0 滚动锁 1 数字锁定 2 大写锁定
func (*LedStatePseudo) Type ¶
func (that *LedStatePseudo) Type() rfb.EncodingType
type RREEncoding ¶
type RREEncoding struct {
// contains filtered or unexported fields
}
RREEncoding RRE表示提升和运行长度,正如它名字暗示的那样,它实质上表示二维向量的运行长度编码。 RRE把矩形编码成可以被客户机的图形引擎翻译的格式。RRE不适合复杂的桌面,但在一些情况下比较有用。 RRE的思想就是把像素矩形的数据分成一些子区域,和一些压缩原始区域的单元。最近最佳的分区方式一般是比较容易计算的。 编码是由像素值组成的,Vb(基本上是在矩形中最常用的像素值)和一个计数N,紧接着是N的子矩形列表,这些里面由数组组成,(x,y)是对应子矩形的坐标, 表示子矩形上-左的坐标值,(w,h) 则表示子矩形的宽高。客户端可以通过绘制使用背景像素数据值,然后再根据子矩形来绘制原始矩形。 二维行程编码本质上是对行程编码的一个二维模拟,而其压缩度可以保证与行程编码相同甚至更好。 而且更重要的是,采用RRE编码的矩形被传送到客户端以后,可以立即有效地被最简单的图形引擎所还原。
func (*RREEncoding) Type ¶
func (that *RREEncoding) Type() rfb.EncodingType
type RawEncoding ¶
type RawEncoding struct {
// contains filtered or unexported fields
}
RawEncoding 采用原始地像素数据,而不进行任何的加工处理。 在这种情况下,对于一个宽度乘以高度(即面积)为N的矩形,数据就由N个像素值组成,这些值表示按照扫描线顺序从左到右排列的每个像素。 很明显,这种编码方式是最简单的,也是效率最低的。 RFB要求所有的客户都必须能够处理这种原始编码的数据,并且在客户没有特别指定需要某种编码方式的时候,RFB服务器就默认生成原始编码。
func (*RawEncoding) Type ¶
func (that *RawEncoding) Type() rfb.EncodingType
type TightEncoding ¶
type TightEncoding struct {
// contains filtered or unexported fields
}
func (*TightEncoding) ReadCompactLen ¶
func (that *TightEncoding) ReadCompactLen(session rfb.ISession) (int, error)
ReadCompactLen 获取动态长度
func (*TightEncoding) ReadTightData ¶
func (that *TightEncoding) ReadTightData(dataSize int, session rfb.ISession) error
func (*TightEncoding) Type ¶
func (that *TightEncoding) Type() rfb.EncodingType
type TightPngEncoding ¶
type TightPngEncoding struct {
// contains filtered or unexported fields
}
func (*TightPngEncoding) ReadCompactLen ¶
func (that *TightPngEncoding) ReadCompactLen(session rfb.ISession) (int, error)
ReadCompactLen 获取动态长度
func (*TightPngEncoding) Supported ¶
func (that *TightPngEncoding) Supported(session rfb.ISession) bool
func (*TightPngEncoding) Type ¶
func (that *TightPngEncoding) Type() rfb.EncodingType
type XCursorPseudoEncoding ¶
type XCursorPseudoEncoding struct {
PrimaryR, PrimaryG, PrimaryB uint8 // 主颜色
SecondaryR, SecondaryG, SecondaryB uint8 // 次颜色
Bitmap []byte //颜色位图
Bitmask []byte //透明度位掩码
}
func (*XCursorPseudoEncoding) Clone ¶
func (that *XCursorPseudoEncoding) Clone(data ...bool) rfb.IEncoding
func (*XCursorPseudoEncoding) Supported ¶
func (that *XCursorPseudoEncoding) Supported(session rfb.ISession) bool
func (*XCursorPseudoEncoding) Type ¶
func (that *XCursorPseudoEncoding) Type() rfb.EncodingType
type ZLibEncoding ¶
type ZLibEncoding struct {
// contains filtered or unexported fields
}
func (*ZLibEncoding) Type ¶
func (that *ZLibEncoding) Type() rfb.EncodingType
type ZRLEEncoding ¶
type ZRLEEncoding struct {
// contains filtered or unexported fields
}
ZRLEEncoding ZRLE(Zlib Run - Length Encoding),它结合了zlib 压缩,片技术、调色板和运行长度编码。 在传输中,矩形以4 字节长度区域开始,紧接着是zlib 压缩的数据,一个单一的 zlib“流”对象被用在RFB协议的连接上, 因此ZRLE矩形必须严格的按照顺序进行编码和译码。
func (*ZRLEEncoding) Type ¶
func (that *ZRLEEncoding) Type() rfb.EncodingType
Source Files ¶
- default_encoding.go
- encoding.go
- encoding_copyrect.go
- encoding_corre.go
- encoding_h264.go
- encoding_hextile.go
- encoding_jpeg.go
- encoding_jrle.go
- encoding_raw.go
- encoding_rre.go
- encoding_tight.go
- encoding_tightpng.go
- encoding_trle.go
- encoding_zlib.go
- encoding_zrle.go
- pseudo_cursor.go
- pseudo_cursor_with_alpha.go
- pseudo_desktop_name.go
- pseudo_desktop_size.go
- pseudo_extended_desktop_size.go
- pseudo_fence.go
- pseudo_last_rect.go
- pseudo_led_state.go
- pseudo_pointer_pos.go
- pseudo_x_cursor.go