home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
swCHIP 1991 January
/
swCHIP_95-1.bin
/
demo
/
wit4711
/
lib
/
help
/
io
/
swapbyte.
/
swapbyte.bin
Wrap
Text File
|
1995-12-09
|
907b
|
20 lines
OPERATOR
swapBytes --- swap low and high order bytes of an image
DESCRIPTION
The swapBytes operator takes a WiT image as input and outputs a WiT image of
the same type but has the low and high bytes/words swapped. The operator is
useful when WiT images are being processed on different architectures. On PCs,
an ordinary C int variable is stored in memory starting from the least
significant byte up to the most significant byte. On the other hand, Sun
Workstations store the same variable in memory starting from the most
significant byte down to the least significant byte.
For RGB and 8-bit images, swapBytes just outputs the same image as the input
image. No swapping is necessary. For 16-bit images, the operator swaps the
low and high bytes for each pixel. For float and complex images, the
operator reverse the order of the four bytes for each pixel.