Documentation ¶
Index ¶
- Constants
- 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 hdr.Image) error
- func EncodeWithOptions(w io.Writer, m hdr.Image, h *Header) error
- type FormatError
- type Header
- type InternalError
- type UnsupportedError
Constants ¶
View Source
const ( // FormatRGBE for RGBE model FormatRGBE = "RGBE" // FormatXYZE for XYZE model FormatXYZE = "XYZE" // FormatRGB for RGB model FormatRGB = "RGB" // FormatXYZ for XYZ model FormatXYZ = "XYZ" // FormatLogLuv for LogLuv model FormatLogLuv = "LogLuv" // RasterModeNormal for normal pixel positioning RasterModeNormal = "normal" // RasterModeSeparately for separately pixel's color positioning RasterModeSeparately = "separately" // CompressionGzip for gzip compression CompressionGzip = "gzip" // CompressionZstd for Zstandard compression CompressionZstd = "zstd" )
Variables ¶
View Source
var ( // Mode1 offers the better compression in RGBE/XYZE color model depending to // the provided hdr.Image implementation. (quantization steps: 1%) Mode1 = &Header{ Depth: 32, RasterMode: RasterModeSeparately, Compression: CompressionGzip, } // Mode2 offers the better compression in XYZE that covers gamut. (quantization steps: 1%) Mode2 = &Header{ Depth: 32, Format: FormatXYZE, RasterMode: RasterModeSeparately, Compression: CompressionGzip, } // Mode3 offers a trade off in compression/quality in RGB. (quantization steps: 0.1%) Mode3 = &Header{ Depth: 32, Format: FormatRGB, RasterMode: RasterModeSeparately, Compression: CompressionGzip, } // Mode4 offers the better quality in XYZ that covers gamut. (quantization steps: 0.1%) Mode4 = &Header{ Depth: 32, Format: FormatXYZ, RasterMode: RasterModeSeparately, Compression: CompressionGzip, } // Mode5 offers the better compression and quality in LogLuv that covers gamut. (quantization steps: 0.1%) Mode5 = &Header{ Depth: 32, Format: FormatLogLuv, RasterMode: RasterModeSeparately, Compression: CompressionGzip, } // Mode6 offers the better and faster compression and quality in LogLuv that covers gamut. (quantization steps: 0.1%) Mode6 = &Header{ Depth: 32, Format: FormatLogLuv, RasterMode: RasterModeSeparately, Compression: CompressionZstd, } )
Functions ¶
func DecodeConfig ¶
DecodeConfig returns the color model and dimensions of a RGBE image without decoding the entire image.
Types ¶
type FormatError ¶
type FormatError string
A FormatError reports that the input is not a valid CRAD image.
func (FormatError) Error ¶
func (e FormatError) Error() string
type Header ¶
type Header struct { Width int `cbor:"width"` Height int `cbor:"height"` Depth int `cbor:"depth"` Format string `cbor:"format"` RasterMode string `cbor:"raster_mode"` Compression string `cbor:"compression"` Metadata map[string]string `cbor:"metadata,omitempty"` }
A Header handles all image properties.
type InternalError ¶
type InternalError string
An InternalError reports that an internal error was encountered.
func (InternalError) Error ¶
func (e InternalError) Error() string
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
Click to show internal directories.
Click to hide internal directories.