image

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Rect    = image.Rect
	NewRGBA = image.NewRGBA
)

Functions

This section is empty.

Types

type RGBA

type RGBA = image.RGBA

type Rectangle

type Rectangle = image.Rectangle

type Texture

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

Texture represents a power-of-two 2D texture. The power-of-two means that the texture width and height must be a power of two. e.g. 1024x1024.

func NewColorTexture

func NewColorTexture(c color.RGBA) *Texture

func NewTexture

func NewTexture(opts ...TextureOption) *Texture

func (*Texture) Query

func (t *Texture) Query(lod, u, v float64) color.RGBA

Query fetches the color of at pixel (u, v). This function is a naive mipmap implementation that does magnification and minification.

func (*Texture) Size

func (t *Texture) Size() int

Size returns the size of the texture.

func (*Texture) UseMipmap

func (t *Texture) UseMipmap() bool

UseMipmap checks if the texture activates mipmap.

type TextureOption

type TextureOption func(t *Texture)

func WithDebug

func WithDebug(enable bool) TextureOption

func WithIsotropicMipMap

func WithIsotropicMipMap(enable bool) TextureOption

func WithSource

func WithSource(data *image.RGBA) TextureOption

Jump to

Keyboard shortcuts

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