19static unsigned long BMPlenfileheader(
int classv);
20static unsigned long BMPleninfoheader(
int classv);
21static unsigned long BMPlenrgbtable(
int classv,
unsigned long bitcount);
22static unsigned long BMPlenline(
int classv,
unsigned long bitcount,
unsigned long x);
23static unsigned long BMPlenbits(
int classv,
unsigned long bitcount,
unsigned long x,
unsigned long y);
24static unsigned long BMPlenfile(
int classv,
unsigned long bitcount,
unsigned long x,
unsigned long y);
25static unsigned long BMPoffbits(
int classv,
unsigned long bitcount);
37static char er_internal[] =
"%s: internal error!";
40BMPlenfileheader(
int classv)
53 pm_error(er_internal,
"BMPlenfileheader");
59BMPleninfoheader(
int classv)
76 pm_error(er_internal,
"BMPleninfoheader");
82BMPlenrgbtable(
int classv,
unsigned long bitcount)
92 pm_error(er_internal,
"BMPlenrgbtable");
95 lenrgb = (classv == C_OS2) ? 3 : 4;
96 return (1 << bitcount) * lenrgb;
107BMPlenline(
int classv,
unsigned long bitcount,
unsigned long x)
109 unsigned long bitsperline;
111 bitsperline = x * bitcount;
117 if ((bitsperline % 32) != 0)
119 bitsperline += (32 - (bitsperline % 32));
122 if ((bitsperline % 32) != 0)
124 pm_error(er_internal,
"BMPlenline");
129 return bitsperline >> 3;
136 unsigned long bitcount,
140 return y * BMPlenline(classv, bitcount, x);
147 unsigned long bitcount)
149 return BMPlenfileheader(classv)
150 + BMPleninfoheader(classv)
151 + BMPlenrgbtable(classv, bitcount);
158 unsigned long bitcount,
162 return BMPoffbits(classv, bitcount)
163 + BMPlenbits(classv, bitcount, x, y);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void pm_error(const char *format,...)
Outputs the given printf-style message to the user and terminates messily.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.