ROOT  6.06/09
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 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TImagePlugin //
19 // //
20 //////////////////////////////////////////////////////////////////////////
21 
22 #ifndef ROOT_TObject
23 #include "TObject.h"
24 #endif
25 
26 #ifndef ROOT_TString
27 #include "TString.h"
28 #endif
29 
30 
31 class TImagePlugin : public TObject {
32 
33 protected:
34  TString fExtension; // file extension
35 
36 public:
37  TImagePlugin(const char *ext) { fExtension = ext; }
38  virtual ~TImagePlugin() { }
39 
40  virtual unsigned char *ReadFile(const char *filename, UInt_t &w, UInt_t &h) = 0;
41  virtual Bool_t WriteFile(const char *filename, unsigned char *argb, UInt_t w, UInt_t h) = 0;
42  ULong_t Hash() const { return fExtension.Hash(); }
43 
44  ClassDef(TImagePlugin, 0) // base class for different image format handlers(plugins)
45 };
46 
47 #endif
TH1 * h
Definition: legend2.C:5
static const char * filename()
Basic string class.
Definition: TString.h:137
bool Bool_t
Definition: RtypesCore.h:59
ULong_t Hash() const
Return hash value for this object.
Definition: TImagePlugin.h:42
virtual ~TImagePlugin()
Definition: TImagePlugin.h:38
#define ClassDef(name, id)
Definition: Rtypes.h:254
TString fExtension
Definition: TImagePlugin.h:34
unsigned int UInt_t
Definition: RtypesCore.h:42
TImagePlugin(const char *ext)
Definition: TImagePlugin.h:37
unsigned long ULong_t
Definition: RtypesCore.h:51
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Bool_t WriteFile(const char *filename, unsigned char *argb, UInt_t w, UInt_t h)=0
virtual unsigned char * ReadFile(const char *filename, UInt_t &w, UInt_t &h)=0
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:605