img

package
v0.0.0-...-9f55388 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PropAnimationEncoderCreateFilenameString            = "SDL_image.animation_encoder.create.filename"
	PropAnimationEncoderCreateIostreamPointer           = "SDL_image.animation_encoder.create.iostream"
	PropAnimationEncoderCreateIostreamAutocloseBoolean  = "SDL_image.animation_encoder.create.iostream.autoclose"
	PropAnimationEncoderCreateTypeString                = "SDL_image.animation_encoder.create.type"
	PropAnimationEncoderCreateQualityNumber             = "SDL_image.animation_encoder.create.quality"
	PropAnimationEncoderCreateTimebaseNumeratorNumber   = "SDL_image.animation_encoder.create.timebase.numerator"
	PropAnimationEncoderCreateTimebaseDenominatorNumber = "SDL_image.animation_encoder.create.timebase.denominator"

	PropAnimationEncoderCreateAvifMaxThreadsNumber       = "SDL_image.animation_encoder.create.avif.max_threads"
	PropAnimationEncoderCreateAvifKeyframeIntervalNumber = "SDL_image.animation_encoder.create.avif.keyframe_interval"
	PropAnimationEncoderCreateGifUseLutBoolean           = "SDL_image.animation_encoder.create.gif.use_lut"
)
View Source
const (
	PropAnimationDecoderCreateFilenameString            = "SDL_image.animation_decoder.create.filename"
	PropAnimationDecoderCreateIostreamPointer           = "SDL_image.animation_decoder.create.iostream"
	PropAnimationDecoderCreateIostreamAutocloseBoolean  = "SDL_image.animation_decoder.create.iostream.autoclose"
	PropAnimationDecoderCreateTypeString                = "SDL_image.animation_decoder.create.type"
	PropAnimationDecoderCreateTimebaseNumeratorNumber   = "SDL_image.animation_decoder.create.timebase.numerator"
	PropAnimationDecoderCreateTimebaseDenominatorNumber = "SDL_image.animation_decoder.create.timebase.denominator"

	PropAnimationDecoderCreateAvifMaxThreadsNumber           = "SDL_image.animation_decoder.create.avif.max_threads"
	PropAnimationDecoderCreateAvifAllowIncrementalBoolean    = "SDL_image.animation_decoder.create.avif.allow_incremental"
	PropAnimationDecoderCreateAvifAllowProgressiveBoolean    = "SDL_image.animation_decoder.create.avif.allow_progressive"
	PropAnimationDecoderCreateGifTransparentColorIndexNumber = "SDL_image.animation_encoder.create.gif.transparent_color_index"
	PropAnimationDecoderCreateGifNumColorsNumber             = "SDL_image.animation_encoder.create.gif.num_colors"
)
View Source
const (
	PropMetadataIgnorePropsBoolean = "SDL_image.metadata.ignore_props"
	PropMetadataDescriptionString  = "SDL_image.metadata.description"
	PropMetadataCopyrightString    = "SDL_image.metadata.copyright"
	PropMetadataTitleString        = "SDL_image.metadata.title"
	PropMetadataAuthorString       = "SDL_image.metadata.author"
	PropMetadataCreationTimeString = "SDL_image.metadata.creation_time"
	PropMetadataFrameCountNumber   = "SDL_image.metadata.frame_count"
	PropMetadataLoopCountNumber    = "SDL_image.metadata.loop_count"
)

Variables

This section is empty.

Functions

func AddAnimationEncoderFrame

func AddAnimationEncoderFrame(encoder *AnimationEncoder, surface *sdl.Surface, duration uint64) bool

AddAnimationEncoderFrame adds a frame to an animation encoder.

Available since SDL_image 3.4.0.

func CloseAnimationDecoder

func CloseAnimationDecoder(decoder *AnimationDecoder) bool

CloseAnimationDecoder closes an animation decoder, finishing any decoding.

Available since SDL_image 3.4.0.

func CloseAnimationEncoder

func CloseAnimationEncoder(encoder *AnimationEncoder) bool

CloseAnimationEncoder closes an animation encoder, finishing any encoding.

Available since SDL_image 3.4.0.

func CreateAnimatedCursor

func CreateAnimatedCursor(anim *Animation, hotX, hotY int32) *sdl.Cursor

CreateAnimatedCursor creates an animated cursor from an animation.

Available since SDL_image 3.4.0.

func FreeAnimation

func FreeAnimation(anim *Animation)

FreeAnimation disposes of an Animation and free its resources.

func GetAnimationDecoderFrame

