<commit_before>//Create a 2-D histogram from an image.
//Author: <NAME>

void image2hist()
{
   TASImage image("rose512.jpg");
   UInt_t yPixels = image.GetHeight();
   UInt_t xPixels = image.GetWidth();
   UInt_t *argb   = image.GetArgbArray();

   TH2D* h = new TH2D("h","Rose histogram",xPixels,-1,1,yPixels,-1,1);

   for (int row=0; row<xPixels; ++row) {
      for (int col=0; col<yPixels; ++col) {
         int index = col*xPixels+row;
         float grey = float(argb[index]&0xff)/256;
         h->SetBinContent(row+1,yPixels-col,grey);
      }
   }

   gStyle->SetPalette(53);<commit_msg>Doxygen. Make sure the macro can be executed from anywhere.<commit_after>/// \file
/// \ingroup image
/// Create a 2-D histogram from an image.
///
/// \macro_image
/// \macro_code
///
/// \author <NAME>

void image2hist()
{
   TASImage image("$ROOTSYS/tutorials/image/rose512.jpg");
   UInt_t yPixels = image.GetHeight();
   UInt_t xPixels = image.GetWidth();
   UInt_t *argb   = image.GetArgbArray();

   TH2D* h = new TH2D("h","Rose histogram",xPixels,-1,1,yPixels,-1,1);

   for (int row=0; row<xPixels; ++row) {
      for (int col=0; col<yPixels; ++col) {
         int index = col*xPixels+row;
         float grey = float(argb[index]&0xff)/256;
         h->SetBinContent(row+1,yPixels-col,grey);
      }
   }

   gStyle->SetPalette(kCubehelix);
{'fraction_non_alphanumeric': 0.1724907063197026, 'fraction_numerical': 0.02825278810408922, 'mean_word_length': 3.042042042042042, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5690986', 'n_tokens_mistral': 551, 'n_tokens_neox': 515, 'n_words': 104}