Home › Forums › TWAIN Classic › Customizing the zooming capability
- This topic has 5 replies, 2 voices, and was last updated 16 years, 6 months ago by gabe.
- AuthorPosts
Hi,
I need to modify a custom zoom capability. But my concern is that custom zoom capability supports only integer values whereas I need to support both integer as well as floating point values.Can i change the data type for the ICAP_ZOOMFACTOR capability or do i need to define my own custom capabilty for it.If you change the size of the dataType I’d say you need to define a customCap, but doesn’t this depend on your interpetation of Icap_ZoomFactor == 1, and on your presicion requirements?
When I initially read your question I think this sounds like a good place for a customCap, but if you could be happy with the range and presicion of a 16bit floating point value then maybe you don’t need a custom cap.
It doesn’t seem to me that the spec defines what setting icap_zoomfactor to 1 means (or 65535 for that matter).
Depending on the precision you’re targeting you *might* be able to defend the argument that you choose to interpret tw_int16 as (internally) Fix16.It may make your value(s) look odd and may not get you invited to next twain develops luau, but as long as you limit yourself to just using the 16 bits of tw_int16, your interpretation of the value is pretty much up to you.
That said, I don’t think implementing icap_zoomFactor’s tw_int16 as a Fix16 is very intuitive but then again this is twain so …
.
so this means that if I can mange in the range of the capabilities data type then there is no need of defining a new capability. But if the data type is INT16 and I enter a FIX16 value, it would display as a BAD_VALUE. Then what should be done to avoid that. I am not sure that it would allow a floating point value for an int.
what|who would display BAD_VALUE? Isn’t this question in relation to a ds that you’re writing?
TWAIN Specifications say that ICAP_ZOOMFACTOR has data type TW_INT 16. Now to allow user to enter floating point vales I would have to change this type to FIX. Otherwise when a flaoting point value would be entered the value would not be allowed as it type is float and allowed type is int. So for this I would need to change the data type of ICAP_ZOOMFACTOR to FIX, which is not in accordance with specification. Is this allowed???
In reference with you opening somebody else’s ds or for someone to open yours? It comes back to the question; What does a current value of Icap_ZoomFactor == 1 mean?
If you are an application writer, I would say you need to see what the vendor means by the (tw_int16) value for the cap.
If you are a source writer, I would say that your ds *could* choose to interpret tw_int16 as fix16 – it just a matter of precision. If you need|want to provide 32bit floating point support then you should add a custom cap.In either case I think that only 16bits should be passed to (or accepted by) Icap_ZoomFactor, what that 16bit number means though is up to the ds writer (imo).
.
- AuthorPosts