Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 244 | chris | 1 | #ifndef __SHARED_IMAGE_H__ |
| 2 | #define __SHARED_IMAGE_H__ |
||
| 3 | |||
| 4 | #include "Common.h" |
||
| 5 | |||
| 6 | namespace Sexy |
||
| 7 | { |
||
| 8 | |||
| 9 | class Image; |
||
| 10 | class DDImage; |
||
| 11 | class MemoryImage; |
||
| 12 | |||
| 13 | class SharedImage |
||
| 14 | { |
||
| 15 | public: |
||
| 16 | DDImage* mImage; |
||
| 17 | int mRefCount; |
||
| 18 | |||
| 19 | SharedImage(); |
||
| 20 | }; |
||
| 21 | |||
| 22 | typedef std::map<std::pair<std::string, std::string>, SharedImage> SharedImageMap; |
||
| 23 | |||
| 24 | class SharedImageRef |
||
| 25 | { |
||
| 26 | public: |
||
| 27 | SharedImage* mSharedImage; |
||
| 28 | MemoryImage* mUnsharedImage; |
||
| 29 | bool mOwnsUnshared; |
||
| 30 | |||
| 31 | public: |
||
| 32 | SharedImageRef(); |
||
| 33 | SharedImageRef(const SharedImageRef& theSharedImageRef); |
||
| 34 | SharedImageRef(SharedImage* theSharedImage); |
||
| 35 | ~SharedImageRef(); |
||
| 36 | |||
| 37 | void Release(); |
||
| 38 | |||
| 39 | SharedImageRef& operator=(const SharedImageRef& theSharedImageRef); |
||
| 40 | SharedImageRef& operator=(SharedImage* theSharedImage); |
||
| 41 | SharedImageRef& operator=(MemoryImage* theUnsharedImage); |
||
| 42 | MemoryImage* operator->(); |
||
| 43 | operator Image*(); |
||
| 44 | operator MemoryImage*(); |
||
| 45 | operator DDImage*(); |
||
| 46 | }; |
||
| 47 | |||
| 48 | } |
||
| 49 | |||
| 50 | #endif //__SHARED_IMAGE_H__ |