Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CS_CSGFX_IMAGEAUTOCONVERT_H__
00021 #define __CS_CSGFX_IMAGEAUTOCONVERT_H__
00022
00023 #include "csgfx/imagememory.h"
00024
00033 namespace CS
00034 {
00039 class ImageAutoConvert
00040 {
00041 csRef<iImage> theImage;
00042 public:
00051 ImageAutoConvert (iImage* image, int desiredFormat)
00052 {
00053 if (image)
00054 {
00055 if (image->GetFormat () == desiredFormat)
00056 theImage = image;
00057 else
00058 theImage.AttachNew (new csImageMemory (image, desiredFormat));
00059 }
00060 }
00062 iImage* operator->() const { return theImage; }
00064 operator iImage*() const { return theImage; }
00065 };
00066 }
00067
00070 #endif // __CS_CSGFX_IMAGEAUTOCONVERT_H__