Documentation ¶
Overview ¶
Package img is a simple library to load images of various formats as SDL surfaces.
Index ¶
- Constants
- func GetError() error
- func Init(flags int) int
- func IsBMP(src *sdl.RWops) bool
- func IsCUR(src *sdl.RWops) bool
- func IsGIF(src *sdl.RWops) bool
- func IsICO(src *sdl.RWops) bool
- func IsJPG(src *sdl.RWops) bool
- func IsLBM(src *sdl.RWops) bool
- func IsPCX(src *sdl.RWops) bool
- func IsPNG(src *sdl.RWops) bool
- func IsPNM(src *sdl.RWops) bool
- func IsTIF(src *sdl.RWops) bool
- func IsWEBP(src *sdl.RWops) bool
- func IsXCF(src *sdl.RWops) bool
- func IsXPM(src *sdl.RWops) bool
- func IsXV(src *sdl.RWops) bool
- func LinkedVersion() *sdl.Version
- func Load(file string) (*sdl.Surface, error)
- func LoadBMPRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadCURRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadGIFRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadICORW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadJPGRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadLBMRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadPCXRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadPNGRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadPNMRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadRW(src *sdl.RWops, freesrc bool) (*sdl.Surface, error)
- func LoadTGARW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadTIFRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadTexture(renderer *sdl.Renderer, file string) (*sdl.Texture, error)
- func LoadTextureRW(renderer *sdl.Renderer, src *sdl.RWops, freesrc bool) (*sdl.Texture, error)
- func LoadTypedRW(src *sdl.RWops, freesrc bool, type_ string) (*sdl.Surface, error)
- func LoadWEBPRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadXCFRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadXPMRW(src *sdl.RWops) (*sdl.Surface, error)
- func LoadXVRW(src *sdl.RWops) (*sdl.Surface, error)
- func Quit()
- func ReadXPMFromArray(xpm string) (*sdl.Surface, error)
- func SavePNG(surface *sdl.Surface, file string) error
- func SavePNGRW(surface *sdl.Surface, dst *sdl.RWops, freedst int) error
Constants ¶
const ( INIT_JPG = 0x00000001 // JPG INIT_PNG = 0x00000002 // PNG INIT_TIF = 0x00000004 // TIF INIT_WEBP = 0x00000008 // WebP )
Flags which may be passed to img.Init() to load support of image formats, can be bitwise OR'd together.
Variables ¶
This section is empty.
Functions ¶
func GetError ¶
func GetError() error
GetError returns the last error that occurred, or an empty string if there hasn't been an error message set since the last call to sdl.ClearError(). (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_45.html)
func Init ¶
Init loads dynamic libraries and prepares them for use. Flags should be one or more flags from IMG_InitFlags OR'd together. It returns the flags successfully initialized, or 0 on failure. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_8.html)
func IsBMP ¶
IsBMP reports whether BMP format is supported and image data is readable as a BMP. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_32.html)
func IsCUR ¶
IsCUR reports whether CUR format is supported and image data is readable as a CUR. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_30.html)
func IsGIF ¶
IsGIF reports whether GIF format is supported and image data is readable as a GIF. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_37.html)
func IsICO ¶
IsICO reports whether ICO format is supported and image data is readable as an ICO. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_31.html)
func IsJPG ¶
IsJPG reports whether JPG format is supported and image data is readable as a JPG. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_38.html)
func IsLBM ¶
IsLBM reports whether LBM format is supported and image data is readable as an LBM. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_41.html)
func IsPCX ¶
IsPCX reports whether PCX format is supported and image data is readable as a PCX. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_36.html)
func IsPNG ¶
IsPNG reports whether PNG format is supported and image data is readable as a PNG. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_40.html)
func IsPNM ¶
IsPNM reports whether PNM format is supported and image data is readable as a PNM. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_33.html)
func IsTIF ¶
IsTIF reports whether TIF format is supported and image data is readable as a TIF. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_39.html)
func IsXCF ¶
IsXCF reports whether XCF format is supported and image data is readable as an XCF. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_35.html)
func IsXPM ¶
IsXPM reports whether XPM format is supported and image data is readable as an XPM. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_34.html)
func IsXV ¶
IsXV reports whether XV format is supported and image data is readable as an XV thumbnail. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_42.html)
func LinkedVersion ¶
LinkedVersion returns the version of the dynamically linked SDL_image library. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_7.html)
func Load ¶
Load loads a file for use as an image in a new surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_11.html)
func LoadBMPRW ¶ added in v0.3.0
LoadBMPRW loads a BMP image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_16.html)
func LoadCURRW ¶ added in v0.3.0
LoadCURRW loads a CUR image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_14.html)
func LoadGIFRW ¶ added in v0.3.0
LoadGIFRW loads a GIF image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_21.html)
func LoadICORW ¶ added in v0.3.0
LoadICORW loads an ICO image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_15.html)
func LoadJPGRW ¶ added in v0.3.0
LoadJPGRW loads a JPG image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_22.html)
func LoadLBMRW ¶ added in v0.3.0
LoadLBMRW loads an LBM image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_26.html)
func LoadPCXRW ¶ added in v0.3.0
LoadPCXRW loads a PCX image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_20.html)
func LoadPNGRW ¶ added in v0.3.0
LoadPNGRW loads a PNG image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_24.html)
func LoadPNMRW ¶ added in v0.3.0
LoadPNMRW loads a PNM image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_17.html)
func LoadRW ¶ added in v0.3.0
LoadRW loads an image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_12.html)
func LoadTGARW ¶ added in v0.3.0
LoadTGARW loads a TGA image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_25.html)
func LoadTIFRW ¶ added in v0.3.0
LoadTIFRW loads a TIF image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_23.html)
func LoadTexture ¶
LoadTexture loads an image directly into a render texture.
func LoadTextureRW ¶ added in v0.3.0
LoadTextureRW loads an image from an SDL data source directly into a render texture.
func LoadTypedRW ¶ added in v0.3.0
LoadTypedRW loads an image from an SDL data source. The 'type' may be one of: "BMP", "GIF", "PNG", etc. If the image format supports a transparent pixel, SDL will set the colorkey for the surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_13.html)
func LoadWEBPRW ¶ added in v0.3.0
LoadWEBPRW loads a WEBP image from an SDL data source for use as a surface.
func LoadXCFRW ¶ added in v0.3.0
LoadXCFRW loads an XCF image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_19.html)
func LoadXPMRW ¶ added in v0.3.0
LoadXPMRW loads an XPM image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_18.html)
func LoadXVRW ¶ added in v0.3.0
LoadXVRW loads an XV thumbnail image from an SDL data source for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_27.html)
func Quit ¶
func Quit()
Quit unloads libraries loaded with img.Init(). (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_9.html)
func ReadXPMFromArray ¶
ReadXPMFromArray loads an XPM image from xpm data for use as a surface. (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_28.html)
Types ¶
This section is empty.