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 HeaderSize + const MaxCoordinate + const SignatureJPEGXE + const Version1 + var ErrCoordinateError = errors.New("event coordinate error") + var ErrDimensionError = errors.New("invalid sensor dimensions") + var ErrEntropyDecodingError = errors.New("entropy decoding error") + var ErrInvalidContext = errors.New("invalid coding context") + var ErrInvalidESPPacket = errors.New("invalid ESP packet") + var ErrInvalidEventStream = errors.New("invalid event stream") + var ErrInvalidHeader = errors.New("invalid JPEG XE header") + var ErrPolarityError = errors.New("event polarity decoding error") + var ErrStreamLimitExceeded = errors.New("event stream size limit exceeded") + var ErrTimestampDeltaExceeded = errors.New("timestamp delta limit exceeded") + var ErrTimestampError = errors.New("event timestamp error") + var ErrTooManyEvents = errors.New("too many events in frame") + var ErrTruncatedStream = errors.New("truncated event stream") + var ErrUnsupportedVersion = errors.New("unsupported JPEG XE version") + func ValidateEventStream(data []byte) error + type CodingMode uint8 + const CodingModeDifferential + const CodingModeEntropy + const CodingModeRaw + const CodingModeSpatialPrediction + func (m CodingMode) String() string + type Decoder struct + func NewDecoder(data []byte) (*Decoder, error) + func NewDecoderWithOptions(data []byte, options *DecoderOptions) (*Decoder, error) + func (d *Decoder) Decode() (*EventStream, error) + func (d *Decoder) DecodeToFrames(frameDuration int64) ([]*EventFrame, error) + func (d *Decoder) GetHeader() *StreamHeader + type DecoderOptions struct + FrameDuration int64 + MaxEvents int + ValidateTimestamps bool + func DefaultDecoderOptions() *DecoderOptions + type DifferentialDecoder struct + func NewDifferentialDecoder() *DifferentialDecoder + func (d *DifferentialDecoder) DecodeTimestamp(encoded int64) int64 + func (d *DifferentialDecoder) DecodeTimestamps(encoded []int64) []int64 + func (d *DifferentialDecoder) Reset() + type DifferentialEncoder struct + func NewDifferentialEncoder() *DifferentialEncoder + func (e *DifferentialEncoder) EncodeTimestamp(timestamp int64) int64 + func (e *DifferentialEncoder) EncodeTimestamps(timestamps []int64) []int64 + func (e *DifferentialEncoder) Reset() + type ESPPacket struct + Events []Event + Flags uint8 + PacketType ESPPacketType + Reserved [2]byte + SequenceNumber uint16 + Timestamp int64 + func (p *ESPPacket) Validate() error + type ESPPacketType uint8 + const ESPPacketTypeConfig + const ESPPacketTypeEvent + const ESPPacketTypeStatus + const ESPPacketTypeSync + func (t ESPPacketType) String() string + type EntropyDecoder struct + func NewEntropyDecoder(data []byte) *EntropyDecoder + func (d *EntropyDecoder) DecodeResidual() (EventResidual, error) + func (d *EntropyDecoder) HasMore() bool + type EntropyEncoder struct + func NewEntropyEncoder() *EntropyEncoder + func (e *EntropyEncoder) EncodeResidual(r EventResidual) + func (e *EntropyEncoder) Finalize() []byte + type Event struct + Polarity EventPolarity + Timestamp int64 + X uint16 + Y uint16 + func (e *Event) Validate(width, height int) error + type EventFrame struct + EndTimestamp int64 + Events []Event + FrameIndex int + Height int + StartTimestamp int64 + Width int + func NewEventFrame(index int, start, end int64, width, height int) (*EventFrame, error) + func (f *EventFrame) AddEvent(e Event) error + func (f *EventFrame) GetDuration() int64 + type EventPolarity uint8 + const PolarityOFF + const PolarityON + func (p EventPolarity) IsValid() bool + func (p EventPolarity) String() string + type EventResidual struct + Polarity EventPolarity + Timestamp int64 + X uint16 + Y uint16 + type EventStream struct + EndTimestamp int64 + Events []Event + Height int + StartTimestamp int64 + TotalDuration int64 + Width int + func NewEventStream(width, height int) (*EventStream, error) + func (s *EventStream) AddEvent(e Event) error + func (s *EventStream) GetEventCount() int + func (s *EventStream) GetEventRate() float64 + func (s *EventStream) Validate() error + type LosslessCodec struct + func NewLosslessCodec(width, height int) *LosslessCodec + func (c *LosslessCodec) Decode(data []byte, count int) ([]Event, error) + func (c *LosslessCodec) Encode(events []Event) ([]byte, error) + type SpatialPredictor struct + func NewSpatialPredictor(width, height int) *SpatialPredictor + func (p *SpatialPredictor) Decode(residual EventResidual) Event + func (p *SpatialPredictor) Encode(event Event) EventResidual + func (p *SpatialPredictor) Reset() + type StreamHeader struct + DurationMicros int64 + EventCount uint32 + Flags uint8 + Reserved [8]byte + SensorHeight uint16 + SensorWidth uint16 + Signature [4]byte + TimestampResolution uint32 + Version uint8 + func ParseEventStreamHeader(data []byte) (*StreamHeader, error) + func (h *StreamHeader) GetSensorDimensions() (int, int, error) + func (h *StreamHeader) IsValid() bool + func (h *StreamHeader) Validate() error