render

package
v0.0.0-...-2c72341 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Rotation
	ROTATION0    = 0
	ROTATION90   = 1
	ROTATION180  = 2
	ROTATION270  = 3
	ROTATIONMASK = 3

	//Flip Horizontal
	FLIPHOR = 4
	//Flip Vertical
	FLIPVER = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRender

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

func (*BaseRender) OrthoProjection

func (r *BaseRender) OrthoProjection() []float32

func (*BaseRender) Pos

func (r *BaseRender) Pos(x, y int) (int, int)

func (*BaseRender) SetProperty

func (r *BaseRender) SetProperty(wW, wH int, iW, iH int, x, y, rw, rh int, op int)

func (*BaseRender) TexCoords

func (r *BaseRender) TexCoords() []float32

func (*BaseRender) Vertices

func (r *BaseRender) Vertices() []float32

type C3Render

type C3Render struct {
	BaseRender
	// contains filtered or unexported fields
}

func (*C3Render) Draw

func (r *C3Render) Draw(pixels interface{})

func (*C3Render) Init

func (r *C3Render) Init(userData interface{})

func (*C3Render) Release

func (r *C3Render) Release()

func (*C3Render) SetData

func (r *C3Render) SetData(pixels interface{})

type Render

type Render interface {
	// Init render, userdata is ignore
	Init()
	Draw(pixels interface{})
	Release()

	// SetProperty
	// wW, wH is windows/client width, height
	// iW, iH is image width, height
	// x, y, w, h is draw image to rect
	// op is ROTATION?? | FLIPHOR | FLIPVER
	SetProperty(wW, wH int, iW, iH int, x, y, w, h int, op int)

	// 验证 pixels 是否符合指定 width、height
	Validate(width, height int, pixels interface{}) bool

	// 转换图片坐标到 windows/client 坐标
	Pos(x, y int) (int, int)
}

type YuvRender

type YuvRender struct {
	BaseRender
	// contains filtered or unexported fields
}

func (*YuvRender) Draw

func (r *YuvRender) Draw(data interface{})

func (*YuvRender) Init

func (r *YuvRender) Init()

func (*YuvRender) Release

func (r *YuvRender) Release()

func (*YuvRender) Validate

func (r *YuvRender) Validate(w, h int, pixels interface{}) bool

Jump to

Keyboard shortcuts

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