// @(#)root/postscript:$Id$
// Author: Valeriy Onuchin

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TImageDump                                                           //
//                                                                      //
// save canvas as an image (GIF, JPEG, PNG, XPM, TIFF etc.)             //
// in batch mode.  Example:                                             //
//                                                                      //
//         $ root -b                                                    //
//         root [0] .x hsimple.C                                        //
//         root [1] c1->Print("c1.gif");                                //
//                                                                      //
// TImageDump can be used in any mode (batch, interactive) as follows   //
//                                                                      //
//    TCanvas *c1;                                                      //
//    TImageDump *imgdump = new TImageDump("test.png");                 //
//    c1->Paint();                                                      //
//    imgdump->Close();                                                 //
//                                                                      //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#include "TImageDump.h"
#include "TImage.h"
#include "TMath.h"
#include "TPoint.h"
#include "TColor.h"
#include "TVirtualPad.h"
#include "TEnv.h"
#include "TROOT.h"
#include "TSystem.h"
#include "TText.h"
#include "RStipples.h"
#include "TList.h"
#include "TStyle.h"
#include "TObjString.h"
#include "TObjArray.h"


ClassImp(TImageDump)


//______________________________________________________________________________
TImageDump::TImageDump() : TVirtualPS()
{
   // Default SVG constructor

   fStream    = 0;
   fImage     = 0;
   gVirtualPS = this;
   fType      = 0;
   SetTitle("IMG");
}

//______________________________________________________________________________
TImageDump::TImageDump(const char *fname, Int_t wtype) : TVirtualPS(fname, wtype)
{
   // Initialize batch image interface
   //
   //  fname : image file name
   //
   //    The possible workstation types are:
   //  111 - Portrait
   //  112 - Landscape
   //  114 - preview, keep in memory (do not write on delete)

   Open(fname, wtype);
   gVirtualPS = this;
   SetTitle("IMG");
}

//______________________________________________________________________________
void TImageDump::Open(const char *fname, Int_t type)
{
   // Open a image file

   fStream = 0;
   fImage  = TImage::Create();
   fType   = type;
   SetName(fname);
}

//______________________________________________________________________________
TImageDump::~TImageDump()
{
   // destructor

   Close();

   delete fImage;
   fImage = 0;

   gVirtualPS = 0;
}

//______________________________________________________________________________
void TImageDump::Close(Option_t *)
{
   // Close a image file

   // if fType == 114 - do not write image
   if (!fImage || (fType == 114)) {
      return;
   }

   //if (fType == 112) fImage->Flip(90);
   fImage->WriteImage(GetName());
}

//______________________________________________________________________________
void TImageDump::DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t  y2)
{
   // Draw a Box

   if (!gPad || !fImage) {
      return;
   }

   fImage->BeginPaint();

   static Double_t x[4], y[4];
   Int_t ix1 = x1 < x2 ? XtoPixel(x1) : XtoPixel(x2);
   Int_t ix2 = x1 < x2 ? XtoPixel(x2) : XtoPixel(x1);
   Int_t iy1 = y1 < y2 ? YtoPixel(y1) : YtoPixel(y2);
   Int_t iy2 = y1 < y2 ? YtoPixel(y2) : YtoPixel(y1);

   if (ix1<0 || ix2 <0 || iy1 < 0 || iy2 <0) return; // box is not visible

   if (TMath::Abs(ix2-ix1) < 1) ix2 = ix1+1;
   if (TMath::Abs(iy1-iy2) < 1) iy1 = iy2+1;

   Int_t fillis = fFillStyle/1000;
   Int_t fillsi = fFillStyle%1000;

   TColor *col = gROOT->GetColor(fFillColor);
   if (!col) { // no color, set it white
      fFillColor = 10;
      col = gROOT->GetColor(fFillColor);
      if (!col) return;
   }

   TColor *linecol = gROOT->GetColor(fLineColor);
   if (!linecol) { // no color, set it to black
      fLineColor = 1;
      linecol = gROOT->GetColor(fLineColor);
   }

   if ((fillis == 3) || (fillis == 2)) {
      if (fillsi > 99) {
         x[0] = x1;   y[0] = y1;
         x[1] = x2;   y[1] = y1;
         x[2] = x2;   y[2] = y2;
         x[3] = x1;   y[3] = y2;
         return;
      }
      if ((fillsi > 0) && (fillsi < 26)) {
         x[0] = x1;   y[0] = y1;
         x[1] = x2;   y[1] = y1;
         x[2] = x2;   y[2] = y2;
         x[3] = x1;   y[3] = y2;
         DrawPS(-4, &x[0], &y[0]);
      }
      if (fillsi == -3) {
         // fill style = -3 ... which is NEVER used now
      }
   }

   if (fillis == 1) {
      fImage->DrawBox(ix1, iy1, ix2, iy2, col->AsHexString(), 1, TVirtualX::kFilled);
   }

   if (fillis == 0) {
      fImage->DrawBox(ix1, iy1, ix2, iy2, linecol->AsHexString(), fLineWidth, TVirtualX::kHollow);
   }
}

//______________________________________________________________________________
void TImageDump::DrawFrame(Double_t x1, Double_t y1, Double_t x2, Double_t  y2,
                            Int_t mode, Int_t bordersize, Int_t dark, Int_t light)
{
   // Draw a Frame around a box
   //
   // mode = -1  the box looks as it is behind the screen
   // mode =  1  the box looks as it is in front of the screen
   // border is the border size in already pre-computed dark is the
   // color for the dark part of the frame light is the color for the light
   // part of the frame

   if (!gPad || !fImage) {
      return;
   }

   fImage->BeginPaint();

   bordersize = bordersize < 1 ? 1 : bordersize;

   TColor *col;
   TColor *lo = gROOT->GetColor(dark);
   if (!lo) {
      lo = gROOT->GetColor(10);
   }
   TColor *hi = gROOT->GetColor(light);
   if (!hi) {
      hi = gROOT->GetColor(10);
   }

   Short_t pxl,pyl,pxt,pyt,px1,py1,px2,py2;

   px1 = XtoPixel(x1);   py1 = YtoPixel(y1);
   px2 = XtoPixel(x2);   py2 = YtoPixel(y2);
   if (px1 < px2) {pxl = px1; pxt = px2;}
   else           {pxl = px2; pxt = px1;}
   if (py1 > py2) {pyl = py1; pyt = py2;}
   else           {pyl = py2; pyt = py1;}

   if (bordersize == 1) {
      col = gROOT->GetColor(fLineColor);
      if (!col) {
         fLineColor = 1;
         col = gROOT->GetColor(fLineColor);
         if (!col) return;
      }
      fImage->DrawBox(pxl, pyl, pxt, pyt-1, col->AsHexString(),  TVirtualX::kFilled);
      return;
   }

   if (!fImage->IsValid()) {
      col = gROOT->GetColor(light);
      if (!col) {
         col = gROOT->GetColor(10);
         if (!col) return;
      }
      fImage->DrawBox(pxl, pyl, pxt, pyt, // force image creation and resizing
                      "#ffffffff", 1,  TVirtualX::kFilled);
   }

   TPoint frame[6];

   frame[0].fX = pxl;                 frame[0].fY = pyl;
   frame[1].fX = pxl + bordersize;    frame[1].fY = pyl - bordersize;
   frame[2].fX = pxl + bordersize;    frame[2].fY = pyt + bordersize;
   frame[3].fX = pxt - bordersize;    frame[3].fY = pyt + bordersize;;
   frame[4].fX = pxt;                 frame[4].fY = pyt;
   frame[5].fX = pxl;                 frame[5].fY = pyt;

   if (mode == -1) col = lo;
   else            col = hi;

   fImage->DrawFillArea(6, frame, col->AsHexString());

   frame[0].fX = pxl;                 frame[0].fY = pyl;
   frame[1].fX = pxl + bordersize;    frame[1].fY = pyl - bordersize;
   frame[2].fX = pxt - bordersize;    frame[2].fY = frame[1].fY;
   frame[3].fX = frame[2].fX;         frame[3].fY = pyt + bordersize;
   frame[4].fX = pxt;                 frame[4].fY = pyt;
   frame[5].fX = pxt;                 frame[5].fY = pyl;

   if (mode == -1) col = hi;
   else            col = lo;

   fImage->DrawFillArea(6, frame, col->AsHexString());
}

