Documentation
¶
Index ¶
- Constants
- Variables
- func WritePFM(jxlImage *JXLImage, output io.Writer) error
- type BoxInfo
- type BoxReader
- type ContainerBoxHeader
- type JXLCodestreamDecoder
- type JXLDecoder
- type JXLImage
- func (jxl *JXLImage) ChannelToImage(channelNo int) (image.Image, error)
- func (jxl *JXLImage) GetFloatChannelData(c int) ([][]float32, error)
- func (jxl *JXLImage) GetIntChannelData(c int) ([][]int32, error)
- func (jxl *JXLImage) HasAlpha() bool
- func (jxl *JXLImage) IsFloatBased() bool
- func (jxl *JXLImage) IsIntBased() bool
- func (jxl *JXLImage) NumExtraChannels() int
- func (jxl *JXLImage) ToImage() (image.Image, error)
Constants ¶
const ( // unsure if will use these yet. PEAK_DETECT_AUTO = -1 PEAK_DETECT_ON = 1 PEAK_DETECT_OFF = 2 )
Variables ¶
var ( JPEGXL_CONTAINER_HEADER = [12]byte{0x00, 0x00, 0x00, 0x0C, 0x4A, 0x58, 0x4C, 0x20, 0x0D, 0x0A, 0x87, 0x0A} JXLL = makeTag([]byte{'j', 'x', 'l', 'l'}, 0, 4) JXLP = makeTag([]byte{'j', 'x', 'l', 'p'}, 0, 4) JXLC = makeTag([]byte{'j', 'x', 'l', 'c'}, 0, 4) )
Functions ¶
Types ¶
type BoxInfo ¶
type BoxInfo struct {
// contains filtered or unexported fields
}
Box information (not sure what this is yet)
type BoxReader ¶
type BoxReader struct {
// contains filtered or unexported fields
}
func NewBoxReader ¶
func (*BoxReader) ReadBoxHeader ¶
func (br *BoxReader) ReadBoxHeader() ([]ContainerBoxHeader, error)
type ContainerBoxHeader ¶
type JXLCodestreamDecoder ¶
type JXLCodestreamDecoder struct {
// contains filtered or unexported fields
}
JXLCodestreamDecoder decodes the JXL image
func NewJXLCodestreamDecoder ¶
func NewJXLCodestreamDecoder(br *jxlio.Bitreader, opts *options.JXLOptions) *JXLCodestreamDecoder
func (*JXLCodestreamDecoder) GetImageHeader ¶
func (jxl *JXLCodestreamDecoder) GetImageHeader() (*bundle.ImageHeader, error)
GetImageHeader just duplicates the first chunk of code from decode. This is so we can get the image size and colour model.
type JXLDecoder ¶
type JXLDecoder struct {
// contains filtered or unexported fields
}
JXLDecoder decodes the JXL image
func NewJXLDecoder ¶
func NewJXLDecoder(in io.ReadSeeker, opts *options.JXLOptions) *JXLDecoder
func (*JXLDecoder) Decode ¶
func (jxl *JXLDecoder) Decode() (*JXLImage, error)
func (*JXLDecoder) GetImageHeader ¶
func (jxl *JXLDecoder) GetImageHeader() (*bundle.ImageHeader, error)
type JXLImage ¶
type JXLImage struct { Width uint32 Height uint32 Buffer []image2.ImageBuffer ColorEncoding int32 // contains filtered or unexported fields }
JXLImage contains the core information about the JXL image.
func NewJXLImageWithBuffer ¶
func NewJXLImageWithBuffer(buffer []image2.ImageBuffer, header bundle.ImageHeader) (*JXLImage, error)
NewJXLImageWithBuffer creates a new JXLImage with the given buffer and header.
func (*JXLImage) ChannelToImage ¶
ChannelToImage converts a single channel to grayscale Go image.Image interface. Can be used for any channel (R,G,B, alpha, depth..... etc) but is really expected to be used for NON "regular" channels (ie depth etc) TODO(kpfaulkner) still need to confirm if generating an 8 bit grayscale image is appropriate for this, or if Gray16... or even RGBA with generating the RGB values itself is the way to proceed.
func (*JXLImage) GetFloatChannelData ¶
GetFloatChannelData will return the floating point image data for a channel. The underlying image MAY not have any floating point data (this is all image dependant).
func (*JXLImage) GetIntChannelData ¶
GetIntChannelData will return the integer image data for a channel. The underlying image MAY not have any integer point data (this is all image dependant).
func (*JXLImage) IsFloatBased ¶
IsFloatBased returns true if underlying data related to image is float based.
func (*JXLImage) IsIntBased ¶
IsIntBased returns true if underlying data related to image is integer based.