Documentation
¶
Overview ¶
Package texture provides image types used by the rcp, e.g. textures and framebuffers.
Index ¶
- Constants
- Variables
- type ColorPalette
- type Components
- type Depth
- type Format
- type Texture
- func Load(r io.Reader) (tex *Texture, err error)
- func NewAlpha(r image.Rectangle) *Texture
- func NewCI8(r image.Rectangle, palette *ColorPalette) *Texture
- func NewFramebuffer(r image.Rectangle) *Texture
- func NewI4(r image.Rectangle) *Texture
- func NewI8(r image.Rectangle) *Texture
- func NewRGBA16(r image.Rectangle) *Texture
- func NewRGBA32(r image.Rectangle) *Texture
- func NewTextureFromImage(img image.Image) (tex *Texture)
- func (p *Texture) Addr() cpu.Addr
- func (p *Texture) Format() Format
- func (p *Texture) HasAlpha() bool
- func (p *Texture) Invalidate()
- func (p *Texture) Palette() *Texture
- func (p *Texture) Pix() []byte
- func (p *Texture) SetOrigin(origin image.Point)
- func (p *Texture) Store(w io.Writer) error
- func (p *Texture) Stride() int
- func (p *Texture) SubImage(r image.Rectangle) *Texture
- func (p *Texture) Writeback()
Constants ¶
View Source
const ( RGBA32 = Format(RGBA) | Format(BPP32) RGBA16 = Format(RGBA) | Format(BPP16) YUV16 = Format(YUV) | Format(BPP16) IA16 = Format(IA) | Format(BPP16) IA8 = Format(IA) | Format(BPP8) IA4 = Format(IA) | Format(BPP4) I8 = Format(I) | Format(BPP8) I4 = Format(I) | Format(BPP4) CI8 = Format(CI) | Format(BPP8) CI4 = Format(CI) | Format(BPP4) )
Variables ¶
View Source
var I4Model color.Model = color.ModelFunc(i4Model)
View Source
var RGBA16Model color.Model = color.ModelFunc(rgba16Model)
Functions ¶
This section is empty.
Types ¶
type ColorPalette ¶
type ColorPalette = imageRGBA16
ColorPalette is a palette of RGBA16 colors.
func CopyColorPalette ¶
func CopyColorPalette(src color.Palette) (*ColorPalette, error)
func NewColorPalette ¶
func NewColorPalette(size int) (*ColorPalette, error)
type Components ¶
type Components uint64
const ( RGBA Components = iota << 53 YUV CI // Color Palette IA // Intensity with alpha I // Intensity )
type Format ¶
type Format uint64
func (Format) Components ¶
func (c Format) Components() Components
type Texture ¶
func NewCI8 ¶
func NewCI8(r image.Rectangle, palette *ColorPalette) *Texture
Stores pixels color index in a RGBA16 palette
func NewFramebuffer ¶ added in v0.1.1
Stores pixels alpha-premultiplied in RGBA with 32bit (8:8:8:8)
func NewTextureFromImage ¶
func (*Texture) Invalidate ¶
func (p *Texture) Invalidate()
func (*Texture) SetOrigin ¶
SetOrigin moves the coordinate system of the texture to origin. Useful if subimages are used as viewports and should have their origin in (0, 0).
Click to show internal directories.
Click to hide internal directories.