display

package
v0.0.0-...-831e56b Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPixelFormat = &types.PixelFormat{
	BPP:        16,
	Depth:      16,
	BigEndian:  0,
	TrueColour: 1,
	RedMax:     0x1f,
	GreenMax:   0x1f,
	BlueMax:    0x1f,
	RedShift:   0xa,
	GreenShift: 0x5,
	BlueShift:  0,
}

DefaultPixelFormat is the default pixel format used in ServerInit messages.

Functions

This section is empty.

Types

type Display

type Display struct {
	// contains filtered or unexported fields
}

Display represents a session with the local display. It manages the gstreamer pipelines and listens for events from the RFB event handlers.

func NewDisplay

func NewDisplay(opts *Opts) *Display

NewDisplay returns a new display with the given dimensions. These dimensions can be mutated later on depending on client support.

func (*Display) Close

func (d *Display) Close() error

Close will stop the gstreamer pipeline.

func (*Display) DispatchClientCutText

func (d *Display) DispatchClientCutText(ev *types.ClientCutText)

DispatchClientCutText dispatches a ClientCutText to the queue.

func (*Display) DispatchFrameBufferUpdate

func (d *Display) DispatchFrameBufferUpdate(req *types.FrameBufferUpdateRequest)

DispatchFrameBufferUpdate dispatches a FrameBufferUpdateRequest on the request queue.

func (*Display) DispatchKeyEvent

func (d *Display) DispatchKeyEvent(ev *types.KeyEvent)

DispatchKeyEvent dispatches a key event to the queue.

func (*Display) DispatchPointerEvent

func (d *Display) DispatchPointerEvent(ev *types.PointerEvent)

DispatchPointerEvent dispatches a pointer event to the queue.

func (*Display) GetCurrentEncoding

func (d *Display) GetCurrentEncoding() encodings.Encoding

GetCurrentEncoding returns the encoder that is currently being used.

func (*Display) GetDimensions

func (d *Display) GetDimensions() (width, height int)

GetDimensions returns the current dimensions of the display.

func (*Display) GetEncodings

func (d *Display) GetEncodings() []int32

GetEncodings returns the encodings currently supported by the client connected to this display.

func (*Display) GetLastImage

func (d *Display) GetLastImage() *image.RGBA

GetLastImage returns the most recent frame for the display.

func (*Display) GetPixelFormat

func (d *Display) GetPixelFormat() *types.PixelFormat

GetPixelFormat returns the current pixel format for the display.

func (*Display) SetDimensions

func (d *Display) SetDimensions(width, height int)

SetDimensions sets the dimensions of the display.

func (*Display) SetEncodings

func (d *Display) SetEncodings(encs []int32, pseudoEns []int32)

SetEncodings sets the encodings that the connected client supports.

func (*Display) SetPixelFormat

func (d *Display) SetPixelFormat(pf *types.PixelFormat)

SetPixelFormat sets the pixel format for the display.

func (*Display) Start

func (d *Display) Start() error

Start will start the underlying display provider.

type GetEncodingsFunc

type GetEncodingsFunc func(encs []int32) encodings.Encoding

GetEncodingsFunc is a function that can be used to retrieve an encoder from a list of client supplied options.

type Opts

type Opts struct {
	DisplayProvider providers.Provider
	Width, Height   int
	Buffer          *buffer.ReadWriter
	GetEncodingFunc GetEncodingsFunc
}

Opts represents options for building a new display.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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