Lines Matching refs:wbmp
116 Wbmp *wbmp; in createwbmp() local
117 if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL) in createwbmp()
121 gdFree(wbmp); in createwbmp()
125 gdFree(wbmp); in createwbmp()
129 if ((wbmp->bitmap = (int *) safe_emalloc(sizeof(int), width * height, 0)) == NULL) in createwbmp()
131 gdFree (wbmp); in createwbmp()
135 wbmp->width = width; in createwbmp()
136 wbmp->height = height; in createwbmp()
138 for (i = 0; i < width * height; wbmp->bitmap[i++] = color); in createwbmp()
140 return (wbmp); in createwbmp()
155 Wbmp *wbmp; in readwbmp() local
157 if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL) in readwbmp()
160 wbmp->type = getin (in); in readwbmp()
161 if (wbmp->type != 0) in readwbmp()
163 gdFree (wbmp); in readwbmp()
169 gdFree (wbmp); in readwbmp()
174 wbmp->width = getmbi (getin, in); in readwbmp()
175 if (wbmp->width == -1) in readwbmp()
177 gdFree (wbmp); in readwbmp()
181 wbmp->height = getmbi (getin, in); in readwbmp()
182 if (wbmp->height == -1) in readwbmp()
184 gdFree (wbmp); in readwbmp()
189 printf ("W: %d, H: %d\n", wbmp->width, wbmp->height); in readwbmp()
192 if (overflow2(sizeof (int), wbmp->width) || in readwbmp()
193 overflow2(sizeof (int) * wbmp->width, wbmp->height)) in readwbmp()
195 gdFree(wbmp); in readwbmp()
199 …if ((wbmp->bitmap = (int *) safe_emalloc((size_t)wbmp->width * wbmp->height, sizeof(int), 0)) == N… in readwbmp()
201 gdFree (wbmp); in readwbmp()
210 for (row = 0; row < wbmp->height; row++) in readwbmp()
212 for (col = 0; col < wbmp->width;) in readwbmp()
218 if (col++ < wbmp->width) in readwbmp()
222 wbmp->bitmap[pos] = WBMP_WHITE; in readwbmp()
226 wbmp->bitmap[pos] = WBMP_BLACK; in readwbmp()
234 *return_wbmp = wbmp; in readwbmp()
252 writewbmp (Wbmp * wbmp, void (*putout) (int c, void *out), void *out) in writewbmp() argument
264 putmbi (wbmp->width, putout, out); /* width */ in writewbmp()
265 putmbi (wbmp->height, putout, out); /* height */ in writewbmp()
269 for (row = 0; row < wbmp->height; row++) in writewbmp()
273 for (col = 0; col < wbmp->width; col++) in writewbmp()
275 octet |= ((wbmp->bitmap[row * wbmp->width + col] == 1) ? WBMP_WHITE : WBMP_BLACK) << --bitpos; in writewbmp()
298 freewbmp (Wbmp * wbmp) in freewbmp() argument
300 gdFree (wbmp->bitmap); in freewbmp()
301 gdFree (wbmp); in freewbmp()
311 printwbmp (Wbmp * wbmp) in printwbmp() argument
314 for (row = 0; row < wbmp->height; row++) in printwbmp()
316 for (col = 0; col < wbmp->width; col++) in printwbmp()
318 if (wbmp->bitmap[wbmp->width * row + col] == WBMP_BLACK) in printwbmp()
360 Wbmp *wbmp; in main() local
365 readwbmp (&getin, wbmp_file, &wbmp); in main()
373 printwbmp (wbmp); in main()
382 writewbmp (wbmp, &putout, stdout); in main()
385 freewbmp (wbmp); in main()