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

/*************************************************************************
 * 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.             *
 *************************************************************************/

#ifndef ROOT_TImageDump
#define ROOT_TImageDump


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TImageDump                                                           //
//                                                                      //
// save canvas in an image in batch mode                                //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TVirtualPS
#include "TVirtualPS.h"
#endif

class TImage;
class TColor;
class TPoint;

class TImageDump : public TVirtualPS {
protected:
   TImage           *fImage;     // image
   Int_t             fType;      // PostScript workstation type

   Int_t  XtoPixel(Double_t x);
   Int_t  YtoPixel(Double_t y);
   void   DrawDashPolyLine(Int_t npoints, TPoint *pt, UInt_t nDash, 
                           const char* pDash, const char* col, UInt_t thick);

public:
   TImageDump();
   TImageDump(const char *filename, Int_t type = -111);
   virtual ~TImageDump();

   void  CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2);
   void  CellArrayFill(Int_t r, Int_t g, Int_t b);
   void  CellArrayEnd();
   void  Close(Option_t *opt = "");
   void  DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t  y2);
   void  DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t  yt,
                   Int_t mode, Int_t border, Int_t dark, Int_t light);
   void  DrawPolyMarker(Int_t n, Float_t *x, Float_t *y);
   void  DrawPolyMarker(Int_t n, Double_t *x, Double_t *y);
   void  DrawPS(Int_t n, Float_t *xw, Float_t *yw);
   void  DrawPS(Int_t n, Double_t *xw, Double_t *yw);
   void  NewPage();
   void  Open(const char *filename, Int_t type = -111);
   void  Text(Double_t x, Double_t y, const char *string);
   void  Text(Double_t x, Double_t y, const wchar_t *string);
   void  SetColor(Float_t r, Float_t g, Float_t b);
   void *GetStream() const {  return (void*)fImage; }
   void  SetType(Int_t type = -111) { fType = type; }
   Int_t GetType() const { return fType; }
   TImage *GetImage() const { return fImage; } 

   ClassDef(TImageDump,0)  // create image in batch mode
};

#endif
 TImageDump.h:1
 TImageDump.h:2
 TImageDump.h:3
 TImageDump.h:4
 TImageDump.h:5
 TImageDump.h:6
 TImageDump.h:7
 TImageDump.h:8
 TImageDump.h:9
 TImageDump.h:10
 TImageDump.h:11
 TImageDump.h:12
 TImageDump.h:13
 TImageDump.h:14
 TImageDump.h:15
 TImageDump.h:16
 TImageDump.h:17
 TImageDump.h:18
 TImageDump.h:19
 TImageDump.h:20
 TImageDump.h:21
 TImageDump.h:22
 TImageDump.h:23
 TImageDump.h:24
 TImageDump.h:25
 TImageDump.h:26
 TImageDump.h:27
 TImageDump.h:28
 TImageDump.h:29
 TImageDump.h:30
 TImageDump.h:31
 TImageDump.h:32
 TImageDump.h:33
 TImageDump.h:34
 TImageDump.h:35
 TImageDump.h:36
 TImageDump.h:37
 TImageDump.h:38
 TImageDump.h:39
 TImageDump.h:40
 TImageDump.h:41
 TImageDump.h:42
 TImageDump.h:43
 TImageDump.h:44
 TImageDump.h:45
 TImageDump.h:46
 TImageDump.h:47
 TImageDump.h:48
 TImageDump.h:49
 TImageDump.h:50
 TImageDump.h:51
 TImageDump.h:52
 TImageDump.h:53
 TImageDump.h:54
 TImageDump.h:55
 TImageDump.h:56
 TImageDump.h:57
 TImageDump.h:58
 TImageDump.h:59
 TImageDump.h:60
 TImageDump.h:61
 TImageDump.h:62
 TImageDump.h:63
 TImageDump.h:64
 TImageDump.h:65
 TImageDump.h:66
 TImageDump.h:67
 TImageDump.h:68
 TImageDump.h:69
 TImageDump.h:70
 TImageDump.h:71
 TImageDump.h:72