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


C++ ColorRGBA函数代码示例

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


在下文中一共展示了ColorRGBA函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:ComboBox.cpp

示例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,代码来源:PERect.cpp

示例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,代码来源:main.cpp

示例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,代码来源:ColorPicker.cpp

示例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,代码来源:CoordinateSystemProvider.cpp

示例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,代码来源:Block.cpp

示例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,代码来源:ColorPicker.cpp

示例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,代码来源:ColorPicker.cpp

示例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,代码来源:main.cpp

示例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,代码来源:ImageCoordinateSystem.cpp

示例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,代码来源:skins.cpp

示例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,代码来源:ExtendedBallPercept.cpp

示例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,代码来源:BallPercept.cpp

示例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,代码来源:kmlGenerator.cpp

示例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,代码来源:coloringSettingsDialog.C


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