func GetAnimationDecoderFrame(decoder *AnimationDecoder, frame **sdl.Surface, duration *uint64) bool

GetAnimationDecoderFrame gets the next frame in an animation decoder.

Available since SDL_image 3.4.0.

func GetAnimationDecoderProperties

func GetAnimationDecoderProperties(decoder *AnimationDecoder) sdl.PropertiesID

GetAnimationDecoderProperties gets the properties of an animation decoder.

Available since SDL_image 3.4.0.

func GetClipboardImage

func GetClipboardImage() *sdl.Surface

GetClipboardImage gets the image currently in the clipboard.

Available since SDL_image 3.4.0.

func IsANI

func IsANI(src *sdl.IOStream) bool

IsANI detects ANI animated cursor data on a readable/seekable sdl.IOStream.

Available since SDL_image 3.4.0.

func IsAVIF

func IsAVIF(src *sdl.IOStream) bool

IsAVIF detects AVIF image data on a readable/seekable sdl.IOStream.

func IsBMP

func IsBMP(src *sdl.IOStream) bool

IsBMP detects BMP image data on a readable/seekable sdl.IOStream.

func IsCUR

func IsCUR(src *sdl.IOStream) bool

IsCUR detects CUR image data on a readable/seekable sdl.IOStream.

func IsGIF

func IsGIF(src *sdl.IOStream) bool

IsGIF detects GIF image data on a readable/seekable sdl.IOStream.

func IsICO

func IsICO(src *sdl.IOStream) bool

IsICO detects ICO image data on a readable/seekable sdl.IOStream.

func IsJPG

func IsJPG(src *sdl.IOStream) bool

IsJPG detects JPG image data on a readable/seekable sdl.IOStream.

func IsJXL

func IsJXL(src *sdl.IOStream) bool

IsJXL detects JXL image data on a readable/seekable sdl.IOStream.

func IsLBM

func IsLBM(src *sdl.IOStream) bool

IsLBM detects LBM image data on a readable/seekable sdl.IOStream.

func IsPCX

func IsPCX(src *sdl.IOStream) bool

IsPCX detects PCX image data on a readable/seekable sdl.IOStream.

func IsPNG

func IsPNG(src *sdl.IOStream) bool

IsPNG detects PNG image data on a readable/seekable sdl.IOStream.

func IsPNM

func IsPNM(src *sdl.IOStream) bool

IsPNM detects PNM image data on a readable/seekable sdl.IOStream.

func IsQOI

func IsQOI(src *sdl.IOStream) bool

IsQOI detects QOI image data on a readable/seekable sdl.IOStream.

func IsSVG

func IsSVG(src *sdl.IOStream) bool

IsSVG detects SVG image data on a readable/seekable sdl.IOStream.

func IsTIF

func IsTIF(src *sdl.IOStream) bool

IsTIF detects TIFF image data on a readable/seekable sdl.IOStream.

func IsWEBP

func IsWEBP(src *sdl.IOStream) bool

IsWEBP detects WEBP image data on a readable/seekable sdl.IOStream.

func IsXCF

func IsXCF(src *sdl.IOStream) bool

IsXCF detects XCF image data on a readable/seekable sdl.IOStream.

func IsXPM

func IsXPM(src *sdl.IOStream) bool

IsXPM detects XPM image data on a readable/seekable sdl.IOStream.

func IsXV

func IsXV(src *sdl.IOStream) bool

IsXV detects XV image data on a readable/seekable sdl.IOStream.

func Load

func Load(file string) *sdl.Surface

Load loads an image from a filesystem path into a software surface.

func LoadAVIFIO

func LoadAVIFIO(src *sdl.IOStream) *sdl.Surface

LoadAVIFIO loads a AVIF image directly.

func LoadBMPIO

func LoadBMPIO(src *sdl.IOStream) *sdl.Surface

LoadBMPIO loads a BMP image directly.

func LoadCURIO

func LoadCURIO(src *sdl.IOStream) *sdl.Surface

LoadCURIO loads a CUR image directly.

func LoadGIFIO

func LoadGIFIO(src *sdl.IOStream) *sdl.Surface

LoadGIFIO loads a GIF image directly.

func LoadGPUTexture

func LoadGPUTexture(device *sdl.GPUDevice, copyPass *sdl.GPUCopyPass, file string, width, height *int32) *sdl.GPUTexture

LoadGPUTexture loads an image from a filesystem path into a GPU texture.

Available since SDL_image 3.4.0.

func LoadGPUTextureIO

