Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ALPHHeader ¶
type ANIMHeader ¶
type ANMFHeader ¶
type AnimatedWEBP ¶
type AnimatedWEBP struct {
Frames []Frame
Header ANIMHeader
Config image.Config
}
AnimatedWEBP is the struct of a AnimatedWEBP container and the image data contained within.
func DecodeAnimated ¶
func DecodeAnimated(r io.Reader) (*AnimatedWEBP, error)
type Frame ¶
type Frame struct {
Header ANMFHeader
Frame image.Image
}
type SubChunkReader ¶
type SubChunkReader struct {
// contains filtered or unexported fields
}
SubChunkReader helps in reading riff data from an existing chunk which are comprised of sub-chunks. A good example would be ANMF chunks of animated webp files. These chunks can contain headers, ALPH chunks and VP8 or VP8L chunks within the main riff data chunk.
func NewSubChunkReader ¶
func NewSubChunkReader(r io.Reader) *SubChunkReader
func (SubChunkReader) Next ¶
Next will return the FourCC, data, and data length of a subchunk. The io.Reader returned for data will not be the same as the provided reader and is safe to discord without fully reading the contents. Will return an error if the format is invalid or an underlying read operation fails.
type VP8XHeader ¶
type VP8XHeader struct {
ICCProfile bool
Alpha bool
ExifMetadata bool
XmpMetadata bool
Animation bool
CanvasWidth uint32
CanvasHeight uint32
}
func DecodeVP8XHeader ¶
func DecodeVP8XHeader(r io.Reader) (*VP8XHeader, error)
DecodeVP8XHeader will return the decoded VP8XHeader if this file is in the Extended File Format as defined by the webp specification. The VP8X chunk must be the first chunk of the file. If the first chunk of the file is anything else, it is not in the extended format and this will return a nil VP8XHeader. An error is only returned if the chunk is found, but invalid or a generic io.Reader error occurs.