Documentation ¶
Index ¶
- Constants
- func DecodeAllFrames(animDecoded *WebpAnimationDecoded) error
- func DecodeNextFrame(animDecoded *WebpAnimationDecoded) bool
- func DecodeRemainingFrames(animDecoded *WebpAnimationDecoded) error
- func DeleteWebPData(webPData *WebPData)
- func ReleaseDecoder(decoded *WebpAnimationDecoded)
- func WebPAnimDecoderDelete(webPAnimDecoder *WebPAnimDecoder)
- func WebPAnimDecoderGetInfo(webPAnimDecoder *WebPAnimDecoder, webPAnimInfo *WebPAnimInfo) bool
- func WebPAnimDecoderGetNext(webPAnimDecoder *WebPAnimDecoder, buffer *([]byte), timestamp *int, size int) bool
- func WebPAnimDecoderReset(webPAnimDecoder *WebPAnimDecoder)
- func WebPAnimEncoderAdd(webPAnimEncoder *WebPAnimEncoder, webPPicture *WebPPicture, timestamp int, ...) int
- func WebPAnimEncoderAssemble(webPAnimEncoder *WebPAnimEncoder, webPData *WebPData) int
- func WebPAnimEncoderDelete(webPAnimEncoder *WebPAnimEncoder)
- func WebPAnimEncoderOptionsInitInternal(webPAnimEncoderOptions *WebPAnimEncoderOptions) int
- func WebPConfigInitInternal(config WebPConfig) int
- func WebPDataClear(webPData *WebPData)
- func WebPDataInit(webPData *WebPData)
- func WebPMuxDelete(webPMux *WebPMux)
- func WebPPictureFree(webPPicture *WebPPicture)
- func WebPPictureImportRGBA(data []byte, stride int, webPPicture *WebPPicture) error
- func WebPPictureInit(webPPicture *WebPPicture) int
- type WebPAnimDecoder
- type WebPAnimDecoderOptions
- type WebPAnimEncoder
- type WebPAnimEncoderOptions
- func (encOptions *WebPAnimEncoderOptions) GetAnimParams() WebPMuxAnimParams
- func (encOptions *WebPAnimEncoderOptions) SetAllowMixed(v int)
- func (encOptions *WebPAnimEncoderOptions) SetAnimParams(v WebPMuxAnimParams)
- func (encOptions *WebPAnimEncoderOptions) SetKmax(v int)
- func (encOptions *WebPAnimEncoderOptions) SetKmin(v int)
- func (encOptions *WebPAnimEncoderOptions) SetMinimizeSize(v int)
- func (encOptions *WebPAnimEncoderOptions) SetVerbose(v int)
- type WebPAnimInfo
- type WebPConfig
- type WebPData
- type WebPFrame
- type WebPMux
- type WebPMuxAnimParams
- type WebPMuxError
- type WebPPicture
- type WebpAnimation
- type WebpAnimationDecoded
Constants ¶
View Source
const ( WebpMuxAbiVersion = 0x0108 WebpEncoderAbiVersion = 0x020f WebpDemuxAbiVersion = 0x0107 )
View Source
const ( WebpMuxOk = WebPMuxError(C.WEBP_MUX_OK) WebpMuxNotFound = WebPMuxError(C.WEBP_MUX_NOT_FOUND) WebpMuxInvalidArgument = WebPMuxError(C.WEBP_MUX_INVALID_ARGUMENT) WebpMuxBadData = WebPMuxError(C.WEBP_MUX_BAD_DATA) WebpMuxMemoryError = WebPMuxError(C.WEBP_MUX_MEMORY_ERROR) WebpMuxNotEnoughData = WebPMuxError(C.WEBP_MUX_NOT_ENOUGH_DATA) )
Variables ¶
This section is empty.
Functions ¶
func DecodeAllFrames ¶
func DecodeAllFrames(animDecoded *WebpAnimationDecoded) error
func DecodeNextFrame ¶
func DecodeNextFrame(animDecoded *WebpAnimationDecoded) bool
Get next frame without and insert into animDecoded.Frames
func DecodeRemainingFrames ¶
func DecodeRemainingFrames(animDecoded *WebpAnimationDecoded) error
func DeleteWebPData ¶
func DeleteWebPData(webPData *WebPData)
func ReleaseDecoder ¶
func ReleaseDecoder(decoded *WebpAnimationDecoded)
func WebPAnimDecoderDelete ¶
func WebPAnimDecoderDelete(webPAnimDecoder *WebPAnimDecoder)
func WebPAnimDecoderGetInfo ¶
func WebPAnimDecoderGetInfo(webPAnimDecoder *WebPAnimDecoder, webPAnimInfo *WebPAnimInfo) bool
func WebPAnimDecoderGetNext ¶
func WebPAnimDecoderGetNext(webPAnimDecoder *WebPAnimDecoder, buffer *([]byte), timestamp *int, size int) bool
func WebPAnimDecoderReset ¶
func WebPAnimDecoderReset(webPAnimDecoder *WebPAnimDecoder)
func WebPAnimEncoderAdd ¶
func WebPAnimEncoderAdd(webPAnimEncoder *WebPAnimEncoder, webPPicture *WebPPicture, timestamp int, webpcfg WebPConfig) int
func WebPAnimEncoderAssemble ¶
func WebPAnimEncoderAssemble(webPAnimEncoder *WebPAnimEncoder, webPData *WebPData) int
func WebPAnimEncoderDelete ¶
func WebPAnimEncoderDelete(webPAnimEncoder *WebPAnimEncoder)
func WebPAnimEncoderOptionsInitInternal ¶
func WebPAnimEncoderOptionsInitInternal(webPAnimEncoderOptions *WebPAnimEncoderOptions) int
func WebPConfigInitInternal ¶
func WebPConfigInitInternal(config WebPConfig) int
func WebPDataClear ¶
func WebPDataClear(webPData *WebPData)
func WebPDataInit ¶
func WebPDataInit(webPData *WebPData)
func WebPMuxDelete ¶
func WebPMuxDelete(webPMux *WebPMux)
func WebPPictureFree ¶
func WebPPictureFree(webPPicture *WebPPicture)
func WebPPictureImportRGBA ¶
func WebPPictureImportRGBA(data []byte, stride int, webPPicture *WebPPicture) error
func WebPPictureInit ¶
func WebPPictureInit(webPPicture *WebPPicture) int
Types ¶
type WebPAnimDecoder ¶
type WebPAnimDecoder C.WebPAnimDecoder
func WebPAnimDecoderNew ¶
func WebPAnimDecoderNew(webPData *WebPData) *WebPAnimDecoder
type WebPAnimDecoderOptions ¶
type WebPAnimDecoderOptions C.WebPAnimDecoderOptions
type WebPAnimEncoder ¶
type WebPAnimEncoder C.WebPAnimEncoder
func WebPAnimEncoderNewInternal ¶
func WebPAnimEncoderNewInternal(width, height int, webPAnimEncoderOptions *WebPAnimEncoderOptions) *WebPAnimEncoder
type WebPAnimEncoderOptions ¶
type WebPAnimEncoderOptions C.WebPAnimEncoderOptions
func (*WebPAnimEncoderOptions) GetAnimParams ¶
func (encOptions *WebPAnimEncoderOptions) GetAnimParams() WebPMuxAnimParams
func (*WebPAnimEncoderOptions) SetAllowMixed ¶
func (encOptions *WebPAnimEncoderOptions) SetAllowMixed(v int)
func (*WebPAnimEncoderOptions) SetAnimParams ¶
func (encOptions *WebPAnimEncoderOptions) SetAnimParams(v WebPMuxAnimParams)
func (*WebPAnimEncoderOptions) SetKmax ¶
func (encOptions *WebPAnimEncoderOptions) SetKmax(v int)
func (*WebPAnimEncoderOptions) SetKmin ¶
func (encOptions *WebPAnimEncoderOptions) SetKmin(v int)
func (*WebPAnimEncoderOptions) SetMinimizeSize ¶
func (encOptions *WebPAnimEncoderOptions) SetMinimizeSize(v int)
func (*WebPAnimEncoderOptions) SetVerbose ¶
func (encOptions *WebPAnimEncoderOptions) SetVerbose(v int)
type WebPAnimInfo ¶
type WebPAnimInfo C.WebPAnimInfo
func (WebPAnimInfo) GetBgColor ¶
func (wpi WebPAnimInfo) GetBgColor() uint32
func (WebPAnimInfo) GetFrameCnt ¶
func (wpi WebPAnimInfo) GetFrameCnt() uint32
func (WebPAnimInfo) GetHeight ¶
func (wpi WebPAnimInfo) GetHeight() uint32
func (WebPAnimInfo) GetLoopCount ¶
func (wpi WebPAnimInfo) GetLoopCount() uint32
func (WebPAnimInfo) GetWidth ¶
func (wpi WebPAnimInfo) GetWidth() uint32
type WebPConfig ¶
type WebPConfig interface { SetLossless(v int) GetLossless() int SetMethod(v int) SetImageHint(v int) SetTargetSize(v int) SetTargetPSNR(v float32) SetSegments(v int) SetSnsStrength(v int) SetFilterStrength(v int) SetFilterSharpness(v int) SetAutofilter(v int) SetAlphaCompression(v int) SetAlphaFiltering(v int) SetPass(v int) SetShowCompressed(v int) SetPreprocessing(v int) SetPartitions(v int) SetPartitionLimit(v int) SetEmulateJpegSize(v int) SetThreadLevel(v int) SetLowMemory(v int) SetNearLossless(v int) SetExact(v int) SetUseDeltaPalette(v int) SetUseSharpYuv(v int) SetAlphaQuality(v int) SetFilterType(v int) SetQuality(v float32) // contains filtered or unexported methods }
type WebPData ¶
func GenerateWebPData ¶
type WebPFrame ¶
func GetNextFrame ¶
func GetNextFrame(animDecoded *WebpAnimationDecoded) (*WebPFrame, bool)
Get next frame without inserting into animDecoded.Frames
type WebPMux ¶
func WebPMuxCreateInternal ¶
type WebPMuxAnimParams ¶
type WebPMuxAnimParams C.WebPMuxAnimParams
func (*WebPMuxAnimParams) SetBgcolor ¶
func (wmap *WebPMuxAnimParams) SetBgcolor(v uint32)
func (*WebPMuxAnimParams) SetLoopCount ¶
func (wmap *WebPMuxAnimParams) SetLoopCount(v int)
type WebPMuxError ¶
type WebPMuxError int
func WebPMuxAssemble ¶
func WebPMuxAssemble(webPMux *WebPMux, webPData *WebPData) WebPMuxError
func WebPMuxGetAnimationParams ¶
func WebPMuxGetAnimationParams(webPMux *WebPMux, webPMuxAnimParams *WebPMuxAnimParams) WebPMuxError
func WebPMuxSetAnimationParams ¶
func WebPMuxSetAnimationParams(webPMux *WebPMux, webPMuxAnimParams *WebPMuxAnimParams) WebPMuxError
type WebPPicture ¶
type WebPPicture C.WebPPicture
func (WebPPicture) GetHeight ¶
func (wpp WebPPicture) GetHeight() int
func (WebPPicture) GetWidth ¶
func (wpp WebPPicture) GetWidth() int
func (*WebPPicture) SetHeight ¶
func (wpp *WebPPicture) SetHeight(v int)
func (*WebPPicture) SetUseArgb ¶
func (wpp *WebPPicture) SetUseArgb(v int)
func (*WebPPicture) SetWidth ¶
func (wpp *WebPPicture) SetWidth(v int)
type WebpAnimation ¶
type WebpAnimation struct { WebPAnimEncoderOptions *WebPAnimEncoderOptions Width int Height int AnimationEncoder *WebPAnimEncoder WebPData *WebPData WebPMux *WebPMux WebPPictures []*WebPPicture // contains filtered or unexported fields }
func NewWebpAnimation ¶
func NewWebpAnimation(width, height, loopCount int) *WebpAnimation
NewWebpAnimation Initialize animation
func (*WebpAnimation) AddFrame ¶
func (wpa *WebpAnimation) AddFrame(img image.Image, timestamp int, webpcfg WebPConfig) error
AddFrame add frame to animation
func (*WebpAnimation) Encode ¶
func (wpa *WebpAnimation) Encode(w io.Writer) error
Encode encode animation
func (*WebpAnimation) GetFrames ¶
func (wpa *WebpAnimation) GetFrames() (frames []image.Image, err error)
Get Frame
func (*WebpAnimation) ReleaseMemory ¶
func (wpa *WebpAnimation) ReleaseMemory()
ReleaseMemory release memory
type WebpAnimationDecoded ¶
Click to show internal directories.
Click to hide internal directories.