home *** CD-ROM | disk | FTP | other *** search
- #ifndef __XBMPVT_H
- #define __XBMPVT_H
- //
- // Copyright (c) 1997,1998 Colosseum Builders, Inc.
- // All rights reserved.
- //
- // Colosseum Builders, Inc. makes no warranty, expressed or implied
- // with regards to this software. It is provided as is.
- //
- // See the README.TXT file that came with this software for restrictions
- // on the use and redistribution of this file or send E-mail to
- // info@colosseumbuilders.com
- //
-
- //
- // Title: XBM Decoder/Encoder Shared Functions
- //
- // Author: John M. Miano miano@colosseumbuilers.com
- //
-
- //
- // Description:
- //
- // This function exchanges the bits within a byte. The
- // most significant bit becomes least significant.
- //
- // The BitmapImage class stores bits from left to right
- // from high order to low order. The XBM format is the
- // opposite: Left is in the low order bits.
- //
- // Return Value:
- // The rotated byte
- //
- #include <limits.h>
-
- static inline UBYTE1 RotateByte (UBYTE1 value)
- {
- UBYTE1 result = 0 ;
-
- for (unsigned int ii = 0 ; ii < CHAR_BIT ; ++ ii)
- {
- if ((value & (1 << (CHAR_BIT - ii - 1))) != 0)
- result |= (1 << ii) ;
- }
- return result ;
- }
-
- #endif
-