bayer

package
v0.0.0-...-65d6c9d Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT, BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ┌───┬───┐
	// │ R │ G │
	// ├───┼───┤
	// │ G │ B │
	// └───┴───┘
	RGGB Pattern = 9
	// ┌───┬───┐
	// │ G │ R │
	// ├───┼───┤
	// │ B │ G │
	// └───┴───┘
	GRBG = 7
	// ┌───┬───┐
	// │ G │ B │
	// ├───┼───┤
	// │ R │ G │
	// └───┴───┘
	GBRG = 5
	// ┌───┬───┐
	// │ B │ G │
	// ├───┼───┤
	// │ G │ R │
	// └───┴───┘
	BGGR = 3
)

Patterns of bayer (alignment).

Variables

This section is empty.

Functions

This section is empty.

Types

type Bayer

type Bayer interface {
	// At returns the RGB pixel.
	At(x, y int) (r, g, b float64)
}

A Bayer allows colors' interpolation from a Color Filter Array data.

func NewBilinear

func NewBilinear(buf []byte, opts *Options) Bayer

NewBilinear instanciates a bilinear interpolation algorithm to parse the CFA provided as buf.

func NewNearestNeighbour

func NewNearestNeighbour(buf []byte, opts *Options) Bayer

NewNearestNeighbour instanciates a nearest neighbour algorithm to parse the CFA provided as buf.

type Options

type Options struct {
	// ByteOrder defines the endianness of the CFA.
	ByteOrder binary.ByteOrder
	// Depth defines the BitsPerSample / BitsPerPixel of the CFA.
	Depth int
	// Width defines the width of the CFA.
	Width int
	// Height defines the height of the CFA.
	Height int
	// Pattern defines the CFAPattern (e.g. RGGB, GRBG, etc.).
	Pattern Pattern
	// BlackLevel defines the zero light level.
	BlackLevel float64
	// WhiteLevel defines the saturation light level.
	WhiteLevel float64
	// WhiteBalance defines the AsShotNeutral with inverted values and then rescaled them all so that the green multiplier is 1.
	WhiteBalance []float64
}

Options contains information for bayer interpolation.

type Pattern

type Pattern int

A Pattern desribes the orientation of the 4 pixels in the top left corner of the Bayer CFA.

func GetPattern

func GetPattern(cfaPattern []uint) (Pattern, error)

GetPattern returns the bayer pattern contant.

Jump to

Keyboard shortcuts

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