core

package
v0.0.0-...-2eec009 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// unsure if will use these yet.
	PEAK_DETECT_AUTO = -1
	PEAK_DETECT_ON   = 1
	PEAK_DETECT_OFF  = 2
)

Variables

View Source
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

func WritePFM

func WritePFM(jxlImage *JXLImage, output io.Writer) error

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 NewBoxReader(reader *jxlio.Bitreader) *BoxReader

func (*BoxReader) ReadBoxHeader

func (br *BoxReader) ReadBoxHeader() ([]ContainerBoxHeader, error)

func (*BoxReader) SkipFully

func (br *BoxReader) SkipFully(i int64) (int64, error)

returns number of bytes that were NOT skipped.

type ContainerBoxHeader

type ContainerBoxHeader struct {
	BoxType   uint64
	BoxSize   uint64
	IsLast    bool
	Offset    int64 // offset compared to very beginning of file.
	Processed bool  // indicated if finished with.
}

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

func (jxl *JXLImage) ChannelToImage(channelNo int) (image.Image, error)

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

func (jxl *JXLImage) GetFloatChannelData(c int) ([][]float32, error)

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

func (jxl *JXLImage) GetIntChannelData(c int) ([][]int32, error)

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) HasAlpha

func (jxl *JXLImage) HasAlpha() bool

func (*JXLImage) IsFloatBased

func (jxl *JXLImage) IsFloatBased() bool

IsFloatBased returns true if underlying data related to image is float based.

func (*JXLImage) IsIntBased

func (jxl *JXLImage) IsIntBased() bool

IsIntBased returns true if underlying data related to image is integer based.

func (*JXLImage) NumExtraChannels

func (jxl *JXLImage) NumExtraChannels() int

func (*JXLImage) ToImage

func (jxl *JXLImage) ToImage() (image.Image, error)

ToImage converts to standard Go image.Image RGBA format for the R,G,B and alpha channels

Jump to

Keyboard shortcuts

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