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

📄 colgen.cpp

📁 miXo is a buzz machine (www.buzzmachines.com) - a plugin for the freely available jeskola buzz track
💻 CPP
字号:
// ColGen.cpp: implementation of the CColGen class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "mixer.h"
#include "ColGen.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
void CDefColGen::Init(int iColDiv,int iHt)
{
	fRedInc=512.0/float(iColDiv);
	fGrnInc=512./float(iColDiv);
	fBlueInc=-812.0/float(iColDiv);
	fRed=-200;
	fGrn=100;
	fBlue=255;
}
COLORREF CDefColGen::Next(int iColCnt)
{
	int iRed=_cpp_max(int(fRed),0);
	int iGrn=_cpp_max(int(fGrn),0);
	int iBlue=_cpp_max(int(fBlue),0);
	fBlue+=fBlueInc;
	fRed+=fRedInc;
	fGrn+=fGrnInc;
	if(fGrn > 190.0) {
		fGrnInc*=-0.4f;
		fGrn=190;
	}
	if(fRed > 255) {
		fRed=255;
	}
	return RGB(iRed,iGrn,iBlue);
}
void COldColGen::Init(int iColDiv,int iHt)
{
	m_fColDiv=float(iColDiv);
	fColOff=255.0f/m_fColDiv;
	fGrnOff=210.0f/m_fColDiv;
}
COLORREF COldColGen::Next(int iColCnt)
{
	int iGrn;
	iGrn=(int(fGrnOff*(m_fColDiv-iColCnt)))-45;
	return RGB((int(fColOff*iColCnt)),(_cpp_max(iGrn,0)), 0);
}
void CRedColGen::Init(int iColDiv,int iHt)
{
	m_fColDiv=float(iColDiv);
	fColOff=210.0f/m_fColDiv;
}
COLORREF CRedColGen::Next(int iColCnt)
{
//	int iGrn;
//	iGrn=(int(fGrnOff*(m_fColDiv-iColCnt)))-45;
	return RGB((45+int(fColOff*iColCnt)),0, 0);
}

⌨️ 快捷键说明

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