Home › Forums › TWAIN Classic › Memory transfer mode: desuming the header › Reply To: Memory transfer mode: desuming the header
Tanks for the reply.
Now i get image not stretched and in BGR format.
Thare’s another problem now: for certains resolutions when i apply a little loop in order to convert from BGR to RGB the scanner produce an image with correct colors; with another resolution no.
The routine is very simple: if i got a buffer (under TWRC_SUCCESS, o the last buffer under TWRX_XFERDONE) i do:
for(int i=0; i
{
tmp=buf;
buf=buf[i+2];
buf[i+2]=tmp;
}
where buf is buffer memory.
So i make a little test, and set all bytes to BLUE color, for example.
So i wrote:
for(int i=0; i
{
buf = 255;//Its in BGR format, for obtain a BLUE pixel
buf[i+1]=0;
buf[i+2]=0;
}
for all pixels in every buffer.
What i expect is the image is all BLUE, unique color, but it’s not:
I read (edited the image with GIMP) a ilne BLUE, another GREEN and the last RED, for all lines in the image.
It’s strange.
Can u help me about this?
Why i change the resolution this strange behavior?
I make a test with my scanner (BROTHER), the kodaki30 in simulation mode.
Best regards