Documentation
¶
Overview ¶
Package tiff is an enhanced version of x/image/tiff.
It uses a consolidated version of compress/lzw (https://github.com/hhrutter/lzw) for compression and also adds support for CMYKAImg.
More information: https://github.com/hhrutter/tiff
Index ¶
- Variables
- func Decode(r io.Reader) (img image.Image, err error)
- func DecodeConfig(r io.Reader) (image.Config, error)
- func Encode(w io.Writer, m image.Image, opt *Options) error
- type CMYKA
- type CMYKAImg
- func (p *CMYKAImg) At(x, y int) color.Color
- func (p *CMYKAImg) Bounds() image.Rectangle
- func (p *CMYKAImg) CMYKAt(x, y int) CMYKA
- func (p *CMYKAImg) ColorModel() color.Model
- func (p *CMYKAImg) Opaque() bool
- func (p *CMYKAImg) PixOffset(x, y int) int
- func (p *CMYKAImg) RGBA64At(x, y int) color.RGBA64
- func (p *CMYKAImg) Set(x, y int, c color.Color)
- func (p *CMYKAImg) SetCMYKA(x, y int, c CMYKA)
- func (p *CMYKAImg) SubImage(r image.Rectangle) image.Image
- type CompressionType
- type FormatError
- type Options
- type UnsupportedError
Constants ¶
This section is empty.
Variables ¶
var CMYKAModel color.Model = color.ModelFunc(cmykModel)
CMYKAModel is the Model for CMYKAImg colors.
Functions ¶
func Decode ¶
Decode reads a TIFF image from r and returns it as an image.Image. The type of Image returned depends on the contents of the TIFF.
func DecodeConfig ¶
DecodeConfig returns the color model and dimensions of a TIFF image without decoding the entire image.
Types ¶
type CMYKA ¶
type CMYKA struct {
C, M, Y, K, A uint8
}
CMYKA represents CMYKAImg color, having 8 bits for each of cyan, magenta, yellow and black, with alpha channel
It is not associated with any particular color profile.
type CMYKAImg ¶
type CMYKAImg struct { // Pix holds the image's pixels, in C, M, Y, K order. The pixel at // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Pix []uint8 // Stride is the Pix stride (in bytes) between vertically adjacent pixels. Stride int // Rect is the image's bounds. Rect image.Rectangle }
CMYKAImg is an in-memory image whose At method returns color.CMYK values.
func (*CMYKAImg) ColorModel ¶
type CompressionType ¶
type CompressionType int
CompressionType describes the type of compression used in Options.
const ( Uncompressed CompressionType = iota Deflate LZW CCITTGroup3 CCITTGroup4 )
Constants for supported compression types.
type FormatError ¶
type FormatError string
A FormatError reports that the input is not a valid TIFF image.
func (FormatError) Error ¶
func (e FormatError) Error() string
type Options ¶
type Options struct { // Compression is the type of compression used. Compression CompressionType // Predictor determines whether a differencing predictor is used; // if true, instead of each pixel's color, the color difference to the // preceding one is saved. This improves the compression for certain // types of images and compressors. For example, it works well for // photos with Deflate compression. Predictor bool }
Options are the encoding parameters.
type UnsupportedError ¶
type UnsupportedError string
An UnsupportedError reports that the input uses a valid but unimplemented feature.
func (UnsupportedError) Error ¶
func (e UnsupportedError) Error() string