| 19 | { |
| 20 | |
| 21 | class image_impl : public AbstractRenderable { |
| 22 | private: |
| 23 | uint mWidth; |
| 24 | uint mHeight; |
| 25 | forge::ChannelFormat mFormat; |
| 26 | gl::GLenum mGLformat; |
| 27 | gl::GLenum mGLiformat; |
| 28 | forge::dtype mDataType; |
| 29 | gl::GLenum mGLType; |
| 30 | float mAlpha; |
| 31 | bool mKeepARatio; |
| 32 | size_t mFormatSize; |
| 33 | /* internal resources for interop */ |
| 34 | size_t mPBOsize; |
| 35 | gl::GLuint mPBO; |
| 36 | gl::GLuint mTex; |
| 37 | ShaderProgram mProgram; |
| 38 | gl::GLuint mMatIndex; |
| 39 | gl::GLuint mTexIndex; |
| 40 | gl::GLuint mNumCIndex; |
| 41 | gl::GLuint mAlphaIndex; |
| 42 | gl::GLuint mCMapLenIndex; |
| 43 | gl::GLuint mCMapIndex; |
| 44 | /* color map details */ |
| 45 | gl::GLuint mColorMapUBO; |
| 46 | gl::GLuint mUBOSize; |
| 47 | |
| 48 | /* helper functions to bind and unbind |
| 49 | * resources for render quad primitive */ |
| 50 | void bindResources(int pWindowId) const; |
| 51 | void unbindResources() const; |
| 52 | |
| 53 | public: |
| 54 | image_impl(const uint pWidth, const uint pHeight, |
| 55 | const forge::ChannelFormat pFormat, const forge::dtype pDataType); |
| 56 | ~image_impl(); |
| 57 | |
| 58 | void setColorMapUBOParams(const gl::GLuint pUBO, const gl::GLuint pSize); |
| 59 | void setAlpha(const float pAlpha); |
| 60 | void keepAspectRatio(const bool pKeep=true); |
| 61 | |
| 62 | uint width() const; |
| 63 | uint height() const; |
| 64 | forge::ChannelFormat pixelFormat() const; |
| 65 | forge::dtype channelType() const; |
| 66 | uint pbo() const; |
| 67 | uint size() const; |
| 68 | |
| 69 | void render(const int pWindowId, |
| 70 | const int pX, const int pY, const int pVPW, const int pVPH, |
| 71 | const glm::mat4 &pView, const glm::mat4 &pOrient); |
| 72 | }; |
| 73 | |
| 74 | } |
| 75 | } |
nothing calls this directly
no outgoing calls
no test coverage detected