tiff

package
v0.0.0-...-a2c472c Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: BSD-4-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Gray32FloatModel color.Model = color.ModelFunc(gray32FloatModel)
View Source
var Gray32Model color.Model = color.ModelFunc(gray32Model)

Functions

func Encode

func Encode(w io.Writer, m image.Image, opt *tiff.Options) error

Encode writes the image m to w. opt determines the options used for encoding, such as the compression type. If opt is nil, an uncompressed image is written.

Types

type Gray32

type Gray32 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)].
	Pix []uint32
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

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

func NewGray32

func NewGray32(r image.Rectangle) *Gray32

NewGray32 returns a new Gray16 image with the given bounds.

func (*Gray32) At

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

func (*Gray32) Bounds

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

func (*Gray32) ColorModel

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

func (*Gray32) Gray32At

func (p *Gray32) Gray32At(x, y int) Gray32Color

func (*Gray32) Opaque

func (p *Gray32) Opaque() bool

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

func (*Gray32) PixOffset

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

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

func (*Gray32) SetGray32

func (p *Gray32) SetGray32(x, y int, c Gray32Color)

func (*Gray32) SubImage

func (p *Gray32) 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 Gray32Color

type Gray32Color struct {
	Y uint32
}

Gray32Color represents a 32-bit grayscale color.

func (Gray32Color) RGBA

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

type GrayFloat32

type GrayFloat32 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)].
	Pix []uint32
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

GrayFloat32 is an in-memory image whose At method returns color.Gray32 values.

func NewGrayFloat32

func NewGrayFloat32(r image.Rectangle) *GrayFloat32

NewGrayFloat32 returns a new Gray16 image with the given bounds.

func (*GrayFloat32) At

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

func (*GrayFloat32) Bounds

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

func (*GrayFloat32) ColorModel

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

func (*GrayFloat32) Gray32At

func (p *GrayFloat32) Gray32At(x, y int) Gray32Color

func (*GrayFloat32) Opaque

func (p *GrayFloat32) Opaque() bool

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

func (*GrayFloat32) PixOffset

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

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

func (*GrayFloat32) SetGray32

func (p *GrayFloat32) SetGray32(x, y int, c GrayFloat32Color)

func (*GrayFloat32) SubImage

func (p *GrayFloat32) 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 GrayFloat32Color

type GrayFloat32Color struct {
	Y uint32
}

GrayFloat32Color represents a 32-bit float grayscale color.

func (GrayFloat32Color) RGBA

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

Jump to

Keyboard shortcuts

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