kopia lustrzana https://gitlab.com/sane-project/backends
Clarification of variable names.
rodzic
7ea6af0624
commit
af6f6d4655
|
@ -154,7 +154,7 @@ output_no_message(j_common_ptr __sane_unused__ cinfo)
|
||||||
* \return SANE_STATUS_GOOD (if everything is OK, otherwise, SANE_STATUS_NO_MEM/SANE_STATUS_INVAL)
|
* \return SANE_STATUS_GOOD (if everything is OK, otherwise, SANE_STATUS_NO_MEM/SANE_STATUS_INVAL)
|
||||||
*/
|
*/
|
||||||
SANE_Status
|
SANE_Status
|
||||||
get_JPEG_data(capabilities_t *scanner, int *w, int *h, int *bps)
|
get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps)
|
||||||
{
|
{
|
||||||
int start = 0;
|
int start = 0;
|
||||||
struct jpeg_decompress_struct cinfo;
|
struct jpeg_decompress_struct cinfo;
|
||||||
|
@ -164,8 +164,8 @@ get_JPEG_data(capabilities_t *scanner, int *w, int *h, int *bps)
|
||||||
int lineSize = 0;
|
int lineSize = 0;
|
||||||
JDIMENSION x_off = 0;
|
JDIMENSION x_off = 0;
|
||||||
JDIMENSION y_off = 0;
|
JDIMENSION y_off = 0;
|
||||||
JDIMENSION wid = 0;
|
JDIMENSION w = 0;
|
||||||
JDIMENSION hei = 0;
|
JDIMENSION h = 0;
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
if (scanner->tmp == NULL)
|
if (scanner->tmp == NULL)
|
||||||
|
@ -204,10 +204,10 @@ get_JPEG_data(capabilities_t *scanner, int *w, int *h, int *bps)
|
||||||
scanner->pos_x = 0;
|
scanner->pos_x = 0;
|
||||||
|
|
||||||
x_off = scanner->pos_x;
|
x_off = scanner->pos_x;
|
||||||
wid = scanner->width - x_off;
|
w = scanner->width - x_off;
|
||||||
y_off = scanner->pos_y;
|
y_off = scanner->pos_y;
|
||||||
hei = scanner->height - y_off;
|
h = scanner->height - y_off;
|
||||||
surface = malloc(wid * hei * cinfo.output_components);
|
surface = malloc(w * h * cinfo.output_components);
|
||||||
if (surface == NULL) {
|
if (surface == NULL) {
|
||||||
jpeg_destroy_decompress(&cinfo);
|
jpeg_destroy_decompress(&cinfo);
|
||||||
DBG( 1, "Escl Jpeg : Memory allocation problem\n");
|
DBG( 1, "Escl Jpeg : Memory allocation problem\n");
|
||||||
|
@ -218,9 +218,9 @@ get_JPEG_data(capabilities_t *scanner, int *w, int *h, int *bps)
|
||||||
return (SANE_STATUS_NO_MEM);
|
return (SANE_STATUS_NO_MEM);
|
||||||
}
|
}
|
||||||
jpeg_start_decompress(&cinfo);
|
jpeg_start_decompress(&cinfo);
|
||||||
if (x_off > 0 || wid < cinfo.output_width)
|
if (x_off > 0 || w < cinfo.output_width)
|
||||||
jpeg_crop_scanline(&cinfo, &x_off, &wid);
|
jpeg_crop_scanline(&cinfo, &x_off, &w);
|
||||||
lineSize = wid * cinfo.output_components;
|
lineSize = w * cinfo.output_components;
|
||||||
if (y_off > 0)
|
if (y_off > 0)
|
||||||
jpeg_skip_scanlines(&cinfo, y_off);
|
jpeg_skip_scanlines(&cinfo, y_off);
|
||||||
pos = 0;
|
pos = 0;
|
||||||
|
@ -230,10 +230,10 @@ get_JPEG_data(capabilities_t *scanner, int *w, int *h, int *bps)
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
scanner->img_data = surface;
|
scanner->img_data = surface;
|
||||||
scanner->img_size = lineSize * hei;
|
scanner->img_size = lineSize * h;
|
||||||
scanner->img_read = 0;
|
scanner->img_read = 0;
|
||||||
*w = wid;
|
*width = w;
|
||||||
*h = hei;
|
*height = h;
|
||||||
*bps = cinfo.output_components;
|
*bps = cinfo.output_components;
|
||||||
jpeg_finish_decompress(&cinfo);
|
jpeg_finish_decompress(&cinfo);
|
||||||
jpeg_destroy_decompress(&cinfo);
|
jpeg_destroy_decompress(&cinfo);
|
||||||
|
@ -245,8 +245,8 @@ get_JPEG_data(capabilities_t *scanner, int *w, int *h, int *bps)
|
||||||
|
|
||||||
SANE_Status
|
SANE_Status
|
||||||
get_JPEG_data(capabilities_t __sane_unused__ *scanner,
|
get_JPEG_data(capabilities_t __sane_unused__ *scanner,
|
||||||
int __sane_unused__ *w,
|
int __sane_unused__ *width,
|
||||||
int __sane_unused__ *h,
|
int __sane_unused__ *height,
|
||||||
int __sane_unused__ *bps)
|
int __sane_unused__ *bps)
|
||||||
{
|
{
|
||||||
return (SANE_STATUS_INVAL);
|
return (SANE_STATUS_INVAL);
|
||||||
|
|
Ładowanie…
Reference in New Issue