func LoadGPUTextureIO(device *sdl.GPUDevice, copyPass *sdl.GPUCopyPass, src *sdl.IOStream, closeio bool, width, height *int32) *sdl.GPUTexture

LoadGPUTextureIO loads an image from an SDL data source into a GPU texture.

Available since SDL_image 3.4.0.

func LoadGPUTextureTypedIO

func LoadGPUTextureTypedIO(device *sdl.GPUDevice, copyPass *sdl.GPUCopyPass, src *sdl.IOStream, closeio bool, _type string, width, height *int32) *sdl.GPUTexture

LoadGPUTextureTypedIO loads an image from an SDL data source into a GPU texture.

Available since SDL_image 3.4.0.

func LoadICOIO

func LoadICOIO(src *sdl.IOStream) *sdl.Surface

LoadICOIO loads a ICO image directly.

func LoadIO

func LoadIO(src *sdl.IOStream, closeio bool) *sdl.Surface

Load loads an image from an SDL data source into a software surface.

func LoadJPGIO

func LoadJPGIO(src *sdl.IOStream) *sdl.Surface

LoadJPGIO loads a JPG image directly.

func LoadJXLIO

func LoadJXLIO(src *sdl.IOStream) *sdl.Surface

LoadJXLIO loads a JXL image directly.

func LoadLBMIO

func LoadLBMIO(src *sdl.IOStream) *sdl.Surface

LoadLBMIO loads a LBM image directly.

func LoadPCXIO

func LoadPCXIO(src *sdl.IOStream) *sdl.Surface

LoadPCXIO loads a PCX image directly.

func LoadPNGIO

func LoadPNGIO(src *sdl.IOStream) *sdl.Surface

LoadPNGIO loads a PNG image directly.

func LoadPNMIO

func LoadPNMIO(src *sdl.IOStream) *sdl.Surface

LoadPNMIO loads a PNM image directly.

func LoadQOIIO

func LoadQOIIO(src *sdl.IOStream) *sdl.Surface

LoadQOIIO loads a QOI image directly.

func LoadSVGIO

func LoadSVGIO(src *sdl.IOStream) *sdl.Surface

LoadSVGIO loads a SVG image directly.

func LoadSizedSVGIO

func LoadSizedSVGIO(src *sdl.IOStream, width int32, height int32) *sdl.Surface

LoadSizedSVGIO loads an SVG image, scaled to a specific size.

func LoadTGAIO

func LoadTGAIO(src *sdl.IOStream) *sdl.Surface

LoadTGAIO loads a TGA image directly.

func LoadTIFIO

func LoadTIFIO(src *sdl.IOStream) *sdl.Surface

LoadTIFIO loads a TIFF image directly.

func LoadTexture

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

LoadTexture loads an image from a filesystem path into a GPU texture.

func LoadTextureIO

func LoadTextureIO(renderer *sdl.Renderer, src *sdl.IOStream, closeio bool) *sdl.Texture

LoadTextureIO loads an image from an SDL data source into a GPU texture.

func LoadTextureTypedIO

func LoadTextureTypedIO(renderer *sdl.Renderer, src *sdl.IOStream, closeio bool, format string) *sdl.Texture

LoadTextureTypedIO loads an image from an SDL data source into a GPU texture.

func LoadTypedIO

func LoadTypedIO(src *sdl.IOStream, closeio bool, format string) *sdl.Surface

LoadTypedIO loads an image from an SDL data source into a software surface.

func LoadWEBPIO

func LoadWEBPIO(src *sdl.IOStream) *sdl.Surface

LoadWEBPIO loads a WEBP image directly.

func LoadXCFIO

func LoadXCFIO(src *sdl.IOStream) *sdl.Surface

LoadXCFIO loads a XCF image directly.

func LoadXPMIO

func LoadXPMIO(src *sdl.IOStream) *sdl.Surface

LoadXPMIO loads a XPM image directly.

func LoadXVIO

func LoadXVIO(src *sdl.IOStream) *sdl.Surface

LoadXVIO loads a XV image directly.

func ReadXPMFromArray

func ReadXPMFromArray(xpm **byte) *sdl.Surface

ReadXPMFromArray loads an XPM image from a memory array.

func ReadXPMFromArrayToRGB888

func ReadXPMFromArrayToRGB888(xpm **byte) *sdl.Surface

ReadXPMFromArrayToRGB888 loads an XPM image from a memory array.

func ResetAnimationDecoder

func ResetAnimationDecoder(decoder *AnimationDecoder) bool

