encodings

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEncodings = []Encoding{
	&RawEncoding{},
	&TightEncoding{},
	&TightPNGEncoding{},
}

DefaultEncodings lists the encodings enabled by default on the server.

Functions

This section is empty.

Types

type Encoding

type Encoding interface {
	// Code should return the int32 code of the encoding type.
	Code() int32
	// HandleBuffer should craft a rectangle from the given image and
	// queue it onto the given writer.
	HandleBuffer(w io.Writer, format *types.PixelFormat, img *image.RGBA)
}

Encoding is an interface to be implemented by different encoding handlers.

func GetDefaults

func GetDefaults() []Encoding

GetDefaults returns a slice of the default encoding handlers.

type RawEncoding

type RawEncoding struct{}

RawEncoding implements an Encoding intercace using raw pixel data.

func (*RawEncoding) Code

func (r *RawEncoding) Code() int32

Code returns the code

func (*RawEncoding) HandleBuffer

func (r *RawEncoding) HandleBuffer(w io.Writer, f *types.PixelFormat, img *image.RGBA)

HandleBuffer handles an image sample.

type TightEncoding

type TightEncoding struct{}

TightEncoding implements an Encoding intercace using Tight encoding.

func (*TightEncoding) Code

func (t *TightEncoding) Code() int32

Code returns the code

func (*TightEncoding) HandleBuffer

func (t *TightEncoding) HandleBuffer(w io.Writer, f *types.PixelFormat, img *image.RGBA)

HandleBuffer handles an image sample.

type TightPNGEncoding

type TightPNGEncoding struct{}

TightPNGEncoding implements an Encoding intercace using Tight encoding.

func (*TightPNGEncoding) Code

func (t *TightPNGEncoding) Code() int32

Code returns the code

func (*TightPNGEncoding) HandleBuffer

func (t *TightPNGEncoding) HandleBuffer(w io.Writer, f *types.PixelFormat, img *image.RGBA)

HandleBuffer handles an image sample.

Jump to

Keyboard shortcuts

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