2022-09-14 19:42:57 +00:00
|
|
|
package frame
|
|
|
|
|
2022-09-15 21:43:42 +00:00
|
|
|
import (
|
2022-11-11 06:30:58 +00:00
|
|
|
"git.gammaspectra.live/S.O.N.G/Ignite/color"
|
2022-11-10 12:01:35 +00:00
|
|
|
"git.gammaspectra.live/S.O.N.G/Ignite/utilities"
|
2022-09-15 21:43:42 +00:00
|
|
|
)
|
2022-09-14 19:42:57 +00:00
|
|
|
|
|
|
|
type AllowedFrameTypes interface {
|
|
|
|
uint8 | uint16
|
|
|
|
}
|
|
|
|
|
|
|
|
type Frame interface {
|
2022-11-10 12:01:35 +00:00
|
|
|
Properties() Properties
|
|
|
|
// PTS usually frame number
|
|
|
|
PTS() int64
|
2022-09-14 19:42:57 +00:00
|
|
|
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)
|
2022-11-11 06:30:58 +00:00
|
|
|
|
2022-11-11 08:49:05 +00:00
|
|
|
// GetNativeLuma also known as Y. Do not keep references to this slice, copy instead.
|
2022-09-14 19:42:57 +00:00
|
|
|
GetNativeLuma() []T
|
2022-11-11 08:49:05 +00:00
|
|
|
// GetNativeCb also known as U. Do not keep references to this slice, copy instead.
|
2022-09-14 19:42:57 +00:00
|
|
|
GetNativeCb() []T
|
2022-11-11 08:49:05 +00:00
|
|
|
// GetNativeCr also known as V. Do not keep references to this slice, copy instead.
|
2022-09-14 19:42:57 +00:00
|
|
|
GetNativeCr() []T
|
|
|
|
}
|
2022-11-10 12:01:35 +00:00
|
|
|
|
|
|
|
type Properties struct {
|
|
|
|
//TODO: HDR
|
|
|
|
Width int
|
|
|
|
Height int
|
|
|
|
PixelAspectRatio utilities.Ratio
|
2022-11-14 11:41:30 +00:00
|
|
|
ColorSpace color.Space
|
2022-11-10 12:01:35 +00:00
|
|
|
FullColorRange bool
|
|
|
|
}
|