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 fsU8 alphaGet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow) const override;
31
32 ~fsCTexture() override;
33
34protected:
35
36 void filterModeSetDo(fsFilterMode pNewMode) override;
37 void wrapModeSetDo(fsWrapMode pNewMode) override;
38
39 std::shared_ptr<fsITexture> doCloneSubSection(fsCBrush const* pBlend, fsPoint const& pOffset) const override;
40 void doBlend(fsCBrush const* pBlend, fsPoint const& pOffset) override;
41
42 fsSColour4B pixelGetDo(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow) override;
43 void doPixelSet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow, const fsSColour4B& pPixel) override;
44 void doTextureCopyThroughStencil(std::shared_ptr<fsITexture> pSrc, std::shared_ptr<fsITexture> pStencil, fsS32 pU,
45 fsS32 pV, fsS32 pX, fsS32 pY, fsS32 pAlphaHitMaskThreshold) override;
46 void doTextureCopyInto(std::shared_ptr<fsITexture> pSrc, fsS32 pU, fsS32 pV, fsS32 pX, fsS32 pY) override;
47
48 fsU8 alphaValueGet(fsS32 pImgX, fsS32 pImgY) override;
49
50 void maskImageLoad(const fsCResourceName& pImageFileName);
51 void createFromImage(fsIImage const* pImage) override;
52
54
55private:
56
57 fsU32 filterModes(fsFilterMode pNewMode);
58 fsU32 wrapModes(fsWrapMode pNewMode);
59
60 void alphaChannelsCombine(fsCBrush const* pBlend, fsPoint const& pOffset);
61
62 void premultipliedAlphaReverse();
63
64 fsS32 strideGet() const;
65
66 std::shared_ptr<Magnum::GL::Texture2D> mTexture;
67};
68
69#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
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
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
~fsCTexture() 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
unsigned char fsU8
Definition fsBaseTypes.h:15
int fsS32
Definition fsBaseTypes.h:20
Definition fsPoint.h:17
Definition fsSColour.h:54