image14bit

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 27, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package image14bit implements 14-bit per pixel images.

It is compatible with the image/draw package.

Index

Constants

This section is empty.

Variables

View Source
var Intensity14Model = color.ModelFunc(convert)

Intensity14Model is the color Model for 14-bit grayscale.

Functions

This section is empty.

Types

type Gray14

type Gray14 struct {
	// Pix holds the image's pixels. Each uint16 element represents one 14-bit
	// pixel.
	Pix []uint16
	// Stride is the Pix stride (in pixels) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

Gray14 represents an image of 14-bit values.

func NewGray14

func NewGray14(r image.Rectangle) *Gray14

NewGray14 returns an initialized Gray14 instance.

func (*Gray14) At

func (i *Gray14) At(x, y int) color.Color

At implements image.Image.

func (*Gray14) Bounds

func (i *Gray14) Bounds() image.Rectangle

Bounds implements image.Image.

func (*Gray14) ColorModel

func (i *Gray14) ColorModel() color.Model

ColorModel implements image.Image.

func (*Gray14) Intensity14At

func (i *Gray14) Intensity14At(x, y int) Intensity14

Intensity14At returns the Intensity14 value at a point.

func (*Gray14) Opaque

func (i *Gray14) Opaque() bool

Opaque returns whether the image is fully opaque.

func (*Gray14) PixOffset

func (i *Gray14) PixOffset(x, y int) int

PixOffset returns the index of the element of Pix that corresponds to the pixel at (x, y).

func (*Gray14) Set

func (i *Gray14) Set(x, y int, c color.Color)

Set implements draw.Image.

func (*Gray14) SetIntensity14

func (i *Gray14) SetIntensity14(x, y int, c Intensity14)

SetIntensity14 sets the Intensity14 value for the pixel at (x, y).

type Intensity14

type Intensity14 uint16

Intensity14 is a 14-bit grayscale implementation of color.Color.

Valid range is between 0 and 16383 (inclusive).

func (Intensity14) RGBA

func (g Intensity14) RGBA() (uint32, uint32, uint32, uint32)

RGBA returns a grayscale result.

func (Intensity14) String

func (g Intensity14) String() string

Jump to

Keyboard shortcuts

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