home *** CD-ROM | disk | FTP | other *** search
- /*
- digpow2.c
-
- % Function for getting power of 2 of a number of bits.
-
- 5/05/89 by Ted.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "digutil.h"
- /* -------------------------------------------------------------------------- */
-
- long DIGPRIV dig_powof2(power)
- byte power;
- /*
- Return the power of 2 for selected powers expected to be found as the
- number of color bits in display hardware.
- */
- {
- switch (power) {
- default:return(1L);
- case 1: return(2L);
- case 2: return(4L);
- case 4: return(16L);
- case 8: return(256L);
- case 16: return(256L * 256L);
- case 18: return(512L * 512L);
- case 20: return(1024L * 1024L * 16L);
- case 24: return(1024L * 1024L * 16L);
- case 32: return(ULONG_MAX);
- }
- }
- /* -------------------------------------------------------------------------- */
-
-