Problem with sparse colours
Posted: 2008-12-19T10:49:42-07:00
I tried implementing Anthony's examples of sparse colours with MagickWand.
The program works fine when doing his first Voronoi example:
But if I just change VoronoiColorInterpolate to ShepardsColorInterpolate in the program, recompile and run it again, I get this:
I'm using IM 6.4.6 2008-12-01 Q8 both for compiling and command line tests. The Shephards example works on the command line.
Am I doing something wrong or is this a bug?
Pete
The program works fine when doing his first Voronoi example:
But if I just change VoronoiColorInterpolate to ShepardsColorInterpolate in the program, recompile and run it again, I get this:
I'm using IM 6.4.6 2008-12-01 Q8 both for compiling and command line tests. The Shephards example works on the command line.
Am I doing something wrong or is this a bug?
Pete
Code: Select all
#include <windows.h>
#include <wand/magick_wand.h>
void test_wand(LPTSTR lpCmdLine)
{
MagickWand *mw = NULL;
double l_doubles[] = {
30,10, 255, 0, 0, // red
10,80, 0, 0, 255, // blue
70,60, 0,128,0, // lime
80,20, 255,255,0 // yellow
};
MagickWandGenesis();
mw = NewMagickWand();
MagickSetSize(mw,100,100);
MagickReadImage(mw,"xc:");
if(!MagickSparseColorImage(mw,RedChannel|GreenChannel|BlueChannel,
ShepardsColorInterpolate,
sizeof(l_doubles)/sizeof(double),
l_doubles)
) {
MessageBox(NULL,"Failed","",MB_OK);
}
MagickWriteImage(mw,"sparse_s.png");
DestroyMagickWand(mw);
MagickWandTerminus();
}