Documentation ¶
Overview ¶
Package image provides a bridge to the Go image package.
Index ¶
- func Decode(im *imageserver.Image) (image.Image, error)
- func RegisterEncoder(format string, enc Encoder)
- type ChangeProcessor
- type Changer
- type Encoder
- type EncoderFunc
- type Handler
- type ListProcessor
- type Processor
- type ProcessorFunc
- type ProcessorProvider
- type Provider
- type ProviderFunc
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(im *imageserver.Image) (image.Image, error)
Decode decodes a raw Image to a Go Image.
It returns an error if the decoded Image format does not match the raw Image format.
func RegisterEncoder ¶
RegisterEncoder registers an Encoder for a format.
Types ¶
type ChangeProcessor ¶
type ChangeProcessor struct {
Processor
}
ChangeProcessor is a Processor that alway return true for the Change method.
func (*ChangeProcessor) Change ¶
func (prc *ChangeProcessor) Change(params imageserver.Params) bool
Change implements Processor.
type Changer ¶
type Changer interface {
Change(imageserver.Params) bool
}
Changer returns true if the Image could change.
type Encoder ¶
Encoder represents an Image encoder.
An Encoder must encode to only one specific format.
type EncoderFunc ¶
EncoderFunc is an Encoder func.
func (EncoderFunc) Change ¶
func (f EncoderFunc) Change(params imageserver.Params) bool
Change implements Encoder.
func (EncoderFunc) Encode ¶
func (f EncoderFunc) Encode(w io.Writer, nim image.Image, params imageserver.Params) error
Encode implements Encoder.
type Handler ¶
type Handler struct {
Processor Processor // Optional Processor
}
Handler is an Image Handler that uses Go Image.
func (*Handler) Handle ¶
func (hdr *Handler) Handle(im *imageserver.Image, params imageserver.Params) (*imageserver.Image, error)
Handle implements Handler.
type ListProcessor ¶
type ListProcessor []Processor
ListProcessor is a list of Processor.
func (ListProcessor) Change ¶
func (prc ListProcessor) Change(params imageserver.Params) bool
Change implements Processor.
func (ListProcessor) Process ¶
func (prc ListProcessor) Process(nim image.Image, params imageserver.Params) (image.Image, error)
Process implements Processor.
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(nim image.Image, params imageserver.Params) (image.Image, error)
Process implements Processor.
type ProcessorProvider ¶
ProcessorProvider is a Go Image provider that processes the Image.
func (*ProcessorProvider) Get ¶
func (prv *ProcessorProvider) Get(params imageserver.Params) (image.Image, error)
Get implements Provider
type Provider ¶
type Provider interface {
Get(params imageserver.Params) (image.Image, error)
}
Provider represents a Go Image provider.
type ProviderFunc ¶
type ProviderFunc func(imageserver.Params) (image.Image, error)
ProviderFunc is a Provider func.
func (ProviderFunc) Get ¶
func (f ProviderFunc) Get(params imageserver.Params) (image.Image, error)
Get implements Provider
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package _test provides utilities for Encoder testing.
|
Package _test provides utilities for Encoder testing. |
Package bmp provides a BMP Encoder.
|
Package bmp provides a BMP Encoder. |
Package gamma provides gamma Processor and CorrectionProcessor.
|
Package gamma provides gamma Processor and CorrectionProcessor. |
Package gif provides a GIF Encoder, Handler, and Processor.
|
Package gif provides a GIF Encoder, Handler, and Processor. |
Package gift provides a GIFT Processor.
|
Package gift provides a GIFT Processor. |
Package jpeg provides a JPEG Encoder.
|
Package jpeg provides a JPEG Encoder. |
Package nfntresize provides a nfnt resize Processor.
|
Package nfntresize provides a nfnt resize Processor. |
Package png provides a PNG Encoder.
|
Package png provides a PNG Encoder. |
Package tiff provides a TIFF Encoder.
|
Package tiff provides a TIFF Encoder. |