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 "../../fsITexture.h"
13
14namespace cocos2d
15{
16 class Texture2D;
17}
18
19namespace cocos2d
20{
21 class Image;
22}
23
24
25class fsCTexture : public fsITexture
26{
27 friend class fsITexture;
28
29public:
30
31 cocos2d::Texture2D* textureGet() const { return mTexture.get(); }
32
33 fsS32 imageWidthGet() const override;
34 fsS32 imageHeightGet() const override;
35 fsS32 textureWidthGet() const override;
36 fsS32 textureHeightGet() const override;
37
38 fsBool hasAlphaChannelGet() const override;
39 fsU8 alphaGet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow) const override;
40
41 virtual ~fsCTexture();
42
43protected:
44
45 void filterModeSetDo(fsFilterMode pNewMode) override;
46 void wrapModeSetDo(fsWrapMode pNewMode) override;
47
48 std::shared_ptr<fsITexture> doCloneSubSection(fsCBrush const* pBlend, fsPoint const& pOffset) const override;
49 void doBlend(fsCBrush const* pBlend, fsPoint const& pOffset) override;
50
51 fsSColour4B pixelGetDo(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow) override;
52 void doPixelSet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow, const fsSColour4B& pPixel) override;
53 void doTextureCopyThroughStencil(std::shared_ptr<fsITexture> pSrc, std::shared_ptr<fsITexture> pStencil, fsS32 pU,
54 fsS32 pV, fsS32 pX, fsS32 pY, fsS32 pAlphaHitMaskThreshold) override;
55 void doTextureCopyInto(std::shared_ptr<fsITexture> pSrc, fsS32 pU, fsS32 pV, fsS32 pX, fsS32 pY) override;
56
57 fsU8 alphaValueGet(fsS32 pImgX, fsS32 pImgY) override;
58
59 void createFromAlpha8Data(std::vector<fsU8>& pAlphaData, fsS32 pImgW, fsS32 pImgH,
60 fsPoint const& pPOTDimenions) override;
61
62 void createFromImage(fsIImage const* pImage) override;
63
65
66private:
67
68 fsU32 v3FilterModes(fsFilterMode pNewMode);
69 fsU32 v3WrapModes(fsWrapMode pNewMode);
70
71 void alphaChannelsCombine(fsCBrush const* pBlend, fsPoint const& pOffset);
72
73 void premultipliedAlphaReverse();
74
75 fsS32 strideGet() const;
76
77 std::shared_ptr<cocos2d::Texture2D> mTexture;
78};
79
80#endif
Definition fsCBrush.h:26
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
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
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
cocos2d::Texture2D * textureGet() const
Definition fsCTexture.h:31
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 fsC3dLight.h:19
Definition fsPoint.h:17
Definition fsSColour.h:54