Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:10

0001 // @(#)root/postscript:$Id$
0002 // Author: Valeriy Onuchin   29/04/2005
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TImageDump
0013 #define ROOT_TImageDump
0014 
0015 
0016 #include "TVirtualPS.h"
0017 
0018 class TImage;
0019 class TColor;
0020 class TPoint;
0021 
0022 class TImageDump : public TVirtualPS {
0023 protected:
0024    TImage           *fImage{nullptr};     ///< Image
0025    Int_t             fType{0};            ///< PostScript workstation type
0026 
0027    Int_t  XtoPixel(Double_t x);
0028    Int_t  YtoPixel(Double_t y);
0029    void   DrawDashPolyLine(Int_t npoints, TPoint *pt, UInt_t nDash,
0030                            const char* pDash, const char* col, UInt_t thick);
0031 
0032 public:
0033    TImageDump();
0034    TImageDump(const char *filename, Int_t type = -111);
0035    ~TImageDump() override;
0036 
0037    void  CellArrayBegin(Int_t W, Int_t H, Double_t x1, Double_t x2, Double_t y1, Double_t y2) override;
0038    void  CellArrayFill(Int_t r, Int_t g, Int_t b) override;
0039    void  CellArrayEnd() override;
0040    void  Close(Option_t *opt = "") override;
0041    void  DrawBox(Double_t x1, Double_t y1,Double_t x2, Double_t  y2) override;
0042    void  DrawFrame(Double_t xl, Double_t yl, Double_t xt, Double_t  yt,
0043                    Int_t mode, Int_t border, Int_t dark, Int_t light) override;
0044    void  DrawPolyMarker(Int_t n, Float_t *x, Float_t *y) override;
0045    void  DrawPolyMarker(Int_t n, Double_t *x, Double_t *y) override;
0046    void  DrawPS(Int_t n, Float_t *xw, Float_t *yw) override;
0047    void  DrawPS(Int_t n, Double_t *xw, Double_t *yw) override;
0048    void  NewPage() override;
0049    void  Open(const char *filename, Int_t type = -111) override;
0050    void  Text(Double_t x, Double_t y, const char *string) override;
0051    void  Text(Double_t x, Double_t y, const wchar_t *string) override;
0052    void  SetColor(Float_t r, Float_t g, Float_t b) override;
0053    void *GetStream() const override { return (void*)fImage; }
0054    void  SetType(Int_t type = -111) override { fType = type; }
0055    Int_t GetType() const override { return fType; }
0056    TImage *GetImage() const { return fImage; }
0057 
0058    ClassDefOverride(TImageDump,0)  // create image in batch mode
0059 };
0060 
0061 #endif