TImageDump.h

Go to the documentation of this file.
00001 // @(#)root/postscript:$Id: TImageDump.h 22872 2008-03-27 16:59:12Z couet $
00002 // Author: Valeriy Onuchin   29/04/2005
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TImageDump
00013 #define ROOT_TImageDump
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TImageDump                                                           //
00019 //                                                                      //
00020 // save canvas in an image in batch mode                                //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 
00025 #ifndef ROOT_TVirtualPS
00026 #include "TVirtualPS.h"
00027 #endif
00028 
00029 class TImage;
00030 class TColor;
00031 class TPoint;
00032 
00033 class TImageDump : public TVirtualPS {
00034 protected:
00035    TImage           *fImage;     // image
00036    Int_t             fType;      // PostScript workstation type
00037 
00038    Int_t  XtoPixel(Double_t x);
00039    Int_t  YtoPixel(Double_t y);
00040    void   DrawDashPolyLine(Int_t npoints, TPoint *pt, UInt_t nDash, 
00041                            const char* pDash, const char* col, UInt_t thick);
00042 
00043 public:
00044    TImageDump();
00045    TImageDump(const char *filename, Int_t type = -111);
00046    virtual ~TImageDump();
00047 
00048    void  CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2);
00049    void  CellArrayFill(Int_t r, Int_t g, Int_t b);
00050    void  CellArrayEnd();
00051    void  Close(Option_t *opt = "");
00052    void  DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t  y2);
00053    void  DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t  yt,
00054                    Int_t mode, Int_t border, Int_t dark, Int_t light);
00055    void  DrawPolyMarker(Int_t n, Float_t *x, Float_t *y);
00056    void  DrawPolyMarker(Int_t n, Double_t *x, Double_t *y);
00057    void  DrawPS(Int_t n, Float_t *xw, Float_t *yw);
00058    void  DrawPS(Int_t n, Double_t *xw, Double_t *yw);
00059    void  NewPage();
00060    void  Open(const char *filename, Int_t type = -111);
00061    void  Text(Double_t x, Double_t y, const char *string);
00062    void  SetColor(Float_t r, Float_t g, Float_t b);
00063    void *GetStream() const {  return (void*)fImage; }
00064    void  SetType(Int_t type = -111) { fType = type; }
00065    Int_t GetType() const { return fType; }
00066    TImage *GetImage() const { return fImage; } 
00067 
00068    ClassDef(TImageDump,0)  // create image in batch mode
00069 };
00070 
00071 #endif

Generated on Tue Jul 5 14:14:29 2011 for ROOT_528-00b_version by  doxygen 1.5.1