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 MaxComponents + const MaxPointTransform + const MaxPrecision + const MaxPredictor + const MaxRowBufferSize + const MinPrecision + const MinPredictor + const PredictorAbove + const PredictorAboveAvg + const PredictorAverage + const PredictorDiagonal + const PredictorLeft + const PredictorLeftAvg + const PredictorLinear + var ErrInvalidMarker = fmt.Errorf("invalid marker") + func ApplyPointTransform(value, pointTransform int) int + func ExtendDifference(bits, category int) int + func PredictorName(predictor int) string + type Component struct + HorizontalSampling int + ID int + QuantTableID int + VerticalSampling int + type DefaultValidator struct + func NewValidator() *DefaultValidator + func (*DefaultValidator) SafeAdd(a, b int) (int, error) + func (*DefaultValidator) SafeMultiply(a, b int) (int, error) + func (*DefaultValidator) SafeSubtract(a, b int) (int, error) + func (*DefaultValidator) ValidateComponentCount(count int) error + func (*DefaultValidator) ValidateDimensions(width, height int) error + func (*DefaultValidator) ValidatePointTransform(pt int) error + func (*DefaultValidator) ValidatePrecision(precision int) error + func (*DefaultValidator) ValidatePredictor(predictor int) error + type Frame struct + Components []Component + Height int + Precision int + Width int + type FrameParser struct + func NewFrameParser(validator Validator) *FrameParser + func (p *FrameParser) ParseSOF3(r io.Reader) (*Frame, error) + type LosslessDecoder struct + func NewLosslessDecoder(width, height, precision, components int, validator Validator) (*LosslessDecoder, error) + func (d *LosslessDecoder) Components() int + func (d *LosslessDecoder) DecodeComponent(componentIdx int, differences []int) error + func (d *LosslessDecoder) GetFlatOutput() []int + func (d *LosslessDecoder) GetOutput(componentIdx int) ([][]int, error) + func (d *LosslessDecoder) Height() int + func (d *LosslessDecoder) Precision() int + func (d *LosslessDecoder) SetScanParameters(predictor, pointTransform int) error + func (d *LosslessDecoder) Width() int + type Predictor struct + func NewPredictor(buffer *RowBuffer, selection int, validator Validator) (*Predictor, error) + func (p *Predictor) Decode(difference int) int + func (p *Predictor) DecodeAndStore(difference int) error + func (p *Predictor) DecodeWithPointTransform(difference, pointTransform int) int + func (p *Predictor) Predict() int + type RowBuffer struct + CurrentColumn int + CurrentRow []int + CurrentRowIndex int + MaxValue int + Precision int + PreviousRow []int + Width int + func NewRowBuffer(width, precision int, validator Validator) (*RowBuffer, error) + func (rb *RowBuffer) GetRa() int + func (rb *RowBuffer) GetRb() int + func (rb *RowBuffer) GetRc() int + func (rb *RowBuffer) NextRow() + func (rb *RowBuffer) Reset() + func (rb *RowBuffer) SetCurrent(value int) error + type SampleDecoder struct + func NewSampleDecoder(buffer *RowBuffer, predictor, pointTransform int, validator Validator) *SampleDecoder + func (d *SampleDecoder) AdvanceRow() + func (d *SampleDecoder) DecodeRow(differences []int) ([]int, error) + func (d *SampleDecoder) DecodeSample(difference int) (int, error) + func (d *SampleDecoder) GetMaxValue() int + func (d *SampleDecoder) GetPrecision() int + func (d *SampleDecoder) Reset() + func (d *SampleDecoder) SetPointTransform(pt int) error + func (d *SampleDecoder) SetPredictor(predictor int) error + type Scan struct + Components []ScanComponent + PointTransform int + Predictor int + type ScanComponent struct + ComponentSelector int + DCTableSelector int + type ScanParser struct + func NewScanParser(validator Validator) *ScanParser + func (p *ScanParser) ParseSOS(r io.Reader) (*Scan, error) + type Validator interface + SafeAdd func(a, b int) (int, error) + SafeMultiply func(a, b int) (int, error) + SafeSubtract func(a, b int) (int, error) + ValidateComponentCount func(count int) error + ValidateDimensions func(width, height int) error + ValidatePointTransform func(pt int) error + ValidatePrecision func(precision int) error + ValidatePredictor func(predictor int) error