go-sdl2: github.com/veandco/go-sdl2/img Index | Files

package img

import "github.com/veandco/go-sdl2/img"

Package img is a simple library to load images of various formats as SDL surfaces.

Index

Package Files

sdl_image.go sdl_image_cgo.go

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.

func GetError Uses

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 Uses

func Init(flags int) int

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 Uses

func IsBMP(src *sdl.RWops) bool

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 Uses

func IsCUR(src *sdl.RWops) bool

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 Uses

func IsGIF(src *sdl.RWops) bool

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 Uses

func IsICO(src *sdl.RWops) bool

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 Uses

func IsJPG(src *sdl.RWops) bool

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 Uses

func IsLBM(src *sdl.RWops) bool

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 Uses

func IsPCX(src *sdl.RWops) bool

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 Uses

func IsPNG(src *sdl.RWops) bool

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 Uses

func IsPNM(src *sdl.RWops) bool

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 Uses

func IsTIF(src *sdl.RWops) bool

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 IsWEBP Uses

func IsWEBP(src *sdl.RWops) bool

IsWEBP reports whether WEBP format is supported and image data is readable as a WEBP.

func IsXCF Uses

func IsXCF(src *sdl.RWops) bool

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 Uses

func IsXPM(src *sdl.RWops) bool

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 Uses

func IsXV(src *sdl.RWops) bool

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 Uses

func LinkedVersion() *sdl.Version

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 Uses

func Load(file string) (*sdl.Surface, error)

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 Uses

func LoadBMPRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadCURRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadGIFRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadICORW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadJPGRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadLBMRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadPCXRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadPNGRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadPNMRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadRW(src *sdl.RWops, freesrc bool) (*sdl.Surface, error)

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 Uses

func LoadTGARW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadTIFRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadTexture(renderer *sdl.Renderer, file string) (*sdl.Texture, error)

LoadTexture loads an image directly into a render texture.

func LoadTextureRW Uses

func LoadTextureRW(renderer *sdl.Renderer, src *sdl.RWops, freesrc bool) (*sdl.Texture, error)

LoadTextureRW loads an image from an SDL data source directly into a render texture.

func LoadTypedRW Uses

func LoadTypedRW(src *sdl.RWops, freesrc bool, type_ string) (*sdl.Surface, error)

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 Uses

func LoadWEBPRW(src *sdl.RWops) (*sdl.Surface, error)

LoadWEBPRW loads a WEBP image from an SDL data source for use as a surface.

func LoadXCFRW Uses

func LoadXCFRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadXPMRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func LoadXVRW(src *sdl.RWops) (*sdl.Surface, error)

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 Uses

func Quit()

Quit unloads libraries loaded with img.Init(). (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_9.html)

func ReadXPMFromArray Uses

func ReadXPMFromArray(xpm string) (*sdl.Surface, error)

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)

func SavePNG Uses

func SavePNG(surface *sdl.Surface, file string) error

SavePNG saves a surface as PNG file.

func SavePNGRW Uses

func SavePNGRW(surface *sdl.Surface, dst *sdl.RWops, freedst int) error

SavePNGRW saves a surface to an SDL data source.

Package img imports 4 packages (graph) and is imported by 36 packages. Updated 2019-02-19. Refresh now. Tools for package owners.