Instruction manual
HDE-3000 - 70 -
Image Data Section of a UYC File
The image data section contains all of the Y, C, and alpha data (see Converting RGB
to YCRCB that follows). The origin of the HDE-3000 coordinate system is the upper left
(line 0 is at the top and pixel 0 is at the left edge). The image data is arranged into lines
to facilitate faster transfer to the HDE-3000. Each line of image data consists of a line of
Y data, a line of C data, and a line of alpha data. The order of the lines of data is
dependent on the type of compression.
For uncompressed UYC files (compression = 0) the line of Y data is written first, then
the line of C data, then the line of alpha data. The following pseudo code illustrates how
to write an uncompressed UYC file.
write the file header
for L = 0 to (Y size - 1)
for P = 0 to ((X size/2) - 1)
write the Y data for line L and pixel pair P
next P
for P = 0 to ((X size/2) - 1)
write the C data for line L and pixel pair P
next P
for P = 0 to ((X size/2) - 1)
write the alpha data for line L and pixel pair P
next P
next L
For compressed UYC files (compression != 0) the line of alpha data is written first,
then the line of Y data, then the line of C data. Also each line of alpha, Y, and C data is
compressed to reduce file size (see Appendix B - UYC RLE Compression). For
simplicity, the compression is only applied to one line of data at a time so that the
decompression algorithm doesn’t have to find the boundaries between each line of
compressed data. The following pseudo code illustrates how to write a compressed
UYC file.
write the file header
for L = 0 to (Y size - 1)
compress the line of alpha data for line L
write the compressed line of alpha data
compress the line of Y data for line L
write the compressed line of Y data
compress the line of C data for line L
write the compressed line of C data
next L