//______________________________________________________________________________
void TImageDump::DrawPolyMarker(Int_t, Float_t *, Float_t *)
{
   // not used

   if (!gPad || !fImage) {
      return;
   }
}

//______________________________________________________________________________
void TImageDump::DrawPolyMarker(Int_t n, Double_t *xw, Double_t *yw)
{
   // draw polymarker

   if (!gPad || !fImage) {
      return;
   }

   fImage->BeginPaint();

   Int_t ms = TMath::Abs(fMarkerStyle);
   static TPoint pt[20];

   if (ms > 7 && ms <= 19) ms = 20;
   if (ms == 4) ms = 24;

   // Define the marker size
   const Int_t kBASEMARKER = 8;
   Double_t msize = fMarkerSize * kBASEMARKER;
   if (ms == 6) msize *= 0.2;
   if (ms == 7) msize *= 0.3;
   Double_t m  = msize;
   Double_t m2 = m/2;
   Double_t m3 = m/3;
   Double_t m6 = m/6;

   TColor *col = gROOT->GetColor(fMarkerColor);
   if (!col) { // no color
      fMarkerColor = 1;
      col = gROOT->GetColor(fMarkerColor);
      if (!col) return;
   }

   // Draw the marker according to the type
   Short_t ix,iy;
   for (Int_t i=0;i<n;i++) {
      ix = XtoPixel(xw[i]);
      iy = YtoPixel(yw[i]);

      switch (ms) {
      // Dots (.) big, medium and small
      case 7:
         fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy-1, col->AsHexString());
         fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy+1, col->AsHexString());
         fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy+1, col->AsHexString());
         fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy-1, col->AsHexString());
      case 6:
         fImage->PutPixel((UInt_t)ix,   (UInt_t)iy-1, col->AsHexString());
         fImage->PutPixel((UInt_t)ix,   (UInt_t)iy+1, col->AsHexString());
         fImage->PutPixel((UInt_t)ix-1, (UInt_t)iy,   col->AsHexString());
         fImage->PutPixel((UInt_t)ix+1, (UInt_t)iy,   col->AsHexString());
      case 1:
         fImage->PutPixel((UInt_t)ix,   (UInt_t)iy,   col->AsHexString());
         break;
      // Plus (+)
      case 2:
         fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString());
         fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), col->AsHexString());
         break;
      // X shape (X)
      case 5:
         fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(ix+m2), UInt_t(iy+m2), col->AsHexString());
         fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy+m2), UInt_t(ix+m2), UInt_t(iy-m2), col->AsHexString());
         break;
      // Asterisk shape (*)
      case 3:
      case 31:
         fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy), UInt_t(ix+m2), UInt_t(iy), col->AsHexString());
         fImage->DrawLine(UInt_t(ix), UInt_t(iy-m2), UInt_t(ix), UInt_t(iy+m2), col->AsHexString());
         fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(ix+m2), UInt_t(iy+m2), col->AsHexString());
         fImage->DrawLine(UInt_t(ix-m2), UInt_t(iy+m2), UInt_t(ix+m2), UInt_t(iy-m2), col->AsHexString());
         break;
      // Circle
      case 4:
      case 24:
         fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), 1);
         break;
      // Circle
      case 8:
      case 20:
         fImage->DrawCircle(ix, iy, Int_t(msize/2), col->AsHexString(), -1);
         break;
      // Square
      case 21:
         fImage->FillRectangle(col->AsHexString(), UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(m), UInt_t(m));
         break;
      case 25:
         fImage->DrawRectangle(UInt_t(ix-m2), UInt_t(iy-m2), UInt_t(m), UInt_t(m), col->AsHexString());
         break;
      // Down triangle
      case 23:
      case 32:
         pt[0].fX = Short_t(ix-m2); pt[0].fY = Short_t(iy-m2);
         pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy-m2);
         pt[2].fX = Short_t(ix);    pt[2].fY = Short_t(iy+m2);
         pt[3].fX = Short_t(ix-m2); pt[3].fY = Short_t(iy-m2);
         ms == 32 ? fImage->DrawPolyLine(4, pt, col->AsHexString()) :
                    fImage->FillPolygon(3, pt, col->AsHexString());
         break;
      // Up triangle
      case 22:
      case 26:
         pt[0].fX = Short_t(ix);    pt[0].fY = Short_t(iy-m2);
         pt[1].fX = Short_t(ix+m2); pt[1].fY = Short_t(iy+m2);
         pt[2].fX = Short_t(ix-m2); pt[2].fY = Short_t(iy+m2);
         pt[3].fX = Short_t(ix);    pt[3].fY = Short_t(iy-m2);
         ms == 26 ? fImage->DrawPolyLine(4, pt, col->AsHexString()) :
                    fImage->FillPolygon(3, pt, col->AsHexString());
         break;
      case 27:
      case 33:
         pt[0].fX = Short_t(ix);    pt[0].fY = Short_t(iy-m2);
         pt[1].fX = Short_t(ix+m3); pt[1].fY = Short_t(iy);
         pt[2].fX = Short_t(ix);    pt[2].fY = Short_t(iy+m2);
         pt[3].fX = Short_t(ix-m3); pt[3].fY = Short_t(iy);
         pt[4].fX = Short_t(ix);    pt[4].fY = Short_t(iy-m2);
         ms == 27 ? fImage->DrawPolyLine(5, pt, col->AsHexString()) :
                    fImage->FillPolygon(4, pt, col->AsHexString());
         break;
      case 28:
      case 34:
         pt[0].fX = Short_t(ix-m6);  pt[0].fY = Short_t(iy-m6);
         pt[1].fX = Short_t(ix-m6);  pt[1].fY = Short_t(iy-m2);
         pt[2].fX = Short_t(ix+m6);  pt[2].fY = Short_t(iy-m2);
         pt[3].fX = Short_t(ix+m6);  pt[3].fY = Short_t(iy-m6);
         pt[4].fX = Short_t(ix+m2);  pt[4].fY = Short_t(iy-m6);
         pt[5].fX = Short_t(ix+m2);  pt[5].fY = Short_t(iy+m6);
         pt[6].fX = Short_t(ix+m6);  pt[6].fY = Short_t(iy+m6);
         pt[7].fX = Short_t(ix+m6);  pt[7].fY = Short_t(iy+m2);
         pt[8].fX = Short_t(ix-m6);  pt[8].fY = Short_t(iy+m2);
         pt[9].fX = Short_t(ix-m6);  pt[9].fY = Short_t(iy+m6);
         pt[10].fX = Short_t(ix-m2); pt[10].fY = Short_t(iy+m6);
         pt[11].fX = Short_t(ix-m2); pt[11].fY = Short_t(iy-m6);
         pt[12].fX = Short_t(ix-m6); pt[12].fY = Short_t(iy-m6);
         ms == 28 ? fImage->DrawPolyLine(13, pt, col->AsHexString()) :
                    fImage->FillPolygon(12, pt, col->AsHexString());
         break;
      case 29:
      case 30:
         pt[0].fX = Short_t(ix);             pt[0].fY = Short_t(iy+m2);
         pt[1].fX = Short_t(ix+0.112255*m);  pt[1].fY = Short_t(iy+0.15451*m);
         pt[2].fX = Short_t(ix+0.47552*m);   pt[2].fY = Short_t(iy+0.15451*m);
         pt[3].fX = Short_t(ix+0.181635*m);  pt[3].fY = Short_t(iy-0.05902*m);
         pt[4].fX = Short_t(ix+0.29389*m);   pt[4].fY = Short_t(iy-0.40451*m);
         pt[5].fX = Short_t(ix);             pt[5].fY = Short_t(iy-0.19098*m);
         pt[6].fX = Short_t(ix-0.29389*m);   pt[6].fY = Short_t(iy-0.40451*m);
         pt[7].fX = Short_t(ix-0.181635*m);  pt[7].fY = Short_t(iy-0.05902*m);
         pt[8].fX = Short_t(ix-0.47552*m);   pt[8].fY = Short_t(iy+0.15451*m);
         pt[9].fX = Short_t(ix-0.112255*m);  pt[9].fY = Short_t(iy+0.15451*m);
         pt[10].fX = Short_t(ix);             pt[10].fY = Short_t(iy+m2);
         ms == 30 ? fImage->DrawPolyLine(11, pt, col->AsHexString()) :
                    fImage->DrawFillArea(10, pt, col->AsHexString());
         break;
      default:
         fImage->PutPixel(UInt_t(ix), UInt_t(iy), col->AsHexString());
         break;
      }
   }
}

