Documentation ¶
Overview ¶
Package gamma provides gamma imageserver/image.Processor implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CorrectionProcessor ¶
type CorrectionProcessor struct { imageserver_image.Processor // contains filtered or unexported fields }
CorrectionProcessor is a imageserver/image.Processor implementation that corrects gamma for a sub Processor.
Steps:
- apply gamma of 1/2.2 (darken)
- call the sub Processor
- apply gamma of 2.2 (lighten)
Internally, it uses NRGBA64 high quality Image, to avoid loss of information.
The CorrectionProcessor can be enabled/disabled with the "gamma_correction" (bool) param.
func NewCorrectionProcessor ¶
func NewCorrectionProcessor(prc imageserver_image.Processor, enabled bool) *CorrectionProcessor
NewCorrectionProcessor creates a CorrectionProcessor.
"enabled" indicated if the CorrectionProcessor is enabled by default.
func (*CorrectionProcessor) Process ¶
func (prc *CorrectionProcessor) Process(nim image.Image, params imageserver.Params) (image.Image, error)
Process implements imageserver/image.Processor.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor is a imageserver/image.Processor implementation that applies gamma transformation.
func NewProcessor ¶
NewProcessor creates a Processor.
"highQuality" indicates if the Processor return a NRGBA64 Image or an Image with the same quality as the given Image.