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()
170 wbmp->width = getmbi (getin, in); in readwbmp()
171 if (wbmp->width == -1) in readwbmp()
173 gdFree (wbmp); in readwbmp()
177 wbmp->height = getmbi (getin, in); in readwbmp()
178 if (wbmp->height == -1) in readwbmp()
180 gdFree (wbmp); in readwbmp()
185 printf ("W: %d, H: %d\n", wbmp->width, wbmp->height); in readwbmp()
188 if (overflow2(sizeof (int), wbmp->width) || in readwbmp()
189 overflow2(sizeof (int) * wbmp->width, wbmp->height)) in readwbmp()
191 gdFree(wbmp); in readwbmp()
195 …if ((wbmp->bitmap = (int *) safe_emalloc((size_t)wbmp->width * wbmp->height, sizeof(int), 0)) == N… in readwbmp()
197 gdFree (wbmp); in readwbmp()
206 for (row = 0; row < wbmp->height; row++) in readwbmp()
208 for (col = 0; col < wbmp->width;) in readwbmp()
214 if (col++ < wbmp->width) in readwbmp()
218 wbmp->bitmap[pos] = WBMP_WHITE; in readwbmp()
222 wbmp->bitmap[pos] = WBMP_BLACK; in readwbmp()
230 *return_wbmp = wbmp; in readwbmp()
248 writewbmp (Wbmp * wbmp, void (*putout) (int c, void *out), void *out) in writewbmp() argument
260 putmbi (wbmp->width, putout, out); /* width */ in writewbmp()
261 putmbi (wbmp->height, putout, out); /* height */ in writewbmp()
265 for (row = 0; row < wbmp->height; row++) in writewbmp()
269 for (col = 0; col < wbmp->width; col++) in writewbmp()
271 octet |= ((wbmp->bitmap[row * wbmp->width + col] == 1) ? WBMP_WHITE : WBMP_BLACK) << --bitpos; in writewbmp()
294 freewbmp (Wbmp * wbmp) in freewbmp() argument
296 gdFree (wbmp->bitmap); in freewbmp()
297 gdFree (wbmp); in freewbmp()
307 printwbmp (Wbmp * wbmp) in printwbmp() argument
310 for (row = 0; row < wbmp->height; row++) in printwbmp()
312 for (col = 0; col < wbmp->width; col++) in printwbmp()
314 if (wbmp->bitmap[wbmp->width * row + col] == WBMP_BLACK) in printwbmp()
356 Wbmp *wbmp; in main() local
361 readwbmp (&getin, wbmp_file, &wbmp); in main()
369 printwbmp (wbmp); in main()
378 writewbmp (wbmp, &putout, stdout); in main()
381 freewbmp (wbmp); in main()