| 22 | { |
| 23 | |
| 24 | class Image { |
| 25 | private: |
| 26 | std::shared_ptr<detail::image_impl> mImage; |
| 27 | |
| 28 | public: |
| 29 | Image(const unsigned pWidth, const unsigned pHeight, |
| 30 | const forge::ChannelFormat pFormat, const forge::dtype pDataType) |
| 31 | : mImage(std::make_shared<detail::image_impl>(pWidth, pHeight, pFormat, pDataType)) {} |
| 32 | |
| 33 | Image(const fg_image pOther) { |
| 34 | mImage = reinterpret_cast<Image*>(pOther)->impl(); |
| 35 | } |
| 36 | |
| 37 | inline const std::shared_ptr<detail::image_impl>& impl() const { return mImage; } |
| 38 | |
| 39 | inline void setAlpha(const float pAlpha) { mImage->setAlpha(pAlpha); } |
| 40 | |
| 41 | inline void keepAspectRatio(const bool pKeep) { mImage->keepAspectRatio(pKeep); } |
| 42 | |
| 43 | inline unsigned width() const { return mImage->width(); } |
| 44 | |
| 45 | inline unsigned height() const { return mImage->height(); } |
| 46 | |
| 47 | inline forge::ChannelFormat pixelFormat() const { return mImage->pixelFormat(); } |
| 48 | |
| 49 | inline forge::dtype channelType() const { return mImage->channelType(); } |
| 50 | |
| 51 | inline unsigned pbo() const { return mImage->pbo(); } |
| 52 | |
| 53 | inline uint size() const { return mImage->size(); } |
| 54 | |
| 55 | inline void render(const int pWindowId, |
| 56 | const int pX, const int pY, const int pVPW, const int pVPH, |
| 57 | const glm::mat4 &pView, const glm::mat4 &pOrient) const { |
| 58 | mImage->render(pWindowId, pX, pY, pVPW, pVPH, pView, pOrient); |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | } |
| 63 | } |