Fission FSN
Loading...
Searching...
No Matches
fsCImage.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCImage.h
4*
5* Purpose: Engine specific image class - helper to load up
6* texture data
7*
8*********************************************************************/
9
10#ifndef fsCImagehdr
11#define fsCImagehdr
12
13#include <map>
14#include <raylib.h>
15
16#include "../../fsIImage.h"
17
18struct fsSColour4B;
19
20
21class fsCImage : public fsIImage
22{
23 friend class fsIImage;
24 friend class fsCTexture;
25
26public:
27
28 ~fsCImage() override;
29
30protected:
31
32 void doAlphaChannelsCombine(fsIImage const* pBlend, fsPoint const& pOffset) override;
33
34 std::unique_ptr<fsIImage> doCloneSubSection(fsIImage const* pBlend, fsPoint const& pOffset) const override;
35
36 std::unique_ptr<fsIImage> doCreateFromAlpha8Data(std::vector<fsU8>& pAlphaData, fsS32 pImgW, fsS32 pImgH, fsPoint const& pPOTDimenions) override;
37
39
40 fsSColour4B doPixelGet(fsPoint const& pOffset) const override;
41
42 fsU8 doAlphaGet(fsPoint const& pPos) const override;
43
44 void doTextureCopyInto(fsIImage const* pSrc, fsS32 pU, fsS32 pV, fsS32 pX, fsS32 pY) override;
45
46 void doTextureCopyThroughStencil(fsIImage const* pSrc, fsIImage const* const pStencil,
47 fsS32 pU, fsS32 pV, fsS32 pX, fsS32 pY) override;
48
49 void doPixelSet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow, const fsSColour4B& pPixel) override;
50
51 fsPoint doDimensionsGet() const override;
52
53 void doCreate(const fsPoint& pDimensions) override;
54 void doCreate(const fsCResourceName& pImageFileName) override;
55
57
58private:
59
60 fsS32 bytesPerPixelGet(::Image const* pImage) const;
61 fsS32 strideGet() const;
62
63 static std::map<fsS32, fsS32> mPixelFormats;
64
65 std::unique_ptr<::Image> mImage;
66};
67
68#endif
Definition fsCImage.h:26
friend class fsCTexture
Definition fsCImage.h:28
~fsCImage() override
void doCreate(const fsCResourceName &pImageFileName) override
void doPixelSet(fsS32 pU, fsS32 pV, fsS32 pCol, fsS32 pRow, const fsSColour4B &pPixel) override
std::unique_ptr< fsIImage > doCreateFromAlpha8Data(std::vector< fsU8 > &pAlphaData, fsS32 pImgW, fsS32 pImgH, fsPoint const &pPOTDimenions) override
void doTextureCopyThroughStencil(fsIImage const *pSrc, fsIImage const *const pStencil, fsS32 pU, fsS32 pV, fsS32 pX, fsS32 pY) override
void doTextureCopyInto(fsIImage const *pSrc, fsS32 pU, fsS32 pV, fsS32 pX, fsS32 pY) override
friend class fsIImage
Definition fsCImage.h:27
fsSColour4B doPixelGet(fsPoint const &pOffset) const override
fsU8 doAlphaGet(fsPoint const &pPos) const override
void doAlphaChannelsCombine(fsIImage const *pBlend, fsPoint const &pOffset) override
void doPremultipliedAlphaReverse() override
std::unique_ptr< fsIImage > doCloneSubSection(fsIImage const *pBlend, fsPoint const &pOffset) const override
fsPoint doDimensionsGet() const override
void doCreate(const fsPoint &pDimensions) override
Definition fsCResourceName.h:32
Definition fsIImage.h:21
unsigned char fsU8
Definition fsBaseTypes.h:15
int fsS32
Definition fsBaseTypes.h:20
Definition fsPoint.h:17
Definition fsSColour.h:54