Versions in this module Expand all Collapse all v1 v1.0.1 Jul 2, 2026 v1.0.0 Jun 27, 2026 Changes in this version + var ErrInsufficientData = errors.New("frame is not long enough to contain RLE encoded data") + var ErrInvalidBitsAllocated = errors.New("the (0028,0100) 'Bits Allocated' value must be 1, 8, 16, 32 or 64") + var ErrInvalidByteOrder = errors.New("'byteorder' must be '>' or '<'") + var ErrInvalidColumns = errors.New("the (0028,0011) 'Columns' value is invalid") + var ErrInvalidHeaderLength = errors.New("the RLE header must be 64 bytes long") + var ErrInvalidPackBitsInput = errors.New("only binary input (containing zeros or ones) can be packed") + var ErrInvalidParameters = errors.New(...) + var ErrInvalidSamplesPerPixel = errors.New("the (0028,0002) 'Samples per Pixel' must be 1 or 3") + var ErrInvalidSegmentOffset = errors.New("invalid segment offset found in the RLE header") + var ErrMissingPixelDataArgs = errors.New("missing expected keyword arguments: bits_allocated, columns, rows") + var ErrSamplesPerPixelBA1 = errors.New(...) + var ErrSegmentDecodeEOF = errors.New("the end of the data was reached before the segment was completely decoded") + var ErrSegmentLength = errors.New("the decoded segment length does not match the expected length") + var ErrTooManySegments = errors.New(...) + var ErrUnsupportedPixelVersion = errors.New("gorle: unsupported pixel data version") + func DecodeFrame(src []byte, nrPixels int, bitsAllocated int, byteOrder ByteOrder) ([]byte, error) + func DecodePixelData(src []byte, opts PixelDataOptions) ([]byte, error) + func DecodeSegment(src []byte) ([]byte, error) + func EncodeFrame(src []byte, rows, cols, spp, bitsAllocated int, byteOrder ByteOrder) ([]byte, error) + func EncodePixelData(src []byte, opts PixelDataOptions) ([]byte, error) + func EncodeRow(src []byte) ([]byte, error) + func EncodeSegment(src []byte, cols int) ([]byte, error) + func PackBits(src []byte, byteOrder ByteOrder) ([]byte, error) + func Packed1BitLength(rows, cols int) int + func ParseHeader(src []byte) ([]uint32, error) + func UnpackBits(src []byte, count int, byteOrder ByteOrder) ([]byte, error) + func UnpackedFrameLength(rows, cols, spp, bitsAllocated int) int + type ByteOrder string + const BigEndian + const LittleEndian + type FrameOptions struct + BitsAllocated int + ByteOrder ByteOrder + Columns int + Rows int + SamplesPerPixel int + type PixelDataOptions struct + PackBits bool + Version PixelDataVersion + type PixelDataVersion int + const PixelDataV1 + const PixelDataV2