filters

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFilters

func ExtractFilters(dict raw.Dictionary) ([]string, []raw.Dictionary)

ExtractFilters reads Filter and DecodeParms entries from a stream dictionary.

Types

type Decoder

type Decoder interface {
	Name() string
	Decode(ctx context.Context, input []byte, params raw.Dictionary) ([]byte, error)
}

func NewASCII85Decoder

func NewASCII85Decoder() Decoder

func NewASCIIHexDecoder

func NewASCIIHexDecoder() Decoder

func NewCCITTFaxDecoder

func NewCCITTFaxDecoder() Decoder

func NewCryptDecoder

func NewCryptDecoder() Decoder

func NewDCTDecoder

func NewDCTDecoder() Decoder

func NewFlateDecoder

func NewFlateDecoder() Decoder

func NewJBIG2Decoder

func NewJBIG2Decoder() Decoder

func NewJPXDecoder

func NewJPXDecoder() Decoder

func NewLZWDecoder

func NewLZWDecoder() Decoder

func NewRunLengthDecoder

func NewRunLengthDecoder() Decoder

type Limits

type Limits struct {
	MaxDecompressedSize int64
	MaxDecodeTime       time.Duration
}

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

func NewPipeline

func NewPipeline(decoders []Decoder, limits Limits) *Pipeline

NewPipeline constructs a pipeline with provided decoders and limits.

func (*Pipeline) Decode

func (p *Pipeline) Decode(ctx context.Context, input []byte, filterNames []string, params []raw.Dictionary) ([]byte, error)

func (*Pipeline) DecodeWithResolver

func (p *Pipeline) DecodeWithResolver(ctx context.Context, input []byte, filterNames []string, params []raw.Dictionary, resolver StreamResolver) ([]byte, error)

DecodeWithResolver decodes a stream using the provided filters and optional resolver.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func (*Registry) Get

func (r *Registry) Get(name string) (Decoder, bool)

func (*Registry) Register

func (r *Registry) Register(d Decoder)

type StreamResolver

type StreamResolver func(context.Context, raw.ObjectRef) ([]byte, error)

StreamResolver resolves referenced streams to decoded bytes for filters that need auxiliary data (e.g., JBIG2Globals).

type UnsupportedError

type UnsupportedError struct{ Filter string }

UnsupportedError reports a filter that is recognized but not implemented.

func (UnsupportedError) Error

func (e UnsupportedError) Error() string