ResetAnimationDecoder resets an animation decoder.

Available since SDL_image 3.4.0.

func Save

func Save(surface *sdl.Surface, file string) bool

Save saves an sdl.Surface into an image file.

Available since SDL_image 3.4.0.

func SaveANIAnimationIO

func SaveANIAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool) bool

SaveANIAnimationIO saves an animation in ANI format to an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveAPNGAnimationIO

func SaveAPNGAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool) bool

SaveAPNGAnimationIO saves an animation in APNG format to an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveAVIF

func SaveAVIF(surface *sdl.Surface, file string, quality int32) bool

SaveAVIF saves an sdl.Surface into a AVIF image file.

func SaveAVIFAnimationIO

func SaveAVIFAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool, quality int32) bool

SaveAVIFAnimationIO saves an animation in AVIF format to an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveAVIFIO

func SaveAVIFIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool, quality int32) bool

SaveAVIFIO saves an sdl.Surface into AVIF image data, via an sdl.IOStream.

func SaveAnimation

func SaveAnimation(anim *Animation, file string) bool

SaveAnimation saves an animation to a file.

Available since SDL_image 3.4.0.

func SaveAnimationTypedIO

func SaveAnimationTypedIO(anim *Animation, dst *sdl.IOStream, closeio bool, _type string) bool

SaveAnimationTypedIO saves an animation to an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveBMP

func SaveBMP(surface *sdl.Surface, file string) bool

SaveBMP saves an sdl.Surface into a BMP image file.

Available since SDL_image 3.4.0.

func SaveBMPIO

func SaveBMPIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool

SaveBMPIO saves an sdl.Surface into BMP image data, via an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveCUR

func SaveCUR(surface *sdl.Surface, file string) bool

SaveCUR saves an sdl.Surface into a CUR image file.

Available since SDL_image 3.4.0.

func SaveCURIO

func SaveCURIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool

SaveCURIO saves an sdl.Surface into CUR image data, via an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveGIF

func SaveGIF(surface *sdl.Surface, file string) bool

SaveGIF saves an sdl.Surface into a GIF image file.

Available since SDL_image 3.4.0.

func SaveGIFAnimationIO

func SaveGIFAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool) bool

SaveGIFAnimationIO saves an animation in GIF format to an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveGIFIO

func SaveGIFIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool

SaveGIFIO saves an sdl.Surface into GIF image data, via an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveICO

func SaveICO(surface *sdl.Surface, file string) bool

SaveICO saves an sdl.Surface into a ICO image file.

Available since SDL_image 3.4.0.

func SaveICOIO

func SaveICOIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool

SaveICOIO saves an sdl.Surface into ICO image data, via an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveJPG

func SaveJPG(surface *sdl.Surface, file string, quality int32) bool

SaveJPG saves an sdl.Surface into a JPEG image file.

func SaveJPGIO

func SaveJPGIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool, quality int32) bool

SaveJPGIO saves an sdl.Surface into JPEG image data, via an sdl.IOStream.

func SavePNG

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

SavePNG saves an sdl.Surface into a PNG image file.

func SavePNGIO

func SavePNGIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool

SavePNGIO saves an sdl.Surface into PNG image data, via an sdl.IOStream.

func SaveTGA

func SaveTGA(surface *sdl.Surface, file string) bool

SaveTGA saves an sdl.Surface into a TGA image file.

Available since SDL_image 3.4.0.

func SaveTGAIO

func SaveTGAIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool

SaveTGAIO saves an sdl.Surface into TGA image data, via an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveTypedIO

func SaveTypedIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool, _type string) bool

SaveTypedIO saves an sdl.Surface into formatted image data, via an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveWEBP

func SaveWEBP(surface *sdl.Surface, file string, quality float32) bool

SaveWEBP saves an sdl.Surface into a WEBP image file.

Available since SDL_image 3.4.0.

func SaveWEBPAnimationIO

func SaveWEBPAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool, quality int32) bool

SaveWEBPAnimationIO saves an animation in WEBP format to an sdl.IOStream.

Available since SDL_image 3.4.0.

func SaveWEBPIO

func SaveWEBPIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool, quality float32) bool

SaveWEBPIO saves an sdl.Surface into WEBP image data, via an sdl.IOStream.

Available since SDL_image 3.4.0.

func Version

func Version() (major, minor, patch int32)

Version gets the version of the dynamically linked SDL_image library.

Types

type Animation

type Animation struct {
	W     int32 // The width of the frames.
	H     int32 // The height of the frames.
	Count int32 // The number of frames.
	// contains filtered or unexported fields
}

