您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ColorRGBA函数代码示例

51自学网 2021-06-01 20:12:22
  C++
这篇教程C++ ColorRGBA函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ColorRGBA函数的典型用法代码示例。如果您正苦于以下问题:C++ ColorRGBA函数的具体用法?C++ ColorRGBA怎么用?C++ ColorRGBA使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: ComponentTexture

void ComboBox::createTexture(void) {   static Kernel *kernel = Kernel::getInstance();   if ((_cTexture = kernel->getWidgetTexture(COMBOBOX)) != NULL) return;   // create texture object   _cTexture = new ComponentTexture(15, 17);   kernel->setWidgetTexture(COMBOBOX, _cTexture);   _cTexture->setTextureEnvMode(GL_MODULATE);   // middle   _cTexture->addTexture(Point(0, 0), MatrixTemplate<ColorRGBA>(1, 1, ColorRGBA(255,255,255,255)));   // lines   _cTexture->addTexture(Point(1, 0), MatrixTemplate<ColorRGBA>(1, 1, ColorRGBA(100,100,100,255)));   // button   _cTexture->addTexture(Point(0, 1), 15, 16, data::ScrollPaneVerticalButton);   // selects   _cTexture->addTexture(Point(2, 0), ColorRGBA(220, 220, 220, 100));   _cTexture->addTexture(Point(3, 0), ColorRGBA(120, 120, 120, 100));   // generate texture   _cTexture->createTexture();}
开发者ID:alexfrasson,项目名称:SCV,代码行数:27,


示例2: ColorRGBA

bool PERect::initWithSize(float width, float height){    if (!PERealNode::init()) {        return false;    }    m_width = width;    m_height = height;    m_data = (float *)malloc(sizeof(float)*(12+8+12));    //coord    m_data[0] = -0.5*m_width; m_data[1] = -0.5*m_height; m_data[2] = 0.0;    m_data[3] = -0.5*m_width; m_data[4] =  0.5*m_height; m_data[5] = 0.0;    m_data[6] =  0.5*m_width; m_data[7] =  0.5*m_height; m_data[8] = 0.0;    m_data[9] =  0.5*m_width; m_data[10] = -0.5*m_height; m_data[11] = 0.0;    //texCoord    m_data[12] = 0.0; m_data[13] = 0.0;    m_data[14] = 0.0; m_data[15] = 1.0;    m_data[16] = 1.0; m_data[17] = 1.0;    m_data[18] = 1.0; m_data[19] = 0.0;    //normal    m_data[20] = 0.0; m_data[21] = 0.0; m_data[22] = 1.0;    m_data[23] = 0.0; m_data[24] = 0.0; m_data[25] = 1.0;    m_data[26] = 0.0; m_data[27] = 0.0; m_data[28] = 1.0;    m_data[29] = 0.0; m_data[30] = 0.0; m_data[31] = 1.0;    //material    m_material.ambient = ColorRGBA(0.2, 0.2, 0.2, 0.1);    m_material.diffuse = ColorRGBA(0.7, 0.7, 0.7, 0.7);    m_material.specular = ColorRGBA(0.95, 0.95, 1.0, 1.0);    m_material.emission = ColorRGBA(0.0, 0.0, 0.0, 0.0);    return true;}
开发者ID:rocket99,项目名称:PEEngine,代码行数:30,


示例3: main

int main(){	// Build scene	SceneList scene;		scene.push_back(new Sphere(Point3(-320,0,50), 200.0f, ColorRGBA(255,0,0,255)));	scene.push_back(new Sphere(Point3(320, 0, 50), 200.0f, ColorRGBA(0, 0, 255, 255)));	scene.push_back(new Sphere(Point3(0, 0, -50), 200.0f, ColorRGBA(0, 255, 0, 255)));	scene.push_back(new Plane(Vector3(0,1,0), Vector3(0, -150, 0), ColorRGBA(255,255,255,255)));		// Render the scene	RayTraceSettings settings;	settings.resolutionWidth  = 600;	settings.resolutionHeight = 480;	settings.depth = 255;	settings.clearColor = ColorRGB(50,50,50);	settings.eyePosition = Point3(0, 0, 600);		RayTracer rayTracer(settings);	rayTracer.renderScene(scene);		rayTracer.saveToFile("rayTracerTest.tga");	// Clean up the scene	std::for_each(scene.begin(), scene.end(), deleteDynamicObject());		return 0;}
开发者ID:mcbouterse,项目名称:portfolio,代码行数:28,


示例4: glReadPixels

void ColorPicker::processMouse(const scv::MouseEvent &evt) {   static Kernel *kernel = Kernel::getInstance();   static Cursor * cursor = Cursor::getInstance();   if (!_receivingCallbacks) {      Component::processMouse(evt);   } else {      Panel::processMouse(evt);   }   if (!_receivingCallbacks) return;   if (_pickerWaitingColor) {      kernel->lockMouseUse(this);	  cursor->forceCursor(kernel->glfwWindow, GLFW_CROSSHAIR_CURSOR);      glReadPixels(evt.getPosition().x, evt.getInversePosition().y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &_currentColor);      setSpinsColor();      onColorChange();      if (evt.getState() == MouseEvent::CLICK && evt.getButton() == MouseEvent::LEFT) {         _btPicker->setState(false);         _pickerWaitingColor = false;         _currentColorPosition = foundHSL();         createTexture();      }   } else {      if (isInside(evt.getPosition()) && kernel->requestMouseUse(this)) {         if (isFocused()) {            Point relativeMouse = evt.getPosition()-getAbsolutePosition();            if (relativeMouse.x < MatrixTemplate<ColorRGBA>::getWidth() && relativeMouse.y < MatrixTemplate<ColorRGBA>::getHeight()) {				cursor->forceCursor(kernel->glfwWindow, GLFW_CROSSHAIR_CURSOR);               if (evt.getState() == MouseEvent::CLICK && evt.getButton() == MouseEvent::LEFT) {                  _isDragging = false;                  _currentColorPosition = relativeMouse;                  _currentColor =  ColorRGBA(MatrixTemplate<ColorRGBA>::get(_currentColorPosition.y,_currentColorPosition.x));                  setSpinsColor();                  onColorChange();                  onMouseClick(evt);               } else if (evt.getState() == MouseEvent::HOLD && evt.getButton() == MouseEvent::LEFT) {                  kernel->lockMouseUse(this);                  _isDragging = false;                  _currentColorPosition = relativeMouse;                  _currentColor =  ColorRGBA(MatrixTemplate<ColorRGBA>::get(_currentColorPosition.y,_currentColorPosition.x));                  setSpinsColor();                  onColorChange();                  onMouseDrag(evt);               } else if (evt.getState() == MouseEvent::UP) {                  kernel->unlockMouseUse(this);               }            }         }      } else if (evt.getState() == MouseEvent::UP) {         kernel->unlockMouseUse(this);      }   }}
开发者ID:alexfrasson,项目名称:SCV,代码行数:55,


示例5: r

void CoordinateSystemProvider::update(ImageCoordinateSystem& imageCoordinateSystem){  Geometry::Line horizon = Geometry::calculateHorizon(theCameraMatrix, theCameraInfo);  imageCoordinateSystem.origin = horizon.base;  imageCoordinateSystem.rotation.c[0] = horizon.direction;  imageCoordinateSystem.rotation.c[1] = Vector2<double>(-horizon.direction.y, horizon.direction.x);  imageCoordinateSystem.invRotation = imageCoordinateSystem.rotation.transpose();  RotationMatrix r(theCameraMatrix.rotation.transpose() * prevCameraMatrix.rotation);  imageCoordinateSystem.offset = Vector2<double>(r.getZAngle(), r.getYAngle());  calcScaleFactors(imageCoordinateSystem.a, imageCoordinateSystem.b);  imageCoordinateSystem.offsetInt = Vector2<int>(int(imageCoordinateSystem.offset.x * 1024 + 0.5),                                                  int(imageCoordinateSystem.offset.y * 1024 + 0.5));  imageCoordinateSystem.aInt = int(imageCoordinateSystem.a * 1024 + 0.5);  imageCoordinateSystem.bInt = int(imageCoordinateSystem.b * 1024 + 0.5);  imageCoordinateSystem.cameraInfo = theCameraInfo;  prevCameraMatrix = theCameraMatrix;  prevTime = theFilteredJointData.timeStamp;  DECLARE_DEBUG_DRAWING("horizon", "drawingOnImage"); // displays the horizon  ARROW("horizon",       imageCoordinateSystem.origin.x,       imageCoordinateSystem.origin.y,       imageCoordinateSystem.origin.x + imageCoordinateSystem.rotation.c[0].x * 50,       imageCoordinateSystem.origin.y + imageCoordinateSystem.rotation.c[0].y * 50,       1, Drawings::ps_solid, ColorRGBA(255,0,0));  ARROW("horizon",       imageCoordinateSystem.origin.x,       imageCoordinateSystem.origin.y,       imageCoordinateSystem.origin.x + imageCoordinateSystem.rotation.c[1].x * 50,       imageCoordinateSystem.origin.y + imageCoordinateSystem.rotation.c[1].y * 50,       1, Drawings::ps_solid, ColorRGBA(255,0,0));  GENERATE_DEBUG_IMAGE(corrected,    INIT_DEBUG_IMAGE_BLACK(corrected);    int yDest = -imageCoordinateSystem.toCorrectedCenteredNeg(0, 0).y;    for(int ySrc = 0; ySrc < theImage.cameraInfo.resolutionHeight; ++ySrc)      for(int yDest2 = -imageCoordinateSystem.toCorrectedCenteredNeg(0, ySrc).y; yDest <= yDest2; ++yDest)      {        int xDest = -imageCoordinateSystem.toCorrectedCenteredNeg(0, ySrc).x;        for(int xSrc = 0; xSrc < theImage.cameraInfo.resolutionWidth; ++xSrc)        {          for(int xDest2 = -imageCoordinateSystem.toCorrectedCenteredNeg(xSrc, ySrc).x; xDest <= xDest2; ++xDest)          {            DEBUG_IMAGE_SET_PIXEL_YUV(corrected, xDest + int(theCameraInfo.opticalCenter.x + 0.5),                                                  yDest + int(theCameraInfo.opticalCenter.y + 0.5),                                                 theImage.image[ySrc][xSrc].y,                                                  theImage.image[ySrc][xSrc].cb,                                                 theImage.image[ySrc][xSrc].cr);          }        }      }    SEND_DEBUG_IMAGE(corrected);  );
开发者ID:alon,项目名称:bhuman2009fork,代码行数:54,


示例6: switch

void Block::updateLevel(){	switch(_blockLevel)	{		case 0: _shape.setColor(ColorRGBA(200,0,0,150)); break;		case 1: _shape.setColor(ColorRGBA(0,200,0,150)); break;		case 2: _shape.setColor(ColorRGBA(0,0,200,150)); break;		case 3: _shape.setColor(ColorRGBA(200,200,0,150)); break;	}}
开发者ID:asyr625,项目名称:mini_sip,代码行数:11,


示例7: ColorRGBA

void ColorPicker::refreshColor(void) {   _currentPickerColor = ColorRGBA((unsigned char)_rgbs[0]->getValue(), (unsigned char)_rgbs[1]->getValue(), (unsigned char)_rgbs[2]->getValue());   if (_saturation != _rgbs[3]->getValue()) {      _saturation = _rgbs[3]->getValue();      createTexture();      _currentColor = ColorRGBA(MatrixTemplate<ColorRGBA>::get(_currentColorPosition.y, _currentColorPosition.x));      setSpinsColor();      onColorChange();   } else if (_currentPickerColor != _currentColor) {      _currentColor = _currentPickerColor;      onColorChange();   }}
开发者ID:alexfrasson,项目名称:SCV,代码行数:13,


示例8: set

void ColorPicker::createColors(void) {   float S = (float)_rgbs[3]->getValue() / 100.f;   for (int L = 100; L > 0 ; L--) {      for (int H = 0; H < 360 ; H++) {         set((100 - L) + 1, H, ColorRGBA::toRGB((float)H, L / 100.0f, S));      }   }   for (int H = 0; H < 360 ; H++) {      set(0, H, ColorRGBA(255,255,255,255));      set(101, H, ColorRGBA(0,0,0,255));   }}
开发者ID:alexfrasson,项目名称:SCV,代码行数:14,


示例9: draw

		void draw()		{			engine->controller.updateMouse();			pos_x = engine->controller.getMousePos().x;			pos_y = engine->controller.getMousePos().y;			renderer->drawQuad(square,Point3f(pos_x+100,pos_y,0),pos_y*1.0,pos_y*1.0,rot);			renderer->drawQuad(square2,Point3f(pos_x,pos_y,-.01),pos_y*1.0,pos_y*1.0,rot*.9);				renderer->drawQuad(square3,Point3f(pos_x-100,pos_y,-.02),pos_y*1.0,pos_y*1.0,rot*.8);							renderer->drawText("default font","Scale 1",Point3f(100,100,0),ColorRGBA(1,1,1,1),8,1.0);			renderer->drawText("default font","Scale 2",Point3f(100,200,0),ColorRGBA(1,1,1,1),8*2,2.0);			renderer->drawText("default font","Scale 3",Point3f(100,300,0),ColorRGBA(1,1,1,1),8*3,3.0);			renderer->drawText("default font",std::to_string(engine->t).c_str(),Point3f(100,400,0),ColorRGBA(1,1,1,1),8*10,10.0);			renderer->drawBuffer();		};                              //executes as often as possible
开发者ID:whynne,项目名称:Wex,代码行数:14,


示例10: DECLARE_DEBUG_DRAWING

void ImageCoordinateSystem::draw() const{  DECLARE_DEBUG_DRAWING("horizon", "drawingOnImage"); // displays the horizon  ARROW("horizon",        origin.x,        origin.y,        origin.x + rotation.c[0].x * 50,        origin.y + rotation.c[0].y * 50,        0, Drawings::ps_solid, ColorRGBA(255, 0, 0));  ARROW("horizon",        origin.x,        origin.y,        origin.x + rotation.c[1].x * 50,        origin.y + rotation.c[1].y * 50,        0, Drawings::ps_solid, ColorRGBA(255, 0, 0));}
开发者ID:BADBDY23,项目名称:BHumanCodeRelease,代码行数:16,


示例11: time

void CSkins::OnInit(){	m_EventSkinPrefix[0] = '/0';	if(g_Config.m_Events)	{		time_t rawtime;		struct tm* timeinfo;		time(&rawtime);		timeinfo = localtime(&rawtime);		if(timeinfo->tm_mon == 11 && timeinfo->tm_mday >= 24 && timeinfo->tm_mday <= 26)		{ // Christmas			str_copy(m_EventSkinPrefix, "santa", sizeof(m_EventSkinPrefix));		}	}	// load skins	m_aSkins.clear();	Storage()->ListDirectory(IStorage::TYPE_ALL, "skins", SkinScan, this);	if(!m_aSkins.size())	{		Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load skins. folder='skins/'");		CSkin DummySkin;		DummySkin.m_IsVanilla = true;		DummySkin.m_OrgTexture = -1;		DummySkin.m_ColorTexture = -1;		str_copy(DummySkin.m_aName, "dummy", sizeof(DummySkin.m_aName));		DummySkin.m_BloodColor = ColorRGBA(1.0f, 1.0f, 1.0f);		m_aSkins.add(DummySkin);	}}
开发者ID:ddnet,项目名称:ddnet,代码行数:31,


示例12: DECLARE_DEBUG_DRAWING

void ExtendedBallPercept::draw() const{  DECLARE_DEBUG_DRAWING("representation:ExtendedBallPercepts:Image", "drawingOnImage"); // drawing of representation BallPercept  DECLARE_DEBUG_DRAWING("representation:ExtendedballPercepts:Field", "drawingOnField"); // drawing of representation BallPercept  if(isValidBallPercept)  {    CIRCLE("representation:ExtendedBallPercepts:Image",       positionInImage.x,       positionInImage.y,       radiusInImage,       2, // pen width       Drawings::ps_solid,       ColorClasses::black,      Drawings::bs_solid,       ColorRGBA(255,128,64,100));    CIRCLE("representation:ExtendedBallPercepts:Field",       relativePositionOnField.x,       relativePositionOnField.y,       45,       1, // pen width       Drawings::ps_solid,       ColorClasses::orange,      Drawings::bs_null,       ColorClasses::orange);  }}
开发者ID:alon,项目名称:bhuman2009fork,代码行数:26,


示例13: DECLARE_DEBUG_DRAWING

void BallPercept::draw() const{    DECLARE_DEBUG_DRAWING("representation:BallPercept:Image", "drawingOnImage");    DECLARE_DEBUG_DRAWING("representation:BallPercept:Field", "drawingOnField");    DECLARE_DEBUG_DRAWING3D("representation:BallPercept", "origin");    TRANSLATE3D("representation:BallPercept", 0, 0, -230);    if(ballWasSeen)    {        CIRCLE("representation:BallPercept:Image",               positionInImage.x,               positionInImage.y,               radiusInImage,               1, // pen width               Drawings::ps_solid,               ColorClasses::black,               Drawings::bs_solid,               ColorRGBA(255, 128, 64, 100));        CIRCLE("representation:BallPercept:Field",               relativePositionOnField.x,               relativePositionOnField.y,               35,               0, // pen width               Drawings::ps_solid,               ColorClasses::orange,               Drawings::bs_null,               ColorClasses::orange);        // Sorry, no access to field dimensions here, so ball radius is hard coded        SPHERE3D("representation:BallPercept", relativePositionOnField.x, relativePositionOnField.y, 35, 35, ColorClasses::orange);    }}
开发者ID:ritwik,项目名称:BHuman2013,代码行数:30,


示例14: startStyle

 void KmlGenerator::putStationStyle() {     startStyle("StationStyle");     putLabelStyle(ColorRGBA(0x00,0x00,0x00,0x00), NORMAL, 0.0f); //invisible labels     putIconStyle(stationIconHref, Offset(), 0.25f, 0.0f);        //custom icon     endStyle();     skipLine(); }
开发者ID:Poulpy21,项目名称:pollution_viewer,代码行数:7,


示例15: split_color_rgba

		void ColoringSettingsDialog::readPreferenceEntries(INIFile& inifile)		{			PreferencesEntry::readPreferenceEntries(inifile);			if (    inifile.hasEntry("COLORING_OPTIONS", "ResidueNames") 				   && inifile.hasEntry("COLORING_OPTIONS", "ResidueNameColors"))			{				String residue_names       = inifile.getValue("COLORING_OPTIONS", "ResidueNames");				String residue_name_colors = inifile.getValue("COLORING_OPTIONS", "ResidueNameColors");				std::vector<String> split_names;				residue_names.split(split_names);				std::vector<String> split_colors;				residue_name_colors.split(split_colors);				if (split_names.size() != split_colors.size())				{					Log.warn() << "ColoringSettingsDialog::fetchPreferences: residue name coloring in inifile is invalid!" << std::endl;				}				std::vector<ColorRGBA> split_color_rgba(split_colors.size());				for (Position i=0; i<split_color_rgba.size(); ++i)				{					split_color_rgba[i] = ColorRGBA(split_colors[i]);				}				residue_table_->setContent(split_names, split_color_rgba);			}		}
开发者ID:HeyJJ,项目名称:ball,代码行数:29,


示例16: D3DXVec3Length

//加入多边形bool GameFootprint::AddPolygon(long vertexCount, const D3DXVECTOR3 *vertex, const D3DXVECTOR3 *normal){	long count = decalVertexCount;	if (count + vertexCount >= maxDecalVertices) return (false);	// Add polygon as a triangle fan	Triangle *triangle = triangleArray + decalTriangleCount;	decalTriangleCount += vertexCount - 2;	for (long a = 2; a < vertexCount; a++)	{		triangle->index[0] = (unsigned short) count;		triangle->index[1] = (unsigned short) (count + a - 1);		triangle->index[2] = (unsigned short) (count + a);		triangle++;	}	// Assign vertex colors	float f = 1.0F / (1.0F - decalEpsilon);	for (long b = 0; b < vertexCount; b++)	{		vertexArray[count] = vertex[b];		const D3DXVECTOR3& n = normal[b];		float alpha = (DotProduct(decalNormal, n) / D3DXVec3Length(&n) - decalEpsilon) * f;		colorArray[count] = ColorRGBA(1.0F, 1.0F, 1.0F, (alpha > 0.0F) ? alpha : 0.0F);		count++;	}	decalVertexCount = count;	return (true);}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:31,


示例17: leftBorder

void ObstacleWheelBH::drawCone(const Cone& cone) const{  float rightAngle = cone.angle;  float leftAngle = cone.angle + coneWidth;  Vector2BH<float> leftBorder(static_cast<float>(wheelRadius), 0.f);  Vector2BH<float> rightBorder(leftBorder);  leftBorder = leftBorder.rotate(leftAngle);  rightBorder = rightBorder.rotate(rightAngle);  LINE("representation:ObstacleWheelBH:wheel", 0, 0, leftBorder.x, leftBorder.y,           1, Drawings::ps_solid, ColorRGBA(0x00, 0x00, 0xFF, 0x0F));  if(cone.spot.seenCount > 0)  {    Vector2BH<float> left(cone.distance, 0);    Vector2BH<float> right(cone.distance, 0);    left.rotate(leftAngle);    right.rotate(rightAngle);    ColorClasses::Color col = ColorClasses::green;    if(cone.hasObstacle)    {      col = ColorClasses::red;    }    LINE("representation:ObstacleWheelBH:wheel", left.x, left.y, right.x, right.y,         8, Drawings::ps_solid, col);  }}
开发者ID:CheddarB,项目名称:nbites,代码行数:31,


示例18: ColorRGBA

//----------------------------------------------------------------------------ColorRGBA operator* (fixed fScalar, const ColorRGBA& rkC){    return ColorRGBA(        fScalar*rkC[0],        fScalar*rkC[1],        fScalar*rkC[2],        fScalar*rkC[3]);}
开发者ID:juhgiyo,项目名称:Soft3DEngine,代码行数:9,


示例19: DECLARE_DEBUG_DRAWING3D

void RobotModelBH::draw() const{  DECLARE_DEBUG_DRAWING3D("representation:RobotModelBH", "origin");  COMPLEX_DRAWING3D("representation:RobotModelBH",  {    for(int i = 0; i < MassCalibrationBH::numOfLimbs; ++i)    {      const Pose3DBH& p = limbs[i];      const Vector3BH<>& v = p.translation;      const Vector3BH<> v1 = p * Vector3BH<>(50, 0, 0);      const Vector3BH<> v2 = p * Vector3BH<>(0, 50, 0);      const Vector3BH<> v3 = p * Vector3BH<>(0, 0, 50);      LINE3D("representation:RobotModelBH", v.x, v.y, v.z, v1.x, v1.y, v1.z, 1, ColorRGBA(255, 0, 0));      LINE3D("representation:RobotModelBH", v.x, v.y, v.z, v2.x, v2.y, v2.z, 1, ColorRGBA(0, 255, 0));      LINE3D("representation:RobotModelBH", v.x, v.y, v.z, v3.x, v3.y, v3.z, 1, ColorRGBA(0, 0, 255));    }  });
开发者ID:CheddarB,项目名称:nbites,代码行数:17,


示例20:

Block::Block(){	_blockLevel = 0;	_isBlockAlive = true;	_shape.setSize(blockWidth, blockHeight);	_shape.setOrigin(blockWidth / 2.f, blockHeight / 2.f);	_shape.setColor(ColorRGBA(200,0,0,150));}
开发者ID:asyr625,项目名称:mini_sip,代码行数:8,


示例21: ColorRGBA

//----------------------------------------------------------------------------ColorRGBA ColorRGBA::operator* (float fScalar) const{	return ColorRGBA(		fScalar*mTuple[0],		fScalar*mTuple[1],		fScalar*mTuple[2],		fScalar*mTuple[3]);}
开发者ID:hustruan,项目名称:RcEngine,代码行数:9,


示例22: DECLARE_DEBUG_DRAWING

void BodyContour::draw() const{  DECLARE_DEBUG_DRAWING("representation:BodyContour", "drawingOnImage");  DECLARE_DEBUG_DRAWING("representation:BodyContour:maxY", "drawingOnImage");  COMPLEX_DRAWING("representation:BodyContour",  {    for(std::vector<Line>::const_iterator i = lines.begin(); i != lines.end(); ++i)      LINE("representation:BodyContour", i->p1.x, i->p1.y, i->p2.x, i->p2.y, 1,           Drawings::ps_solid, ColorRGBA(255, 0, 255));    for(int x = 0; x < cameraResolution.x; x += 10)    {      int y = cameraResolution.y;      clipBottom(x, y);      LINE("representation:BodyContour", x, y, x, cameraResolution.y, 1,           Drawings::ps_solid, ColorRGBA(255, 0, 255));    }  });
开发者ID:BADBDY23,项目名称:BHumanCodeRelease,代码行数:18,


示例23: white

void ColorTest::ColorTypeConversionTests(){	Color3f white(1.f, 1.f, 1.f);	ColorBGRA result = white.toBGR(255);	CPPUNIT_ASSERT_EQUAL(ColorBGRA(0xFFFFFFFF), result);		CPPUNIT_ASSERT_EQUAL(Color::fromRGBA(ColorRGBA(0xFF000000)), Color(0, 0, 0, 255));	CPPUNIT_ASSERT_EQUAL(Color::fromRGBA(ColorRGBA(0x00FF0000)), Color(0, 0, 255, 0));	CPPUNIT_ASSERT_EQUAL(Color::fromRGBA(ColorRGBA(0x0000FF00)), Color(0, 255, 0, 0));	CPPUNIT_ASSERT_EQUAL(Color::fromRGBA(ColorRGBA(0x000000FF)), Color(255, 0, 0, 0));		CPPUNIT_ASSERT_EQUAL(Color::fromBGRA(ColorBGRA(0xFF000000)), Color(0, 0, 0, 255));	CPPUNIT_ASSERT_EQUAL(Color::fromBGRA(ColorBGRA(0x00FF0000)), Color(255, 0, 0, 0));	CPPUNIT_ASSERT_EQUAL(Color::fromBGRA(ColorBGRA(0x0000FF00)), Color(0, 255, 0, 0));	CPPUNIT_ASSERT_EQUAL(Color::fromBGRA(ColorBGRA(0x000000FF)), Color(0, 0, 255, 0));	CPPUNIT_ASSERT_EQUAL(Color::fromBGRA(ColorBGRA(0xFFa8d0df)), Color(168, 208, 223, 255));}
开发者ID:Drakesinger,项目名称:ArxLibertatis,代码行数:18,


示例24: DECLARE_DEBUG_DRAWING

void BallPercept::draw() const{  DECLARE_DEBUG_DRAWING("representation:BallPercept:image", "drawingOnImage");  DECLARE_DEBUG_DRAWING("representation:BallPercept:field", "drawingOnField");  DECLARE_DEBUG_DRAWING3D("representation:BallPercept", "robot");  TRANSLATE3D("representation:BallPercept", 0, 0, -230);  if(status == seen)  {    CIRCLE("representation:BallPercept:image", positionInImage.x(), positionInImage.y(), radiusInImage, 1, // pen width           Drawings::solidPen,  ColorRGBA::black, Drawings::solidBrush, ColorRGBA(255, 128, 64, 100));    CIRCLE("representation:BallPercept:field", positionOnField.x(), positionOnField.y(), radiusOnField, 0, // pen width           Drawings::solidPen, ColorRGBA::orange, Drawings::noBrush, ColorRGBA::orange);    SPHERE3D("representation:BallPercept", positionOnField.x(), positionOnField.y(), radiusOnField, radiusOnField, ColorRGBA::orange);  }  else if(status == guessed)    CIRCLE("representation:BallPercept:image", positionInImage.x(), positionInImage.y(), radiusInImage, 1, // pen width           Drawings::solidPen,  ColorRGBA::black, Drawings::solidBrush, ColorRGBA(64, 128, 255, 90));}
开发者ID:weilandetian,项目名称:Yoyo,代码行数:18,


示例25: DECLARE_DEBUG_DRAWING

void GoalPercept::draw() const{  const ColorRGBA goalPerceptColor = ColorRGBA::yellow;  DECLARE_DEBUG_DRAWING("representation:GoalPercept:Image", "drawingOnImage");  DECLARE_DEBUG_DRAWING("representation:GoalPercept:Field", "drawingOnField");  DECLARE_DEBUG_DRAWING3D("representation:GoalPercept", "robot");  TRANSLATE3D("representation:GoalPercept", 0, 0, -230);  ColorRGBA color = ColorRGBA(220, 220, 220);  for(unsigned int i = 0; i < goalPosts.size(); ++i)  {    const GoalPost& p = goalPosts.at(i);    if(p.position != GoalPost::IS_UNKNOWN)    {      CIRCLE("representation:GoalPercept:Field", p.positionOnField.x(), p.positionOnField.y(),             50, 0, Drawings::solidPen, goalPerceptColor, Drawings::solidBrush, color);      LINE("representation:GoalPercept:Field", p.positionOnField.x(), p.positionOnField.y(),           p.positionOnField.x(), p.positionOnField.y() +           (p.position == GoalPost::IS_LEFT ? -700 : 700),           60, Drawings::solidPen, goalPerceptColor);      MID_DOT("representation:GoalPercept:Image", p.positionInImage.x(), p.positionInImage.y(),              goalPerceptColor, color);      LINE("representation:GoalPercept:Image", p.positionInImage.x(), p.positionInImage.y(), p.positionInImage.x(), 0,           5, Drawings::solidPen, goalPerceptColor);      if(p.position == GoalPost::IS_LEFT)        DRAWTEXT("representation:GoalPercept:Image", p.positionInImage.x() + 10, 40, 36, goalPerceptColor, "L");      else if(p.position == GoalPost::IS_RIGHT)        DRAWTEXT("representation:GoalPercept:Image", p.positionInImage.x() - 30, 40, 36, goalPerceptColor, "R");    }    else    {      CIRCLE("representation:GoalPercept:Field", p.positionOnField.x(), p.positionOnField.y(),             50, 0, Drawings::solidPen, ColorRGBA(255, 0, 0), Drawings::solidBrush, goalPerceptColor);      MID_DOT("representation:GoalPercept:Image", p.positionInImage.x(), p.positionInImage.y(),              ColorRGBA(255, 0, 0), goalPerceptColor);      LINE("representation:GoalPercept:Image", p.positionInImage.x(), p.positionInImage.y(), p.positionInImage.x(), 0,           5, Drawings::dottedPen, goalPerceptColor);    }    // Sorry, no access to field dimensions here, so the dimensions are hard coded    CYLINDER3D("representation:GoalPercept", p.positionOnField.x(), p.positionOnField.y(), 400, 0, 0, 0, 50, 800, goalPerceptColor);    LINE3D("representation:GoalPercept", 0, 0, 1.f, p.positionOnField.x(), p.positionOnField.y(), 1.f, 2.f, goalPerceptColor);  }}
开发者ID:Yanzqing,项目名称:BHumanCodeRelease,代码行数:44,



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


C++ Colour函数代码示例
C++ ColorF函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。