⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch16p1_imagemanipulator.h

📁 游戏开发特殊技巧-special.effects.game.programming
💻 H
字号:
#include "CommonFuncs.h"
#include "D3DHelperFuncs.h"
#include "Ch16p1_ImageManipulatorKernels.h"

class CImageManipulator
{
public:
  CImageManipulator() { }
  virtual ~CImageManipulator() { }

  bool ProcessImage(LPDIRECT3DTEXTURE8 pSrcTexture, LPDIRECT3DTEXTURE8 pDestTexture, 
    int iWidth, int iHeight, CImageManipulatorKernel &kernel,
    bool bRedEnable = true, bool bGreenEnable = true, bool bBlueEnable = true, bool bAlphaEnable = false);
  
  D3DXCOLOR ReadPixelRel(int iRelPosX, int iRelPosY);
  
private:
  void WritePixelRel(D3DXCOLOR color, 
    bool bRedEnable, bool bGreenEnable, bool bBlueEnable, bool bAlphaEnable);

  LPDIRECT3DTEXTURE8 m_pSrcTexture;
  LPDIRECT3DTEXTURE8 m_pDestTexture;
  int m_iWidth;
  int m_iHeight;
  int m_iPitch;
  int m_iCurPosX;
  int m_iCurPosY;
  unsigned int m_iSrcIndex;
  unsigned int m_iDestIndex;
  unsigned char *m_pSrcBits;
  unsigned char *m_pDestBits;
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -