textures

package
v0.0.0-...-ec9fd1c Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2012 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClipMode

type ClipMode int
const (
	ClipExtend ClipMode = iota
	Clip
	ClipCube
	ClipRepeat
)

type ImageLoader

type ImageLoader interface {
	LoadImage(name string) (img *goray.Image, err error)
}

ImageLoader is an interface for retrieving images with a name.

func NewImageLoader

func NewImageLoader(base string) ImageLoader

NewImageLoader creates an image loader that defaults to the given directory. Users of the loader can access anything in local storage.

func NewImageLoaderDirectory

func NewImageLoaderDirectory(base string) ImageLoader

NewImageLoaderDirectory creates an image loader that is rooted at a given directory. Users of the loader will not directly be able to access anything outside the directory, but symlinks inside the directory will be followed.

type ImageLoaderFunc

type ImageLoaderFunc func(string) (*goray.Image, error)

ImageLoaderFunc uses a function to perform loads.

func (ImageLoaderFunc) LoadImage

func (f ImageLoaderFunc) LoadImage(name string) (img *goray.Image, err error)

type Interpolation

type Interpolation int
const (
	NoInterpolation Interpolation = 0
	Bilinear
	Bicubic
)

type Texture

type Texture struct {
	Image         *goray.Image
	Interpolation Interpolation
	UseAlpha      bool

	ClipMode         ClipMode
	RepeatX, RepeatY int
}

func (*Texture) ColorAt

func (t *Texture) ColorAt(pt vec64.Vector) (col color.AlphaColor)

func (*Texture) Is3D

func (t *Texture) Is3D() bool

func (*Texture) IsNormalMap

func (t *Texture) IsNormalMap() bool

func (*Texture) Resolution

func (t *Texture) Resolution() (x, y, z int)

func (*Texture) ScalarAt

func (t *Texture) ScalarAt(pt vec64.Vector) float64

Jump to

Keyboard shortcuts

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