Fission FSN
Loading...
Searching...
No Matches
fsCTexture.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCTexture.h
4*
5* Purpose: Cocos2d-x implementation of a texture.
6*
7*********************************************************************/
8
9#ifndef fsCTexturehdr
10#define fsCTexturehdr
11
12#include <Magnum/GL/GL.h>
13
14#include "../../fsITexture.h"
15
16
17class fsCTexture : public fsITexture
18{
19 friend class fsITexture;
20
21public:
22
23 Magnum::GL::Texture2D* textureGet() const { return mTexture.get(); }
24
25 fsS32 imageWidthGet() const override;
26 fsS32 imageHeightGet() const override;
27 fsS32 textureWidthGet() const override;
28 fsS32 textureHeightGet() const override;
29
30 fsBool hasAlphaChannelGet() const override;
31 fsU8 alphaGet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow) const override;
32
33 virtual ~fsCTexture();
34
35protected:
36
37 void filterModeSetDo(fsFilterMode pNewMode) override;
38 void wrapModeSetDo(fsWrapMode pNewMode) override;
39
40 std::shared_ptr<fsITexture> doCloneSubSection(fsCBrush const* pBlend, fsPoint const& pOffset) const override;
41 void doBlend(fsCBrush const* pBlend, fsPoint const& pOffset) override;
42
43 fsSColour4B pixelGetDo(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow) override;
44 void doPixelSet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow, const fsSColour4B& pPixel) override;
45 void doTextureCopyThroughStencil(std::shared_ptr<fsITexture> pSrc, std::shared_ptr<fsITexture> pStencil, fsS32 pU,
46 fsS32 pV, fsS32 pX, fsS32 pY, fsS32 pAlphaHitMaskThreshold) override;
47 void doTextureCopyInto(std::shared_ptr<fsITexture> pSrc, fsS32 pU, fsS32 pV, fsS32 pX, fsS32 pY) override;
48
49 fsU8 alphaValueGet(fsS32 pImgX, fsS32 pImgY) override;
50
51 void createFromAlpha8Data(std::vector<fsU8>& pAlphaData, fsS32 pImgW, fsS32 pImgH,
52 fsPoint const& pPOTDimenions) override;
53
54 void maskImageLoad(const fsCResourceName& pImageFileName);
55 void createFromImage(fsIImage const* pImage) override;
56
58
59private:
60
61 fsU32 filterModes(fsFilterMode pNewMode);
62 fsU32 wrapModes(fsWrapMode pNewMode);
63
64 void alphaChannelsCombine(fsCBrush const* pBlend, fsPoint const& pOffset);
65
66 void premultipliedAlphaReverse();
67
68 fsS32 strideGet() const;
69
70 std::shared_ptr<Magnum::GL::Texture2D> mTexture;
71};
72
73#endif
Definition fsCBrush.h:26
Definition fsCResourceName.h:32
Definition fsCTexture.h:22
fsU8 alphaValueGet(fsS32 pImgX, fsS32 pImgY) override
fsSColour4B pixelGetDo(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow) override
fsS32 textureHeightGet() const override
void doTextureCopyInto(std::shared_ptr< fsITexture > pSrc, fsS32 pU, fsS32 pV, fsS32 pX, fsS32 pY) override
fsS32 textureWidthGet() const override
void createFromAlpha8Data(std::vector< fsU8 > &pAlphaData, fsS32 pImgW, fsS32 pImgH, fsPoint const &pPOTDimenions) override
fsBool hasAlphaChannelGet() const override
fsS32 imageHeightGet() const override
void maskImageLoad(const fsCResourceName &pImageFileName)
fsU8 alphaGet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow) const override
std::shared_ptr< fsITexture > doCloneSubSection(fsCBrush const *pBlend, fsPoint const &pOffset) const override
void createFromImage(fsIImage const *pImage) override
Magnum::GL::Texture2D * textureGet() const
Definition fsCTexture.h:23
friend class fsITexture
Definition fsCTexture.h:23
virtual ~fsCTexture()
fsS32 imageWidthGet() const override
void doTextureCopyThroughStencil(std::shared_ptr< fsITexture > pSrc, std::shared_ptr< fsITexture > pStencil, fsS32 pU, fsS32 pV, fsS32 pX, fsS32 pY, fsS32 pAlphaHitMaskThreshold) override
void doPixelSet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow, const fsSColour4B &pPixel) override
void doBlend(fsCBrush const *pBlend, fsPoint const &pOffset) override
void wrapModeSetDo(fsWrapMode pNewMode) override
void filterModeSetDo(fsFilterMode pNewMode) override
Definition fsIImage.h:21
Definition fsITexture.h:26
fsFilterMode
Definition fsITexture.h:37
fsWrapMode
Definition fsITexture.h:48
unsigned int fsU32
Definition fsBaseTypes.h:21
bool fsBool
Definition fsBaseTypes.h:26
unsigned char fsU8
Definition fsBaseTypes.h:15
int fsS32
Definition fsBaseTypes.h:20
Definition fsPoint.h:17
Definition fsSColour.h:54