[vtkusers] #Defines for Big or Little Endian
Sean McBride
sean at rogue-research.com
Fri Sep 1 10:56:53 EDT 2006
On 2006-08-31 16:35, Mike Jackson said:
>Is there a #define some where that I can use to test if I am running
>on a big or little endian machine?
>
>Beyond that, are there already methods some where that I have not
>found that will take a value, say UIn32 and swap the bytes to whatever
>the system is? Something like:
>
>ByteSwap::swapLEToSystem( UInt32 );
I believe vtkByteSwap is the only class that does anything like this.
You might want to search all the vtk code for "VTK_WORDS_BIGENDIAN" to
learn a little more about how vtk does swapping.
Personally, I find Apple's APIs are much better named, but I believe
vtkByteSwap::Swap4BE(), for example, swaps a 4 byte value from host to big.
--
____________________________________________________________
Sean McBride, B. Eng sean at rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
More information about the vtkusers
mailing list