image

package
v0.0.0-...-4b31f30 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2016 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (img image.Image, err error)

func DecodeConfig

func DecodeConfig(r io.Reader) (cfg image.Config, err error)

func ListRegisteredTagPresenceIDs

func ListRegisteredTagPresenceIDs() []uint16

func RegisterCompression

func RegisterCompression(c Compression)

func RegisterHandlerByMake

func RegisterHandlerByMake(m string, h TIFFHandler)

func RegisterHandlerByTagPresence

func RegisterHandlerByTagPresence(t uint16, h TIFFHandler)

Types

type Baseline

type Baseline struct {
	NewSubfileType            *uint32  `tiff:"field,tag=254"`
	SubfileType               *uint16  `tiff:"field,tag=255"`
	ImageWidth                *uint32  `tiff:"field,tag=256"`
	ImageLength               *uint32  `tiff:"field,tag=257"`
	BitsPerSample             []uint16 `tiff:"field,tag=258"`
	Compression               *uint16  `tiff:"field,tag=259"`
	PhotometricInterpretation *uint16  `tiff:"field,tag=262"`
	Threshholding             *uint16  `tiff:"field,tag=263"`
	CellWidth                 *uint16  `tiff:"field,tag=264"`
	CellLength                *uint16  `tiff:"field,tag=265"`
	FillOrder                 *uint16  `tiff:"field,tag=266"`
	ImageDescription          *string  `tiff:"field,tag=270"`
	Make                      *string  `tiff:"field,tag=271"`
	Model                     *string  `tiff:"field,tag=272"`
	StripOffsets              []uint32 `tiff:"field,tag=273"`
	Orientation               *uint16  `tiff:"field,tag=274"`
	SamplesPerPixel           *uint16  `tiff:"field,tag=277"`
	RowsPerStrip              *uint32  `tiff:"field,tag=278"`
	StripByteCounts           []uint32 `tiff:"field,tag=279"`
	MinSampleValue            *uint16  `tiff:"field,tag=280"`
	MaxSampleValue            *uint16  `tiff:"field,tag=281"`
	XResolution               *big.Rat `tiff:"field,tag=282"`
	YResolution               *big.Rat `tiff:"field,tag=283"`
	PlanarConfiguration       *uint16  `tiff:"field,tag=284"`
	FreeOffsets               []uint32 `tiff:"field,tag=288"`
	FreeByteCounts            []uint32 `tiff:"field,tag=289"`
	GrayResponseUnit          *uint16  `tiff:"field,tag=290"`
	GrayResponseCurve         []uint16 `tiff:"field,tag=291"`
	ResolutionUnit            *uint16  `tiff:"field,tag=296"`
	Software                  *string  `tiff:"field,tag=305"`
	DateTime                  *string  `tiff:"field,tag=306"`
	Artist                    *string  `tiff:"field,tag=315"`
	HostComputer              *string  `tiff:"field,tag=316"`
	ColorMap                  []uint16 `tiff:"field,tag=320"`
	ExtraSamples              []byte   `tiff:"field,tag=338"`
	Copyright                 *string  `tiff:"field,tag=33432"`
}

type BaselineDecoder

type BaselineDecoder struct {
	//We only really care about these fields.
	ImageWidth                *uint32  `tiff:"field,tag=256"`
	ImageLength               *uint32  `tiff:"field,tag=257"`
	BitsPerSample             []uint16 `tiff:"field,tag=258"`
	Compression               *uint16  `tiff:"field,tag=259"`
	PhotometricInterpretation *uint16  `tiff:"field,tag=262"`
	StripOffsets              []uint32 `tiff:"field,tag=273"`
	SamplesPerPixel           *uint16  `tiff:"field,tag=277"`
	RowsPerStrip              *uint32  `tiff:"field,tag=278"`
	StripByteCounts           []uint32 `tiff:"field,tag=279"`
	XResolution               *big.Rat `tiff:"field,tag=282"`
	YResolution               *big.Rat `tiff:"field,tag=283"`
	ResolutionUnit            *uint16  `tiff:"field,tag=296"`
	ColorMap                  []uint16 `tiff:"field,tag=320"`
	// contains filtered or unexported fields
}

Required fields for baseline

func (*BaselineDecoder) Config

func (bld *BaselineDecoder) Config() (cfg image.Config, err error)

func (*BaselineDecoder) Image

func (bld *BaselineDecoder) Image() (image.Image, error)

type BaselineHandler

type BaselineHandler struct{}

func (BaselineHandler) CanHandle

func (BaselineHandler) CanHandle(ifd tiff.IFD) bool

func (BaselineHandler) Decoder

func (BaselineHandler) Decoder(ifd tiff.IFD, br tiff.BReader) (dec Decoder, err error)

type Bilevel

type Bilevel struct{}

func (Bilevel) CanHandle

func (Bilevel) CanHandle(ifd tiff.IFD) bool

func (Bilevel) Decoder

func (Bilevel) Decoder(ifd tiff.IFD, br tiff.BReader) (dec Decoder, err error)

type Compression

type Compression interface {
	ID() uint16
	Name() string
	Compress([]byte) ([]byte, error)
	Decompress([]byte) ([]byte, error)
}

func GetCompression

func GetCompression(id uint16) Compression

func NewCompression

func NewCompression(id uint16, name string, comp, decomp func([]byte) ([]byte, error)) Compression

type CompressionError

type CompressionError struct {
	Method  string
	Message string
}

func (CompressionError) Error

func (ce CompressionError) Error() string

type CompressionNotSupported

type CompressionNotSupported struct {
	Method uint16
}

func (CompressionNotSupported) Error

func (cni CompressionNotSupported) Error() string

type Decoder

type Decoder interface {
	Image() (image.Image, error)
	Config() (image.Config, error)
}

type FullColorRGB

type FullColorRGB struct{}

func (FullColorRGB) CanHandle

func (FullColorRGB) CanHandle(ifd tiff.IFD) bool

func (FullColorRGB) Decoder

func (FullColorRGB) Decoder(ifd tiff.IFD, br tiff.BReader) (dec Decoder, err error)

type Grayscale

type Grayscale struct{}

func (Grayscale) CanHandle

func (Grayscale) CanHandle(ifd tiff.IFD) bool

func (Grayscale) Decoder

func (Grayscale) Decoder(ifd tiff.IFD, br tiff.BReader) (dec Decoder, err error)

type IFDHandler

type IFDHandler interface {
	Decoder(tiff.IFD, tiff.BReader) (Decoder, error)
	CanHandle(tiff.IFD) bool
}

type PaletteColor

type PaletteColor struct{}

func (PaletteColor) CanHandle

func (PaletteColor) CanHandle(ifd tiff.IFD) bool

func (PaletteColor) Decoder

func (PaletteColor) Decoder(ifd tiff.IFD, br tiff.BReader) (dec Decoder, err error)

type TIFFHandler

type TIFFHandler interface {
	Decoder(tiff.TIFF) (Decoder, error)
	CanHandle(tiff.TIFF) bool
}

func GetHandlerByMake

func GetHandlerByMake(m string) TIFFHandler

func GetHandlerByTagPresence

func GetHandlerByTagPresence(t uint16) TIFFHandler

Jump to

Keyboard shortcuts

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