nrgb

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Model color.Model = color.ModelFunc(nrgbModel)

Functions

func NewNRGBScanner

func NewNRGBScanner(source_image image.Image, opaque_base Color) types.Scanner

Types

type Color

type Color struct {
	R, G, B uint8
}

func (Color) AsSharp

func (c Color) AsSharp() string

func (Color) RGBA

func (c Color) RGBA() (r, g, b, a uint32)

type Image

type Image struct {
	// Pix holds the image's pixels, in R, G, B order. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*3].
	Pix []uint8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

Image is an in-memory image whose At method returns Color values.

func NewNRGB

func NewNRGB(r image.Rectangle) *Image

func NewNRGBWithContiguousRGBPixels

func NewNRGBWithContiguousRGBPixels(p []byte, left, top, width, height int) (*Image, error)

func (*Image) At

func (p *Image) At(x, y int) color.Color

func (*Image) Bounds

func (p *Image) Bounds() image.Rectangle

func (*Image) ColorModel

func (p *Image) ColorModel() color.Model

func (*Image) NRGBAt

func (p *Image) NRGBAt(x, y int) Color

func (*Image) Opaque

func (p *Image) Opaque() bool

Opaque scans the entire image and reports whether it is fully opaque.

func (*Image) PixOffset

func (p *Image) PixOffset(x, y int) int

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

func (*Image) Set

func (p *Image) Set(x, y int, c color.Color)

func (*Image) SetNRGBA

func (p *Image) SetNRGBA(x, y int, c color.NRGBA)

func (*Image) SetRGBA64

func (p *Image) SetRGBA64(x, y int, c color.RGBA64)

func (*Image) SubImage

func (p *Image) SubImage(r image.Rectangle) image.Image

SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.

Jump to

Keyboard shortcuts

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