gamma

package
v0.0.0-...-b98e79d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 7 Imported by: 6

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

func NewProcessor(gamma float64, highQuality bool) *Processor

NewProcessor creates a Processor.

"highQuality" indicates if the Processor return a NRGBA64 Image or an Image with the same quality as the given Image.

func (*Processor) Change

func (prc *Processor) Change(params imageserver.Params) bool

Change implements imageserver/image.Processor.

func (*Processor) Process

func (prc *Processor) Process(nim image.Image, params imageserver.Params) (image.Image, error)

Process implements imageserver/image.Processor.

It doesn't return an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL