Documentation ¶
Overview ¶
Package texture provides classes for creating and storing images.
Index ¶
- func SaveGif(filepath string, images []Image2D) error
- type Image2D
- func (image *Image2D) FlipX()
- func (image *Image2D) FlipY()
- func (image *Image2D) GetA(x, y int) uint8
- func (image *Image2D) GetB(x, y int) uint8
- func (image *Image2D) GetChannels() int
- func (image *Image2D) GetData() []uint8
- func (image *Image2D) GetDataPointer() unsafe.Pointer
- func (image *Image2D) GetG(x, y int) uint8
- func (image *Image2D) GetHeight() int
- func (image *Image2D) GetPixelType() uint32
- func (image *Image2D) GetR(x, y int) uint8
- func (image *Image2D) GetRGB(x, y int) (uint8, uint8, uint8)
- func (image *Image2D) GetRGBA(x, y int) (uint8, uint8, uint8, uint8)
- func (image *Image2D) GetWidth() int
- func (img *Image2D) SaveToPath(path string) error
- func (image *Image2D) SetA(x, y int, a uint8)
- func (image *Image2D) SetB(x, y int, b uint8)
- func (image *Image2D) SetG(x, y int, g uint8)
- func (image *Image2D) SetR(x, y int, r uint8)
- func (image *Image2D) SetRGB(x, y int, r, g, b uint8)
- func (image *Image2D) SetRGBA(x, y int, r, g, b, a uint8)
- func (image Image2D) String() string
- func (img *Image2D) ToImage() (image.Image, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Image2D ¶
type Image2D struct {
// contains filtered or unexported fields
}
Image2D stores the dimensions, data format and it's pixel data. It can be used to manipulate single pixels and is used to upload it's data to a texture.
func MakeFromData ¶
MakeFromData constructs an image of the specified width and height and the specified data.
func MakeFromFrameBuffer ¶
func MakeFromPath ¶
MakeFromPath constructs the image data from the specified path. If there is no image at the specified path an error is returned instead.
func (*Image2D) FlipX ¶
func (image *Image2D) FlipX()
FlipX changes the order of the columns by swapping the first column of a row with the last column of the same row, the second column of this row with the second last column of this row etc.
func (*Image2D) FlipY ¶
func (image *Image2D) FlipY()
FlipY changes the order of the rows by swapping the first row with the last row, the second row with the second last row etc.
func (*Image2D) GetChannels ¶
GetChannels return the number of the channels of the image.
func (*Image2D) GetDataPointer ¶
GetDataPointer returns an pointer to the beginning of the image data.
func (*Image2D) GetPixelType ¶
GetPixelType gets the data type of the pixel data.
func (*Image2D) SaveToPath ¶
SaveToPath saves the image at the specified path in the png format. The specified image path has to have the fileextension .png. An error is thrown if the path is not valid or any of the specified directories don't exist.