scimage

package module
v0.0.0-...-7a5e784 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: BSD-3-Clause Imports: 3 Imported by: 3

README

scimage

Extension of the Go image library with new data types for scientific use.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGray

func NewGray(r image.Rectangle, cm color.Model) image.Image

NewGray returns a new image implementing the provided scicolor Model.

Types

type BlankImage

type BlankImage struct {
	color.Model
	Rect image.Rectangle
}

GrayF32 is an in-memory image whose At method returns color.Gray16 values.

func NewBlankImage

func NewBlankImage(c color.Model, rect image.Rectangle) *BlankImage

NewBlankImage returns a new image implementing the provided scicolor Model.

func (*BlankImage) At

func (bi *BlankImage) At(x, y int) color.Color

func (*BlankImage) Bounds

func (bi *BlankImage) Bounds() image.Rectangle

func (*BlankImage) ColorModel

func (bi *BlankImage) ColorModel() color.Model

func (*BlankImage) SubImage

func (bi *BlankImage) 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.

type GrayF32

type GrayF32 struct {
	// Pix holds the image's pixels, as gray values in native format. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)].
	//Pix []uint8
	Pix []float32
	// Stride is the Pix stride (in pixels) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle

	Min, Max, NoData float32
}

GrayF32 is an in-memory image whose At method returns color.Gray16 values.

func NewGrayF32

func NewGrayF32(r image.Rectangle, min, max, noData float32) *GrayF32

NewGrayS16 returns a new GrayS16 image with the given bounds and with the Min value as its pixel contents.

func (*GrayF32) AsPaletted

func (p *GrayF32) AsPaletted(palette color.Palette) *image.Paletted

AsPaletted transforms the image into a paletted image.

func (*GrayF32) At

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

func (*GrayF32) Bounds

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

func (*GrayF32) ColorModel

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

func (*GrayF32) GrayF32At

func (p *GrayF32) GrayF32At(x, y int) scicolor.GrayF32

func (*GrayF32) Opaque

func (p *GrayF32) Opaque() bool

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

func (*GrayF32) PixOffset

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

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

func (*GrayF32) Set

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

func (*GrayF32) SetGrayF32

func (p *GrayF32) SetGrayF32(x, y int, c scicolor.GrayF32)

func (*GrayF32) SubImage

func (p *GrayF32) 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.

type GrayS16

type GrayS16 struct {
	// Pix holds the image's pixels, as gray values in native format. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)].
	Pix []int16
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle

	Min, Max, NoData int16
}

GrayS16 is an in-memory image whose At method returns color.Gray16 values.

func NewGrayS16

func NewGrayS16(r image.Rectangle, min, max, noData int16) *GrayS16

NewGrayS16 returns a new GrayS16 image with the given bounds and with the Min value as its pixel contents.

func (*GrayS16) AsPaletted

func (p *GrayS16) AsPaletted(palette color.Palette) *image.Paletted

AsPaletted transforms the image into a paletted image.

func (*GrayS16) At

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

func (*GrayS16) Bounds

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

func (*GrayS16) ColorModel

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

func (*GrayS16) GrayS16At

func (p *GrayS16) GrayS16At(x, y int) scicolor.GrayS16

func (*GrayS16) Opaque

func (p *GrayS16) Opaque() bool

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

func (*GrayS16) PixOffset

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

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

func (*GrayS16) Set

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

func (*GrayS16) SetGrayS16

func (p *GrayS16) SetGrayS16(x, y int, c scicolor.GrayS16)

func (*GrayS16) SubImage

func (p *GrayS16) 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.

type GrayS8

type GrayS8 struct {
	// Pix holds the image's pixels, as gray values. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].
	Pix []int8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle

	Min, Max, NoData int8
}

GrayS8 is an in-memory image whose At method returns color.Gray values.

func NewGrayS8

func NewGrayS8(r image.Rectangle, min, max, noData int8) *GrayS8

NewGrayS16 returns a new GrayS16 image with the given bounds and with the Min value as its pixel contents.

func (*GrayS8) AsPaletted

func (p *GrayS8) AsPaletted(palette color.Palette) *image.Paletted

AsPaletted transforms the image into a paletted image.

