alpha patterns
This commit is contained in:
@@ -18,3 +18,20 @@ func V210LineSize(width int) int {
|
||||
func V210FrameSize(width, height int) int {
|
||||
return V210LineSize(width) * height
|
||||
}
|
||||
|
||||
// AlphaLineSize returns the byte stride of one packed 10-bit alpha row. Each
|
||||
// little-endian 32-bit word contains three alpha samples and two unused bits.
|
||||
func AlphaLineSize(width int) int {
|
||||
return ((width + 2) / 3) * 4
|
||||
}
|
||||
|
||||
// AlphaFrameSize returns the size of the alpha plane in a v210a frame.
|
||||
func AlphaFrameSize(width, height int) int {
|
||||
return AlphaLineSize(width) * height
|
||||
}
|
||||
|
||||
// V210AFrameSize returns the total size of a v210a payload: the complete v210
|
||||
// fill plane followed by the complete packed 10-bit alpha plane.
|
||||
func V210AFrameSize(width, height int) int {
|
||||
return V210FrameSize(width, height) + AlphaFrameSize(width, height)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user