Documentation ¶
Overview ¶
Package gif provides GIF imageserver/image.Encoder|Processor and imageserver.Handler implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct{}
Encoder is a GIF imageserver/image.Encoder implementation.
type FallbackHandler ¶
type FallbackHandler struct { *Handler Fallback imageserver.Handler }
FallbackHandler is a imageserver.Handler implementation that allows to switch between a Handler of this package, or a fallback Handler.
If the Image format and the "format" param are equal to "gif", the Handler of this package is used. Otherwise, the fallback Handler is used.
func (*FallbackHandler) Handle ¶
func (hdr *FallbackHandler) Handle(im *imageserver.Image, params imageserver.Params) (*imageserver.Image, error)
Handle implements imageserver.Handler.
type Handler ¶
type Handler struct {
Processor Processor
}
Handler is a GIF imageserver.Handler implementation.
Steps:
- decode the GIF image
- processes the GIF image with a Processor from this package
- encode the image to GIF
If there is nothing to do, Handler does not decode the GIF image or call the Processor.
func (*Handler) Handle ¶
func (hdr *Handler) Handle(im *imageserver.Image, params imageserver.Params) (*imageserver.Image, error)
Handle implements imageserver.Handler.
type Processor ¶
type Processor interface { Process(*gif.GIF, imageserver.Params) (*gif.GIF, error) imageserver_image.Changer }
Processor processes a GIF image.
type ProcessorFunc ¶
ProcessorFunc is a Processor func.
func (ProcessorFunc) Change ¶
func (f ProcessorFunc) Change(params imageserver.Params) bool
Change implements Processor.
func (ProcessorFunc) Process ¶
func (f ProcessorFunc) Process(g *gif.GIF, params imageserver.Params) (*gif.GIF, error)
Process implements Processor.
type SimpleProcessor ¶
type SimpleProcessor struct {
imageserver_image.Processor
}
SimpleProcessor is a Processor implementation that processes each frames with the sub imageserver/image.Processor.
func (*SimpleProcessor) Process ¶
func (prc *SimpleProcessor) Process(g *gif.GIF, params imageserver.Params) (*gif.GIF, error)
Process implements Processor.