kopia lustrzana https://gitlab.com/sane-project/backends
- UTA and custom gamma fix (wrongly inactive ...)
- gamma table check on option setmerge-requests/1/head
rodzic
f7ce836c46
commit
d54f39f55b
|
@ -1,3 +1,9 @@
|
||||||
|
2003-08-15 Stéphane Voltz <svoltz@wanadoo.fr>
|
||||||
|
|
||||||
|
* backend/umax_pp.c backend/umax_pp.h: added a check of values passed
|
||||||
|
in gamma table. Fixed a bug which prevented custom gamm and UTA to be
|
||||||
|
active
|
||||||
|
|
||||||
2003-08-14 Gerhard Jaeger <gerhard@gjaeger.de>
|
2003-08-14 Gerhard Jaeger <gerhard@gjaeger.de>
|
||||||
|
|
||||||
* doc/sane-plustek.man: Added debug description
|
* doc/sane-plustek.man: Added debug description
|
||||||
|
|
|
@ -102,8 +102,8 @@
|
||||||
* see Changelog
|
* see Changelog
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define UMAX_PP_BUILD 12
|
#define UMAX_PP_BUILD 13
|
||||||
#define UMAX_PP_STATE "beta"
|
#define UMAX_PP_STATE "stable"
|
||||||
|
|
||||||
static int num_devices = 0;
|
static int num_devices = 0;
|
||||||
static Umax_PP_Descriptor *devlist = NULL;
|
static Umax_PP_Descriptor *devlist = NULL;
|
||||||
|
@ -484,14 +484,14 @@ init_options (Umax_PP_Device * dev)
|
||||||
dev->opt[OPT_UTA_CONTROL].size = sizeof (SANE_Word);
|
dev->opt[OPT_UTA_CONTROL].size = sizeof (SANE_Word);
|
||||||
dev->opt[OPT_UTA_CONTROL].unit = SANE_UNIT_NONE;
|
dev->opt[OPT_UTA_CONTROL].unit = SANE_UNIT_NONE;
|
||||||
dev->val[OPT_UTA_CONTROL].w = SANE_TRUE;
|
dev->val[OPT_UTA_CONTROL].w = SANE_TRUE;
|
||||||
dev->opt[OPT_UTA_CONTROL].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE;
|
dev->opt[OPT_UTA_CONTROL].cap |= SANE_CAP_ADVANCED;
|
||||||
|
|
||||||
/* custom-gamma table */
|
/* custom-gamma table */
|
||||||
dev->opt[OPT_CUSTOM_GAMMA].name = SANE_NAME_CUSTOM_GAMMA;
|
dev->opt[OPT_CUSTOM_GAMMA].name = SANE_NAME_CUSTOM_GAMMA;
|
||||||
dev->opt[OPT_CUSTOM_GAMMA].title = SANE_TITLE_CUSTOM_GAMMA;
|
dev->opt[OPT_CUSTOM_GAMMA].title = SANE_TITLE_CUSTOM_GAMMA;
|
||||||
dev->opt[OPT_CUSTOM_GAMMA].desc = SANE_DESC_CUSTOM_GAMMA;
|
dev->opt[OPT_CUSTOM_GAMMA].desc = SANE_DESC_CUSTOM_GAMMA;
|
||||||
dev->opt[OPT_CUSTOM_GAMMA].type = SANE_TYPE_BOOL;
|
dev->opt[OPT_CUSTOM_GAMMA].type = SANE_TYPE_BOOL;
|
||||||
dev->opt[OPT_CUSTOM_GAMMA].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE;
|
dev->opt[OPT_CUSTOM_GAMMA].cap |= SANE_CAP_ADVANCED;
|
||||||
dev->val[OPT_CUSTOM_GAMMA].w = SANE_FALSE;
|
dev->val[OPT_CUSTOM_GAMMA].w = SANE_FALSE;
|
||||||
|
|
||||||
/* grayscale gamma vector */
|
/* grayscale gamma vector */
|
||||||
|
@ -1339,6 +1339,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
|
||||||
SANE_Status status;
|
SANE_Status status;
|
||||||
SANE_Word w, cap, tmpw;
|
SANE_Word w, cap, tmpw;
|
||||||
int dpi, rc;
|
int dpi, rc;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
DBG (6, "control_option: option %d, action %d\n", option, action);
|
DBG (6, "control_option: option %d, action %d\n", option, action);
|
||||||
|
|
||||||
|
@ -1409,6 +1410,14 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
|
||||||
case OPT_GAMMA_VECTOR_G:
|
case OPT_GAMMA_VECTOR_G:
|
||||||
case OPT_GAMMA_VECTOR_B:
|
case OPT_GAMMA_VECTOR_B:
|
||||||
|
|
||||||
|
for(i=0;i<dev->opt[option].size/sizeof(SANE_Word);i++)
|
||||||
|
{
|
||||||
|
if(((SANE_Int *)val)[i]<0 || ((SANE_Int *)val)[i]>255)
|
||||||
|
{
|
||||||
|
DBG (2, "Value at index %d out of range\n",i);
|
||||||
|
return SANE_STATUS_INVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
memcpy (val, dev->val[option].wa, dev->opt[option].size);
|
memcpy (val, dev->val[option].wa, dev->opt[option].size);
|
||||||
return SANE_STATUS_GOOD;
|
return SANE_STATUS_GOOD;
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,7 @@ typedef union
|
||||||
{
|
{
|
||||||
SANE_Word w;
|
SANE_Word w;
|
||||||
SANE_Word *wa; /* word array */
|
SANE_Word *wa; /* word array */
|
||||||
|
SANE_Int *ia; /* int array */
|
||||||
SANE_String s;
|
SANE_String s;
|
||||||
}
|
}
|
||||||
Option_Value;
|
Option_Value;
|
||||||
|
@ -192,17 +193,4 @@ Umax_PP_Device;
|
||||||
__PRETTY_FUNCTION__, V_MAJOR, V_MINOR, \
|
__PRETTY_FUNCTION__, V_MAJOR, V_MINOR, \
|
||||||
UMAX_PP_BUILD, UMAX_PP_STATE, __LINE__)
|
UMAX_PP_BUILD, UMAX_PP_STATE, __LINE__)
|
||||||
|
|
||||||
#define ASSERT(cond) if (!(cond)) \
|
|
||||||
{ \
|
|
||||||
DEBUG(); \
|
|
||||||
DBG(1, "ASSERT(%s) failed\n", STRINGIFY(cond)); \
|
|
||||||
DBG(1, "expect disaster...\n");\
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Please note: ASSERT won't go away if you define NDEBUG, it just won't
|
|
||||||
* output a message when ASSERT failes. So if "cond" does anything, it will
|
|
||||||
* be executed, even if NDEBUG is defined...
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* umax_pp_h */
|
#endif /* umax_pp_h */
|
||||||
|
|
Ładowanie…
Reference in New Issue