Home › Forums › TWAIN Classic › Bit Depth and Pixel Type Container Types
- This topic has 3 replies, 2 voices, and was last updated 16 years, 9 months ago by gabe.
- AuthorPosts
I know that when I get the current bit depth and pixel type values they can be “one value” or “enumeration” container types. Is it common that a scanner will use only one of these container types? Or might the same scanner use either type depending on the scan settings selected by the user?
Thanks!
in my use, I’ll ask for the available pixel types and I get an enum. From there I’ll set with a onevalue. using oneValue or enum in the set depends somewhat on your intended use, are you trying to set to a value (use oneVal) or limit the user’s chose to a format you support (use enum) – least that’s how I read the spec,
.
@gabe wrote:
in my use, I’ll ask for the available pixel types and I get an enum. From there I’ll set with a onevalue. using oneValue or enum in the set depends somewhat on your intended use, are you trying to set to a value (use oneVal) or limit the user’s chose to a format you support (use enum) – least that’s how I read the spec,
.
Thanks for your reply. I am not trying to set the value, nor am I trying to limit the user’s choices. I let the scanner driver’s interface handle the scanning. When the scan process is complete and I need to retrieve the results. I am trying to get the current settings so I know what I am retrieving.
The problem is that I recently discovered I need to support the enum container type. I am trying to locate a scanner in-house that I can test with. All appear to use one-value, but I am wondering if changing their scan settings (using the scanner driver’s scan interface) might cause them to use enum.
Anyone know?
ah, right then. if i were interested the setting that was used during the transfer I would check the tw_ImageInfo structure – tw_ImageInfo.BitsPerPixel and tw_ImageInfo.PixelType.
If I were somehow unable to get the tw_imageInfo, I would feel pretty confident that I only needed to check for a oneValue, there is *some* chance that you’ll get an enum but I’m thinking if you ask for a oneVal you’ll be ok. I’d be more concerned with (the slim chance that) the approach fails to provide the right info do to the source reseting values after the scan is complete to some default that wasn’t used during the transfer – it’s not likely but it *could* happen,
If it were me, I’d check the tw_ImageInfo. Some devices might also give useful bits in twei_*.
.
- AuthorPosts