Documentation
¶
Index ¶
Constants ¶
View Source
const ( BoxTypeSignature = 0x6A502020 // 'jP ' - JP2 Signature BoxTypeFileType = 0x66747970 // 'ftyp' - File Type BoxTypeJP2Header = 0x6A703268 // 'jp2h' - JP2 Header BoxTypeImageHeader = 0x69686472 // 'ihdr' - Image Header BoxTypeColourSpec = 0x636F6C72 // 'colr' - Colour Specification BoxTypeCodestream = 0x6A703263 // 'jp2c' - Contiguous Codestream )
JP2 box types
View Source
const ( ColourMethodEnumCS = 1 // Enumerated Colourspace ColourMethodRestrictedICC = 2 // Restricted ICC Profile )
Colour specification method
View Source
const ( ColourSpaceUnknown = 0 ColourSpaceSRGB = 16 // sRGB ColourSpaceGray = 17 // Greyscale ColourSpaceSYCC = 18 // sYCC (YCbCr) )
Enumerated colourspaces
Variables ¶
View Source
var ( ErrInvalidSignature = errors.New("invalid JP2 signature") ErrMissingHeader = errors.New("missing JP2 header") ErrInvalidBox = errors.New("invalid box structure") ErrMissingCodestream = errors.New("missing codestream") )
Errors
View Source
var BrandJP2 = [4]byte{'j', 'p', '2', ' '}
BrandJP2 is the JP2 file type brand identifier.
View Source
var Signature = [4]byte{0x0D, 0x0A, 0x87, 0x0A}
Signature contains the signature box contents for JP2 files
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder builds a complete JP2 file
func (*Builder) SetBitDepth ¶
SetBitDepth sets the bits per component
func (*Builder) SetColourSpace ¶
SetColourSpace sets the colour space
func (*Builder) SetComponents ¶
SetComponents sets the number of components
func (*Builder) SetImageSize ¶
SetImageSize sets the image dimensions
type ImageInfo ¶
type ImageInfo struct {
Width uint32
Height uint32
NumComps uint16
BitsPerComp uint8
Signed bool
ColourSpace int
}
ImageInfo contains image information for JP2 header
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads JP2 container format
func (*Reader) ExtractCodestream ¶
ExtractCodestream extracts the codestream from the JP2 file
func (*Reader) GetImageInfo ¶
GetImageInfo extracts image information from the JP2 header
Click to show internal directories.
Click to hide internal directories.