本文整理汇总了C++中Pixel::blendRGBA方法的典型用法代码示例。如果您正苦于以下问题:C++ Pixel::blendRGBA方法的具体用法?C++ Pixel::blendRGBA怎么用?C++ Pixel::blendRGBA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pixel
的用法示例。
在下文中一共展示了Pixel::blendRGBA方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePixelsFromDTFrame
void ServerClientProxy::updatePixelsFromDTFrame(DTFrame* frame){
vector<DTPixel*>* newPixels = frame->getPixels();
vector<DTPixel*>::iterator it = newPixels->begin();
int counter=0;
while (it != newPixels->end())
{
DTPixel* newPixel= *it;
//pixels must be ordered <
Pixel* localPixel = this->pixelsFast[counter];
localPixel->blendRGBA(newPixel->getR(),newPixel->getG(),newPixel->getB(),newPixel->getA(),1);
it++;
counter++;
}
}
示例2: update
void AudioBehaviour::update() {
// first, some decay to black in all pixels
vector<Pixel*>::iterator it = pixelsFast->begin();
while (it != pixelsFast->end()) {
Pixel* px = *it;
if (fade2blackType) {
px->fadeToBlack (1-fade2black);
} else {
px->blendRGBA (0, 0, 0, 255, fade2black);
}
it++;
}
// grab spectrum data
float constQ [NUM_POINTS];
audio.spectrum (constQ, NUM_POINTS);
// now update spheric points with audio data
for (int i=0; i<NUM_POINTS; i++) {
if (sphericPoints [i]->config.enabled) {
sphericPoints [i]->update (sphericPoints [i]->config.audio_enabled? constQ[i] : 1.0);
}
}
// iterate through spheric points
vector<SphericPoint*>::iterator ip = sphericPoints.begin();
while (ip != sphericPoints.end()) {
SphericPoint* sp = *ip;
if (sp->config.enabled) {
//iterate pixels
vector<Pixel*>::iterator it = this->pixelsFast->begin();
while (it!=this->pixelsFast->end()) {
Pixel* px = *it;
// colorize through this spheric point
sp->colorize (px);
it++;
}
}
ip++;
}
}
示例3: updateParticulas
void Recuerdo::updateParticulas(double tiempoSeg, double tiempoMil){
// a que recuerdo llamo con tiempo en segundo.
bool* pixelBool = new bool[(int)this->pixels->size()];
std::fill_n( pixelBool, (int)this->pixels->size(), 0 );
vector<Particula*>::iterator it = this->particulas->begin();
vector<Pixel*>::iterator itpixels;
Pixel *pixel;
Particula* particula;
Punto *ptoAnt = NULL;
Punto *ptoSig = NULL;
Punto *ptoAct = NULL;
long a;// = ofGetElapsedTimeMillis() % 1000;
bool recTienePar=false;
while (it!=this->particulas->end())
{
particula = *it;
// a = fmod(tiempoMil,particula->frecuencia);
a = fmod(tiempoMil - (particula->tiempoini),particula->frecuencia );//+ particula->tiempoini*1000;
itpixels = pixels->begin();
//if (particula->tiempoini <= tiempoSeg && particula->tiempofin >= tiempoSeg){
if (particula->tiempoini <= tiempoMil && particula->tiempofin >= tiempoMil){
ptoAnt = anterior(particula, a);
ptoSig = siguiente(particula,a);
if (ptoAnt != NULL && ptoSig != NULL){
ptoAct = ptoActual(ptoAnt,ptoSig,a);
//Gonzalo
//ptoAct->draw(ptoAct);
//ofPushMatrix();
//particula->draw(ptoAct);
//ofPopMatrix();
cout << particula->id;
while (itpixels != pixels->end()){
pixel = *itpixels;
ofVec3f pos = pixel->getPosition();
int dis = sqrt((pos.x - ptoAct->x)*(pos.x - ptoAct->x) + (pos.z - ptoAct->z)* (pos.z - ptoAct->z));
if (dis <= ptoAct->intensidad){
//Aca va el decaimiento del color
ofVec3f colores(ptoAct->r, ptoAct->g,ptoAct->b);
ofVec3f retColores = decaimiento (colores,dis,ptoAct->intensidad);
pixel->blendRGBA(retColores.x, retColores.y, retColores.z,0,0.4f);
//pixel->blendRGBA(ptoAct->r,ptoAct->g,ptoAct->b,0,0.4f);
pixelBool[(int)pixel->getId()] = true;
}
itpixels++;
}
}
}
it++;
}// Busco
itpixels = pixels->begin();
if (recTienePar) {
while (itpixels != pixels->end()){
Pixel* px = *itpixels;
if (!pixelBool[(int)px->getId()]){
px->blendRGBA(0, 0, 0, 255, 0.4f);
}
itpixels++;
}
}
delete[] pixelBool;
this->draw();
};