Skip to content

Commit

Permalink
WIP: add XV15
Browse files Browse the repository at this point in the history
  • Loading branch information
tomba committed Nov 7, 2024
1 parent 4654796 commit dc44784
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion pixutils/formats/pixelformats.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class PixelFormatPlaneInfo(NamedTuple):
bytespergroup: int
# plane's lines in a group
linespergroup: int
# subsampling
hsub: int
vsub: int


class PixelFormat:
Expand All @@ -35,7 +38,13 @@ def __init__(self, name: str,
self.packed = packed
# pixel group size (width-in-pixels, height-in-lines)
self.group_size = group_size
self.planes = [PixelFormatPlaneInfo(*p) for p in planes]

def adjust_p(p):
if len(p) == 2:
return (p[0], p[1], 1, 1)
return p

self.planes = [PixelFormatPlaneInfo(*adjust_p(p)) for p in planes]

def __str__(self):
return self.name
Expand Down Expand Up @@ -279,6 +288,15 @@ def get_formats():
( ( 4, 1 ), ),
)

XV15 = PixelFormat('XV15',
'XV15', None,
PixelColorEncoding.YUV,
False,
( 6, 2 ),
( ( 8, 2, 1, 1, ),
( 8, 1, 2, 2, ), ),
)

# YUV 4:4:4

VUY888 = PixelFormat('VUY888',
Expand Down

0 comments on commit dc44784

Please sign in to comment.