-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
80 additions
and
60 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/python3 | ||
|
||
import gzip | ||
import numpy as np | ||
|
||
from pixutils.formats import PixelFormats | ||
from pixutils.conv import buffer_to_bgr888 | ||
|
||
WIDTH = 640 | ||
HEIGHT = 480 | ||
|
||
SEED = 1234 | ||
|
||
FMTS = [ | ||
PixelFormats.BGR888, | ||
PixelFormats.RGB888, | ||
PixelFormats.XBGR8888, | ||
PixelFormats.XRGB8888, | ||
|
||
PixelFormats.NV12, | ||
PixelFormats.UYVY, | ||
PixelFormats.YUYV, | ||
|
||
PixelFormats.SRGGB10, | ||
PixelFormats.SRGGB10P, | ||
PixelFormats.SRGGB12, | ||
PixelFormats.SRGGB16, | ||
PixelFormats.SRGGB8, | ||
] | ||
|
||
def main(): | ||
options = { | ||
'range': 'limited', | ||
'encoding': 'bt601', | ||
} | ||
|
||
for fmt in FMTS: | ||
rnd = np.random.default_rng(SEED) | ||
|
||
size = fmt.framesize(WIDTH, HEIGHT) | ||
|
||
buf = np.frombuffer(rnd.bytes(size), dtype=np.uint8) | ||
rgb = buffer_to_bgr888(fmt, WIDTH, HEIGHT, 0, buf, options) | ||
|
||
with gzip.open(f'{WIDTH}x{HEIGHT}-{fmt}.bin.gz', 'wb') as f: | ||
f.write(buf.tobytes()) | ||
|
||
with gzip.open(f'{WIDTH}x{HEIGHT}-{fmt}-BGR888.bin.gz', 'wb') as f: | ||
f.write(rgb.tobytes()) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters