Ignite/frame/frame.go

40 lines
952 B
Go

package frame
import (
"git.gammaspectra.live/S.O.N.G/Ignite/color"
"git.gammaspectra.live/S.O.N.G/Ignite/utilities"
)
type AllowedFrameTypes interface {
uint8 | uint16
}
type Frame interface {
Properties() Properties
// PTS usually frame number
PTS() int64
Get16(x, y int) (Y uint16, Cb uint16, Cr uint16)
Get8(x, y int) (Y uint8, Cb uint8, Cr uint8)
}
type TypedFrame[T AllowedFrameTypes] interface {
Frame
GetNative(x, y int) (Y T, Cb T, Cr T)
// GetNativeLuma also known as Y. Do not keep references to this slice, copy instead.
GetNativeLuma() []T
// GetNativeCb also known as U. Do not keep references to this slice, copy instead.
GetNativeCb() []T
// GetNativeCr also known as V. Do not keep references to this slice, copy instead.
GetNativeCr() []T
}
type Properties struct {
//TODO: HDR
Width int
Height int
PixelAspectRatio utilities.Ratio
ColorSpace color.Space
FullColorRange bool
}