Documentation
¶
Index ¶
- Constants
- func AddAnimationEncoderFrame(encoder *AnimationEncoder, surface *sdl.Surface, duration uint64) bool
- func CloseAnimationDecoder(decoder *AnimationDecoder) bool
- func CloseAnimationEncoder(encoder *AnimationEncoder) bool
- func CreateAnimatedCursor(anim *Animation, hotX, hotY int32) *sdl.Cursor
- func FreeAnimation(anim *Animation)
- func GetAnimationDecoderFrame(decoder *AnimationDecoder, frame **sdl.Surface, duration *uint64) bool
- func GetAnimationDecoderProperties(decoder *AnimationDecoder) sdl.PropertiesID
- func GetClipboardImage() *sdl.Surface
- func IsANI(src *sdl.IOStream) bool
- func IsAVIF(src *sdl.IOStream) bool
- func IsBMP(src *sdl.IOStream) bool
- func IsCUR(src *sdl.IOStream) bool
- func IsGIF(src *sdl.IOStream) bool
- func IsICO(src *sdl.IOStream) bool
- func IsJPG(src *sdl.IOStream) bool
- func IsJXL(src *sdl.IOStream) bool
- func IsLBM(src *sdl.IOStream) bool
- func IsPCX(src *sdl.IOStream) bool
- func IsPNG(src *sdl.IOStream) bool
- func IsPNM(src *sdl.IOStream) bool
- func IsQOI(src *sdl.IOStream) bool
- func IsSVG(src *sdl.IOStream) bool
- func IsTIF(src *sdl.IOStream) bool
- func IsWEBP(src *sdl.IOStream) bool
- func IsXCF(src *sdl.IOStream) bool
- func IsXPM(src *sdl.IOStream) bool
- func IsXV(src *sdl.IOStream) bool
- func Load(file string) *sdl.Surface
- func LoadAVIFIO(src *sdl.IOStream) *sdl.Surface
- func LoadBMPIO(src *sdl.IOStream) *sdl.Surface
- func LoadCURIO(src *sdl.IOStream) *sdl.Surface
- func LoadGIFIO(src *sdl.IOStream) *sdl.Surface
- func LoadGPUTexture(device *sdl.GPUDevice, copyPass *sdl.GPUCopyPass, file string, ...) *sdl.GPUTexture
- func LoadGPUTextureIO(device *sdl.GPUDevice, copyPass *sdl.GPUCopyPass, src *sdl.IOStream, ...) *sdl.GPUTexture
- func LoadGPUTextureTypedIO(device *sdl.GPUDevice, copyPass *sdl.GPUCopyPass, src *sdl.IOStream, ...) *sdl.GPUTexture
- func LoadICOIO(src *sdl.IOStream) *sdl.Surface
- func LoadIO(src *sdl.IOStream, closeio bool) *sdl.Surface
- func LoadJPGIO(src *sdl.IOStream) *sdl.Surface
- func LoadJXLIO(src *sdl.IOStream) *sdl.Surface
- func LoadLBMIO(src *sdl.IOStream) *sdl.Surface
- func LoadPCXIO(src *sdl.IOStream) *sdl.Surface
- func LoadPNGIO(src *sdl.IOStream) *sdl.Surface
- func LoadPNMIO(src *sdl.IOStream) *sdl.Surface
- func LoadQOIIO(src *sdl.IOStream) *sdl.Surface
- func LoadSVGIO(src *sdl.IOStream) *sdl.Surface
- func LoadSizedSVGIO(src *sdl.IOStream, width int32, height int32) *sdl.Surface
- func LoadTGAIO(src *sdl.IOStream) *sdl.Surface
- func LoadTIFIO(src *sdl.IOStream) *sdl.Surface
- func LoadTexture(renderer *sdl.Renderer, file string) *sdl.Texture
- func LoadTextureIO(renderer *sdl.Renderer, src *sdl.IOStream, closeio bool) *sdl.Texture
- func LoadTextureTypedIO(renderer *sdl.Renderer, src *sdl.IOStream, closeio bool, format string) *sdl.Texture
- func LoadTypedIO(src *sdl.IOStream, closeio bool, format string) *sdl.Surface
- func LoadWEBPIO(src *sdl.IOStream) *sdl.Surface
- func LoadXCFIO(src *sdl.IOStream) *sdl.Surface
- func LoadXPMIO(src *sdl.IOStream) *sdl.Surface
- func LoadXVIO(src *sdl.IOStream) *sdl.Surface
- func ReadXPMFromArray(xpm **byte) *sdl.Surface
- func ReadXPMFromArrayToRGB888(xpm **byte) *sdl.Surface
- func ResetAnimationDecoder(decoder *AnimationDecoder) bool
- func Save(surface *sdl.Surface, file string) bool
- func SaveANIAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool) bool
- func SaveAPNGAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool) bool
- func SaveAVIF(surface *sdl.Surface, file string, quality int32) bool
- func SaveAVIFAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool, quality int32) bool
- func SaveAVIFIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool, quality int32) bool
- func SaveAnimation(anim *Animation, file string) bool
- func SaveAnimationTypedIO(anim *Animation, dst *sdl.IOStream, closeio bool, _type string) bool
- func SaveBMP(surface *sdl.Surface, file string) bool
- func SaveBMPIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool
- func SaveCUR(surface *sdl.Surface, file string) bool
- func SaveCURIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool
- func SaveGIF(surface *sdl.Surface, file string) bool
- func SaveGIFAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool) bool
- func SaveGIFIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool
- func SaveICO(surface *sdl.Surface, file string) bool
- func SaveICOIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool
- func SaveJPG(surface *sdl.Surface, file string, quality int32) bool
- func SaveJPGIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool, quality int32) bool
- func SavePNG(surface *sdl.Surface, file string) bool
- func SavePNGIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool
- func SaveTGA(surface *sdl.Surface, file string) bool
- func SaveTGAIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool) bool
- func SaveTypedIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool, _type string) bool
- func SaveWEBP(surface *sdl.Surface, file string, quality float32) bool
- func SaveWEBPAnimationIO(anim *Animation, dst *sdl.IOStream, closeio bool, quality int32) bool
- func SaveWEBPIO(surface *sdl.Surface, dst *sdl.IOStream, closeio bool, quality float32) bool
- func Version() (major, minor, patch int32)
- type Animation
- func LoadANIAnimationIO(src *sdl.IOStream) *Animation
- func LoadAPNGAnimationIO(src *sdl.IOStream) *Animation
- func LoadAVIFAnimationIO(src *sdl.IOStream) *Animation
- func LoadAnimation(file string) *Animation
- func LoadAnimationIO(src *sdl.IOStream, closeio bool) *Animation
- func LoadAnimationTypedIO(src *sdl.IOStream, closeio bool, format string) *Animation
- func LoadGIFAnimationIO(src *sdl.IOStream) *Animation
- func LoadWEBPAnimationIO(src *sdl.IOStream) *Animation
- type AnimationDecoder
- type AnimationDecoderStatus
- type AnimationEncoder
Constants ¶
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" )
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" )
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 ¶
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 ¶
GetClipboardImage gets the image currently in the clipboard.
Available since SDL_image 3.4.0.
func IsANI ¶
IsANI detects ANI animated cursor data on a readable/seekable sdl.IOStream.
Available since SDL_image 3.4.0.
func IsAVIF ¶
IsAVIF detects AVIF image data on a readable/seekable sdl.IOStream.
func IsBMP ¶
IsBMP detects BMP image data on a readable/seekable sdl.IOStream.
func IsCUR ¶
IsCUR detects CUR image data on a readable/seekable sdl.IOStream.
func IsGIF ¶
IsGIF detects GIF image data on a readable/seekable sdl.IOStream.
func IsICO ¶
IsICO detects ICO image data on a readable/seekable sdl.IOStream.
func IsJPG ¶
IsJPG detects JPG image data on a readable/seekable sdl.IOStream.
func IsJXL ¶
IsJXL detects JXL image data on a readable/seekable sdl.IOStream.
func IsLBM ¶
IsLBM detects LBM image data on a readable/seekable sdl.IOStream.
func IsPCX ¶
IsPCX detects PCX image data on a readable/seekable sdl.IOStream.
func IsPNG ¶
IsPNG detects PNG image data on a readable/seekable sdl.IOStream.
func IsPNM ¶
IsPNM detects PNM image data on a readable/seekable sdl.IOStream.
func IsQOI ¶
IsQOI detects QOI image data on a readable/seekable sdl.IOStream.
func IsSVG ¶
IsSVG detects SVG image data on a readable/seekable sdl.IOStream.
func IsTIF ¶
IsTIF detects TIFF image data on a readable/seekable sdl.IOStream.
func IsWEBP ¶
IsWEBP detects WEBP image data on a readable/seekable sdl.IOStream.
func IsXCF ¶
IsXCF detects XCF image data on a readable/seekable sdl.IOStream.
func IsXPM ¶
IsXPM detects XPM image data on a readable/seekable sdl.IOStream.
func IsXV ¶
IsXV detects XV image data on a readable/seekable sdl.IOStream.
func LoadAVIFIO ¶
LoadAVIFIO loads a AVIF 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 LoadSizedSVGIO ¶
LoadSizedSVGIO loads an SVG image, scaled to a specific size.
func LoadTexture ¶
LoadTexture loads an image from a filesystem path into a GPU texture.
func LoadTextureIO ¶
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 ¶
LoadTypedIO loads an image from an SDL data source into a software surface.
func LoadWEBPIO ¶
LoadWEBPIO loads a WEBP image directly.
func ReadXPMFromArray ¶
ReadXPMFromArray loads an XPM image from a memory array.
func ReadXPMFromArrayToRGB888 ¶
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 SaveANIAnimationIO ¶
SaveANIAnimationIO saves an animation in ANI format to an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveAPNGAnimationIO ¶
SaveAPNGAnimationIO saves an animation in APNG format to an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveAVIF ¶
SaveAVIF saves an sdl.Surface into a AVIF image file.
func SaveAVIFAnimationIO ¶
SaveAVIFAnimationIO saves an animation in AVIF format to an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveAVIFIO ¶
SaveAVIFIO saves an sdl.Surface into AVIF image data, via an sdl.IOStream.
func SaveAnimationTypedIO ¶
SaveAnimationTypedIO saves an animation to an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveBMPIO ¶
SaveBMPIO saves an sdl.Surface into BMP image data, via an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveCURIO ¶
SaveCURIO saves an sdl.Surface into CUR image data, via an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveGIFAnimationIO ¶
SaveGIFAnimationIO saves an animation in GIF format to an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveGIFIO ¶
SaveGIFIO saves an sdl.Surface into GIF image data, via an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveICOIO ¶
SaveICOIO saves an sdl.Surface into ICO image data, via an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveJPG ¶
SaveJPG saves an sdl.Surface into a JPEG image file.
func SaveJPGIO ¶
SaveJPGIO saves an sdl.Surface into JPEG image data, via an sdl.IOStream.
func SavePNG ¶
SavePNG saves an sdl.Surface into a PNG image file.
func SavePNGIO ¶
SavePNGIO saves an sdl.Surface into PNG image data, via an sdl.IOStream.
func SaveTGAIO ¶
SaveTGAIO saves an sdl.Surface into TGA image data, via an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveTypedIO ¶
SaveTypedIO saves an sdl.Surface into formatted image data, via an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveWEBP ¶
SaveWEBP saves an sdl.Surface into a WEBP image file.
Available since SDL_image 3.4.0.
func SaveWEBPAnimationIO ¶
SaveWEBPAnimationIO saves an animation in WEBP format to an sdl.IOStream.
Available since SDL_image 3.4.0.
func SaveWEBPIO ¶
SaveWEBPIO saves an sdl.Surface into WEBP image data, via an sdl.IOStream.
Available since SDL_image 3.4.0.
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 ¶
LoadANIAnimationIO loads an ANI animation directly from an sdl.IOStream.
Available since SDL_image 3.4.0.
func LoadAPNGAnimationIO ¶
LoadAPNGAnimationIO loads an APNG animation directly from an sdl.IOStream.
Available since SDL_image 3.4.0.
func LoadAVIFAnimationIO ¶
LoadAVIFAnimationIO loads an AVIF animation directly from an sdl.IOStream.
Available since SDL_image 3.4.0.
func LoadAnimation ¶
LoadAnimation loads an animation from a file.
func LoadAnimationIO ¶
LoadAnimation loads an animation from an sdl.IOStream.
func LoadAnimationTypedIO ¶
LoadAnimationTypedIO loads an animation from an sdl.IOStream.
func LoadGIFAnimationIO ¶
LoadGIFAnimationIO loads a GIF animation directly.
func LoadWEBPAnimationIO ¶
LoadWEBPAnimationIO loads a WEBP animation directly.
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.