PCMBuffer.h
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
00021
00022
00023
00024
00027
00028 #ifndef __PCM_BUFFER_H__
00029 # define __PCM_BUFFER_H__
00030
00031
00032
00033
00034
00035 # include "PCMPremeditations.h"
00036
00037 # include "PCMException.h"
00038
00039 # include "PCMLogger.h"
00040
00041 # include "PCMPointer.h"
00042
00043
00044
00045
00046
00047 # include <pcapi.h>
00048
00049
00050
00051
00052
00053 # include <squirrel/squirrel.h>
00054 # include <squirrel/sqstdio.h>
00055 # include <squirrel/sqstdaux.h>
00056 # include <squirrel/sqplus.h>
00057
00058 namespace ParCompMark
00059 {
00060
00067 class Buffer
00068 {
00069
00070
00071
00072
00073 # ifdef PARCOMPMARK_TEST
00074 friend class ParCompMarkTest::TestBuffer;
00075 # endif
00076
00077
00078
00079
00080
00082
00083
00091 public:static void squirrelGlue()
00092 {
00093 ::SqPlus::SQClassDef < Buffer > (_T("Buffer")).func(&Buffer::getLeft, _T("getLeft")).func(&Buffer::setLeft,
00094 _T("setLeft")).
00095 func(&Buffer::getTop, _T("getTop")).func(&Buffer::setTop, _T("setTop")).func(&Buffer::getWidth,
00096 _T("getWidth")).
00097 func(&Buffer::setWidth, _T("setWidth")).func(&Buffer::getHeight,
00098 _T("getHeight")).func(&Buffer::setHeight,
00099 _T("setHeight")).
00100 func(&Buffer::getDepthFormat, _T("getDepthFormat")).func(&Buffer::setDepthFormat, _T("setDepthFormat"));
00101 }
00102
00104
00105
00106
00107
00108
00109 public:
00110
00112 typedef Pointer < Buffer,
00113 Mutex > Pointer;
00114
00115
00116
00117
00118
00120
00121
00122 protected:
00123
00129 Node * mParent;
00130
00136 PCuint mLeft;
00137
00143 PCuint mTop;
00144
00150 PCuint mWidth;
00151
00157 PCuint mHeight;
00158
00164 bool mOwnPointers;
00165
00171 PCuint *mColour;
00172
00178 void *mDepth;
00179
00185 PCint mDepthFormat;
00186
00192 PCint mOutputRowPixel;
00193
00199 bool mInitialized;
00200
00202
00203
00204
00205
00206
00208
00209
00210 public:
00211
00215 Buffer();
00216
00226 Buffer(const PCuint & left, const PCuint & top, const PCuint & width,
00227 const PCuint & height, const PCuint & depthFormat, Node * parent);
00228
00232 virtual ~ Buffer();
00233
00235
00236
00237
00238
00239
00241
00242
00243 public:
00244
00250 Node * getParent() const;
00251
00257 const PCuint & getLeft() const;
00258
00264 void setLeft(const PCuint left);
00265
00271 const PCuint & getTop() const;
00272
00278 void setTop(const PCuint top);
00279
00285 const PCuint & getWidth() const;
00286
00292 void setWidth(const PCuint width);
00293
00299 const PCuint & getHeight() const;
00300
00306 void setHeight(const PCuint height);
00307
00313 const bool & getOwnPointers() const;
00314
00320 PCuint *getColour();
00321
00327 void setColour(const PCuint * colour);
00328
00334 void *getDepth();
00335
00341 void setDepth(const void *depth);
00342
00348 const PCint & getDepthFormat() const;
00349
00355 void setDepthFormat(const PCint depthformat);
00356
00362 const PCint & getOutputRowPixel() const;
00363
00369 void setOutputRowPixel(const PCint & outputrowpixel);
00370
00376 const bool & getInitialized() const;
00377
00379
00380
00381
00382
00383
00385
00386
00387 public:
00388
00392 virtual void initialize();
00393
00397 virtual void finalize();
00398
00403 virtual void saveToFile(const std::string & filename);
00404
00405 protected:
00406
00410 virtual void freeBuffers();
00411
00413
00414 };
00415
00416
00417
00418
00419
00420 # include "PCMBuffer_impl.h"
00421
00422 }
00423
00424
00426 DECLARE_INSTANCE_TYPE_NAME(ParCompMark::Buffer, Buffer);
00427
00428 #endif