Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SippGray ¶
A SippGray wraps a Go Gray image and implements the SippImage interface.
type SippGray16 ¶
A SippGray16 wraps a Go Gray16 image and implements the SippImage interface.
func (*SippGray16) Bpp ¶
func (sg *SippGray16) Bpp() int
Bpp returns the pixel depth of this image, i.e. 16
func (*SippGray16) IntVal ¶
func (sg16 *SippGray16) IntVal(x, y int) int32
IntVal returns the grayscale value at x, y as an int32.
func (*SippGray16) Pix ¶
func (sg16 *SippGray16) Pix() []uint8
Pix returns the slice of underlying image data, for efficient access.
func (*SippGray16) Thumbnail ¶
func (img *SippGray16) Thumbnail() SippImage
func (*SippGray16) Val ¶
func (sg16 *SippGray16) Val(x, y int) float64
Val returns the grayscale value at x, y as a float64.
func (*SippGray16) Write ¶
func (img *SippGray16) Write(out *string) error
Write encodes the image into a PNG of the given name.
type SippImage ¶
type SippImage interface {
// Embed the Go image interface to allow reading and writing using the Go
// PNG decoder and encoder.
image.Image
// Bounded Go images all implement PixOffset, though it's not part of the
// Image interface, so it's included here.
PixOffset(x, y int) int
// Pix returns the slice of underlying image data, for efficient access.
Pix() []uint8
// Val returns the grayscale value at x, y as a float64.
Val(x, y int) float64
// IntVal returns the grayscale value at x, y as an int32.
IntVal(x, y int) int32
// Bpp returns the pixel depth of this image, either 8 or 16.
Bpp() int
// Write encodes the image into a PNG of the given name.
Write(out *string) error
// Thumbnail returns a small version of the image. Thumbnails are always
// 8-bit Gray images. TODO: If the original is smaller than the thumbnail,
// the returned image will contain the original, centered.
Thumbnail() SippImage
}
SippImage embeds the Image interface from the Go standard library and adds a few methods to enable polymorphism.
Click to show internal directories.
Click to hide internal directories.