Lines Matching refs:wbmp
115 Wbmp *wbmp; in createwbmp() local
116 if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL) in createwbmp()
120 gdFree(wbmp); in createwbmp()
124 gdFree(wbmp); in createwbmp()
128 if ((wbmp->bitmap = (int *) safe_emalloc(sizeof(int), width * height, 0)) == NULL) in createwbmp()
130 gdFree (wbmp); in createwbmp()
134 wbmp->width = width; in createwbmp()
135 wbmp->height = height; in createwbmp()
137 for (i = 0; i < width * height; wbmp->bitmap[i++] = color); in createwbmp()
139 return (wbmp); in createwbmp()
154 Wbmp *wbmp; in readwbmp() local
156 if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL) in readwbmp()
159 wbmp->type = getin (in); in readwbmp()
160 if (wbmp->type != 0) in readwbmp()
162 gdFree (wbmp); in readwbmp()
168 gdFree (wbmp); in readwbmp()
173 wbmp->width = getmbi (getin, in); in readwbmp()
174 if (wbmp->width == -1) in readwbmp()
176 gdFree (wbmp); in readwbmp()
180 wbmp->height = getmbi (getin, in); in readwbmp()
181 if (wbmp->height == -1) in readwbmp()
183 gdFree (wbmp); in readwbmp()
188 printf ("W: %d, H: %d\n", wbmp->width, wbmp->height); in readwbmp()
191 if (overflow2(sizeof (int), wbmp->width) || in readwbmp()
192 overflow2(sizeof (int) * wbmp->width, wbmp->height)) in readwbmp()
194 gdFree(wbmp); in readwbmp()
198 …if ((wbmp->bitmap = (int *) safe_emalloc((size_t)wbmp->width * wbmp->height, sizeof(int), 0)) == N… in readwbmp()
200 gdFree (wbmp); in readwbmp()
209 for (row = 0; row < wbmp->height; row++) in readwbmp()
211 for (col = 0; col < wbmp->width;) in readwbmp()
217 if (col++ < wbmp->width) in readwbmp()
221 wbmp->bitmap[pos] = WBMP_WHITE; in readwbmp()
225 wbmp->bitmap[pos] = WBMP_BLACK; in readwbmp()
233 *return_wbmp = wbmp; in readwbmp()
251 writewbmp (Wbmp * wbmp, void (*putout) (int c, void *out), void *out) in writewbmp() argument
263 putmbi (wbmp->width, putout, out); /* width */ in writewbmp()
264 putmbi (wbmp->height, putout, out); /* height */ in writewbmp()
268 for (row = 0; row < wbmp->height; row++) in writewbmp()
272 for (col = 0; col < wbmp->width; col++) in writewbmp()
274 octet |= ((wbmp->bitmap[row * wbmp->width + col] == 1) ? WBMP_WHITE : WBMP_BLACK) << --bitpos; in writewbmp()
297 freewbmp (Wbmp * wbmp) in freewbmp() argument
299 gdFree (wbmp->bitmap); in freewbmp()
300 gdFree (wbmp); in freewbmp()
310 printwbmp (Wbmp * wbmp) in printwbmp() argument
313 for (row = 0; row < wbmp->height; row++) in printwbmp()
315 for (col = 0; col < wbmp->width; col++) in printwbmp()
317 if (wbmp->bitmap[wbmp->width * row + col] == WBMP_BLACK) in printwbmp()
359 Wbmp *wbmp; in main() local
364 readwbmp (&getin, wbmp_file, &wbmp); in main()
372 printwbmp (wbmp); in main()
381 writewbmp (wbmp, &putout, stdout); in main()
384 freewbmp (wbmp); in main()