00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef INC_MI32_FRAMEMEM_H
00024 #define INC_MI32_FRAMEMEM_H
00025
00026 #ifndef INC_MI32_MG2MEM24_H
00027 #include <mi32/mg2mem24.h>
00028 #endif
00029
00030 #ifndef INC_GRE_BASE_H
00031 #include <gre/base.h>
00032 #endif
00033
00034
00037
00038 class FRAMEMEM {
00039
00040
00041 public:
00042
00043 FRAMEMEM (
00044 const FRAMEMEM &rhs
00045 );
00046
00047 FRAMEMEM (
00048 const GRE::VIEW &view
00049 );
00050
00051 FRAMEMEM (
00052 const INT32 &width,
00053 const INT32 &height
00054 );
00055
00056 ~FRAMEMEM (
00057 );
00058
00059 FRAMEMEM& operator= (
00060 const FRAMEMEM& rhs
00061 );
00062
00063 operator const UINT8* (
00064 ) const {
00065 if (!IsValid()) return (0);
00066 return (m_Display->GetImagePointer(0,0,0,0));
00067 }
00068
00069 operator UINT8* (
00070 ) {
00071 if (!IsValid()) return (0);
00072 return (m_Display->GetImagePointer(0,0,0,0));
00073 }
00074
00075
00079 MGD::CONTEXT* CreateGC (
00080 );
00081
00085 inline INT32 GetHeight (
00086 ) const {
00087 return m_Height;
00088 }
00089
00093 inline INT32 GetWidth (
00094 ) const {
00095 return m_Width;
00096 }
00097
00101 ERRVALUE Copy (
00102 const FRAMEMEM &frame,
00103 const INT32 dstX = 0,
00104 const INT32 dstY = 0,
00105 const INT32 srcX = 0,
00106 const INT32 srcY = 0,
00107 const INT32 srcW = INT32_MAX,
00108 const INT32 srcH = INT32_MAX
00109 );
00110
00114 ERRVALUE CopyFromView (
00115 const GRE::VIEW &view,
00116 const INT32 dstX = 0,
00117 const INT32 dstY = 0,
00118 const INT32 srcX = 0,
00119 const INT32 srcY = 0,
00120 const INT32 srcW = INT32_MAX,
00121 const INT32 srcH = INT32_MAX
00122 );
00123
00124 private:
00125 #ifndef GENERATING_DOXYGEN_OUTPUT
00126
00127 INT32 m_Height;
00128 INT32 m_Width;
00129 MGD::DEVICE_MEM24 *m_Display;
00130 MGD::CONTEXT *m_Gc;
00131 ERRVALUE m_Error;
00132
00133 FRAMEMEM (
00134 );
00135
00136 void Init (
00137 );
00138
00139 void Close (
00140 );
00141
00142 inline bool IsValid (
00143 ) const {
00144 return ((m_Width > 0) && (m_Height > 0) && (m_Gc != 0) && (m_Display != 0));
00145 }
00146
00147 ERRVALUE CopyFromDisplay (
00148 MGD::DEVICE &display,
00149 const INT32 dstX,
00150 const INT32 dstY,
00151 const INT32 srcX,
00152 const INT32 srcY,
00153 const INT32 srcW,
00154 const INT32 srcH
00155 );
00156 #endif // GENERATING_DOXYGEN_OUTPUT
00157
00158 };
00159
00160
00161
00162 #endif