00001 // @(#)root/graf:$Id: TImagePlugin.h 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: Valeriy Onuchin 23/06/05 00003 00004 /************************************************************************* 00005 * Copyright (C) 2001-2002, Rene Brun, Fons Rademakers and Reiner Rohlfs * 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_TImagePlugin 00013 #define ROOT_TImagePlugin 00014 00015 00016 ////////////////////////////////////////////////////////////////////////// 00017 // // 00018 // TImagePlugin // 00019 // // 00020 ////////////////////////////////////////////////////////////////////////// 00021 00022 #ifndef ROOT_TObject 00023 #include "TObject.h" 00024 #endif 00025 00026 #ifndef ROOT_TString 00027 #include "TString.h" 00028 #endif 00029 00030 00031 class TImagePlugin : public TObject { 00032 00033 protected: 00034 TString fExtension; // file extension 00035 00036 public: 00037 TImagePlugin(const char *ext) { fExtension = ext; } 00038 virtual ~TImagePlugin() { } 00039 00040 virtual unsigned char *ReadFile(const char *filename, UInt_t &w, UInt_t &h) = 0; 00041 virtual Bool_t WriteFile(const char *filename, unsigned char *argb, UInt_t w, UInt_t h) = 0; 00042 ULong_t Hash() const { return fExtension.Hash(); } 00043 00044 ClassDef(TImagePlugin, 0) // base class for different image format handlers(plugins) 00045 }; 00046 00047 #endif