PixelGetBlueQuantum doesn't work in HDRI
Posted: 2014-06-19T14:49:37-07:00
The ImageMagick wand functions for getting colors as quantum values seem to not work. Code below gives the output:
"#define MagickSignature 0xabacadabUL"
Coincidentally, 'adab' appears to be part of the MagickSignature:Color pink Blue value is 0.796078, quantum adab
Color purple Blue value is 0.501961, quantum adab
Color red Blue value is 0.000000, quantum adab
Color blue Blue value is 1.000000, quantum adab
"#define MagickSignature 0xabacadabUL"
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <wand/MagickWand.h>
int main(int argc,char **argv) {
int i;
double blueValue;
Quantum blueQuantum;
MagickWandGenesis();
char * color;
PixelWand *pixel_wand = NULL;
char *colors[] = {"pink", "purple", "red", "blue", "rgb(13, 13, 13)"};
for (i=0; i<4 ; i++) {
color = colors[i];
pixel_wand = NewPixelWand();
PixelSetColor(pixel_wand, color);
blueValue = PixelGetBlue(pixel_wand);
blueQuantum = PixelGetBlueQuantum(pixel_wand);
printf("Color %s \t Blue value is %f, quantum %x\n", color, blueValue, blueQuantum);
}
MagickWandTerminus();
return(0);
}