func (*GrayS8) At

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

func (*GrayS8) Bounds

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

func (*GrayS8) ColorModel

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

func (*GrayS8) GrayS8At

func (p *GrayS8) GrayS8At(x, y int) scicolor.GrayS8

func (*GrayS8) Opaque

func (p *GrayS8) Opaque() bool

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

func (*GrayS8) PixOffset

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

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

func (*GrayS8) Set

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

func (*GrayS8) SetGrayS8

func (p *GrayS8) SetGrayS8(x, y int, c scicolor.GrayS8)

func (*GrayS8) SubImage

func (p *GrayS8) 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.

type GrayU16

type GrayU16 struct {
	// Pix holds the image's pixels, as gray values in big-endian format. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2].
	Pix []uint16
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle

	Min, Max, NoData uint16
}

GrayU16 is an in-memory image whose At method returns color.Gray16 values.

func NewGrayU16

func NewGrayU16(r image.Rectangle, min, max, noData uint16) *GrayU16

NewGray16 returns a new Gray16 image with the given bounds.

func (*GrayU16) At

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

func (*GrayU16) Bounds

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

func (*GrayU16) ColorModel

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

func (*GrayU16) GrayU16At

func (p *GrayU16) GrayU16At(x, y int) scicolor.GrayU16

func (*GrayU16) Opaque

func (p *GrayU16) Opaque() bool

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

func (*GrayU16) PixOffset

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

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

func (*GrayU16) Set

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

func (*GrayU16) SetGrayU16

func (p *GrayU16) SetGrayU16(x, y int, c scicolor.GrayU16)

func (*GrayU16) SubImage

func (p *GrayU16) 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.

type GrayU8

type GrayU8 struct {
	// Pix holds the image's pixels, as gray values. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].
	Pix []uint8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle

	Min, Max, NoData uint8
}

GrayU8 is an in-memory image whose At method returns color.Gray values.

func NewGrayU8

func NewGrayU8(r image.Rectangle, min, max, noData uint8) *GrayU8

NewGrayS16 returns a new GrayS16 image with the given bounds and with the Min value as its pixel contents.

func (*GrayU8) AsPaletted

func (p *GrayU8) AsPaletted(palette color.Palette) *image.Paletted

AsPaletted transforms the image into a paletted image.

func (*GrayU8) At

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

func (*GrayU8) Bounds

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

func (*GrayU8) ColorModel

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

func (*GrayU8) GrayU8At

func (p *GrayU8) GrayU8At(x, y int) scicolor.GrayU8

func (*GrayU8) Opaque

func (p *GrayU8) Opaque() bool

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

func (*GrayU8) PixOffset

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

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

func (*GrayU8) Set

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

func (*GrayU8) SetGrayU8

func (p *GrayU8) SetGrayU8(x, y int, c scicolor.GrayU8)

func (*GrayU8) SubImage

func (p *GrayU8) 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.

type Mask

type Mask struct {
	// Pix holds the image's pixels, as gray values. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].
	Pix []bool
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

GrayU8 is an in-memory image whose At method returns color.Gray values.

func NewMask

func NewMask(r image.Rectangle) *Mask

NewMask returns a new Mask image with the given bounds initialised to false values

func (*Mask) At

func (m *Mask) At(x, y int) color.Color

func (*Mask) BinaryAt

func (m *Mask) BinaryAt(x, y int) scicolor.Binary

func (*Mask) Bounds

func (m *Mask) Bounds() image.Rectangle

func (*Mask) ColorModel

func (m *Mask) ColorModel() color.Model

func (*Mask) Opaque

func (m *Mask) Opaque() bool

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

func (*Mask) PixOffset

func (m *Mask) PixOffset(x, y int) int

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

func (*Mask) Set

func (m *Mask) Set(x, y int, c color.Color)

func (*Mask) SetBinary

func (m *Mask) SetBinary(x, y int, c scicolor.Binary)

func (*Mask) SubImage

func (m *Mask) 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.

Directories

Path Synopsis
cog
Package tiff implements a TIFF image decoder and encoder.
Package tiff implements a TIFF image decoder and encoder.
lzw
Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19.
Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19.

Jump to

Keyboard shortcuts

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