Animation defines the animated image support.

func LoadANIAnimationIO

func LoadANIAnimationIO(src *sdl.IOStream) *Animation

LoadANIAnimationIO loads an ANI animation directly from an sdl.IOStream.

Available since SDL_image 3.4.0.

func LoadAPNGAnimationIO

func LoadAPNGAnimationIO(src *sdl.IOStream) *Animation

LoadAPNGAnimationIO loads an APNG animation directly from an sdl.IOStream.

Available since SDL_image 3.4.0.

func LoadAVIFAnimationIO

func LoadAVIFAnimationIO(src *sdl.IOStream) *Animation

LoadAVIFAnimationIO loads an AVIF animation directly from an sdl.IOStream.

Available since SDL_image 3.4.0.

func LoadAnimation

func LoadAnimation(file string) *Animation

LoadAnimation loads an animation from a file.

func LoadAnimationIO

func LoadAnimationIO(src *sdl.IOStream, closeio bool) *Animation

LoadAnimation loads an animation from an sdl.IOStream.

func LoadAnimationTypedIO

func LoadAnimationTypedIO(src *sdl.IOStream, closeio bool, format string) *Animation

LoadAnimationTypedIO loads an animation from an sdl.IOStream.

func LoadGIFAnimationIO

func LoadGIFAnimationIO(src *sdl.IOStream) *Animation

LoadGIFAnimationIO loads a GIF animation directly.

func LoadWEBPAnimationIO

func LoadWEBPAnimationIO(src *sdl.IOStream) *Animation

LoadWEBPAnimationIO loads a WEBP animation directly.

func (*Animation) Delays

func (a *Animation) Delays() []int32

Delays gets delays between frames.

func (*Animation) Frames

func (a *Animation) Frames() []*sdl.Surface

Frames gets available frames.

type AnimationDecoder

type AnimationDecoder struct{}

AnimationDecoder is an object representing animation decoder.

Available since SDL_image 3.4.0.

func CreateAnimationDecoder

func CreateAnimationDecoder(file string) *AnimationDecoder

CreateAnimationDecoder creates a decoder to read a series of images from a file.

Available since SDL_image 3.4.0.

func CreateAnimationDecoderIO

func CreateAnimationDecoderIO(src *sdl.IOStream, closeio bool, _type string) *AnimationDecoder

CreateAnimationDecoderIO creates a decoder to read a series of images from an IOStream.

Available since SDL_image 3.4.0.

func CreateAnimationDecoderWithProperties

func CreateAnimationDecoderWithProperties(props sdl.PropertiesID) *AnimationDecoder

CreateAnimationDecoderWithProperties creates an animation decoder with the specified properties.

Available since SDL_image 3.4.0.

type AnimationDecoderStatus

type AnimationDecoderStatus int32

AnimationDecoderStatus is an enum representing the status of an animation decoder.

Available since SDL_image 3.4.0.

const (
	DecoderStatusInvalid  AnimationDecoderStatus = iota - 1 // The decoder is invalid.
	DecoderStatusOk                                         // The decoder is ready to decode the next frame.
	DecoderStatusFailed                                     // The decoder failed to decode a frame, call [sdl.GetError] for more information.
	DecoderStatusComplete                                   // No more frames available.
)

func GetAnimationDecoderStatus

func GetAnimationDecoderStatus(decoder *AnimationDecoder) AnimationDecoderStatus

GetAnimationDecoderStatus gets the decoder status indicating the current state of the decoder.

Available since SDL_image 3.4.0.

type AnimationEncoder

type AnimationEncoder struct{}

AnimationEncoder is an object representing the encoder context.

Available since SDL_image 3.4.0.

func CreateAnimationEncoder

func CreateAnimationEncoder(file string) *AnimationEncoder

CreateAnimationEncoder creates an encoder to save a series of images to a file.

Available since SDL_image 3.4.0.

func CreateAnimationEncoderIO

func CreateAnimationEncoderIO(dst *sdl.IOStream, closeio bool, _type string) *AnimationEncoder

CreateAnimationEncoderIO creates an encoder to save a series of images to an IOStream.

Available since SDL_image 3.4.0.

func CreateAnimationEncoderWithProperties

func CreateAnimationEncoderWithProperties(props sdl.PropertiesID) *AnimationEncoder

CreateAnimationEncoderWithProperties creates an animation encoder with the specified properties.

Available since SDL_image 3.4.0.

Jump to

Keyboard shortcuts

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