Re: Dealing with MONO12 images in memory

Bob Friesenhahn <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
On Tue, 21 Nov 2017, Robert H. Olsen wrote:

>
> Thank you very much for your quick reply Bob.
> This works very well when I limit the camera to MONO_8 images.  I am still 
> having trouble with the 12 bit images, but I need to verify my own code (I 
> may have may some mistakes refactoring to use GraphicsMagick)  before I 
> assume the problem is with how I am calling your functions.

The gray coder does not appear to support 12 bit images since the C 
API supports obtaining a sub-rectangle of the image, which requires 
random access.  Random access is most easily done with pixels aligned 
with bytes.  The gray coder can support 8/16/32 bit images.

Are your 12-bit images a compact stream of bits (e.g. in big-endian 
order with samples crossing byte boundaries), or are they 12-bits in 
16-bit samples, or something else?  One possible way to know is if the 
(rows * columns * depth) / 8 ~= data size.

If you do have compacted 12-bit data, do not lose hope since there is 
always Plan B.

> Can you tell me where I can find the options for that final argument "GRAY" 
> in the image.read() function?  I tried calling
>  ListMagickInfo_L("ListMagickInfoResult");
> which looked like it might give me that sort of information, but I probably 
> either made a mistake in linking or scoping (or...) since I got a message 
> that the function couldn't be found.

From the command line, one can learn the supported formats via:

   gm convert -list formats

The ListMagickInfo() function writes the same output to a C file 
handle as produced using fopen().

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.