I’m working with .tif images which are in 32 bit ARGB format. (alpha, red, green, blue). I’ve written code which extracts the alpha, red, green and blue components and puts them into their own 2D histograms. But what I would really like is to have a TH2I histogram and a 32bit (or 24 bit, I can strip off the alpha portion of the ARGB pixel value) color palette so when I call the ->Draw(“col”) member function, the 2D hist is drawn with the full 32bit color scheme. Any pointers?
TH2I *pRGBHist = new TH2I(....);
int Bluepixelvalue = 0xff0000; // Pure blue
int Yellowpixelvalue = 0x00ffff; // pure yellow (equal mix of red and green)
pRGBHist->SetBinContent(1,1, Bluepixelvalue);
pRGBHist->SetBinContent(2,2, Yellowpixelvalue);
pRGBHist->Draw("col"); // displays binx 1, biny 1 in blue, binx 2, bin2 in yellow.
I think this code snipit explains what I’d like to do.