Lines Matching refs:srcpitch
88 int srcpitch, unsigned char *dstbuf, enum BMPPIXELFORMAT dstformat, int dstpitch, in pixelconvert() argument
94 srcptr=flip? &srcbuf[srcpitch*(h-1)]:srcbuf; in pixelconvert()
96 srcptr+=flip? -srcpitch:srcpitch, dstptr+=dstpitch) in pixelconvert()
178 int fd=-1, bytesread, srcpitch, srcbottomup=1, srcps, dstpitch, in loadbmp() local
248 srcpitch=(((*w)*srcps)+3)&(~3); in loadbmp()
251 if(srcpitch*(*h)+bh.bfOffBits!=bh.bfSize) _throw("Corrupt bitmap header"); in loadbmp()
252 if((tempbuf=(unsigned char *)malloc(srcpitch*(*h)))==NULL in loadbmp()
257 _unix(bytesread=read(fd, tempbuf, srcpitch*(*h))); in loadbmp()
258 if(bytesread!=srcpitch*(*h)) _throw("Read error"); in loadbmp()
260 pixelconvert(tempbuf, BMP_BGR, srcpitch, *buf, f, dstpitch, *w, *h, in loadbmp()
274 enum BMPPIXELFORMAT f, int srcpitch, int srcbottomup) in saveppm() argument
287 pixelconvert(buf, f, srcpitch, tempbuf, BMP_RGB, w*3, w, h, in saveppm()
299 enum BMPPIXELFORMAT f, int srcpitch, int srcbottomup) in savebmp() argument
311 if(!filename || !buf || w<1 || h<1 || f<0 || f>BMPPIXELFORMATS-1 || srcpitch<0) in savebmp()
314 if(srcpitch==0) srcpitch=w*ps[f]; in savebmp()
319 return saveppm(filename, buf, w, h, f, srcpitch, srcbottomup); in savebmp()
374 pixelconvert(buf, f, srcpitch, tempbuf, BMP_BGR, dstpitch, w, h, in savebmp()