Shouldn't, but is there a setting for the Colour Gamut?<br><br>
<div><span class="gmail_quote">On 21/04/06, <b class="gmail_sendername">Todd Martin</b> <<a href="mailto:toddm@kol.co.nz">toddm@kol.co.nz</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Do you ever get values > 255?<br><br>Todd.<br><br>On Wednesday 19 Apr 2006 21:42, Phil Middlemiss wrote:
<br>> Thanks for the example Todd - yeah, that's compiling and seems to be<br>> running fine. There are no reported memory leaks around the pixel wands<br>> either.<br>><br>> One question though: the PixelPacket contains *Word* values for red,
<br>> green, blue, and opacity. How do I interpret values greater than 255?<br>><br>> Cheers,<br>> Phil.<br>><br>> Todd Martin wrote:<br>> Hi Phil<br>><br>> I've only just started looking at Image Magic myself.
<br>> Try this :)<br>> You'll need to add a correction and a function declaration to<br>> "pixel_iterator.inc" as outlined below.<br>><br>> uses<br>> magick_wand, ImageMagick;<br>><br>> procedure DrawDiagonalLine(AInputFileName, AOutputFileName : AnsiString);
<br>> var<br>> Iterator : PPixelIterator;<br>> PixelWands : PPPixelWand;<br>> ImageWand : PMagickWand;<br>> Status : MagickBooleanType;<br>> RowIndex, WandCount : Cardinal;<br>> begin<br>> Iterator := nil;
<br>> ImageWand := nil;<br>> try<br>> ImageWand := NewMagickWand;<br>> status := MagickReadImage(ImageWand,PChar(AInputFileName));<br>> if (status = MagickTrue) then<br>> begin<br>> //use a pixel iterator to draw a diagonal line
<br>> Iterator:=NewPixelIterator(ImageWand);<br>> if assigned(Iterator) then<br>> begin<br>> //return the next row as an array of pixel wands<br>> PixelWands:=PixelGetNextIteratorRow(Iterator,WandCount);
<br>> RowIndex := 0;<br>> while assigned(PixelWands) do<br>> begin<br>> inc(PixelWands,RowIndex); //move to the pixel wand at column=row<br>> PixelSetColor(PixelWands^,'#224466');
<br>> PixelSyncIterator(Iterator);<br>> PixelWands:=PixelGetNextIteratorRow(Iterator,WandCount);<br>> inc(RowIndex);<br>> end;<br>> end;<br>><br>> MagickWriteImage(ImageWand,PChar(AOutputFileName));
<br>> end;<br>> finally<br>> DestroyPixelIterator(Iterator);<br>> DestroyMagickWand(ImageWand);<br>> end;<br>> end;<br>><br>> initialization<br>> MagickWandGenesis;<br>><br>
> finalization<br>> MagickWandTerminus;<br>><br>><br>> ....and put the following in pixel_iterator.inc<br>><br>> //****correction*****<br>> function NewPixelIterator(wand: PMagickWand): PPixelIterator; cdecl;
<br>> external WandExport;<br>><br>> //****extra declaration****<br>> function PixelGetNextIteratorRow(iterator: PPixeliterator; var columnCount<br>> : Cardinal) : PPPixelWand; cdecl; external WandExport;<br>
><br>> I compiled this in Kylix. Let me know if you have any problems.<br>> Todd.<br>><br>> On Wednesday 19 Apr 2006 03:54, Phil Middlemiss wrote:<br>><br>><br>> Yeah, I've got the source and looked through the API.
<br>><br>> >From what I can see of the API though, it jumps straight down into the<br>> > fine details of documenting each method and doesn't have anything that<br>> > tells you "This is the general approach to use".
<br>><br>> For example, I see that there is a routine called MagickSetFirstIterator<br>> (among other iteration routines) but nowhere does it describe the way to<br>> set up an iteration, or even what you are iterating. There is a pixel wand
<br>> too (and a pixel iterator), but I can't find anything that describes the<br>> overall method of using them.<br>><br>> Have you got any examples (I don't care if they are not documented) that I<br>> could look at?
<br>><br>> Cheers,<br>> Phil.<br>><br>> Todd Martin wrote:<br>> Hi Phil<br>><br>> Have you looked at the API documents?<br>> {myInstallDirectoryForImageMagic}/share/doc/ImageMagick-6.2.6/www/api
<br>><br>> Are you running Windows or Linux? Do you have the ImageMagic source or just<br>> a binary download?<br>><br>> Todd.<br>><br>> On Wednesday 19 Apr 2006 02:39, Phil Middlemiss wrote:<br>><br>
><br>> Hi all,<br>><br>> I'm trying to understand Image Magick - I have got the Lazerus headers<br>> and compiled and run the sample app listed on the wiki page for it. All<br>> fine.<br>><br>> Now when it comes to actually working out how to use the thing I'm not
<br>> sure how to go about it. The documentation is a little different from<br>> the actual Lazerus files, and even if it were the same it is lacking the<br>> whole "This is the overview/paradigm" section.
<br>><br>> What I really need is a good example that does more than just read in an<br>> image and save it to another format. Does anyone has some<br>> examples/documentation that they are willing to share?<br>
><br>> Cheers,<br>> Phil.<br>><br>><br>> _______________________________________________<br>> Delphi mailing list<br>> <a href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</a><br>> <a href="http://ns3.123.co.nz/mailman/listinfo/delphi">
http://ns3.123.co.nz/mailman/listinfo/delphi</a><br>><br>><br>> _______________________________________________<br>> Delphi mailing list<br>> <a href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</a><br>
> <a href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br>_______________________________________________<br>Delphi mailing list<br><a href="mailto:Delphi@ns3.123.co.nz">
Delphi@ns3.123.co.nz</a><br><a href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br></blockquote></div><br>