当前位置: 首页>>代码示例>>C++>>正文


C++ Pixel::getA方法代码示例

本文整理汇总了C++中Pixel::getA方法的典型用法代码示例。如果您正苦于以下问题:C++ Pixel::getA方法的具体用法?C++ Pixel::getA怎么用?C++ Pixel::getA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pixel的用法示例。


在下文中一共展示了Pixel::getA方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: buildFrameToTransmit

DTFrame* ServerClientProxy::buildFrameToTransmit(){
    vector<Pixel*>::iterator it;
	it=this->pixelsFast.begin();
    
	vector<DTPixel*>* dtVector = new vector<DTPixel*>();
    
    int size=this->pixelsFast.size();
    
    cl_float* newPixelArray = new cl_float[size * 4];
    int cont=0;
	while (it != this->pixelsFast.end())
	{
        Pixel* px = *it;

        int pId = px->getId();
        float pR = px->getR();
        float pG = px->getG();
        float pB = px->getB();
        float pA = px->getA();
        
        DTPixel * pixelForNewFrame= px->getDTPixel();
		
        dtVector->push_back(pixelForNewFrame);
        
        newPixelArray[(cont*4)] = (cl_float)pR;
        newPixelArray[(cont*4)+1] = (cl_float)pG;
        newPixelArray[(cont*4)+2] = (cl_float)pB;
        newPixelArray[(cont*4)+3] = (cl_float)pA;
        cont++;
		it++;
	}
	return new DTFrame(0, dtVector, newPixelArray, this->pixelsFast.size(), 0);
}
开发者ID:LaboratorioDeMedios,项目名称:SenderoServer,代码行数:33,代码来源:ServerClientProxy.cpp

示例2:

Pixel::Pixel(Pixel &p)
{
    this->_r = p.getR();
    this->_g = p.getG();
    this->_b = p.getB();
    this->_a = p.getA();
}
开发者ID:ionaic,项目名称:barbs-bandits,代码行数:7,代码来源:Pixel.cpp

示例3: transmitFrame

void GenericClientManager::transmitFrame() {
    //construyo DTFrame en base a los pixels mezclados

    if(this->waitForReceiver==0) { // envio solo si el server no me pidio esperarpor error

        vector<DTPixel*>* newVector = new vector<DTPixel*>;
        map<int,Pixel*>::iterator it = this->pixels->begin();
        while (it!=this->pixels->end())
        {
            Pixel* px = it->second;
            ofVec3f position = px->getPosition();
            ofVec3f front = px->getFront();
            ofVec3f up = px->getUp();
            string modelName = px->getModelName();
            DTPixel* dtPix = new DTPixel(px->getId(), px->getR(), px->getG(), px->getB(), px->getA(), position.x, position.y, position.z, front, up, modelName);

            newVector->push_back(dtPix);

            it++;
        }
        DTFrame * newFrame = new DTFrame(0, newVector, this->pixels->size() , this->sequenceNumber);

        // slice the DTFrame and transmit by piece.

        int pixelQuantity = newVector->size();
        int minId=0;
        int maxId=pixelQuantity-1;

        while(pixelQuantity>0) {
            celebra_packet_t toTransmit;
            int headerSize =18;
            if (pixelQuantity<=341) {
                toTransmit=newFrame->getBinaryPacketFromFrame(minId, maxId, this->sequenceNumber, 1);
                int sent = this->udpManager.SendAll((char *)&toTransmit, headerSize+((maxId-minId+1)*3));
                pixelQuantity=0;
            }
            else {

                toTransmit=newFrame->getBinaryPacketFromFrame(minId, minId+340, this->sequenceNumber, 0);
                int sent = this->udpManager.SendAll((char *)&toTransmit, headerSize+(341*3));
                pixelQuantity=pixelQuantity-341;
                minId = minId + 341;
            }

            // must increment sequence number.
            if (this->sequenceNumber==65535) {
                this->sequenceNumber=0;
            }
            else {
                this->sequenceNumber++;
            }

        }

        delete newFrame;
    }
    else {
        this->waitForReceiver-=1;
    }

}
开发者ID:Gonzant,项目名称:TDI,代码行数:61,代码来源:GenericClientManager.cpp


注:本文中的Pixel::getA方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。