canvas

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockWidth  = 16
	BlockHeight = 16
)

Variables

This section is empty.

Functions

func MakeRect

func MakeRect(x, y, width, height int) image.Rectangle

func MakeRectFromVncRect

func MakeRectFromVncRect(rect *rfb.Rectangle) image.Rectangle

Types

type RGBColor

type RGBColor struct {
	R, G, B uint8
}

func (RGBColor) RGBA

func (that RGBColor) RGBA() (r, g, b, a uint32)

type RGBImage

type RGBImage struct {
	// Pix holds the image's pixels, in R, G, B, A order. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*3].
	Pix []uint8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

func NewRGBImage

func NewRGBImage(r image.Rectangle) *RGBImage

func (RGBImage) At

func (that RGBImage) At(x, y int) color.Color

func (RGBImage) Bounds

func (that RGBImage) Bounds() image.Rectangle

func (RGBImage) ColorModel

func (that RGBImage) ColorModel() color.Model

func (*RGBImage) PixOffset

func (that *RGBImage) PixOffset(x, y int) int

func (*RGBImage) RGBAt

func (that *RGBImage) RGBAt(x, y int) *RGBColor

func (RGBImage) Set

func (that RGBImage) Set(x, y int, c color.Color)

func (*RGBImage) SetRGB

func (that *RGBImage) SetRGB(x, y int, c color.RGBA)

type VncCanvas

type VncCanvas struct {
	draw.Image

	Cursor         draw.Image
	CursorMask     [][]bool
	CursorBackup   draw.Image
	CursorOffset   *image.Point
	CursorLocation *image.Point
	DrawCursor     bool
	Changed        map[string]bool
	// contains filtered or unexported fields
}

func NewVncCanvas

func NewVncCanvas(width, height int) *VncCanvas

func (*VncCanvas) Close

func (that *VncCanvas) Close() error

Close 关闭会话

func (*VncCanvas) DecodeRaw

func (that *VncCanvas) DecodeRaw(reader io.Reader, pf *rfb.PixelFormat, rect *rfb.Rectangle) error

func (*VncCanvas) FillRect

func (that *VncCanvas) FillRect(rect *image.Rectangle, c color.Color)

FillRect 为指定的矩形区域填充颜色

func (*VncCanvas) PaintCursor

func (that *VncCanvas) PaintCursor() image.Image

func (*VncCanvas) Read

func (that *VncCanvas) Read(buf []byte) (int, error)

Read 从链接中读取数据

func (*VncCanvas) ReadColor

func (that *VncCanvas) ReadColor(c io.Reader, pf *rfb.PixelFormat) (*color.RGBA, error)

ReadColor Read unmarshal color from conn

func (*VncCanvas) RemoveCursor

func (that *VncCanvas) RemoveCursor() image.Image

func (*VncCanvas) Reset

func (that *VncCanvas) Reset(rect *rfb.Rectangle)

func (*VncCanvas) SetChanged

func (that *VncCanvas) SetChanged(rect *rfb.Rectangle)

func (*VncCanvas) Write

func (that *VncCanvas) Write(buf []byte) (int, error)

Write 写入数据到链接

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL