Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 09:10:22

0001 // @(#)root/graf:$Id$
0002 // Author: Valeriy Onuchin   23/06/05
0003 
0004 /*************************************************************************
0005  * Copyright (C) 2001-2002, Rene Brun, Fons Rademakers and Reiner Rohlfs *
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_TImagePlugin
0013 #define ROOT_TImagePlugin
0014 
0015 
0016 #include "TObject.h"
0017 
0018 #include "TString.h"
0019 
0020 #include "TROOT.h"
0021 
0022 class TImagePlugin : public TObject {
0023 
0024 protected:
0025    TString fExtension;  ///< file extension
0026 
0027 public:
0028    TImagePlugin(const char *ext) { fExtension = ext; }
0029    ~TImagePlugin() override
0030    {
0031       // Required since we overload TObject::Hash.
0032       ROOT::CallRecursiveRemoveIfNeeded(*this);
0033    }
0034 
0035    virtual unsigned char *ReadFile(const char *filename, UInt_t &w,  UInt_t &h) = 0;
0036    virtual Bool_t WriteFile(const char *filename, unsigned char *argb, UInt_t w,  UInt_t  h) = 0;
0037    ULong_t Hash() const override { return fExtension.Hash(); }
0038 
0039    ClassDefOverride(TImagePlugin, 0)  // base class for different image format handlers(plugins)
0040 };
0041 
0042 #endif