- /* read rgb value (16bit) */
- lseek(fd,pi.so[k/pi.rps]+2*l+2*(k%pi.rps)*pi.width,SEEK_SET);
- read(fd,tbuf,pi.bits[0]/8);
- short2int(bla,tbuf);
- // bla=(tbuf[0]<<8)|tbuf[1];
- bbuf[0]=(bla>>10)<<3;
- bbuf[1]=((bla>>5)&31)<<3;
- bbuf[2]=(bla&31)<<3;
+ short2int(bla,buf+2*(pi.width*(pi.height-k-1)+l));
+ bbuf[0]=((bla>>10)&31)<<3; /* blau */
+ bbuf[1]=((bla>>5)&31)<<3; /* gelb */
+ bbuf[2]=(bla&31)<<3; /* rot */