Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Formentar
iscan
main_loop_deunroll.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File main_loop_deunroll.patch of Package iscan
*** backend/epkowa.c.orig 2008-05-18 21:12:14.000000000 +0100 --- backend/epkowa.c 2008-05-18 21:20:27.000000000 +0100 *************** *** 6717,6723 **** --- 6717,6725 ---- SANE_Status status; int index = 0; + int color_index[] = { 0, 1, 0, 2 }; SANE_Bool reorder = SANE_FALSE; SANE_Bool needStrangeReorder = SANE_FALSE; int bytes_to_process = 0; + int curcolor; if (s->buf == 0 && s->canceling) *************** *** 6767,6891 **** */ ! ! /* ! * read the first color line - the number of bytes to read ! * is already known (from last call to read_data_block() ! * We determine where to write the line from the color information ! * in the data block. At the end we want the order RGB, but the ! * way the data is delivered does not guarantee this - actually it's ! * most likely that the order is GRB if it's not RGB! ! */ ! switch (GET_COLOR (result)) ! { ! case 1: ! index = 1; ! break; ! case 2: ! index = 0; ! break; ! case 3: ! index = 2; ! break; ! } ! ! receive (s, s->buf + index * s->params.pixels_per_line, buf_len, ! &status); ! ! if (SANE_STATUS_GOOD != status) ! { ! *length = 0; ! scan_finish (s); ! return status; ! } ! ! /* ! * send the ACK signal to the scanner in order to make ! * it ready for the next data block. ! */ ! send (s, S_ACK, 1, &status); ! ! /* ! * ... and request the next data block ! */ ! if (SANE_STATUS_GOOD != (status = read_data_block (s, &result))) ! { ! *length = 0; ! scan_finish (s); ! return status; ! } ! ! buf_len = result.buf[1] << 8 | result.buf[0]; ! /* ! * this should never happen, because we are already in ! * line mode, but it does not hurt to check ... ! */ ! if (s->block) ! buf_len *= (result.buf[3] << 8 | result.buf[2]); ! ! DBG (5, "sane_read: buf len2 = %lu\n", (u_long) buf_len); ! ! switch (GET_COLOR (result)) ! { ! case 1: ! index = 1; ! break; ! case 2: ! index = 0; ! break; ! case 3: ! index = 2; ! break; ! } ! ! receive (s, s->buf + index * s->params.pixels_per_line, buf_len, ! &status); ! ! if (SANE_STATUS_GOOD != status) ! { ! *length = 0; ! scan_finish (s); ! return status; ! } ! ! send (s, S_ACK, 1, &status); ! ! /* ! * ... and the last data block ! */ ! if (SANE_STATUS_GOOD != (status = read_data_block (s, &result))) ! { ! *length = 0; ! scan_finish (s); ! return status; ! } ! ! buf_len = result.buf[1] << 8 | result.buf[0]; ! ! if (s->block) ! buf_len *= (result.buf[3] << 8 | result.buf[2]); ! ! DBG (5, "sane_read: buf len3 = %lu\n", (u_long) buf_len); ! ! switch (GET_COLOR (result)) ! { ! case 1: ! index = 1; ! break; ! case 2: ! index = 0; ! break; ! case 3: ! index = 2; ! break; ! } ! ! receive (s, s->buf + index * s->params.pixels_per_line, buf_len, ! &status); ! ! if (SANE_STATUS_GOOD != status) { ! *length = 0; ! scan_finish (s); ! return status; } } --- 6769,6823 ---- */ ! for(curcolor = 0; curcolor < 3; curcolor++) { ! if (curcolor) ! { ! buf_len = result.buf[1] << 8 | result.buf[0]; ! /* ! * this should never happen, because we are already in ! * line mode, but it does not hurt to check ... ! */ ! if (s->block) ! buf_len *= (result.buf[3] << 8 | result.buf[2]); ! ! DBG (5, "sane_read: buf len%d = %lu\n", curcolor + 1, ! (u_long) buf_len); ! } ! ! /* ! * read a color line - for the first color the number of bytes to ! * read is already known (from last call to read_data_block() ! * We determine where to write the line from the color information ! * in the data block. At the end we want the order RGB, but the ! * way the data is delivered does not guarantee this - actually it's ! * most likely that the order is GRB if it's not RGB! ! */ ! index = color_index[GET_COLOR (result)]; ! ! receive (s, s->buf + index * s->params.pixels_per_line, buf_len, ! &status); ! ! if (SANE_STATUS_GOOD != status) ! { ! *length = 0; ! scan_finish (s); ! return status; ! } ! ! /* ! * send the ACK signal to the scanner in order to make ! * it ready for the next data block. ! */ ! send (s, S_ACK, 1, &status); ! ! /* ! * ... and request the next data block ! */ ! if (SANE_STATUS_GOOD != (status = read_data_block (s, &result))) ! { ! *length = 0; ! scan_finish (s); ! return status; ! } } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor