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 BlockSize + const BlockSize2 + const BoxTypeCodestream + const BoxTypeColourSpec + const BoxTypeFileType + const BoxTypeImageHeader + const BoxTypeJP2Header + const BoxTypeJP2Signature + const BoxTypeResolution + const BoxTypeUUID + const BoxTypeUUIDInfo + const BoxTypeXML + const DefaultEncoderComment + const J2KCOC + const J2KCOD + const J2KCOM + const J2KCRG + const J2KEOC + const J2KEPH + const J2KPLM + const J2KPLT + const J2KPOC + const J2KPPM + const J2KPPT + const J2KQCC + const J2KQCD + const J2KRGN + const J2KSIZ + const J2KSOC + const J2KSOD + const J2KSOP + const J2KSOT + const J2KTLM + const MaxBitsPerSample + const MaxImageDimension + const MaxImagePixels + const MaxMemoryAllocation + const MaxQuality + const MinBitsPerSample + const MinImageDimension + const MinQuality + const WeightAPPMarker + const WeightHuffmanTable + const WeightQuantizationTable + var EncoderQualityMappings = map[EncoderFamily]EncoderQualityMapping + var ErrAPIDecodeFailure = errors.New("jpeg: decode failure") + var ErrAPIUnsupportedFormat = errors.New("jpeg: unsupported or unrecognized format") + var ErrDimensionOverflow = errors.New("dimension calculation would overflow") + var ErrEOF = errors.New("EOF") + var ErrEmptyData = errors.New("jpeg: empty data") + var ErrEmptyTables = errors.New("no quantization tables provided") + var ErrEncoderBufferTooSmall = errors.New("encoder buffer too small") + var ErrEncoderEntropyCoding = errors.New("encoder entropy coding failed") + var ErrEncoderInvalidInput = errors.New("invalid encoder input") + var ErrEncoderNotInitialized = errors.New("encoder not initialized") + var ErrEncoderQuantizationFailed = errors.New("encoder quantization failed") + var ErrEncoderTransformFailed = errors.New("encoder transform failed") + var ErrEncoderUnsupportedColorSpace = errors.New("unsupported color space for encoding") + var ErrEncoderUnsupportedFormat = errors.New("unsupported encoder format") + var ErrInsufficientData = errors.New("pixel buffer too small for dimensions") + var ErrIntegerOverflow = errors.New("integer overflow") + var ErrInvalidBitsPerSample = errors.New("bits per sample out of valid range") + var ErrInvalidColorSpace = errors.New("invalid color space") + var ErrInvalidDimension = errors.New("dimension out of valid range") + var ErrInvalidLength = errors.New("invalid length") + var ErrInvalidMarker = errors.New("invalid JPEG marker") + var ErrInvalidPosition = errors.New("invalid position") + var ErrInvalidQuality = errors.New("quality must be between 0 and 100") + var ErrInvalidStride = errors.New("stride invalid for image dimensions") + var ErrLosslessJPEG = errors.New("quality estimation not applicable to lossless JPEG (SOF3)") + var ErrNilInput = errors.New("input cannot be nil") + var ErrNilReader = errors.New("jpeg: nil reader") + var ErrNoDQTMarker = errors.New("JPEG contains no quantization table (DQT) markers") + var ErrNoSOFMarker = errors.New("no SOF marker found") + var ErrNotJPEG = errors.New("not a valid JPEG file") + var ErrNotValidJPEG = errors.New("data is not a valid JPEG: missing SOI marker (0xFFD8)") + var ErrOutOfBounds = errors.New("index out of bounds") + var ErrOverflow = errors.New("arithmetic overflow") + var ErrResourceLimit = errors.New("resource limit exceeded") + var ErrTruncatedFile = errors.New("truncated file") + var ErrUnderflow = errors.New("arithmetic underflow") + var StandardChrominanceQuantTable = [BlockSize2]int + var StandardLuminanceQuantTable = [BlockSize2]int + var StdEncoderACChrominanceBits = [16]int + var StdEncoderACChrominanceValues = []byte + var StdEncoderACLuminanceBits = [16]int + var StdEncoderACLuminanceValues = []byte + var StdEncoderDCChrominanceBits = [16]int + var StdEncoderDCChrominanceValues = []byte + var StdEncoderDCLuminanceBits = [16]int + var StdEncoderDCLuminanceValues = []byte + var UnzigzagOrder [BlockSize2]int + var ZigzagOrder = [BlockSize2]int + func AnalyzeDCTDistribution(coefficients []int) float64 + func CalculateMCUCount(width, height int, components []EncoderComponentSpec) (mcuCols, mcuRows, totalMCUs int) + func CalculateReEncodingLikelihood(data []byte, tables map[int][64]int) float64 + func CalculateTableHash(table [64]int) uint64 + func CheckCharacteristicRatios(table [64]int, expected []float64) float64 + func CheckedAddInt(a, b int) (int, error) + func CheckedAddInt64(a, b int64) (int64, error) + func CheckedMulInt(a, b int) (int, error) + func CheckedMulInt64(a, b int64) (int64, error) + func CheckedSubInt(a, b int) (int, error) + func CheckedSubInt64(a, b int64) (int64, error) + func ClampBlock(block *[BlockSize2]float64, max float64) + func ComputeTableHash(table [64]int) string + func ComputeTablesHash(tables map[int][64]int) string + func Decode(r io.Reader) (img image.Image, err error) + func DecodeACValue(runSize byte, additionalBits uint16) (runLength int, value int) + func DecodeDCValue(category byte, additionalBits uint16) int + func DetectDoubleQuantization(table [64]int) float64 + func DetectLocale() string + func DetectQualityMismatch(lumQuality, chromQuality int) float64 + func EncodeACValue(runLength int, value int) (runSize byte, additionalBits uint16, nAdditionalBits int) + func EncodeCoefficientsToJPEG(coefficients []int, meta *CoeffEncoderMetadata, opts *EncoderOptions) ([]byte, error) + func EncodeDCValue(diff int) (category byte, additionalBits uint16, nAdditionalBits int) + func ExtractBlock(img *ImageData, component int, bx, by int) *[BlockSize2]float64 + func GetEncoderQualityCurve(encoder EncoderFamily, quality int) [64]int + func GetLogger() logger.LeveledLogger + func GetSupportedLocales() []string + func IsSuperBox(boxType string) bool + func IsSupported(formatName string) bool + func LevelShift(block *[BlockSize2]float64, bits int) + func LevelUnshift(block *[BlockSize2]float64, bits int) + func MCUDimensions(components []EncoderComponentSpec) (mcuWidth, mcuHeight, blocksPerMCU int) + func MustAddInt(a, b int) int + func MustMulInt(a, b int) int + func NewTranslator(locale ...string) (*i18n.Translator, error) + func NormalizeQualityToLibjpeg(quality int, encoder EncoderFamily) int + func ParallelForEachFormat(files [][]byte, fn func(data []byte, format Format) interface{}) []interface + func PopulateEncoderDetection(estimate *QualityEstimate, data []byte, tables map[int][64]int) + func ReverseEngineerEncoderQuality(table [64]int, encoder EncoderFamily) int + func SafeBlockCount(width, height int) (int, error) + func SafeBlockIndex(blockX, blockY, blocksPerRow, totalBlocks int) (int, error) + func SafeBufferSize(width, height, channels int) (int64, error) + func SafeDivInt(a, b int) (int, error) + func SafeDivInt64(a, b int64) (int64, error) + func SafeMCUCount(width, height, hMax, vMax int) (int, error) + func SafePixelOffset(x, y, stride, bufLen int) (int, error) + func SafeStrideSize(width, channels int) (int, error) + func ScaleQuantTable(table [BlockSize2]int, quality int) [BlockSize2]int + func SetLogger(l logger.LeveledLogger) + func SetTranslator(translator TranslatorProvider) + func StoreBlock(img *ImageData, component int, bx, by int, block *[BlockSize2]float64) + func SubsamplingQualityScore(mode ChromaSubsamplingMode) float64 + func ValidateBufferSize(size int64) error + func ValidateDimensions(width, height int) error + func ValidateEncoderOptions(opts *EncoderOptions) error + func ValidateImageData(img *ImageData) error + func WriteAPP0(w io.Writer) error + func WriteAPP0Version(w io.Writer, major, minor byte) error + func WriteCOM(w io.Writer, comment string) error + func WriteDHT(w io.Writer, tables []HuffmanSpec) error + func WriteDQT(w io.Writer, tables map[int][64]int) error + func WriteEOI(w io.Writer) error + func WriteSOF0(w io.Writer, width, height int, components []EncoderComponentSpec) error + func WriteSOI(w io.Writer) error + func WriteSOS(w io.Writer, components []ScanComponent) error + func ZigzagDecode(block *[BlockSize2]int) *[BlockSize2]int + func ZigzagEncode(block *[BlockSize2]int) *[BlockSize2]int + func ZigzagToNatural(zigzagTable [BlockSize2]int) [BlockSize2]int + type APPMarkerHints struct + AdobeColorTransform int + AdobeDCTVersion int + CommentStrings []string + ExifMake string + ExifModel string + ExifSoftware string + Has8BIMResources bool + HasAdobeMarker bool + HasICCProfile bool + HasJFIFThumbnail bool + HasPhotoshopMarker bool + JFIFVersion string + PhotoshopVersion string + RawAPPMarkers []RawAPPMarker + func ExtractAPPMarkerHints(data []byte) (*APPMarkerHints, error) + type APPSegment struct + AppType int + Data []byte + Identifier string + type AlgorithmConfig struct + DCTHistogram AlgorithmSettings + LeastSquares AlgorithmSettings + ScaleFactor AlgorithmSettings + type AlgorithmResult struct + Confidence float64 + Method EstimationMethod + Quality int + Weight float64 + type AlgorithmSettings struct + Enabled bool + Weight float64 + type ArithmeticLosslessEncoder struct + func NewArithmeticLosslessEncoder(opts *EncoderOptions) *ArithmeticLosslessEncoder + func NewArithmeticLosslessEncoderWithOptions(opts *EncoderOptions, losslessOpts *LosslessOptions) *ArithmeticLosslessEncoder + func (e *ArithmeticLosslessEncoder) Encode(img *ImageData) ([]byte, error) + func (e *ArithmeticLosslessEncoder) EncodeImage(img image.Image) ([]byte, error) + func (e *ArithmeticLosslessEncoder) Format() Format + func (e *ArithmeticLosslessEncoder) Predictor() int + func (e *ArithmeticLosslessEncoder) SetPredictor(predictor int) error + func (e *ArithmeticLosslessEncoder) SetQuality(_ int) error + type ArithmeticProgressiveEncoder struct + func NewArithmeticProgressiveEncoder(opts *EncoderOptions) *ArithmeticProgressiveEncoder + func NewArithmeticProgressiveEncoderWithScript(opts *EncoderOptions, script *ScanScript) *ArithmeticProgressiveEncoder + func (e *ArithmeticProgressiveEncoder) Encode(img *ImageData) ([]byte, error) + func (e *ArithmeticProgressiveEncoder) EncodeImage(img image.Image) ([]byte, error) + func (e *ArithmeticProgressiveEncoder) Format() Format + func (e *ArithmeticProgressiveEncoder) SetQuality(quality int) error + type ArithmeticSequentialEncoder struct + func NewArithmeticSequential12BitEncoder(opts *EncoderOptions) *ArithmeticSequentialEncoder + func NewArithmeticSequentialEncoder(opts *EncoderOptions) *ArithmeticSequentialEncoder + func (e *ArithmeticSequentialEncoder) Encode(img *ImageData) ([]byte, error) + func (e *ArithmeticSequentialEncoder) EncodeImage(img image.Image) ([]byte, error) + func (e *ArithmeticSequentialEncoder) Format() Format + func (e *ArithmeticSequentialEncoder) SetQuality(quality int) error + type AsyncEventReader interface + ReadEvent func() (*VisualEvent, error) + StartReading func(r io.Reader) error + StopReading func() error + type BaselineCoeffEncoder struct + func NewBaselineEncoderForCoefficients(opts *EncoderOptions) *BaselineCoeffEncoder + func (e *BaselineCoeffEncoder) EncodeCoefficients(coefficients []int, meta *CoeffEncoderMetadata) ([]byte, error) + func (e *BaselineCoeffEncoder) SetOptions(opts *EncoderOptions) error + func (e *BaselineCoeffEncoder) SetQuality(quality int) error + type BasicFormatInfo struct + Description string + Name string + type BatchDetector interface + DetectBatch func(files [][]byte) []DetectionResult + DetectBatchWithInfo func(files [][]byte) []DetectionResult + func NewConcurrentDetector(workers int) BatchDetector + func NewConcurrentDetectorWithDetector(workers int, detector FormatDetector) BatchDetector + type BitStreamReader struct + func NewBitStreamReader(r io.Reader) *BitStreamReader + func (br *BitStreamReader) ReadBits(nBits int) (uint32, error) + type BitStreamWriter struct + func NewBitStreamWriter(w io.Writer) *BitStreamWriter + func (bw *BitStreamWriter) BytesWritten() int + func (bw *BitStreamWriter) Error() error + func (bw *BitStreamWriter) Flush() error + func (bw *BitStreamWriter) WriteBits(bits uint32, nBits int) error + func (bw *BitStreamWriter) WriteCode(code HuffmanEncoderCode) error + type BlockReconstructor struct + func NewBlockReconstructor(bits int) *BlockReconstructor + func NewBlockReconstructorWithDCT(bits int, dct DCTTransformer) *BlockReconstructor + func (br *BlockReconstructor) Reconstruct(coeffs *[BlockSize2]int, qtable *[BlockSize2]int) *[BlockSize2]byte + func (br *BlockReconstructor) ReconstructToFloat(coeffs *[BlockSize2]int, qtable *[BlockSize2]int) *[BlockSize2]float64 + type BufferError struct + Actual int + BufferName string + Cause error + Expected int + Operation string + Position int + func NewBufferError(operation, bufferName string, position, expected, actual int, cause error) *BufferError + func (e *BufferError) Error() string + func (e *BufferError) Is(target error) bool + func (e *BufferError) Unwrap() error + type ByteReader interface + Len func() int + Position func() int + ReadByte func() (byte, error) + Remaining func() int + SetPosition func(pos int) + func NewByteReader(data []byte) ByteReader + type CODMarker struct + CodeBlockHeight int + CodeBlockStyle byte + CodeBlockWidth int + CodingStyle byte + DecompositionLevels int + MultipleComponentTransform bool + ProgressionOrder int + QualityLayers int + Transformation int + type ChromaSubsampler interface + Mode func() ChromaSubsampling + Subsample func(img *ImageData) (y, cb, cr []byte, cbWidth, cbHeight int) + func NewChromaSubsampler(mode ChromaSubsampling) ChromaSubsampler + type ChromaSubsampling int + const Subsampling411 + const Subsampling420 + const Subsampling422 + const Subsampling444 + const SubsamplingGrayscale + func (s ChromaSubsampling) String() string + type ChromaSubsamplingMode int + const ChromaSubsampling420 + const ChromaSubsampling422 + const ChromaSubsampling444 + const ChromaSubsamplingUnknown + func DetectChromaSubsampling(data []byte) ChromaSubsamplingMode + func (m ChromaSubsamplingMode) String() string + type ChromaUpsampler interface + Mode func() ChromaSubsampling + Upsample func(y, cb, cr []byte, yWidth, yHeight, cbWidth, cbHeight int) (yOut, cbOut, crOut []byte) + func NewChromaUpsampler(mode ChromaSubsampling) ChromaUpsampler + func NewChromaUpsamplerWithMode(mode ChromaSubsampling, upsamplingMode UpsamplingMode) ChromaUpsampler + type CodestreamParser interface + ParseCOD func(data []byte) (*CODMarker, error) + ParseQCD func(data []byte) (*QCDMarker, error) + ParseSIZ func(data []byte) (*SIZMarker, error) + ParseSOT func(data []byte) (*SOTMarker, error) + func DefaultCodestreamParser() CodestreamParser + func NewCodestreamParser(validator SecurityValidator) CodestreamParser + type CoeffEncoder interface + EncodeCoefficients func(coefficients []int, meta *CoeffEncoderMetadata) ([]byte, error) + type CoeffEncoderMetadata struct + ComponentCount int + Height int + Quality int + QuantTables map[int][64]int + Subsampling ChromaSubsampling + Width int + type CoefficientExtractor interface + Extract func(data []byte) ([]DCTCoefficient, error) + GetComponentCount func() int + GetImageDimensions func() (width, height int) + func NewDecoder() CoefficientExtractor + type CoefficientRatio struct + ExpectedRatio float64 + Position int + Weight float64 + type ColorConversionStandard int + const ColorConversionBT601 + const ColorConversionBT709 + func (c ColorConversionStandard) String() string + type ColorConverter interface + RGBToYCbCr func(r, g, b uint8) (y, cb, cr uint8) + Standard func() string + YCbCrToRGB func(y, cb, cr uint8) (r, g, b uint8) + func NewBT601Converter() ColorConverter + func NewBT709Converter() ColorConverter + type ColorSpace int + const ColorSpaceCMYK + const ColorSpaceGrayscale + const ColorSpaceRGB + const ColorSpaceRGBA + const ColorSpaceUnknown + const ColorSpaceYCbCr + func (cs ColorSpace) Channels() int + func (cs ColorSpace) String() string + type ComponentError struct + Cause error + ComponentID int + Message string + Operation string + func NewComponentError(componentID int, operation, message string, cause error) *ComponentError + func (e *ComponentError) Error() string + func (e *ComponentError) Unwrap() error + type ComponentReconstructor struct + func NewComponentReconstructor(componentID, qtableID, bits int) *ComponentReconstructor + func (cr *ComponentReconstructor) ComponentID() int + func (cr *ComponentReconstructor) QuantTableID() int + func (cr *ComponentReconstructor) ReconstructBlock(coeffs *[BlockSize2]int, dcDiff int, qtable *[BlockSize2]int) *[BlockSize2]byte + func (cr *ComponentReconstructor) Reset() + type ComponentSpec struct + BitDepth int + HorizontalSeparation int + Signed bool + VerticalSeparation int + type ConfidenceBreakdown struct + APPMarkerScore float64 + ContradictionDetails []string + ContradictionPenalty float64 + FinalConfidence float64 + HuffmanTableScore float64 + QuantizationTableScore float64 + type ConfidenceCalculator struct + func NewConfidenceCalculator() *ConfidenceCalculator + func (c *ConfidenceCalculator) CalculateFinalConfidence(breakdown *ConfidenceBreakdown) float64 + func (c *ConfidenceCalculator) DetectContradictions(encoderFamily string, hints *APPMarkerHints) []string + type Configurable interface + GetOptions func() *EncoderOptions + SetOptions func(opts *EncoderOptions) error + type DCPredictor struct + func NewDCPredictor() *DCPredictor + func (p *DCPredictor) Predict(component int, dc int) int + func (p *DCPredictor) Reset() + func (p *DCPredictor) Unpredict(component int, diff int) int + type DCTCoefficient struct + BlockX int + BlockY int + Col int + Component int + Row int + Value int16 + type DCTHistogramAnalyzer struct + func NewDCTHistogramAnalyzer() *DCTHistogramAnalyzer + func (a *DCTHistogramAnalyzer) AnalyzeCoefficients(coefficients []int, blockSize int) (*DCTHistogramResult, error) + func (a *DCTHistogramAnalyzer) AnalyzeDCTCoefficients(dctCoeffs []DCTCoefficient) (*DCTHistogramResult, error) + func (a *DCTHistogramAnalyzer) CalculateHistogramSpread(histogram []HistogramBucket) float64 + func (a *DCTHistogramAnalyzer) EstimateQualityFromHistogram(histogram []HistogramBucket) (quality int, confidence float64) + func (a *DCTHistogramAnalyzer) ExtractACHistogram(coefficients []int, blockSize int) []HistogramBucket + func (a *DCTHistogramAnalyzer) ExtractDCHistogram(coefficients []int, blockSize int) []HistogramBucket + type DCTHistogramResult struct + ACHistogram []HistogramBucket + Confidence float64 + DCHistogram []HistogramBucket + EstimatedQuality int + Kurtosis float64 + Spread float64 + ZeroPercentage float64 + type DCTImplementation int + const DCTDefault + const DCTInteger + const DCTReference + func (d DCTImplementation) String() string + type DCTTransformer interface + Forward func(block *[BlockSize2]float64) + Inverse func(block *[BlockSize2]float64) + func NewAANDCT() DCTTransformer + func NewDCT() DCTTransformer + func NewIntegerDCT() DCTTransformer + func NewReferenceDCT() DCTTransformer + func NewSeparableDCT() DCTTransformer + type DHTSegment struct + Bits [16]int + TableClass int + TableID int + Values []byte + type DQTSegment struct + Precision int + TableID int + Values [64]uint16 + type DecodeMetadata struct + HDR *HDRDecodeMetadata + LightField *LightFieldDecodeMetadata + Trust *TrustDecodeMetadata + type DecodeResult struct + ComponentCount int + EventStream *EventStreamResult + Format Format + HDRData []float32 + HDRUint16Data []uint16 + Height int + Image image.Image + LightFieldViews map[[2]int]image.Image + Metadata *DecodeMetadata + PointCloud *PointCloudResult + Width int + type Decoder struct + func NewDecoderWithOptions(opts *DecoderOptions) *Decoder + func (d *Decoder) ClearSignatureCache() + func (d *Decoder) Decode(data []byte) (image.Image, error) + func (d *Decoder) Extract(data []byte) ([]DCTCoefficient, error) + func (d *Decoder) Format() Format + func (d *Decoder) GetComponentCount() int + func (d *Decoder) GetDimensions() (width, height int) + func (d *Decoder) GetImageDimensions() (width, height int) + func (d *Decoder) IsBaseline() bool + func (d *Decoder) QualityFactor() int + func (d *Decoder) QuantizationTable(component int) []int + func (d *Decoder) Signature() *Signature + type DecoderOptions struct + ChromaUpsampling UpsamplingMode + ColorConversion ColorConversionStandard + DCT DCTImplementation + HDRIgnoreExtension bool + HDROutput HDROutputMode + LightFieldView LightFieldViewMode + LightFieldViewU int + LightFieldViewV int + LowLatencyMode bool + PointCloudFormat PointCloudOutputFormat + PointCloudIncludeColors bool + PointCloudIncludeNormals bool + func DefaultDecoderOptions() *DecoderOptions + func HDRDecoderOptions() *DecoderOptions + func LightFieldDecoderOptions() *DecoderOptions + func LowLatencyDecoderOptions() *DecoderOptions + type DefaultValidator struct + func (v *DefaultValidator) SafeAdd(a, b int) (int, error) + func (v *DefaultValidator) SafeMultiply(a, b int) (int, error) + func (v *DefaultValidator) ValidateCoefficient(value int) error + func (v *DefaultValidator) ValidateMarkerLength(length int, remaining int) error + func (v *DefaultValidator) ValidatePosition(pos int, maxPos int) error + func (v *DefaultValidator) ValidateSliceAccess(index int, sliceLen int) error + func (v *DefaultValidator) ValidateTableIndex(index int, maxIndex int) error + type DetectionResult struct + Data []byte + Error error + Format Format + Info *FormatInfo + func DetectFormatsConcurrently(files [][]byte) []DetectionResult + func DetectFormatsWithInfoConcurrently(files [][]byte) []DetectionResult + type DifferentialEncodingMode int + const DifferentialSequential + type DifferentialLosslessEncoder struct + func NewDifferentialLosslessArithmeticEncoder(opts *EncoderOptions) *DifferentialLosslessEncoder + func NewDifferentialLosslessEncoder(opts *EncoderOptions) *DifferentialLosslessEncoder + func (e *DifferentialLosslessEncoder) Encode(img *ImageData) ([]byte, error) + func (e *DifferentialLosslessEncoder) EncodeImage(img image.Image) ([]byte, error) + func (e *DifferentialLosslessEncoder) Format() Format + func (e *DifferentialLosslessEncoder) Predictor() int + func (e *DifferentialLosslessEncoder) SetHierarchyOptions(opts *HierarchicalOptions) + func (e *DifferentialLosslessEncoder) SetLosslessOptions(opts *LosslessOptions) + func (e *DifferentialLosslessEncoder) SetPredictor(predictor int) error + func (e *DifferentialLosslessEncoder) SetQuality(_ int) error + type DifferentialProgressiveEncoder struct + func NewDifferentialProgressiveArithmeticEncoder(opts *EncoderOptions) *DifferentialProgressiveEncoder + func NewDifferentialProgressiveEncoder(opts *EncoderOptions) *DifferentialProgressiveEncoder + func (e *DifferentialProgressiveEncoder) Encode(img *ImageData) ([]byte, error) + func (e *DifferentialProgressiveEncoder) EncodeImage(img image.Image) ([]byte, error) + func (e *DifferentialProgressiveEncoder) Format() Format + func (e *DifferentialProgressiveEncoder) SetHierarchyOptions(opts *HierarchicalOptions) + func (e *DifferentialProgressiveEncoder) SetQuality(quality int) error + func (e *DifferentialProgressiveEncoder) SetScanScript(script *ScanScript) + type DifferentialSequentialEncoder struct + func NewDifferentialSequentialArithmeticEncoder(opts *EncoderOptions) *DifferentialSequentialEncoder + func NewDifferentialSequentialEncoder(opts *EncoderOptions) *DifferentialSequentialEncoder + func (e *DifferentialSequentialEncoder) Encode(img *ImageData) ([]byte, error) + func (e *DifferentialSequentialEncoder) EncodeImage(img image.Image) ([]byte, error) + func (e *DifferentialSequentialEncoder) Format() Format + func (e *DifferentialSequentialEncoder) SetHierarchyOptions(opts *HierarchicalOptions) + func (e *DifferentialSequentialEncoder) SetQuality(quality int) error + type EXIFMetadataParser interface + Parse func(data []byte) (*exif.Data, error) + type EXIFParser struct + func NewEXIFParser() *EXIFParser + func (p *EXIFParser) Parse(data []byte) (*exif.Data, error) + type Encoder interface + Encode func(img *ImageData) ([]byte, error) + EncodeImage func(img image.Image) ([]byte, error) + Format func() Format + SetQuality func(quality int) error + func NewEncoder(format Format, opts *EncoderOptions) (Encoder, error) + type EncoderBitWriter struct + func NewEncoderBitWriter(w io.Writer) *EncoderBitWriter + func (bw *EncoderBitWriter) BytesWritten() int + func (bw *EncoderBitWriter) Error() error + func (bw *EncoderBitWriter) Flush() error + func (bw *EncoderBitWriter) Reset() + func (bw *EncoderBitWriter) WriteBits(bits uint32, n int) error + func (bw *EncoderBitWriter) WriteByteAligned(b byte) error + type EncoderComponentSpec struct + ACTableID int + DCTableID int + HSampling int + ID int + QuantTableID int + VSampling int + func Get420ComponentSpecs() []EncoderComponentSpec + func Get422ComponentSpecs() []EncoderComponentSpec + func Get444ComponentSpecs() []EncoderComponentSpec + func GetGrayscaleComponentSpecs() []EncoderComponentSpec + type EncoderDetector interface + DetectEncoder func(data []byte) (*EncoderSignature, error) + DetectEncoderFromTables func(tables map[int][64]int) (*EncoderSignature, error) + func NewEncoderDetector(validator SecurityValidator) EncoderDetector + type EncoderError struct + Cause error + Format Format + Message string + Phase string + func NewEncoderError(format Format, phase, message string, cause error) *EncoderError + func (e *EncoderError) Error() string + func (e *EncoderError) Is(target error) bool + func (e *EncoderError) Unwrap() error + type EncoderFamily int + const EncoderApple + const EncoderCanon + const EncoderF5James + const EncoderLibJPEG + const EncoderMozJPEG + const EncoderNikon + const EncoderPhotoshop + const EncoderSamsung + const EncoderSony + const EncoderUnknown + func DetectEncoderFromAllSources(data []byte, tables map[int][64]int) (EncoderFamily, float64) + func MatchCameraSignature(table [64]int) (EncoderFamily, float64) + func (e EncoderFamily) String() string + type EncoderOptions struct + ChromaSubsampling ChromaSubsampling + ChrominanceQuantTable *[BlockSize2]int + Comment string + DisableComment bool + Lossless bool + LuminanceQuantTable *[BlockSize2]int + OptimizeHuffman bool + Progressive bool + Quality int + RestartInterval int + func DefaultEncoderOptions() *EncoderOptions + type EncoderQualityMapping struct + Curve QualityCurve + Name string + ScaleMax int + ScaleMin int + UsesLibjpegScale bool + type EncoderSignature struct + Confidence float64 + DetectedPatterns []string + EncoderFamily string + EncoderName string + EncoderVersion string + MatchMethod string + TableSignatureHash string + type EncoderWithConfig interface + type EncoderWithValidation interface + type EstimationMethod int + const EstimationMethodDCTHistogram + const EstimationMethodLeastSquares + const EstimationMethodScaleFactor + func (m EstimationMethod) String() string + type EventStreamDecoder interface + DecodeEvents func(r io.Reader) ([]VisualEvent, *EventStreamInfo, error) + type EventStreamInfo struct + EndTimestamp uint64 + EventCount uint64 + Height int + SensorType string + StartTimestamp uint64 + Width int + type EventStreamResult struct + Duration uint64 + Events []VisualEventData + SensorHeight int + SensorWidth int + type ExtendedEncoder struct + func NewExtended12BitEncoder(opts *EncoderOptions) *ExtendedEncoder + func NewExtendedEncoder(opts *EncoderOptions) *ExtendedEncoder + func (e *ExtendedEncoder) Encode(img *ImageData) ([]byte, error) + func (e *ExtendedEncoder) EncodeImage(img image.Image) ([]byte, error) + func (e *ExtendedEncoder) Format() Format + func (e *ExtendedEncoder) Precision() int + func (e *ExtendedEncoder) SetPrecision(precision int) error + func (e *ExtendedEncoder) SetQuality(quality int) error + type Format int + const FormatArithmeticLossless + const FormatArithmeticProgressive + const FormatArithmeticSequential + const FormatBaselineJPEG + const FormatDiffArithLossless + const FormatDiffArithProgressive + const FormatDiffArithSequential + const FormatDifferentialLossless + const FormatDifferentialProgressive + const FormatDifferentialSequential + const FormatExtendedJPEG + const FormatHTJ2K + const FormatJLINK + const FormatJP3D + const FormatJPEG2000 + const FormatJPEG360 + const FormatJPEGAI + const FormatJPEGLS + const FormatJPEGLS_T870 + const FormatJPEGPlenoHolography + const FormatJPEGPlenoLightField + const FormatJPEGPlenoPointCloud + const FormatJPEGTrust + const FormatJPEGXE + const FormatJPEGXL + const FormatJPEGXR + const FormatJPEGXS + const FormatJPEGXT + const FormatJPIP + const FormatJPM + const FormatJPSEC + const FormatJPWL + const FormatJPX + const FormatJUMBF + const FormatLosslessJPEG + const FormatMJ2 + const FormatProgressiveJPEG + const FormatUnknown + func DetectAndDecode(r io.Reader) (img image.Image, format Format, err error) + func DetectFormat(data []byte) (Format, error) + func SupportedFormats() []Format + func (f Format) Info() BasicFormatInfo + func (f Format) Is3D() bool + func (f Format) IsDifferential() bool + func (f Format) IsEventBased() bool + func (f Format) IsHDR() bool + func (f Format) IsJPEG2000Family() bool + func (f Format) IsLossy() bool + func (f Format) IsLowLatency() bool + func (f Format) IsMetadataFormat() bool + func (f Format) IsNeuralBased() bool + func (f Format) IsNextGen() bool + func (f Format) IsPlenoptic() bool + func (f Format) IsProgressive() bool + func (f Format) IsSecure() bool + func (f Format) String() string + func (f Format) UsesArithmeticCoding() bool + type FormatAnalyzer interface + Analyze func(data []byte) (*FormatInfo, error) + func DefaultFormatAnalyzer() FormatAnalyzer + type FormatDetector interface + Detect func(data []byte) (Format, error) + func DefaultFormatDetector() FormatDetector + type FormatInfo struct + BitsPerSample int + Components int + Format Format + Has360Metadata bool + HasHDR bool + HasJUMBF bool + HasLinks bool + HasThumbnail bool + HasTrust bool + Height int + IsJPEG2000 bool + IsJPEG2000Ext bool + IsJPEGAI bool + IsJPEGPleno bool + IsJPEGXE bool + IsJPEGXS bool + IsJPEGXT bool + Width int + func DetectFormatInfo(data []byte) (*FormatInfo, error) + type FrameDifferencer struct + Differential *ImageData + Reference *ImageData + Target *ImageData + func NewFrameDifferencer(reference, target *ImageData) (*FrameDifferencer, error) + func (fd *FrameDifferencer) ComputeDifferential() (*ImageData, error) + type FullEncoder interface + type HDRDecodeMetadata struct + DynamicRange float64 + MaxLuminance float64 + MinLuminance float64 + Profile int + ToneMapOperator string + type HDRDecoder interface + DecodeHDR func(r io.Reader) ([]float32, *HDRMetadata, error) + type HDREncoder interface + EncodeHDR func(w io.Writer, pixels []float32, metadata *HDRMetadata) (int, error) + type HDRInfoProvider interface + GetHDRInfo func(data []byte) (*HDRMetadata, error) + type HDRMetadata struct + BitDepth int + DynamicRange float64 + IsFloatingPoint bool + MaxLuminance float64 + MinLuminance float64 + Profile int + RefinementLayers int + ToneMapOperator string + type HDROutputMode int + const HDROutputFloat32 + const HDROutputSDR + const HDROutputUint16 + func (h HDROutputMode) String() string + type HashLookupResult struct + EncoderFamily string + Quality int + TableType TableType + type HierarchicalFrameStructure struct + Levels []*HierarchicalLevel + Options *HierarchicalOptions + Original *ImageData + func NewHierarchicalFrameStructure(img *ImageData, opts *HierarchicalOptions) (*HierarchicalFrameStructure, error) + type HierarchicalFrameType int + const FrameTypeDifferential + const FrameTypeNonDifferential + type HierarchicalLevel struct + Data *ImageData + FrameType HierarchicalFrameType + Height int + ScaleFactor int + Width int + type HierarchicalOptions struct + BaseEncodingMode DifferentialEncodingMode + NumberOfLevels int + UseArithmetic bool + func DefaultHierarchicalOptions() *HierarchicalOptions + type HistogramBucket struct + Count int + RangeMax int + RangeMin int + type HologramData struct + ComplexData []complex64 + Height int + IsBinary bool + PixelPitch float64 + RealData []float32 + Wavelength float64 + Width int + type HologramDecoder interface + DecodeHologram func(r io.Reader) (*HologramData, error) + type HuffTable struct + BITS [17]int + CODE int + HUFFCODE [257]int + HUFFSIZE [257]int + HUFFVAL [256]int + I int + J int + K int + LASTK int + Ln int + MAXCODE [18]int + MINCODE [17]int + SI int + VALPTR [17]int + func NewHuffTable(reader ByteReader) *HuffTable + type HuffmanAnalysisResult struct + Confidence float64 + DetectedPatterns []string + HasCustomTables bool + IsOptimized bool + IsStandardAC bool + IsStandardDC bool + type HuffmanBlockEncoder struct + func NewHuffmanBlockEncoder(w io.Writer, dcTable, acTable *HuffmanEncoderTable) *HuffmanBlockEncoder + func (e *HuffmanBlockEncoder) BytesWritten() int + func (e *HuffmanBlockEncoder) EncodeBlock(block *[BlockSize2]int, prevDC int) (int, error) + func (e *HuffmanBlockEncoder) Flush() error + type HuffmanDecode struct + Nf int + X int + Y int + func NewHuffmanDecode(data []byte, reader ByteReader) *HuffmanDecode + func NewHuffmanDecodeForCoefficients(data []byte, reader ByteReader) *HuffmanDecode + func NewHuffmanDecodeForQTable(data []byte, reader ByteReader) *HuffmanDecode + func (h *HuffmanDecode) Decode() ([]int, error) + func (h *HuffmanDecode) GetComponentCount() int + func (h *HuffmanDecode) GetImageHeight() int + func (h *HuffmanDecode) GetImageWidth() int + func (h *HuffmanDecode) GetQuantTableIDs() []int + func (h *HuffmanDecode) GetQuantizationTables() map[int][64]int + func (h *HuffmanDecode) GetSamplingFactors() (horizontal, vertical []int) + type HuffmanDecoder interface + Decode func() ([]int, error) + GetQuantizationTables func() map[int][64]int + type HuffmanEncoderCode struct + Code uint16 + Size byte + type HuffmanEncoderTable struct + Bits [16]int + TableClass int + TableID int + Values []byte + func GenerateEncoderHuffmanTable(frequencies [256]int, class, id int) *HuffmanEncoderTable + func NewHuffmanEncoderTable(bits [16]int, values []byte, class, id int) *HuffmanEncoderTable + func NewStandardEncoderACChrominanceTable() *HuffmanEncoderTable + func NewStandardEncoderACLuminanceTable() *HuffmanEncoderTable + func NewStandardEncoderDCChrominanceTable() *HuffmanEncoderTable + func NewStandardEncoderDCLuminanceTable() *HuffmanEncoderTable + func (h *HuffmanEncoderTable) Encode(symbol byte) HuffmanEncoderCode + func (h *HuffmanEncoderTable) GetCode(symbol byte) (code uint16, size byte) + type HuffmanFrequencyCounter struct + ACFreq [256]int + DCFreq [256]int + func NewHuffmanFrequencyCounter() *HuffmanFrequencyCounter + func (fc *HuffmanFrequencyCounter) CountBlock(block *[BlockSize2]int, prevDC int) int + func (fc *HuffmanFrequencyCounter) GenerateACTable(class, id int) *HuffmanEncoderTable + func (fc *HuffmanFrequencyCounter) GenerateDCTable(class, id int) *HuffmanEncoderTable + type HuffmanSignatureAnalyzer struct + func NewHuffmanSignatureAnalyzer() *HuffmanSignatureAnalyzer + func (a *HuffmanSignatureAnalyzer) AnalyzeHuffmanTables(dhtSegments []*DHTSegment) *HuffmanAnalysisResult + type HuffmanSpec struct + Bits [16]int + Class int + ID int + Values []byte + func GetStandardHuffmanSpecs() []HuffmanSpec + type HuffmanTableInfo struct + Class int + ID int + SymbolCounts [16]int + Symbols []byte + type ImageData struct + BitsPerSample int + ColorSpace ColorSpace + Height int + Pixels []byte + Stride int + Width int + func NewImageData(width, height int, colorSpace ColorSpace) *ImageData + func NewImageDataFromImage(img image.Image) *ImageData + func NewImageDataSafe(width, height int, colorSpace ColorSpace) (*ImageData, error) + func (img *ImageData) GetPixel(x, y int) []byte + func (img *ImageData) SetPixel(x, y int, values []byte) + type ImageDecoder interface + Decode func(data []byte) (image.Image, error) + func NewImageDecoder() ImageDecoder + type ImageInfo struct + BitDepth int + Format Format + HasHDR bool + Height int + IsLowLatency bool + NumChannels int + Width int + func DecodeInfo(r io.Reader) (info *ImageInfo, err error) + type ImageReconstructor struct + func NewImageReconstructor(subsampling ChromaSubsampling, quantTables map[int][BlockSize2]int) *ImageReconstructor + func (ir *ImageReconstructor) GetComponentReconstructor(component int) *ComponentReconstructor + func (ir *ImageReconstructor) GetMCUProcessor() *MCUProcessor + func (ir *ImageReconstructor) GetQuantTable(tableID int) *[BlockSize2]int + func (ir *ImageReconstructor) ResetAtRestartMarker() + type InferenceEngine interface + GetModelInfo func() (*ModelInfo, error) + Infer func(latentData []float32) ([]float32, error) + type JP2Box struct + Data []byte + Length int64 + Position int64 + Type string + type JP2BoxReader interface + EnterSuperBox func(box *JP2Box) error + ExitSuperBox func() error + Position func() int64 + ReadBox func() (*JP2Box, error) + ReadBoxData func(box *JP2Box) ([]byte, error) + Remaining func() int64 + func NewJP2BoxReader(data []byte) JP2BoxReader + type JUMBFBox struct + Children []JUMBFBox + ContentType string + Data []byte + ID uint32 + Label string + Type [4]byte + type JUMBFReader interface + FindBoxByType func(data []byte, boxType [4]byte) ([]*JUMBFBox, error) + ReadBox func(data []byte) (*JUMBFBox, error) + type LightFieldDecodeMetadata struct + AngularPrecision float64 + BaselineU float64 + BaselineV float64 + UCount int + VCount int + type LightFieldDecoder interface + DecodeView func(u, v int) (*LightFieldView, error) + GetViewCount func() (uCount, vCount int, err error) + type LightFieldView struct + Height int + Pixels []byte + U int + V int + Width int + type LightFieldViewMode int + const LightFieldViewAll + const LightFieldViewCenter + const LightFieldViewSpecific + func (l LightFieldViewMode) String() string + type LineBufferDecoder interface + BufferLine func(lineData []byte) error + BufferedLines func() int + FlushLine func() ([]byte, error) + type LosslessEncoderImpl struct + func NewLosslessEncoder(opts *EncoderOptions) *LosslessEncoderImpl + func NewLosslessEncoderWithOptions(opts *EncoderOptions, losslessOpts *LosslessOptions) *LosslessEncoderImpl + func NewLosslessEncoderWithPredictor(opts *EncoderOptions, predictor int) *LosslessEncoderImpl + func (e *LosslessEncoderImpl) Encode(img *ImageData) ([]byte, error) + func (e *LosslessEncoderImpl) EncodeImage(img image.Image) ([]byte, error) + func (e *LosslessEncoderImpl) Format() Format + func (e *LosslessEncoderImpl) PointTransform() int + func (e *LosslessEncoderImpl) Precision() int + func (e *LosslessEncoderImpl) Predictor() int + func (e *LosslessEncoderImpl) SetPointTransform(pt int) error + func (e *LosslessEncoderImpl) SetPrecision(precision int) error + func (e *LosslessEncoderImpl) SetPredictor(predictor int) error + func (e *LosslessEncoderImpl) SetQuality(_ int) error + type LosslessOptions struct + PointTransform int + Precision int + Predictor int + func DefaultLosslessOptions() *LosslessOptions + type LowLatencyDecoder interface + DecodeLine func(lineNumber int) ([]byte, error) + type LowLatencyEncoder interface + EncodeLine func(lineNumber int, pixels []byte) ([]byte, error) + type MCUProcessor struct + func NewMCUProcessor(subsampling ChromaSubsampling) *MCUProcessor + func NewMCUProcessorFromSamplingFactors(hSampleY, vSampleY, hSampleC, vSampleC int) *MCUProcessor + func (mcu *MCUProcessor) BlocksPerMCU() (yBlocks, cbBlocks, crBlocks int) + func (mcu *MCUProcessor) CalculateMCUCount(imageWidth, imageHeight int) (mcuCols, mcuRows int) + func (mcu *MCUProcessor) GetSamplingFactors() (hY, vY, hC, vC int) + func (mcu *MCUProcessor) MCUPixelSize() (width, height int) + func (mcu *MCUProcessor) Subsampling() ChromaSubsampling + type Marker = markers.Marker + type MarkerParser struct + func NewMarkerParser(_ ByteReader) *MarkerParser + func (p *MarkerParser) Parse(data []byte) ([]Marker, error) + type MarkerParserInterface interface + Parse func(data []byte) ([]Marker, error) + type MarkerReader interface + Position func() int + ReadMarker func() (byte, error) + ReadSegment func(length int) ([]byte, error) + ReadSegmentLength func() (int, error) + Remaining func() int + Skip func(n int) error + func NewMarkerReader(data []byte) MarkerReader + type ModelInfo struct + InputSize [4]int + Name string + OutputSize [4]int + Precision string + Version string + type ModelLoader interface + IsModelLoaded func() bool + LoadModel func(path string) (*ModelInfo, error) + UnloadModel func() error + type MultiAlgorithmEstimator struct + func NewMultiAlgorithmEstimator(config *AlgorithmConfig) *MultiAlgorithmEstimator + func (m *MultiAlgorithmEstimator) EstimateQuality(data []byte) (*QualityEstimate, error) + func (m *MultiAlgorithmEstimator) EstimateQualityFromTables(tables map[int][64]int) (*QualityEstimate, error) + type NeuralDecoder interface + DecodeNeural func(r io.Reader) ([]byte, error) + type NopLogger struct + func (l *NopLogger) Debug(_ string, _ ...any) + func (l *NopLogger) Error(_ string, _ ...any) + func (l *NopLogger) Fatal(_ string, _ ...any) + func (l *NopLogger) Info(_ string, _ ...any) + func (l *NopLogger) Warn(_ string, _ ...any) + type OverflowError struct + Cause error + Context string + Operand1 int64 + Operand2 int64 + Operation string + func NewOverflowError(operation string, op1, op2 int64, context string) *OverflowError + func (e *OverflowError) Error() string + func (e *OverflowError) Is(target error) bool + func (e *OverflowError) Unwrap() error + type ParseError struct + Cause error + Marker byte + Message string + Position int + func (e *ParseError) Error() string + func (e *ParseError) Unwrap() error + type PatternDetectionResult struct + Confidence float64 + DetectedPatterns []string + DetectedQuality int + EncoderFamily string + EncoderName string + type PatternMatcher interface + Match func(tables map[int][64]int, hints *APPMarkerHints) *PatternDetectionResult + Name func() string + Priority func() int + func GetRegisteredPatternMatchers() []PatternMatcher + type Point3D struct + B uint8 + G uint8 + NX float32 + NY float32 + NZ float32 + R uint8 + X float32 + Y float32 + Z float32 + type PointCloudData struct + BoundingBox struct{ ... } + HasColor bool + HasNormals bool + Points []Point3D + type PointCloudDecoder interface + DecodePointCloud func(r io.Reader) (*PointCloudData, error) + type PointCloudOutputFormat int + const PointCloudPLY + const PointCloudRaw + const PointCloudXYZ + func (p PointCloudOutputFormat) String() string + type PointCloudResult struct + BoundingBox struct{ ... } + Colors [][3]uint8 + HasColors bool + HasNormals bool + Normals [][3]float32 + Points [][3]float32 + type ProgressiveEncoderImpl struct + func NewProgressiveEncoder(opts *EncoderOptions) *ProgressiveEncoderImpl + func NewProgressiveEncoderWithScript(opts *EncoderOptions, script *ScanScript) *ProgressiveEncoderImpl + func (e *ProgressiveEncoderImpl) Encode(img *ImageData) ([]byte, error) + func (e *ProgressiveEncoderImpl) EncodeCoefficients(coefficients []int, meta *CoeffEncoderMetadata) ([]byte, error) + func (e *ProgressiveEncoderImpl) EncodeImage(img image.Image) ([]byte, error) + func (e *ProgressiveEncoderImpl) Format() Format + func (e *ProgressiveEncoderImpl) SetQuality(quality int) error + func (e *ProgressiveEncoderImpl) SetScanScript(script *ScanScript) + type ProgressiveScanAnalyzer struct + func NewProgressiveScanAnalyzer() *ProgressiveScanAnalyzer + func (a *ProgressiveScanAnalyzer) AnalyzeScanPatterns(sosSegments []*SOSSegment) *ProgressiveScanResult + type ProgressiveScanResult struct + Confidence float64 + EncoderHints []string + Patterns []ScanPattern + ScanCount int + Strategy string + type ProvenanceChecker interface + GetProvenance func(data []byte) ([]ProvenanceRecord, error) + HasProvenance func(data []byte) bool + type ProvenanceRecord struct + Action string + Actor string + Description string + Software string + Timestamp int64 + type QCDMarker struct + GuardBits int + QuantizationStyle byte + StepSizes []float64 + type QualityConfidenceBreakdown struct + AlgorithmAgreement float64 + EncoderDetection float64 + TableMatch float64 + type QualityConfidenceCalculator struct + func NewQualityConfidenceCalculator() *QualityConfidenceCalculator + func (c *QualityConfidenceCalculator) CalculateAlgorithmAgreementConfidence(results []AlgorithmResult) float64 + func (c *QualityConfidenceCalculator) CalculateEncoderConfidenceContribution(encoderConf float64, detected bool) float64 + func (c *QualityConfidenceCalculator) CalculateMultiFactorConfidence(tableMatchConf, algorithmAgree, encoderConf float64, encoderDetected bool) float64 + func (c *QualityConfidenceCalculator) CalculateTableMatchConfidence(rmse float64, isStandard bool) float64 + func (c *QualityConfidenceCalculator) Handle16BitPrecision(table [64]int, precision int) [64]int + func (c *QualityConfidenceCalculator) HandleAllMaxTable(table [64]int) (quality int, confidence float64) + func (c *QualityConfidenceCalculator) HandleAllOnesTable(table [64]int) (quality int, confidence float64) + func (c *QualityConfidenceCalculator) HandleProgressivePartialData(data []byte) (*QualityEstimate, error) + func (c *QualityConfidenceCalculator) IsCustomTable(table [64]int) bool + func (c *QualityConfidenceCalculator) IsProgressiveJPEG(data []byte) bool + func (c *QualityConfidenceCalculator) PopulateQualityConfidenceBreakdown(estimate *QualityEstimate, rmse float64, isStandard bool, ...) + type QualityCurve func(quality int) [64]int + type QualityEstimate struct + ChromaSubsampling ChromaSubsamplingMode + ChrominanceQuality int + Confidence float64 + ConfidenceBreakdown QualityConfidenceBreakdown + DCTAnalysisScore float64 + DetectedEncoder EncoderFamily + EncoderConfidence float64 + EncoderHint string + EstimationMethods []EstimationMethod + IsStandardTable bool + LuminanceQuality int + Method string + Quality int + RMSE float64 + ReEncodingLikelihood float64 + SSE float64 + func (q *QualityEstimate) IsHighConfidence() bool + func (q *QualityEstimate) IsReEncoded() bool + func (q *QualityEstimate) PrimaryMethod() EstimationMethod + type QualityEstimator interface + EstimateQuality func(data []byte) (*QualityEstimate, error) + EstimateQualityFromTables func(tables map[int][64]int) (*QualityEstimate, error) + func NewQualityEstimator(validator SecurityValidator) QualityEstimator + type QuantTableInfo struct + NaturalOrder [64]int + Precision int + ZigzagOrder [64]int + type QuantizationSignature struct + CharacteristicCoeffs []CoefficientRatio + DCRange [2]int + Family EncoderFamily + RatioTolerance float64 + TableHash uint64 + type Quantizer interface + Dequantize func(block *[BlockSize2]int) *[BlockSize2]float64 + Quantize func(block *[BlockSize2]float64) *[BlockSize2]int + Table func() *[BlockSize2]int + func NewChrominanceQuantizer(quality int) Quantizer + func NewLuminanceQuantizer(quality int) Quantizer + func NewQuantizer(table [BlockSize2]int) Quantizer + type RawAPPMarker struct + Data []byte + Identifier string + Type int + type SIZMarker struct + Capabilities uint16 + ComponentCount int + ComponentSpecs []ComponentSpec + Height int + TileHeight int + TileWidth int + TileXOffset int + TileYOffset int + Width int + XOffset int + YOffset int + type SOFComponent struct + HorizontalSampling int + ID int + QuantTableID int + VerticalSampling int + type SOFSegment struct + ComponentCount int + Components []SOFComponent + Height int + Precision int + Width int + type SOFType int + const SOFArithmeticDiffLossless + const SOFArithmeticDiffProgressive + const SOFArithmeticDiffSequential + const SOFArithmeticLossless + const SOFArithmeticProgressive + const SOFArithmeticSequential + const SOFBaseline + const SOFDifferentialLossless + const SOFDifferentialProgressive + const SOFDifferentialSequential + const SOFExtended + const SOFJPEGLS + const SOFLossless + const SOFProgressive + func (s SOFType) String() string + type SOFVariantHandler struct + func NewSOFVariantHandler() *SOFVariantHandler + func (h *SOFVariantHandler) AnalyzeVariant(sofType SOFType, precision int, dhtSegments []*DHTSegment, ...) *VariantInfo + type SOSComponent struct + ACTableSelector int + ComponentSelector int + DCTableSelector int + type SOSSegment struct + ComponentCount int + Components []SOSComponent + SpectralEnd int + SpectralStart int + SuccessiveHigh int + SuccessiveLow int + type SOTMarker struct + TileIndex int + TilePartCount int + TilePartIndex int + TilePartLength int64 + type SafeMath interface + SafeAdd func(a, b int) (int, bool) + SafeMultiply func(a, b int) (int, bool) + SafeSubtract func(a, b int) (int, bool) + type ScanComponent struct + ACTableID int + ComponentID int + DCTableID int + func Get420ScanComponents() []ScanComponent + func Get422ScanComponents() []ScanComponent + func Get444ScanComponents() []ScanComponent + func GetGrayscaleScanComponents() []ScanComponent + type ScanPattern struct + ComponentCount int + SpectralEnd int + SpectralStart int + SuccessiveHigh int + SuccessiveLow int + type ScanScript struct + Scans []ScanSpec + func DefaultScanScript(numComponents int) *ScanScript + func SimpleScanScript(numComponents int) *ScanScript + type ScanSpec struct + Components []int + SpectralEnd int + SpectralStart int + SuccApproxHigh int + SuccApproxLow int + type SecurityError struct + Cause error + Details string + ViolationType SecurityViolationType + func NewSecurityError(violationType SecurityViolationType, cause error) *SecurityError + func (e *SecurityError) Error() string + func (e *SecurityError) Unwrap() error + type SecurityValidator interface + CheckIteration func() error + Reset func() + ValidateAllocation func(size uint64) error + ValidateComponentCount func(count int) error + ValidateImageSize func(width, height int) error + ValidateSegmentLength func(length int) error + func NewSecurityValidator() SecurityValidator + func NewThreadSafeValidator(v SecurityValidator) SecurityValidator + type SecurityViolationType int + const InfiniteLoop + const MemoryExhaustion + const ViolationBufferOverflow + const ViolationInfiniteLoop + const ViolationIntegerOverflow + const ViolationInvalidMarker + const ViolationMalformedData + const ViolationResourceExhaustion + func (t SecurityViolationType) String() string + type SegmentParser interface + ParseAPP func(appType int, data []byte) (*APPSegment, error) + ParseDHT func(data []byte) (*DHTSegment, error) + ParseDQT func(data []byte) (*DQTSegment, error) + ParseSOF func(data []byte) (*SOFSegment, error) + ParseSOS func(data []byte) (*SOSSegment, error) + func DefaultSegmentParser() SegmentParser + func NewSegmentParser(validator SecurityValidator) SegmentParser + type Signature struct + APPMarkers map[int][]byte + Comments []string + EncoderHints *APPMarkerHints + HuffmanTables []HuffmanTableInfo + QuantTables map[int]QuantTableInfo + SOFInfo *SignatureSOFInfo + func ExtractSignature(data []byte) (*Signature, error) + type SignatureComponentInfo struct + HSampling int + ID int + QuantTableID int + VSampling int + type SignatureDatabase struct + func NewSignatureDatabase() *SignatureDatabase + func (db *SignatureDatabase) FindClosestMatch(table [64]int) (quality int, tableType TableType, sse int64, isExact bool) + func (db *SignatureDatabase) GetChrominanceTable(quality int) *[64]int + func (db *SignatureDatabase) GetLuminanceTable(quality int) *[64]int + func (db *SignatureDatabase) GetStandardChrominanceTable() [64]int + func (db *SignatureDatabase) GetStandardLuminanceTable() [64]int + func (db *SignatureDatabase) LookupByHash(hash string) *HashLookupResult + func (db *SignatureDatabase) LookupByTable(table [64]int) *TableLookupResult + func (db *SignatureDatabase) RegisterTableHash(hash string, encoderFamily string, quality int, tableType TableType) + type SignatureSOFInfo struct + Components []SignatureComponentInfo + Height int + Precision int + Width int + type SimpleDecoder interface + DecodeImage func() (image.Image, error) + GetImageInfo func() *ImageInfo + func NewSimpleDecoder(r io.Reader) (dec SimpleDecoder, err error) + func NewSimpleDecoderForFormat(r io.Reader, format Format) (dec SimpleDecoder, err error) + type StandardDecoder struct + func NewStandardDecoder() *StandardDecoder + func (s *StandardDecoder) EncodeCoefficients(coefficients []int) ([]byte, error) + func (s *StandardDecoder) EncodeCoefficientsWithOptions(coefficients []int, opts *EncoderOptions) ([]byte, error) + func (s *StandardDecoder) ExtractCoefficients(data []byte) ([]int, error) + func (s *StandardDecoder) GetComponentCount() int + func (s *StandardDecoder) GetImageDimensions() (width, height int) + func (s *StandardDecoder) GetMetadata() *CoeffEncoderMetadata + func (s *StandardDecoder) GetQuantizationTables() map[int][64]int + func (s *StandardDecoder) GetSamplingFactors() (horizontal, vertical []int) + func (s *StandardDecoder) GetSubsampling() ChromaSubsampling + type StreamingDecoder interface + FeedData func(data []byte) error + ReadFrame func() ([]byte, error) + StartStream func(width, height, bitDepth int) error + StopStream func() error + type StreamingEncoder interface + StartStream func(w io.Writer, width, height, bitDepth int) error + StopStream func() error + WriteFrame func(pixels []byte) error + type TableLookupResult struct + Confidence float64 + EncoderFamily string + IsExactMatch bool + Quality int + TableType TableType + type TableType int + const TableTypeChrominance + const TableTypeLuminance + func (t TableType) String() string + type ToneMapper interface + ToneMap func(hdrPixels []float32, metadata *HDRMetadata) ([]uint8, error) + type TransformError struct + BlockX int + BlockY int + Cause error + Message string + Transform string + func NewTransformError(transform string, blockX, blockY int, message string, cause error) *TransformError + func (e *TransformError) Error() string + func (e *TransformError) Unwrap() error + type TranslatorProvider interface + GetLocale func() string + HasKey func(key string) bool + SetLocale func(locale string) + Translate func(key string) string + TranslateWithArgs func(key string, args ...interface{}) string + func GetTranslator() TranslatorProvider + type TrustDecodeMetadata struct + Assertions []string + IsAIGenerated bool + IsSigned bool + ProvenanceChain []string + type TrustManifest struct + Assertions []string + HashMethod string + IsAIContent bool + Issuer string + Signature []byte + Version string + type TrustValidator interface + ValidateTrust func(data []byte) (*TrustManifest, error) + type UnifiedDecoder struct + func NewUnifiedDecoder() *UnifiedDecoder + func NewUnifiedDecoderWithOptions(opts *DecoderOptions) *UnifiedDecoder + func (d *UnifiedDecoder) Decode(data []byte) (*DecodeResult, error) + func (d *UnifiedDecoder) DecodeHDR(data []byte) ([]float32, *HDRDecodeMetadata, error) + func (d *UnifiedDecoder) DecodeLightField(data []byte) (map[[2]int]image.Image, *LightFieldDecodeMetadata, error) + func (d *UnifiedDecoder) DecodePointCloud(data []byte) (*PointCloudResult, error) + func (d *UnifiedDecoder) DecodeToImage(data []byte) (image.Image, error) + func (d *UnifiedDecoder) GetFormat(data []byte) (Format, error) + func (d *UnifiedDecoder) GetOptions() *DecoderOptions + func (d *UnifiedDecoder) SetOptions(opts *DecoderOptions) + type UpsamplingMode int + const UpsamplingBilinear + const UpsamplingNearestNeighbor + func (m UpsamplingMode) String() string + type Validatable interface + Validate func() error + type ValidationError struct + Cause error + Field string + Limit interface{} + Message string + Value interface{} + func NewValidationError(field, message string, cause error) *ValidationError + func (e *ValidationError) Error() string + func (e *ValidationError) Unwrap() error + type Validator interface + SafeAdd func(a, b int) (int, error) + SafeMultiply func(a, b int) (int, error) + ValidateCoefficient func(value int) error + ValidateMarkerLength func(length int, remaining int) error + ValidatePosition func(pos int, maxPos int) error + ValidateSliceAccess func(index int, sliceLen int) error + ValidateTableIndex func(index int, maxIndex int) error + func NewValidator() Validator + type VariantInfo struct + IsArithmetic bool + IsLossless bool + IsProgressive bool + Precision int + SOFType SOFType + ScanCount int + ScanPatterns []ScanPattern + SupportLevel string + VariantSpecificHints []string + type VisualEvent struct + Polarity int8 + Timestamp uint64 + X uint16 + Y uint16 + type VisualEventData struct + Polarity int8 + Timestamp uint64 + X uint16 + Y uint16 + type WorkerPool interface + Shutdown func() + Submit func(job func()) + Wait func() + WorkerCount func() int + func NewWorkerPool(workers int) WorkerPool