//______________________________________________________________________________
void TImageDump::DrawPS(Int_t nn, Double_t *x, Double_t *y)
{
   // This function defines a path with xw and yw and draw it according the
   // value of nn:
   //
   //  If nn > 0 a line is drawn.
   //  If nn < 0 a closed polygon is drawn.

   if (!gPad || !fImage || !nn) {
      return;
   }

   fImage->BeginPaint();

   TColor *col = 0;
   Int_t  fais = 0 , fasi = 0;
   Bool_t line = nn > 1;
   UInt_t n = TMath::Abs(nn);

   fais = fFillStyle/1000;
   fasi = fFillStyle%1000;

   Short_t px1, py1, px2, py2;
   static const UInt_t gCachePtSize = 200;
   static TPoint gPointCache[gCachePtSize];
   Bool_t del = kTRUE;


   // SetLineStyle
   Int_t ndashes = 0;
   char *dash = 0;
   static char dashList[10];
   Int_t dashLength = 0;
   Int_t dashSize = 0;

   if (line) {
      // dash lines
      if (fLineStyle > 1) {
         TString st = gStyle->GetLineStyleString(fLineStyle);
         TObjArray *tokens = st.Tokenize(" ");
         ndashes = tokens->GetEntries();
         dash = new char[ndashes];

         for (int j = 0; j < ndashes; j++) {
            Int_t it;
            sscanf(((TObjString*)tokens->At(j))->GetName(), "%d", &it);
            dash[j] = (char)(it/4);
         }

         dashSize = TMath::Min((int)sizeof(dashList), ndashes);
         dashLength = 0;
         for (int i = 0; i < dashSize; i++ ) {
            dashList[i] = dash[i];
            dashLength += dashList[i];
         }
         delete tokens;
         delete [] dash;
      }

      // SetLineColor
      col = gROOT->GetColor(fLineColor);
      if (!col) { // no color, make it black
         fLineColor = 1;
         col = gROOT->GetColor(fLineColor);
         if (!col) return;
      }
   }

   if (n == 1) {  // point
      col = gROOT->GetColor(fFillColor);
      if (!col) { // no color, make it black
         fFillColor = 1;
         col = gROOT->GetColor(fFillColor);
         if (!col) return;
      }
      px1 = XtoPixel(x[0]);   py1 = YtoPixel(y[0]);
      fImage->PutPixel(px1, py1, col->AsHexString());
      return;
   }

   if (n == 2) {  // line
      px1 = XtoPixel(x[0]);   py1 = YtoPixel(y[0]);
      px2 = XtoPixel(x[1]);   py2 = YtoPixel(y[1]);

      // SetLineColor
      col = gROOT->GetColor(fLineColor);
      if (!col) { // no color, make it black
         fLineColor = 1;
         col = gROOT->GetColor(fLineColor);
         if (!col) return;
      }
      if (fLineStyle < 2) {
         fImage->DrawLine(px1, py1, px2, py2, col->AsHexString(), fLineWidth);
      } else {
         fImage->DrawDashLine(px1, py1, px2, py2, dashSize, (const char*)dashList,
                                 col->AsHexString(), fLineWidth);
      }
      return;
   }

   if (!line && ((fais == 3) || (fais == 2)) && (fasi > 100) ) {
      return;
   }

   TPoint *pt = 0;
   if (n+1 < gCachePtSize) {
      pt = (TPoint*)&gPointCache;
      del = kFALSE;
   } else {
      pt = new TPoint[n+1];
      del = kTRUE;
   }

   TColor *fcol = gROOT->GetColor(fFillColor);
   if (!fcol) { // no color, set it white
      fFillColor = 10;
      fcol = gROOT->GetColor(fFillColor);
   }

   TColor *lcol = gROOT->GetColor(fLineColor);
   if (!lcol) { // no color, make it black
      fLineColor = 1;
      lcol = gROOT->GetColor(fLineColor);
   }

   for (UInt_t i = 0; i < n; i++) {
      pt[i].fX = XtoPixel(x[i]);
      pt[i].fY = YtoPixel(y[i]);
   }
   pt[n].fX = pt[0].fX;
   pt[n].fY = pt[0].fY;

   const char *stipple = (fais == 3) && (fasi > 0) && (fasi < 26) ? (const char*)gStipples[fasi] : 0;

   // filled polygon
   if (!line && fFillStyle && (fFillStyle != 4000)) {
      if (!fcol) return;

      if (n < 5) {   // convex
         fImage->FillPolygon(n, pt, fcol->AsHexString(), stipple);
      } else {       // non-convex fill area
         fImage->DrawFillArea(n, pt, fcol->AsHexString(), stipple);
      }
   }

   // hollow polygon or polyline is drawn
   if (line || !fFillStyle || (fFillStyle == 4000)) {
      if (!lcol) return;
      if (!line) {
         fImage->DrawPolyLine(n+1, pt, fcol->AsHexString(), 1);
      } else {
         if (fLineStyle < 2) { // solid
            fImage->DrawPolyLine(n, pt, lcol->AsHexString(), fLineWidth);
         } else { // dashed
            DrawDashPolyLine(n, pt,  dashSize, (const char*)dashList,
                            lcol->AsHexString(), fLineWidth);
         }
      }
   }
   if (del) delete [] pt;
}

