Re: ExportImagePixelArea

Bob Friesenhahn <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
On Tue, 5 Jun 2018, Adam Morissun wrote:

> Hi. Would someone explain how to use ExportImagePixelArea() ? I cannot make 
> it work for the life of me.
>
> I've attached the smallest C code I could devise to demonstrate my problem. 
> I'm using Gimp to examine the '/tmp/pixels_**.data' files.

You are definitely closing in on the solution.  The GetImagePixels() 
requests that you currently have commented out are vitally important. 
Even if you have no intention to use the returned pointer, these 
requests are also setting the pixel region/area that 
ExportImagePixelArea() will then use.

Later on in the implementation (in ExportViewPixelArea()), the 
AccessCacheViewPixels() function returns the same pointer that 
GetImagePixels() previously returned, and AcquireCacheViewIndexes() 
returns the colormap indexes if the image is colormapped 
(image->storage_class == PseudoClass).

Bob

------------------------------------------------------------------------------
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.