Logo ROOT  
Reference Guide
TImagePlugin.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Valeriy Onuchin 23/06/05
3 
4 /*************************************************************************
5  * Copyright (C) 2001-2002, Rene Brun, Fons Rademakers and Reiner Rohlfs *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TImagePlugin
13 #define ROOT_TImagePlugin
14 
15 
16 #include "TObject.h"
17 
18 #include "TString.h"
19 
20 #include "TROOT.h"
21 
22 class TImagePlugin : public TObject {
23 
24 protected:
25  TString fExtension; ///< file extension
26 
27 public:
28  TImagePlugin(const char *ext) { fExtension = ext; }
29  virtual ~TImagePlugin()
30  {
31  // Required since we overload TObject::Hash.
33  }
34 
35  virtual unsigned char *ReadFile(const char *filename, UInt_t &w, UInt_t &h) = 0;
36  virtual Bool_t WriteFile(const char *filename, unsigned char *argb, UInt_t w, UInt_t h) = 0;
37  ULong_t Hash() const { return fExtension.Hash(); }
38 
39  ClassDef(TImagePlugin, 0) // base class for different image format handlers(plugins)
40 };
41 
42 #endif
TImagePlugin::fExtension
TString fExtension
file extension
Definition: TImagePlugin.h:25
TImagePlugin::ReadFile
virtual unsigned char * ReadFile(const char *filename, UInt_t &w, UInt_t &h)=0
TImagePlugin::Hash
ULong_t Hash() const
Return hash value for this object.
Definition: TImagePlugin.h:37
TImagePlugin::TImagePlugin
TImagePlugin(const char *ext)
Definition: TImagePlugin.h:28
TString::Hash
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:659
TString
Basic string class.
Definition: TString.h:136
TString.h
bool
TROOT.h
TImagePlugin::WriteFile
virtual Bool_t WriteFile(const char *filename, unsigned char *argb, UInt_t w, UInt_t h)=0
h
#define h(i)
Definition: RSha256.hxx:106
TImagePlugin
Definition: TImagePlugin.h:22
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
unsigned int
TObject.h
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TImagePlugin::~TImagePlugin
virtual ~TImagePlugin()
Definition: TImagePlugin.h:29
ROOT::CallRecursiveRemoveIfNeeded
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition: TROOT.h:395