//______________________________________________________________________________
void TImageDump::DrawPS(Int_t, Float_t *, Float_t *)
{
   // not used

   if (!gPad || !fImage) {
      return;
   }
}
//______________________________________________________________________________
void TImageDump::DrawDashPolyLine(Int_t nn, TPoint *xy, UInt_t nDash,
                                    const char* pDash, const char* col, UInt_t thick)
{
   // draw dashed polyline

   Int_t x0 = xy[0].GetX();
   Int_t y0 = xy[0].GetY();
   Int_t x = 0;
   Int_t y = 0;

   for (Int_t i = 1; i < nn; i++) {
      x = xy[i].GetX();
      y = xy[i].GetY();

      fImage->DrawDashLine(x0, y0, x, y, nDash, pDash, col, thick);

      x0 = x;
      y0 = y;
   }
}

//______________________________________________________________________________
void TImageDump::NewPage()
{
   // new page

   if (gPad && fImage) {
      UInt_t w = UInt_t(gPad->GetWw()*gPad->GetWNDC());
      UInt_t h = UInt_t(gPad->GetWh()*gPad->GetHNDC());
      fImage->DrawRectangle(0, 0, w, h, "#ffffffff");
   }
   return;
}

//______________________________________________________________________________
void TImageDump::Text(Double_t x, Double_t y, const char *chars)
{
   // Draw text
   //
   // x: x position of the text
   // y: y position of the text

   if (!gPad || !fImage) {
      return;
   }

   fImage->BeginPaint();

   TText t(x, y, chars);
   t.SetTextSize(fTextSize);
   t.SetTextFont(fTextFont);
   t.SetTextAlign(fTextAlign);
   t.SetTextAngle(fTextAngle);
   t.SetTextColor(fTextColor);
   fImage->DrawText(&t, XtoPixel(x), YtoPixel(y));
}


//______________________________________________________________________________
void TImageDump::Text(Double_t x, Double_t y, const wchar_t *chars)
{
   // Draw text
   //
   // x: x position of the text
   // y: y position of the text

   if (!gPad || !fImage) {
      return;
   }

   fImage->BeginPaint();

   TText t(x, y, chars);
   t.SetTextSize(fTextSize);
   t.SetTextFont(fTextFont);
   t.SetTextAlign(fTextAlign);
   t.SetTextAngle(fTextAngle);
   t.SetTextColor(fTextColor);
   fImage->DrawText(&t, XtoPixel(x), YtoPixel(y));
}


////////////////////////// CellArray code ////////////////////////////////////
static UInt_t *gCellArrayColors = 0;
static Int_t   gCellArrayN = 0;
static Int_t   gCellArrayW = 0;
static Int_t   gCellArrayH = 0;
static Int_t   gCellArrayX1 = 0;
static Int_t   gCellArrayX2 = 0;
static Int_t   gCellArrayY1 = 0;
static Int_t   gCellArrayY2 = 0;
static Int_t   gCellArrayIdx = 0;

//______________________________________________________________________________
void TImageDump::CellArrayBegin(Int_t w, Int_t h, Double_t x1, Double_t x2,
                                Double_t y1, Double_t y2)
{
   //cell array begin

   if (!gPad || !fImage || (w <= 0) || (h <= 0)) {
      return;
   }

   if (gCellArrayColors) {
      delete [] gCellArrayColors;
   }

   fImage->BeginPaint();

   gCellArrayN = w * h;
   gCellArrayW = w;
   gCellArrayH = h;
   gCellArrayColors = new UInt_t[gCellArrayN];

   gCellArrayX1 = x1 < x2 ? XtoPixel(x1) : XtoPixel(x2);
   gCellArrayX2 = x1 > x2 ? XtoPixel(x2) : XtoPixel(x1);
   gCellArrayY1 = y1 < y2 ? YtoPixel(y1) : YtoPixel(y2);
   gCellArrayY2 = y1 < y2 ? YtoPixel(y2) : YtoPixel(y1);

   gCellArrayIdx = 0;
}

//______________________________________________________________________________
void TImageDump::CellArrayFill(Int_t r, Int_t g, Int_t b)
{
   //Cell array fill

   if (gCellArrayIdx >= gCellArrayN) return;

   fImage->BeginPaint();

   gCellArrayColors[gCellArrayIdx] = ((r & 0xFF) << 16) + ((g & 0xFF) << 8) + (b & 0xFF);
   gCellArrayIdx++;
}

//______________________________________________________________________________
void TImageDump::CellArrayEnd()
{
   //Cell array end

   if (!fImage || !gCellArrayColors || !gCellArrayW || !gCellArrayH) {
      return;
   }

   fImage->BeginPaint();

   fImage->DrawCellArray(gCellArrayX1, gCellArrayX2, gCellArrayY1, gCellArrayY2,
                         gCellArrayW, gCellArrayH, gCellArrayColors);

   delete [] gCellArrayColors;
   gCellArrayColors = 0;
   gCellArrayN = 0;
   gCellArrayW = 0;
   gCellArrayH = 0;
   gCellArrayX1 = 0;
   gCellArrayX2 = 0;
   gCellArrayY1 = 0;
   gCellArrayY2 = 0;
   gCellArrayIdx = 0;
}

