19 static unsigned long BMPlenfileheader(
int classv);
20 static unsigned long BMPleninfoheader(
int classv);
21 static unsigned long BMPlenrgbtable(
int classv,
unsigned long bitcount);
22 static unsigned long BMPlenline(
int classv,
unsigned long bitcount,
unsigned long x);
23 static unsigned long BMPlenbits(
int classv,
unsigned long bitcount,
unsigned long x,
unsigned long y);
24 static unsigned long BMPlenfile(
int classv,
unsigned long bitcount,
unsigned long x,
unsigned long y);
25 static unsigned long BMPoffbits(
int classv,
unsigned long bitcount);
37 static char er_internal[] =
"%s: internal error!";
40 BMPlenfileheader(
int classv)
53 pm_error(er_internal,
"BMPlenfileheader");
59 BMPleninfoheader(
int classv)
76 pm_error(er_internal,
"BMPleninfoheader");
82 BMPlenrgbtable(
int classv,
unsigned long bitcount)
92 pm_error(er_internal,
"BMPlenrgbtable");
104 pm_error(er_internal,
"BMPlenrgbtable");
108 return (1 << bitcount) * lenrgb;
119 BMPlenline(
int classv,
unsigned long bitcount,
unsigned long x)
121 unsigned long bitsperline;
123 bitsperline = x * bitcount;
129 if ((bitsperline % 32) != 0)
131 bitsperline += (32 - (bitsperline % 32));
134 if ((bitsperline % 32) != 0)
136 pm_error(er_internal,
"BMPlenline");
141 return bitsperline >> 3;
148 unsigned long bitcount,
152 return y * BMPlenline(classv, bitcount, x);
159 unsigned long bitcount)
161 return BMPlenfileheader(classv)
162 + BMPleninfoheader(classv)
163 + BMPlenrgbtable(classv, bitcount);
170 unsigned long bitcount,
174 return BMPoffbits(classv, bitcount)
175 + BMPlenbits(classv, bitcount, x, y);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.