Versions in this module Expand all Collapse all v1 v1.0.1 Jun 30, 2026 v1.0.0 Jun 30, 2026 Changes in this version + const BoxTypeCodestream + const BoxTypeColourSpec + const BoxTypeFileType + const BoxTypeImageHeader + const BoxTypeJP2Header + const BoxTypeSignature + const ColourMethodEnumCS + const ColourMethodRestrictedICC + const ColourSpaceGray + const ColourSpaceSRGB + const ColourSpaceSYCC + const ColourSpaceUnknown + var BrandJP2 = [4]byte + var ErrInvalidBox = errors.New("invalid box structure") + var ErrInvalidSignature = errors.New("invalid JP2 signature") + var ErrMissingCodestream = errors.New("missing codestream") + var ErrMissingHeader = errors.New("missing JP2 header") + var Signature = [4]byte + type Box struct + Children []*Box + Data []byte + Type uint32 + type Builder struct + func NewBuilder() *Builder + func (b *Builder) Build(codestream []byte) ([]byte, error) + func (b *Builder) SetBitDepth(bpc uint8, signed bool) *Builder + func (b *Builder) SetColourSpace(cs int) *Builder + func (b *Builder) SetComponents(numComps uint16) *Builder + func (b *Builder) SetImageSize(width, height uint32) *Builder + type ImageInfo struct + BitsPerComp uint8 + ColourSpace int + Height uint32 + NumComps uint16 + Signed bool + Width uint32 + type Reader struct + func NewReader(data []byte) *Reader + func (r *Reader) ExtractCodestream() ([]byte, error) + func (r *Reader) GetImageInfo() (*ImageInfo, error) + func (r *Reader) ReadBox() (*Box, error) + func (r *Reader) Verify() error + type Writer struct + func NewWriter() *Writer + func (w *Writer) Bytes() []byte + func (w *Writer) Reset() + func (w *Writer) WriteBox(boxType uint32, data []byte) + func (w *Writer) WriteJP2(info *ImageInfo, codestream []byte) error + func (w *Writer) WriteTo(writer io.Writer) (int64, error)