//______________________________________________________________________________
void TImageDump::SetColor(Float_t /*r*/, Float_t /*g*/, Float_t /*b*/)
{
   // Set color with its R G B components
   //
   //  r: % of red in [0,1]
   //  g: % of green in [0,1]
   //  b: % of blue in [0,1]

}

//______________________________________________________________________________
Int_t TImageDump::XtoPixel(Double_t x)
{
   // x to pixel

   return  gPad->XtoAbsPixel(x);
}

//______________________________________________________________________________
Int_t TImageDump::YtoPixel(Double_t y)
{
   // y to pixel

   return  gPad->YtoAbsPixel(y);
}
 TImageDump.cxx:1
 TImageDump.cxx:2
 TImageDump.cxx:3
 TImageDump.cxx:4
 TImageDump.cxx:5
 TImageDump.cxx:6
 TImageDump.cxx:7
 TImageDump.cxx:8
 TImageDump.cxx:9
 TImageDump.cxx:10
 TImageDump.cxx:11
 TImageDump.cxx:12
 TImageDump.cxx:13
 TImageDump.cxx:14
 TImageDump.cxx:15
 TImageDump.cxx:16
 TImageDump.cxx:17
 TImageDump.cxx:18
 TImageDump.cxx:19
 TImageDump.cxx:20
 TImageDump.cxx:21
 TImageDump.cxx:22
 TImageDump.cxx:23
 TImageDump.cxx:24
 TImageDump.cxx:25
 TImageDump.cxx:26
 TImageDump.cxx:27
 TImageDump.cxx:28
 TImageDump.cxx:29
 TImageDump.cxx:30
 TImageDump.cxx:31
 TImageDump.cxx:32
 TImageDump.cxx:33
 TImageDump.cxx:34
 TImageDump.cxx:35
 TImageDump.cxx:36
 TImageDump.cxx:37
 TImageDump.cxx:38
 TImageDump.cxx:39
 TImageDump.cxx:40
 TImageDump.cxx:41
 TImageDump.cxx:42
 TImageDump.cxx:43
 TImageDump.cxx:44
 TImageDump.cxx:45
 TImageDump.cxx:46
 TImageDump.cxx:47
 TImageDump.cxx:48
 TImageDump.cxx:49
 TImageDump.cxx:50
 TImageDump.cxx:51
 TImageDump.cxx:52
 TImageDump.cxx:53
 TImageDump.cxx:54
 TImageDump.cxx:55
 TImageDump.cxx:56
 TImageDump.cxx:57
 TImageDump.cxx:58
 TImageDump.cxx:59
 TImageDump.cxx:60
 TImageDump.cxx:61
 TImageDump.cxx:62
 TImageDump.cxx:63
 TImageDump.cxx:64
 TImageDump.cxx:65
 TImageDump.cxx:66
 TImageDump.cxx:67
 TImageDump.cxx:68
 TImageDump.cxx:69
 TImageDump.cxx:70
 TImageDump.cxx:71
 TImageDump.cxx:72
 TImageDump.cxx:73
 TImageDump.cxx:74
 TImageDump.cxx:75
 TImageDump.cxx:76
 TImageDump.cxx:77
 TImageDump.cxx:78
 TImageDump.cxx:79
 TImageDump.cxx:80
 TImageDump.cxx:81
 TImageDump.cxx:82
 TImageDump.cxx:83
 TImageDump.cxx:84
 TImageDump.cxx:85
 TImageDump.cxx:86
 TImageDump.cxx:87
 TImageDump.cxx:88
 TImageDump.cxx:89
 TImageDump.cxx:90
 TImageDump.cxx:91
 TImageDump.cxx:92
 TImageDump.cxx:93
 TImageDump.cxx:94
 TImageDump.cxx:95
 TImageDump.cxx:96
 TImageDump.cxx:97
 TImageDump.cxx:98
 TImageDump.cxx:99
 TImageDump.cxx:100
 TImageDump.cxx:101
 TImageDump.cxx:102
 TImageDump.cxx:103
 TImageDump.cxx:104
 TImageDump.cxx:105
 TImageDump.cxx:106
 TImageDump.cxx:107
 TImageDump.cxx:108
 TImageDump.cxx:109
 TImageDump.cxx:110
 TImageDump.cxx:111
 TImageDump.cxx:112
 TImageDump.cxx:113
 TImageDump.cxx:114
 TImageDump.cxx:115
 TImageDump.cxx:116
 TImageDump.cxx:117
 TImageDump.cxx:118
 TImageDump.cxx:119
 TImageDump.cxx:120
 TImageDump.cxx:121
 TImageDump.cxx:122
 TImageDump.cxx:123
 TImageDump.cxx:124
 TImageDump.cxx:125
 TImageDump.cxx:126
 TImageDump.cxx:127
 TImageDump.cxx:128
 TImageDump.cxx:129
 TImageDump.cxx:130
 TImageDump.cxx:131
 TImageDump.cxx:132
 TImageDump.cxx:133
 TImageDump.cxx:134
 TImageDump.cxx:135
 TImageDump.cxx:136
 TImageDump.cxx:137
 TImageDump.cxx:138
 TImageDump.cxx:139
 TImageDump.cxx:140
 TImageDump.cxx:141
 TImageDump.cxx:142
 TImageDump.cxx:143
 TImageDump.cxx:144
 TImageDump.cxx:145
 TImageDump.cxx:146
 TImageDump.cxx:147
 TImageDump.cxx:148
 TImageDump.cxx:149
 TImageDump.cxx:150
 TImageDump.cxx:151
 TImageDump.cxx:152
 TImageDump.cxx:153
 TImageDump.cxx:154
 TImageDump.cxx:155
 TImageDump.cxx:156
 TImageDump.cxx:157
 TImageDump.cxx:158
 TImageDump.cxx:159
 TImageDump.cxx:160
 TImageDump.cxx:161
 TImageDump.cxx:162
 TImageDump.cxx:163
 TImageDump.cxx:164
 TImageDump.cxx:165
 TImageDump.cxx:166
 TImageDump.cxx:167
 TImageDump.cxx:168
 TImageDump.cxx:169
 TImageDump.cxx:170
 TImageDump.cxx:171
 TImageDump.cxx:172
 TImageDump.cxx:173
 TImageDump.cxx:174
 TImageDump.cxx:175
 TImageDump.cxx:176
 TImageDump.cxx:177
 TImageDump.cxx:178
 TImageDump.cxx:179
 TImageDump.cxx:180
 TImageDump.cxx:181
 TImageDump.cxx:182
 TImageDump.cxx:183
 TImageDump.cxx:184
 TImageDump.cxx:185
 TImageDump.cxx:186
 TImageDump.cxx:187
 TImageDump.cxx:188
 TImageDump.cxx:189
 TImageDump.cxx:190
 TImageDump.cxx:191
 TImageDump.cxx:192
 TImageDump.cxx:193
 TImageDump.cxx:194
 TImageDump.cxx:195
 TImageDump.cxx:196
 TImageDump.cxx:197
 TImageDump.cxx:198
 TImageDump.cxx:199
 TImageDump.cxx:200
 TImageDump.cxx:201
 TImageDump.cxx:202
 TImageDump.cxx:203
 TImageDump.cxx:204
 TImageDump.cxx:205
 TImageDump.cxx:206
 TImageDump.cxx:207
 TImageDump.cxx:208
 TImageDump.cxx:209
 TImageDump.cxx:210
 TImageDump.cxx:211
 TImageDump.cxx:212
 TImageDump.cxx:213
 TImageDump.cxx:214
 TImageDump.cxx:215
 TImageDump.cxx:216
 TImageDump.cxx:217
 TImageDump.cxx:218
 TImageDump.cxx:219
 TImageDump.cxx:220
 TImageDump.cxx:221
 TImageDump.cxx:222
 TImageDump.cxx:223
 TImageDump.cxx:224
 TImageDump.cxx:225
 TImageDump.cxx:226
 TImageDump.cxx:227
 TImageDump.cxx:228
 TImageDump.cxx:229
 TImageDump.cxx:230
 TImageDump.cxx:231
 TImageDump.cxx:232
 TImageDump.cxx:233
 TImageDump.cxx:234
 TImageDump.cxx:235
 TImageDump.cxx:236
 TImageDump.cxx:237
 TImageDump.cxx:238
 TImageDump.cxx:239
 TImageDump.cxx:240
 TImageDump.cxx:241
 TImageDump.cxx:242
 TImageDump.cxx:243
 TImageDump.cxx:244
 TImageDump.cxx:245
 TImageDump.cxx:246
 TImageDump.cxx:247
 TImageDump.cxx:248
 TImageDump.cxx:249
 TImageDump.cxx:250
 TImageDump.cxx:251
 TImageDump.cxx:252
 TImageDump.cxx:253
 TImageDump.cxx:254
 TImageDump.cxx:255
 TImageDump.cxx:256
 TImageDump.cxx:257
 TImageDump.cxx:258
 TImageDump.cxx:259
 TImageDump.cxx:260
 TImageDump.cxx:261
 TImageDump.cxx:262
 TImageDump.cxx:263
 TImageDump.cxx:264
 TImageDump.cxx:265
 TImageDump.cxx:266
 TImageDump.cxx:267
 TImageDump.cxx:268
 TImageDump.cxx:269
 TImageDump.cxx:270
 TImageDump.cxx:271
 TImageDump.cxx:272
 TImageDump.cxx:273
 TImageDump.cxx:274
 TImageDump.cxx:275
 TImageDump.cxx:276
 TImageDump.cxx:277
 TImageDump.cxx:278
 TImageDump.cxx:279
 TImageDump.cxx:280
 TImageDump.cxx:281
 TImageDump.cxx:282
 TImageDump.cxx:283
 TImageDump.cxx:284
 TImageDump.cxx:285
 TImageDump.cxx:286
 TImageDump.cxx:287
 TImageDump.cxx:288
 TImageDump.cxx:289
 TImageDump.cxx:290
 TImageDump.cxx:291
 TImageDump.cxx:292
 TImageDump.cxx:293
 TImageDump.cxx:294
 TImageDump.cxx:295
 TImageDump.cxx:296
 TImageDump.cxx:297
 TImageDump.cxx:298
 TImageDump.cxx:299
 TImageDump.cxx:300
 TImageDump.cxx:301
 TImageDump.cxx:302
 TImageDump.cxx:303
 TImageDump.cxx:304
 TImageDump.cxx:305
 TImageDump.cxx:306
 TImageDump.cxx:307
 TImageDump.cxx:308
 TImageDump.cxx:309
 TImageDump.cxx:310
 TImageDump.cxx:311
 TImageDump.cxx:312
 TImageDump.cxx:313
 TImageDump.cxx:314
 TImageDump.cxx:315
 TImageDump.cxx:316
 TImageDump.cxx:317
 TImageDump.cxx:318
 TImageDump.cxx:319
 TImageDump.cxx:320
 TImageDump.cxx:321
 TImageDump.cxx:322
 TImageDump.cxx:323
 TImageDump.cxx:324
 TImageDump.cxx:325
 TImageDump.cxx:326
 TImageDump.cxx:327
 TImageDump.cxx:328
 TImageDump.cxx:329
 TImageDump.cxx:330
 TImageDump.cxx:331
 TImageDump.cxx:332
 TImageDump.cxx:333
 TImageDump.cxx:334
 TImageDump.cxx:335
 TImageDump.cxx:336
 TImageDump.cxx:337
 TImageDump.cxx:338
 TImageDump.cxx:339
 TImageDump.cxx:340
 TImageDump.cxx:341
 TImageDump.cxx:342
 TImageDump.cxx:343
 TImageDump.cxx:344
 TImageDump.cxx:345
 TImageDump.cxx:346
 TImageDump.cxx:347
 TImageDump.cxx:348
 TImageDump.cxx:349
 TImageDump.cxx:350
 TImageDump.cxx:351
 TImageDump.cxx:352
 TImageDump.cxx:353
 TImageDump.cxx:354
 TImageDump.cxx:355
 TImageDump.cxx:356
 TImageDump.cxx:357
 TImageDump.cxx:358
 TImageDump.cxx:359
 TImageDump.cxx:360
 TImageDump.cxx:361
 TImageDump.cxx:362
 TImageDump.cxx:363
 TImageDump.cxx:364
 TImageDump.cxx:365
 TImageDump.cxx:366
 TImageDump.cxx:367
 TImageDump.cxx:368
 TImageDump.cxx:369
 TImageDump.cxx:370
 TImageDump.cxx:371
 TImageDump.cxx:372
 TImageDump.cxx:373
 TImageDump.cxx:374
 TImageDump.cxx:375
 TImageDump.cxx:376
 TImageDump.cxx:377
 TImageDump.cxx:378
 TImageDump.cxx:379
 TImageDump.cxx:380
 TImageDump.cxx:381
 TImageDump.cxx:382
 TImageDump.cxx:383
 TImageDump.cxx:384
 TImageDump.cxx:385
 TImageDump.cxx:386
 TImageDump.cxx:387
 TImageDump.cxx:388
 TImageDump.cxx:389
 TImageDump.cxx:390
 TImageDump.cxx:391
 TImageDump.cxx:392
 TImageDump.cxx:393
 TImageDump.cxx:394
 TImageDump.cxx:395
 TImageDump.cxx:396
 TImageDump.cxx:397
 TImageDump.cxx:398
 TImageDump.cxx:399
 TImageDump.cxx:400
 TImageDump.cxx:401
 TImageDump.cxx:402
 TImageDump.cxx:403
 TImageDump.cxx:404
 TImageDump.cxx:405
 TImageDump.cxx:406
 TImageDump.cxx:407
 TImageDump.cxx:408
 TImageDump.cxx:409
 TImageDump.cxx:410
 TImageDump.cxx:411
 TImageDump.cxx:412
 TImageDump.cxx:413
 TImageDump.cxx:414
 TImageDump.cxx:415
 TImageDump.cxx:416
 TImageDump.cxx:417
 TImageDump.cxx:418
 TImageDump.cxx:419
 TImageDump.cxx:420
 TImageDump.cxx:421
 TImageDump.cxx:422
 TImageDump.cxx:423
 TImageDump.cxx:424
 TImageDump.cxx:425
 TImageDump.cxx:426
 TImageDump.cxx:427
 TImageDump.cxx:428
 TImageDump.cxx:429
 TImageDump.cxx:430
 TImageDump.cxx:431
 TImageDump.cxx:432
 TImageDump.cxx:433
 TImageDump.cxx:434
 TImageDump.cxx:435
 TImageDump.cxx:436
 TImageDump.cxx:437
 TImageDump.cxx:438
 TImageDump.cxx:439
 TImageDump.cxx:440
 TImageDump.cxx:441
 TImageDump.cxx:442
 TImageDump.cxx:443
 TImageDump.cxx:444
 TImageDump.cxx:445
 TImageDump.cxx:446
 TImageDump.cxx:447
 TImageDump.cxx:448
 TImageDump.cxx:449
 TImageDump.cxx:450
 TImageDump.cxx:451
 TImageDump.cxx:452
 TImageDump.cxx:453
 TImageDump.cxx:454
 TImageDump.cxx:455
 TImageDump.cxx:456
 TImageDump.cxx:457
 TImageDump.cxx:458
 TImageDump.cxx:459
 TImageDump.cxx:460
 TImageDump.cxx:461
 TImageDump.cxx:462
 TImageDump.cxx:463
 TImageDump.cxx:464
 TImageDump.cxx:465
 TImageDump.cxx:466
 TImageDump.cxx:467
 TImageDump.cxx:468
 TImageDump.cxx:469
 TImageDump.cxx:470
 TImageDump.cxx:471
 TImageDump.cxx:472
 TImageDump.cxx:473
 TImageDump.cxx:474
 TImageDump.cxx:475
 TImageDump.cxx:476
 TImageDump.cxx:477
 TImageDump.cxx:478
 TImageDump.cxx:479
 TImageDump.cxx:480
 TImageDump.cxx:481
 TImageDump.cxx:482
 TImageDump.cxx:483
 TImageDump.cxx:484
 TImageDump.cxx:485
 TImageDump.cxx:486
 TImageDump.cxx:487
 TImageDump.cxx:488
 TImageDump.cxx:489
 TImageDump.cxx:490
 TImageDump.cxx:491
 TImageDump.cxx:492
 TImageDump.cxx:493
 TImageDump.cxx:494
 TImageDump.cxx:495
 TImageDump.cxx:496
 TImageDump.cxx:497
 TImageDump.cxx:498
 TImageDump.cxx:499
 TImageDump.cxx:500
 TImageDump.cxx:501
 TImageDump.cxx:502
 TImageDump.cxx:503
 TImageDump.cxx:504
 TImageDump.cxx:505
 TImageDump.cxx:506
 TImageDump.cxx:507
 TImageDump.cxx:508
 TImageDump.cxx:509
 TImageDump.cxx:510
 TImageDump.cxx:511
 TImageDump.cxx:512
 TImageDump.cxx:513
 TImageDump.cxx:514
 TImageDump.cxx:515
 TImageDump.cxx:516
 TImageDump.cxx:517
 TImageDump.cxx:518
 TImageDump.cxx:519
 TImageDump.cxx:520
 TImageDump.cxx:521
 TImageDump.cxx:522
 TImageDump.cxx:523
 TImageDump.cxx:524
 TImageDump.cxx:525
 TImageDump.cxx:526
 TImageDump.cxx:527
 TImageDump.cxx:528
 TImageDump.cxx:529
 TImageDump.cxx:530
 TImageDump.cxx:531
 TImageDump.cxx:532
 TImageDump.cxx:533
 TImageDump.cxx:534
 TImageDump.cxx:535
 TImageDump.cxx:536
 TImageDump.cxx:537
 TImageDump.cxx:538
 TImageDump.cxx:539
 TImageDump.cxx:540
 TImageDump.cxx:541
 TImageDump.cxx:542
 TImageDump.cxx:543
 TImageDump.cxx:544
 TImageDump.cxx:545
 TImageDump.cxx:546
 TImageDump.cxx:547
 TImageDump.cxx:548
 TImageDump.cxx:549
 TImageDump.cxx:550
 TImageDump.cxx:551
 TImageDump.cxx:552
 TImageDump.cxx:553
 TImageDump.cxx:554
 TImageDump.cxx:555
 TImageDump.cxx:556
 TImageDump.cxx:557
 TImageDump.cxx:558
 TImageDump.cxx:559
 TImageDump.cxx:560
 TImageDump.cxx:561
 TImageDump.cxx:562
 TImageDump.cxx:563
 TImageDump.cxx:564
 TImageDump.cxx:565
 TImageDump.cxx:566
 TImageDump.cxx:567
 TImageDump.cxx:568
 TImageDump.cxx:569
 TImageDump.cxx:570
 TImageDump.cxx:571
 TImageDump.cxx:572
 TImageDump.cxx:573
 TImageDump.cxx:574
 TImageDump.cxx:575
 TImageDump.cxx:576
 TImageDump.cxx:577
 TImageDump.cxx:578
 TImageDump.cxx:579
 TImageDump.cxx:580
 TImageDump.cxx:581
 TImageDump.cxx:582
 TImageDump.cxx:583
 TImageDump.cxx:584
 TImageDump.cxx:585
 TImageDump.cxx:586
 TImageDump.cxx:587
 TImageDump.cxx:588
 TImageDump.cxx:589
 TImageDump.cxx:590
 TImageDump.cxx:591
 TImageDump.cxx:592
 TImageDump.cxx:593
 TImageDump.cxx:594
 TImageDump.cxx:595
 TImageDump.cxx:596
 TImageDump.cxx:597
 TImageDump.cxx:598
 TImageDump.cxx:599
 TImageDump.cxx:600
 TImageDump.cxx:601
 TImageDump.cxx:602
 TImageDump.cxx:603
 TImageDump.cxx:604
 TImageDump.cxx:605
 TImageDump.cxx:606
 TImageDump.cxx:607
 TImageDump.cxx:608
 TImageDump.cxx:609
 TImageDump.cxx:610
 TImageDump.cxx:611
 TImageDump.cxx:612
 TImageDump.cxx:613
 TImageDump.cxx:614
 TImageDump.cxx:615
 TImageDump.cxx:616
 TImageDump.cxx:617
 TImageDump.cxx:618
 TImageDump.cxx:619
 TImageDump.cxx:620
 TImageDump.cxx:621
 TImageDump.cxx:622
 TImageDump.cxx:623
 TImageDump.cxx:624
 TImageDump.cxx:625
 TImageDump.cxx:626
 TImageDump.cxx:627
 TImageDump.cxx:628
 TImageDump.cxx:629
 TImageDump.cxx:630
 TImageDump.cxx:631
 TImageDump.cxx:632
 TImageDump.cxx:633
 TImageDump.cxx:634
 TImageDump.cxx:635
 TImageDump.cxx:636
 TImageDump.cxx:637
 TImageDump.cxx:638
 TImageDump.cxx:639
 TImageDump.cxx:640
 TImageDump.cxx:641
 TImageDump.cxx:642
 TImageDump.cxx:643
 TImageDump.cxx:644
 TImageDump.cxx:645
 TImageDump.cxx:646
 TImageDump.cxx:647
 TImageDump.cxx:648
 TImageDump.cxx:649
 TImageDump.cxx:650
 TImageDump.cxx:651
 TImageDump.cxx:652
 TImageDump.cxx:653
 TImageDump.cxx:654
 TImageDump.cxx:655
 TImageDump.cxx:656
 TImageDump.cxx:657
 TImageDump.cxx:658
 TImageDump.cxx:659
 TImageDump.cxx:660
 TImageDump.cxx:661
 TImageDump.cxx:662
 TImageDump.cxx:663
 TImageDump.cxx:664
 TImageDump.cxx:665
 TImageDump.cxx:666
 TImageDump.cxx:667
 TImageDump.cxx:668
 TImageDump.cxx:669
 TImageDump.cxx:670
 TImageDump.cxx:671
 TImageDump.cxx:672
 TImageDump.cxx:673
 TImageDump.cxx:674
 TImageDump.cxx:675
 TImageDump.cxx:676
 TImageDump.cxx:677
 TImageDump.cxx:678
 TImageDump.cxx:679
 TImageDump.cxx:680
 TImageDump.cxx:681
 TImageDump.cxx:682
 TImageDump.cxx:683
 TImageDump.cxx:684
 TImageDump.cxx:685
 TImageDump.cxx:686
 TImageDump.cxx:687
 TImageDump.cxx:688
 TImageDump.cxx:689
 TImageDump.cxx:690
 TImageDump.cxx:691
 TImageDump.cxx:692
 TImageDump.cxx:693
 TImageDump.cxx:694
 TImageDump.cxx:695
 TImageDump.cxx:696
 TImageDump.cxx:697
 TImageDump.cxx:698
 TImageDump.cxx:699
 TImageDump.cxx:700
 TImageDump.cxx:701
 TImageDump.cxx:702
 TImageDump.cxx:703
 TImageDump.cxx:704
 TImageDump.cxx:705
 TImageDump.cxx:706
 TImageDump.cxx:707
 TImageDump.cxx:708
 TImageDump.cxx:709
 TImageDump.cxx:710
 TImageDump.cxx:711
 TImageDump.cxx:712
 TImageDump.cxx:713
 TImageDump.cxx:714
 TImageDump.cxx:715
 TImageDump.cxx:716
 TImageDump.cxx:717
 TImageDump.cxx:718
 TImageDump.cxx:719
 TImageDump.cxx:720
 TImageDump.cxx:721
 TImageDump.cxx:722
 TImageDump.cxx:723
 TImageDump.cxx:724
 TImageDump.cxx:725
 TImageDump.cxx:726
 TImageDump.cxx:727
 TImageDump.cxx:728
 TImageDump.cxx:729
 TImageDump.cxx:730
 TImageDump.cxx:731
 TImageDump.cxx:732
 TImageDump.cxx:733
 TImageDump.cxx:734
 TImageDump.cxx:735
 TImageDump.cxx:736
 TImageDump.cxx:737
 TImageDump.cxx:738
 TImageDump.cxx:739
 TImageDump.cxx:740
 TImageDump.cxx:741
 TImageDump.cxx:742
 TImageDump.cxx:743
 TImageDump.cxx:744
 TImageDump.cxx:745
 TImageDump.cxx:746
 TImageDump.cxx:747
 TImageDump.cxx:748
 TImageDump.cxx:749
 TImageDump.cxx:750
 TImageDump.cxx:751
 TImageDump.cxx:752
 TImageDump.cxx:753
 TImageDump.cxx:754
 TImageDump.cxx:755
 TImageDump.cxx:756
 TImageDump.cxx:757
 TImageDump.cxx:758
 TImageDump.cxx:759
 TImageDump.cxx:760
 TImageDump.cxx:761
 TImageDump.cxx:762
 TImageDump.cxx:763
 TImageDump.cxx:764
 TImageDump.cxx:765
 TImageDump.cxx:766
 TImageDump.cxx:767
 TImageDump.cxx:768
 TImageDump.cxx:769
 TImageDump.cxx:770
 TImageDump.cxx:771
 TImageDump.cxx:772
 TImageDump.cxx:773
 TImageDump.cxx:774
 TImageDump.cxx:775
 TImageDump.cxx:776
 TImageDump.cxx:777
 TImageDump.cxx:778
 TImageDump.cxx:779
 TImageDump.cxx:780
 TImageDump.cxx:781
 TImageDump.cxx:782
 TImageDump.cxx:783
 TImageDump.cxx:784
 TImageDump.cxx:785
 TImageDump.cxx:786
 TImageDump.cxx:787
 TImageDump.cxx:788
 TImageDump.cxx:789
 TImageDump.cxx:790
 TImageDump.cxx:791
 TImageDump.cxx:792
 TImageDump.cxx:793
 TImageDump.cxx:794
 TImageDump.cxx:795
 TImageDump.cxx:796
 TImageDump.cxx:797
 TImageDump.cxx:798
 TImageDump.cxx:799
 TImageDump.cxx:800
 TImageDump.cxx:801
 TImageDump.cxx:802
 TImageDump.cxx:803
 TImageDump.cxx:804
 TImageDump.cxx:805