Documentation ¶
Overview ¶
Package exr contains an implementation of an OpenEXR image decoder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // RGBAModel returns the color.Model for RGBAColor colors. RGBAModel color.Model = color.ModelFunc(rgbaModel) )
Functions ¶
func Decode ¶
Decode reads an EXR image from in and returns it as an image.Image. The type of the Image is RGBAImage.
Only a limited set of EXR image types are supported at the moment. The main restrictions are as follows, though others apply as well:
- They have to be single-part scan line images.
- They have to use no compression or zip compression.
func DecodeConfig ¶
DecodeConfig returns the color model and dimensions of an EXR image without decoding the entire image.
This function supports all version 2 EXR images.
Types ¶
type Encoder ¶
type Encoder interface { Encode(w io.Writer, m image.Image) error Compress(b bool) Encoder Float16() Encoder Float32() Encoder }
func NewEncoder ¶
func NewEncoder() Encoder
type RGBAColor ¶
type RGBAColor struct { // R holds the amount of red in this color. R float32 // G holds the amount of green in this color. G float32 // B holds the amount of blue in this color. B float32 // A holds the amount of alpha in this color. A float32 }
RGBAColor represents a linear EXR color that implements the color.Color interface and is composed of R, G, B, and A components.
func (RGBAColor) RGBA ¶
RGBA returns the alpha-premultiplied red, green, blue and alpha values for the color. Each value ranges within [0, 0xffff], but is represented by a uint32 so that multiplying by a blend factor up to 0xffff will not overflow.
An alpha-premultiplied color component c has been scaled by alpha (a), so has valid values 0 <= c <= a.
Reinhard tone mapping and gamma correction are performed to convert the color into sRGB space.
type RGBAImage ¶
type RGBAImage struct {
// contains filtered or unexported fields
}
RGBAImage represents an EXR image that consists of R, G, B, and A components.
Even if the original image that is loaded does not contain all of the components, default ones will be assigned.
func NewFloat16 ¶
func NewFloat32 ¶
func (*RGBAImage) At ¶
At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.
The returned color is of type RGBAColor which can be used to acquire the linear (float) components of the color.
func (*RGBAImage) Bounds ¶
Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0).
func (*RGBAImage) ColorModel ¶
ColorModel returns the RGBAImage's color model.