writeppm: for bitmaps, 1 is black, 0 is white

This commit is contained in:
ppatience0 2013-05-12 16:36:29 -04:00
parent a1130d843d
commit a3f776a13e

View file

@ -90,6 +90,8 @@ writedata(Biobuf *fd, Image *image, Memimage *memimage, int rflag)
pix = (data[i]>>depth*((xmask-x)&xmask))&pmask;
if(((x+1)&xmask) == 0)
i++;
if(chan == GREY1)
pix = pix == 1? 0: 1;
if(rflag){
if(chan == GREY1)
Bputbit(fd, pix);