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

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

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

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

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

示例1: GUIWindow

//.........这里部分代码省略.........	m_pGameModeOptionController->Add(m_pGameOptionBox);	m_pGameModeOptionController->Add(m_pDebugOptionBox);	m_pGameModeOptionController->Add(m_pFrontEndOptionBox);	m_pDebugOptionBox->SetToggled(true);	m_pFaceMergingCheckbox = new CheckBox(m_pRenderer, m_defaultFont, "Face Merging");	m_pFaceMergingCheckbox->SetDimensions(10, 10, 14, 14);	m_pFaceMergingCheckbox->SetCallBackFunction(_FaceMergeCheckboxChanged);	m_pFaceMergingCheckbox->SetCallBackData(this);	m_pStepUpdateCheckbox = new CheckBox(m_pRenderer, m_defaultFont, "Step Update");	m_pStepUpdateCheckbox->SetDimensions(110, 10, 14, 14);	m_pStepUpdateButton = new Button(m_pRenderer, m_defaultFont, "Step");	m_pStepUpdateButton->SetDimensions(200, 5, 65, 25);	m_pStepUpdateButton->SetCallBackFunction(_StepUpdatePressed);	m_pStepUpdateButton->SetCallBackData(this);	m_pDebugCameraOptionBox = new OptionBox(m_pRenderer, m_defaultFont, "Debug");	m_pDebugCameraOptionBox->SetDimensions(10, 70, 14, 14);	m_pDebugCameraOptionBox->SetCallBackFunction(_CameraModeChanged);	m_pDebugCameraOptionBox->SetCallBackData(this);	m_pMouseRotateCameraOptionBox = new OptionBox(m_pRenderer, m_defaultFont, "Player Rotate");	m_pMouseRotateCameraOptionBox->SetDimensions(10, 50, 14, 14);	m_pMouseRotateCameraOptionBox->SetCallBackFunction(_CameraModeChanged);	m_pMouseRotateCameraOptionBox->SetCallBackData(this);	m_pAutoCameraOptionBox = new OptionBox(m_pRenderer, m_defaultFont, "Auto");	m_pAutoCameraOptionBox->SetDimensions(10, 30, 14, 14);	m_pAutoCameraOptionBox->SetCallBackFunction(_CameraModeChanged);	m_pAutoCameraOptionBox->SetCallBackData(this);	m_pFrontendCameraOptionBox = new OptionBox(m_pRenderer, m_defaultFont, "Frontend");	m_pFrontendCameraOptionBox->SetDimensions(10, 10, 14, 14);	m_pFrontendCameraOptionBox->SetCallBackFunction(_CameraModeChanged);	m_pFrontendCameraOptionBox->SetCallBackData(this);	m_pCameraModeOptionController = new OptionController(m_pRenderer, m_defaultFont, "Camera");	m_pCameraModeOptionController->SetDisplayLabel(true);	m_pCameraModeOptionController->SetDisplayBorder(true);	m_pCameraModeOptionController->SetDimensions(160, 35, 105, 90);	m_pCameraModeOptionController->Add(m_pDebugCameraOptionBox);	m_pCameraModeOptionController->Add(m_pMouseRotateCameraOptionBox);	m_pCameraModeOptionController->Add(m_pAutoCameraOptionBox);	m_pCameraModeOptionController->Add(m_pFrontendCameraOptionBox);	m_pDebugCameraOptionBox->SetToggled(true);	m_pMouseRotateCameraOptionBox->SetDisabled(true);	m_pAutoCameraOptionBox->SetDisabled(true);	m_pFrontendCameraOptionBox->SetDisabled(true);	m_pGameWindow->AddComponent(m_pGameModeOptionController);	m_pGameWindow->AddComponent(m_pCameraModeOptionController);	m_pGameWindow->AddComponent(m_pFaceMergingCheckbox);	m_pGameWindow->AddComponent(m_pStepUpdateCheckbox);	m_pGameWindow->AddComponent(m_pStepUpdateButton);	// Console window	m_pConsoleWindow = new GUIWindow(m_pRenderer, m_defaultFont, "Console");	m_pConsoleWindow->AllowMoving(true);	m_pConsoleWindow->AllowClosing(false);	m_pConsoleWindow->AllowMinimizing(true);	m_pConsoleWindow->AllowScrolling(true);	m_pConsoleWindow->SetRenderTitleBar(true);	m_pConsoleWindow->SetRenderWindowBackground(true);	m_pConsoleWindow->SetOutlineRender(true);	m_pConsoleWindow->SetDimensions(635, 35, 500, 140);	m_pConsoleWindow->SetApplicationDimensions(m_windowWidth, m_windowHeight);	m_pConsoleTextbox = new TextBox(m_pRenderer, m_defaultFont, "", "");	m_pConsoleTextbox->SetDimensions(1, 1, 498, 16);	m_pConsoleTextbox->SetDontLoseFocus(false);	m_pConsoleTextbox->SetCallBackFunction_OnReturnPressed(_ConsoleReturnPressed);	m_pConsoleTextbox->SetCallBackData_OnReturnPressed(this);	m_pConsoleTextbox->SetPipeColour(Colour(0.0f, 0.0f, 0.0f));	m_pConsoleTextbox->SetDontLoseFocus(true);	m_pConsoleScrollbar = new ScrollBar(m_pRenderer);	m_pConsoleScrollbar->SetScrollDirection(EScrollBarDirection_Vertical);	m_pConsoleScrollbar->SetScrollSize(1.0f);	m_pConsoleScrollbar->SetScrollPosition(1.0f);	m_pConsoleScrollbar->SetScissorEnabled(true);	m_pConsoleScrollbar->SetScrollArea(-484, 0, 490, 122);	m_pConsoleScrollbar->SetDepth(2.0f);	m_pConsoleScrollbar->SetDimensions(486, 18, 14, 122);	m_pConsoleScrollbar->SetScissorEnabled(true);	m_pConsoleWindow->AddComponent(m_pConsoleTextbox);	m_pConsoleWindow->AddComponent(m_pConsoleScrollbar);	m_pGUI->AddWindow(m_pMainWindow);	m_pGUI->AddWindow(m_pGameWindow);	m_pGUI->AddWindow(m_pConsoleWindow);	UpdateCharactersPulldown();	UpdateWeaponsPulldown();	UpdateAnimationsPulldown();	m_pCharacterPulldown->SetSelectedItem("Steve");	m_pWeaponsPulldown->SetSelectedItem("None");	m_pAnimationsPulldown->SetSelectedItem("BindPose");	m_GUICreated = true;}
开发者ID:rzh,项目名称:Vox,代码行数:101,


示例2: Colour

inline Colour operator +(const Colour& a, const Colour& b){  return Colour(a.R()+b.R(), a.G()+b.G(), a.B()+b.B());}
开发者ID:wienleung,项目名称:graphics,代码行数:4,


示例3: default_log

Plotter::Plotter(    DataLog* log,    float left, float right, float bottom, float top,    float tickx, float ticky,    Plotter* linked_plotter_x,    Plotter* linked_plotter_y)   : default_log(log),      colour_wheel(0.6f),      rview_default(left,right,bottom,top), rview(rview_default), target(rview),      selection(0,0,0,0),      track(false), track_x("$i"), track_y(""),      trigger_edge(0), trigger("$0"),      linked_plotter_x(linked_plotter_x),      linked_plotter_y(linked_plotter_y){    if(!log) {        throw std::runtime_error("DataLog not specified");    }    // Prevent links to ourselves - this could cause infinite recursion.    if(linked_plotter_x == this) this->linked_plotter_x = 0;    if(linked_plotter_y == this) this->linked_plotter_y = 0;    // Handle our own mouse / keyboard events    this->handler = this;    hover[0] = 0;    hover[1] = 0;    // Default colour scheme    colour_bg = Colour(0.0f, 0.0f, 0.0f);    colour_tk = Colour(0.2f, 0.2f, 0.2f);    colour_ax = Colour(0.5f, 0.5f, 0.5f);    SetTicks(tickx, ticky);    // Create shader for drawing simple primitives    prog_lines.AddShader( GlSlVertexShader,                         "attribute vec2 a_position;/n"                         "uniform vec4 u_color;/n"                         "uniform vec2 u_scale;/n"                         "uniform vec2 u_offset;/n"                         "varying vec4 v_color;/n"                         "void main() {/n"                         "    gl_Position = vec4(u_scale * (a_position + u_offset),0,1);/n"                         "    v_color = u_color;/n"                         "}/n"                         );    prog_lines.AddShader( GlSlFragmentShader,                      #ifdef HAVE_GLES_2                          "precision mediump float;/n"                      #endif // HAVE_GLES_2                         "varying vec4 v_color;/n"                         "void main() {/n"                         "  gl_FragColor = v_color;/n"                         "}/n"                         );    prog_lines.BindPangolinDefaultAttribLocationsAndLink();    prog_text.AddShader( GlSlVertexShader,                         "attribute vec2 a_position;/n"                         "attribute vec2 a_texcoord;/n"                         "uniform vec4 u_color;/n"                         "uniform vec2 u_scale;/n"                         "uniform vec2 u_offset;/n"                         "varying vec4 v_color;/n"                         "varying vec2 v_texcoord;/n"                         "void main() {/n"                         "    gl_Position = vec4(u_scale * (a_position + u_offset),0,1);/n"                         "    v_color = u_color;/n"                         "    v_texcoord = a_texcoord;/n"                         "}/n"                         );    prog_text.AddShader( GlSlFragmentShader,                     #ifdef HAVE_GLES_2                         "precision mediump float;/n"                     #endif // HAVE_GLES_2                         "varying vec4 v_color;/n"                         "varying vec2 v_texcoord;/n"                         "uniform sampler2D u_texture;/n"                         "void main() {/n"                         "  gl_FragColor = v_color;/n"                         "  gl_FragColor.a *= texture2D(u_texture, v_texcoord).a;/n"                         "}/n"                         );    prog_text.BindPangolinDefaultAttribLocationsAndLink();    const size_t RESERVED_SIZE = 100;    // Setup default PlotSeries    plotseries.reserve(RESERVED_SIZE);    for(unsigned int i=0; i< 10; ++i) {        std::ostringstream oss;        oss << "$" << i;        plotseries.push_back( PlotSeries() );        plotseries.back().CreatePlot( "$i", oss.str(),            colour_wheel.GetUniqueColour(),            i < log->Labels().size() ? log->Labels()[i] : oss.str()        );    }    // Setup test PlotMarkers//.........这里部分代码省略.........
开发者ID:DapengChalmers,项目名称:ZSLAM_TX2,代码行数:101,


示例4:

void GUI::LeftPanel::paint (Graphics & g){    // backGround Filling    g.fillAll (Colour (0xff292929));}
开发者ID:cyberCBM,项目名称:ScPlayer,代码行数:5,


示例5: TLDebug_Break

//.........这里部分代码省略.........			return SyncFalse;		//	convert to normalised quaternion		TLMaths::TAxisAngle AxisAngle( f );		BinaryData.Write( AxisAngle );		return SyncTrue;	}		case TLBinary_TypeRef(TRef):	{		TRef Ref( DataString );		BinaryData.Write( Ref );		return SyncTrue;	}		case TLBinary_TypeRef_String:	{		//	do string cleanup, convert "/n" to a linefeed etc		if ( TLString::IsStringDirty( DataString ) )		{			TString OutputString = DataString;			TLString::CleanString( OutputString );			BinaryData.WriteString( OutputString );		}		else		{			//	already clean, just write the original			BinaryData.WriteString( DataString );		}		return SyncTrue;	}		case TLBinary_TypeRef(TColour):	{		float4 f;		if ( !TLString::ReadNextFloatArray( DataString, CharIndex, f.GetData(), f.GetSize() ) )			return SyncFalse;				//	check range		//	gr: use TLDebug_CheckInRange() ?		if ( f.x > 1.0f || f.x < 0.0f ||			f.y > 1.0f || f.y < 0.0f ||			f.z > 1.0f || f.z < 0.0f ||			f.w > 1.0f || f.w < 0.0f )		{			if ( !TLDebug_Break( TString("Colour float type has components out of range (0..1); %.3f,%.3f,%.3f,%.3f", f.x, f.y, f.z, f.w) ) )				return SyncFalse;		}		TColour Colour( f );		BinaryData.Write( Colour );		return SyncTrue;	}		case TLBinary_TypeRef(TColour24):	{		Type3<s32> Colours;		if ( !TLString::ReadNextInteger( DataString, CharIndex, Colours.x ) )		return SyncFalse;		if ( !TLString::ReadNextInteger( DataString, CharIndex, Colours.y ) )		return SyncFalse;		if ( !TLString::ReadNextInteger( DataString, CharIndex, Colours.z ) )		return SyncFalse;				//	check range		//	gr: use TLDebug_CheckInRange() ?		if ( Colours.x > 255 || Colours.x < 0 ||			Colours.y > 255 || Colours.y < 0 ||
开发者ID:SoylentGraham,项目名称:Tootle,代码行数:67,


示例6: graph

ControlPanel::ControlPanel(ProcessorGraph* graph_, AudioComponent* audio_)    : graph(graph_), audio(audio_), initialize(true), open(false), lastEngineIndex(-1){    if (1)    {        font = Font("Paragraph", 13, Font::plain);        // MemoryInputStream mis(BinaryData::misoserialized, BinaryData::misoserializedSize, false);        // Typeface::Ptr typeface = new CustomTypeface(mis);        // font = Font(typeface);        // font.setHeight(15);    }    audioEditor = (AudioEditor*) graph->getAudioNode()->createEditor();    addAndMakeVisible(audioEditor);    playButton = new PlayButton();    playButton->addListener(this);    addAndMakeVisible(playButton);    recordButton = new RecordButton();    recordButton->addListener(this);    addAndMakeVisible(recordButton);    masterClock = new Clock();    addAndMakeVisible(masterClock);    cpuMeter = new CPUMeter();    addAndMakeVisible(cpuMeter);    diskMeter = new DiskSpaceMeter();    addAndMakeVisible(diskMeter);    cpb = new ControlPanelButton(this);    addAndMakeVisible(cpb);    recordSelector = new ComboBox();    recordSelector->addListener(this);    for (int i =0; i < RecordEngineManager::getNumOfBuiltInEngines(); i++)    {        RecordEngineManager* rem = RecordEngineManager::createBuiltInEngineManager(i);        recordSelector->addItem(rem->getName(),i+1);        recordEngines.add(rem);    }    addChildComponent(recordSelector);    recordOptionsButton = new UtilityButton("R",Font("Small Text", 15, Font::plain));    recordOptionsButton->setEnabledState(true);    recordOptionsButton->addListener(this);    recordOptionsButton->setTooltip("Configure options for selected record engine");    addChildComponent(recordOptionsButton);    newDirectoryButton = new UtilityButton("+", Font("Small Text", 15, Font::plain));    newDirectoryButton->setEnabledState(false);    newDirectoryButton->addListener(this);    newDirectoryButton->setTooltip("Start a new data directory");    addChildComponent(newDirectoryButton);    File executable = File::getSpecialLocation(File::currentExecutableFile);#if defined(__APPLE__)    const String executableDirectory =        executable.getParentDirectory().getParentDirectory().getParentDirectory().getParentDirectory().getFullPathName();#else    const String executableDirectory = executable.getParentDirectory().getFullPathName();#endif    filenameComponent = new FilenameComponent("folder selector",                                              executableDirectory,                                              true,                                              true,                                              true,                                              "*",                                              "",                                              "");    addChildComponent(filenameComponent);    prependText = new Label("Prepend","");    prependText->setEditable(true);    prependText->addListener(this);    prependText->setColour(Label::backgroundColourId, Colours::lightgrey);    prependText->setTooltip("Prepend to name of data directory");    addChildComponent(prependText);    dateText = new Label("Date","YYYY-MM-DD_HH-MM-SS");    dateText->setColour(Label::backgroundColourId, Colours::lightgrey);    dateText->setColour(Label::textColourId, Colours::grey);    addChildComponent(dateText);    appendText = new Label("Append","");    appendText->setEditable(true);    appendText->addListener(this);    appendText->setColour(Label::backgroundColourId, Colours::lightgrey);    addChildComponent(appendText);    appendText->setTooltip("Append to name of data directory");//.........这里部分代码省略.........
开发者ID:SunandhaSrikanth,项目名称:open-ephys-GUI,代码行数:101,


示例7: vcolour

int vcolour(Vec3 c) { // converts a 4 vector to a colour.    return Colour((int)(c[0]), (int)(c[1]), (int)(c[2]));}
开发者ID:graingert,项目名称:comp3004-2,代码行数:3,


示例8: paint

void MainContentComponent::paint (Graphics& g){    g.fillAll (Colour (0xffeeddff));}
开发者ID:AndyBrown91,项目名称:JuceMonome,代码行数:4,


示例9: Colour

CodeEditorComponent::ColourScheme LuaTokeniser::getDefaultColourScheme(){    static const CodeEditorComponent::ColourScheme::TokenType types[] =    {        { "Error",          Colour (0xffcc0000) },        { "Comment",        Colour (0xff3c3c3c) },        { "Keyword",        Colour (0xff0000cc) },        { "Operator",       Colour (0xff225500) },        { "Identifier",     Colour (0xff000000) },        { "Integer",        Colour (0xff880000) },        { "Float",          Colour (0xff885500) },        { "String",         Colour (0xff990099) },        { "Bracket",        Colour (0xff000055) },        { "Punctuation",    Colour (0xff004400) }    };    CodeEditorComponent::ColourScheme cs;    for (auto& t : types)        cs.set (t.name, Colour (t.colour));    return cs;}
开发者ID:imekon,项目名称:SampleBrowser2,代码行数:23,


示例10: _commands

//==============================================================================ChannelStripComponent::ChannelStripComponent(ApplicationCommandManager &commands, int trackID, const Audio::Engine &engine) :	_commands(commands),	_trackID(trackID),	_engine(engine){    addAndMakeVisible(label = new Label(String::empty, String::empty));    label->setFont(Font(11.0f, Font::FontStyleFlags::plain));    label->setJustificationType(Justification::centred);    label->setEditable(false, true);    label->addListener(this);        // some method should be used to return the name of a track    auto trackLabel = "Track" + String(trackID);    label->setText(trackLabel, NotificationType::sendNotification);        addAndMakeVisible(volumeSlider = new Slider(trackLabel + " v"));    volumeSlider->setSliderStyle(Slider::SliderStyle::LinearVertical);    volumeSlider->setRange(0.0f, 1.0f);    volumeSlider->setSkewFactor(0.5f);    volumeSlider->setTextBoxStyle(Slider::NoTextBox, false, 80, 20);    volumeSlider->setValue(0.7f);	_engine.getMixer()->changeGain(ChannelStripNode::GAIN, static_cast<float>(volumeSlider->getValue()));    volumeSlider->addListener(this);        addAndMakeVisible(panPot = new Slider(trackLabel + " p"));	panPot->setSliderStyle(Slider::SliderStyle::RotaryVerticalDrag);	panPot->setRange(0.0f, 1.0f);        panPot->setTextBoxStyle(Slider::NoTextBox, false, 80, 20);    panPot->setColour(Slider::rotarySliderFillColourId, Colour(0x7fffff));    panPot->setColour(Slider::rotarySliderOutlineColourId, Colour(0x8cffff));    panPot->setValue(0.5f);	_engine.getMixer()->changePan(ChannelStripNode::PAN, static_cast<float>(panPot->getValue()));    panPot->addListener(this);        addAndMakeVisible(muteButton = new ToggleButton("Mute"));    muteButton->setColour(TextButton::buttonColourId, Colours::blue);	setButtonState("Mute", false);    muteButton->addListener(this);    	if (trackID != 0)	{		addAndMakeVisible(soloButton = new ToggleButton("Solo"));		soloButton->setColour(TextButton::buttonColourId, Colours::yellow);		setButtonState("Solo", false);		soloButton->addListener(this);	}	addAndMakeVisible(_pluginsButton = new TextButton("Plugins"));	_pluginsButton->addListener(this);    addAndMakeVisible(plugins1 = new TextButton("Plugin 1"));    plugins1->addListener(this);        addAndMakeVisible(plugins2 = new TextButton("Plugin 2"));    plugins2->addListener(this);	plugins2->setEnabled(false);        addAndMakeVisible(plugins3 = new TextButton("Plugin 3"));    plugins3->addListener(this);	plugins3->setEnabled(false);    addAndMakeVisible(plugins4 = new TextButton("Plugin 4"));    plugins4->addListener(this);	plugins4->setEnabled(false);	addAndMakeVisible(plugins5 = new TextButton("Plugin 1"));	plugins5->addListener(this);	addAndMakeVisible(plugins6 = new TextButton("Plugin 2"));	plugins6->addListener(this);	plugins6->setEnabled(false);	addAndMakeVisible(plugins7 = new TextButton("Plugin 3"));	plugins7->addListener(this);	plugins7->setEnabled(false);	addAndMakeVisible(plugins8 = new TextButton("Plugin 4"));	plugins8->addListener(this);	plugins8->setEnabled(false);}
开发者ID:dmtaudio,项目名称:mordaw,代码行数:80,


示例11: sprintf

void VoxGame::AddConsoleLabel(string message){	if (m_GUICreated == false)	{		m_vStringCache.push_back(message);		return;	}	char lChatString[8192];	sprintf(lChatString, "%s", message.c_str());	string chatString = lChatString;	int lCharIndex = 0;	int lStartLineIndex = 0;	int lPreviousSpaceIndex = 0;	// Our position	float lCurrentTextX = 0.0f;	int newLineIndex = 1;	int indexToUse = (int)m_vpConsoleLabels.size() + (int)m_vpConsoleLabels_Add.size();	while (lChatString[lCharIndex] != 0)	{		char lpChar = lChatString[lCharIndex];		char lpNextChar = lChatString[lCharIndex + 1];		// Check for spaces		if (lpChar == ' ')		{			string lString(chatString.substr(lStartLineIndex, lCharIndex - lStartLineIndex));			int lTextLineWidth = m_pRenderer->GetFreeTypeTextWidth(m_defaultFont, "%s", lString.c_str());			// If the current X position, plus our new text length is greater than the width, then we know we will go out of bounds			if (lCurrentTextX + lTextLineWidth > m_pConsoleScrollbar->GetScrollArea().m_width)			{				string lString(chatString.substr(lStartLineIndex, lPreviousSpaceIndex - lStartLineIndex));				Label* pNewLabel = new Label(m_pRenderer, m_defaultFont, lString.c_str(), Colour(1.0f, 1.0f, 1.0f));				int xPos = m_pConsoleScrollbar->GetScrollArea().m_x;				int yPos = m_pConsoleScrollbar->GetScrollArea().m_y + m_pConsoleScrollbar->GetScrollArea().m_height - (indexToUse + newLineIndex) * 14;				pNewLabel->SetLocation(xPos, yPos);				m_vpConsoleLabels_Add.push_back(pNewLabel);				// Skip over the new line, else we will detect it on the next loop				lStartLineIndex = lPreviousSpaceIndex + 1;				newLineIndex++;			}			lPreviousSpaceIndex = lCharIndex;		}		// Check for the end of the string		if (lpNextChar == 0)		{			string lString(chatString.substr(lStartLineIndex, lCharIndex + 1 - lStartLineIndex));			int lTextLineWidth = m_pRenderer->GetFreeTypeTextWidth(m_defaultFont, "%s", lString.c_str());			Label* pNewLabel = new Label(m_pRenderer, m_defaultFont, lString.c_str(), Colour(1.0f, 1.0f, 1.0f));			int xPos = m_pConsoleScrollbar->GetScrollArea().m_x;			int yPos = m_pConsoleScrollbar->GetScrollArea().m_y + m_pConsoleScrollbar->GetScrollArea().m_height - (indexToUse + newLineIndex) * 14;			pNewLabel->SetLocation(xPos, yPos);			m_vpConsoleLabels_Add.push_back(pNewLabel);		}		lCharIndex++;	}}
开发者ID:rzh,项目名称:Vox,代码行数:72,


示例12: Colour

//==============================================================================const Colour Colours::findColourForName (const String& colourName,                                         const Colour& defaultColour){    static const int presets[] =    {        // (first value is the string's hashcode, second is ARGB)        0x05978fff, 0xff000000, /* black */        0x06bdcc29, 0xffffffff, /* white */        0x002e305a, 0xff0000ff, /* blue */        0x00308adf, 0xff808080, /* grey */        0x05e0cf03, 0xff008000, /* green */        0x0001b891, 0xffff0000, /* red */        0xd43c6474, 0xffffff00, /* yellow */        0x620886da, 0xfff0f8ff, /* aliceblue */        0x20a2676a, 0xfffaebd7, /* antiquewhite */        0x002dcebc, 0xff00ffff, /* aqua */        0x46bb5f7e, 0xff7fffd4, /* aquamarine */        0x0590228f, 0xfff0ffff, /* azure */        0x05947fe4, 0xfff5f5dc, /* beige */        0xad388e35, 0xffffe4c4, /* bisque */        0x00674f7e, 0xffffebcd, /* blanchedalmond */        0x39129959, 0xff8a2be2, /* blueviolet */        0x059a8136, 0xffa52a2a, /* brown */        0x89cea8f9, 0xffdeb887, /* burlywood */        0x0fa260cf, 0xff5f9ea0, /* cadetblue */        0x6b748956, 0xff7fff00, /* chartreuse */        0x2903623c, 0xffd2691e, /* chocolate */        0x05a74431, 0xffff7f50, /* coral */        0x618d42dd, 0xff6495ed, /* cornflowerblue */        0xe4b479fd, 0xfffff8dc, /* cornsilk */        0x3d8c4edf, 0xffdc143c, /* crimson */        0x002ed323, 0xff00ffff, /* cyan */        0x67cc74d0, 0xff00008b, /* darkblue */        0x67cd1799, 0xff008b8b, /* darkcyan */        0x31bbd168, 0xffb8860b, /* darkgoldenrod */        0x67cecf55, 0xff555555, /* darkgrey */        0x920b194d, 0xff006400, /* darkgreen */        0x923edd4c, 0xffbdb76b, /* darkkhaki */        0x5c293873, 0xff8b008b, /* darkmagenta */        0x6b6671fe, 0xff556b2f, /* darkolivegreen */        0xbcfd2524, 0xffff8c00, /* darkorange */        0xbcfdf799, 0xff9932cc, /* darkorchid */        0x55ee0d5b, 0xff8b0000, /* darkred */        0xc2e5f564, 0xffe9967a, /* darksalmon */        0x61be858a, 0xff8fbc8f, /* darkseagreen */        0xc2b0f2bd, 0xff483d8b, /* darkslateblue */        0xc2b34d42, 0xff2f4f4f, /* darkslategrey */        0x7cf2b06b, 0xff00ced1, /* darkturquoise */        0xc8769375, 0xff9400d3, /* darkviolet */        0x25832862, 0xffff1493, /* deeppink */        0xfcad568f, 0xff00bfff, /* deepskyblue */        0x634c8b67, 0xff696969, /* dimgrey */        0x45c1ce55, 0xff1e90ff, /* dodgerblue */        0xef19e3cb, 0xffb22222, /* firebrick */        0xb852b195, 0xfffffaf0, /* floralwhite */        0xd086fd06, 0xff228b22, /* forestgreen */        0xe106b6d7, 0xffff00ff, /* fuchsia */        0x7880d61e, 0xffdcdcdc, /* gainsboro */        0x00308060, 0xffffd700, /* gold */        0xb3b3bc1e, 0xffdaa520, /* goldenrod */        0xbab8a537, 0xffadff2f, /* greenyellow */        0xe4cacafb, 0xfff0fff0, /* honeydew */        0x41892743, 0xffff69b4, /* hotpink */        0xd5796f1a, 0xffcd5c5c, /* indianred */        0xb969fed2, 0xff4b0082, /* indigo */        0x05fef6a9, 0xfffffff0, /* ivory */        0x06149302, 0xfff0e68c, /* khaki */        0xad5a05c7, 0xffe6e6fa, /* lavender */        0x7c4d5b99, 0xfffff0f5, /* lavenderblush */        0x195756f0, 0xfffffacd, /* lemonchiffon */        0x28e4ea70, 0xffadd8e6, /* lightblue */        0xf3c7ccdb, 0xfff08080, /* lightcoral */        0x28e58d39, 0xffe0ffff, /* lightcyan */        0x21234e3c, 0xfffafad2, /* lightgoldenrodyellow */        0xf40157ad, 0xff90ee90, /* lightgreen */        0x28e744f5, 0xffd3d3d3, /* lightgrey */        0x28eb3b8c, 0xffffb6c1, /* lightpink */        0x9fb78304, 0xffffa07a, /* lightsalmon */        0x50632b2a, 0xff20b2aa, /* lightseagreen */        0x68fb7b25, 0xff87cefa, /* lightskyblue */        0xa8a35ba2, 0xff778899, /* lightslategrey */        0xa20d484f, 0xffb0c4de, /* lightsteelblue */        0xaa2cf10a, 0xffffffe0, /* lightyellow */        0x0032afd5, 0xff00ff00, /* lime */        0x607bbc4e, 0xff32cd32, /* limegreen */        0x06234efa, 0xfffaf0e6, /* linen */        0x316858a9, 0xffff00ff, /* magenta */        0xbf8ca470, 0xff800000, /* maroon */        0xbd58e0b3, 0xff66cdaa, /* mediumaquamarine */        0x967dfd4f, 0xff0000cd, /* mediumblue */        0x056f5c58, 0xffba55d3, /* mediumorchid */        0x07556b71, 0xff9370db, /* mediumpurple */        0x5369b689, 0xff3cb371, /* mediumseagreen */        0x066be19e, 0xff7b68ee, /* mediumslateblue */        0x3256b281, 0xff00fa9a, /* mediumspringgreen */        0xc0ad9f4c, 0xff48d1cc, /* mediumturquoise */        0x628e63dd, 0xffc71585, /* mediumvioletred */        0x168eb32a, 0xff191970, /* midnightblue *///.........这里部分代码省略.........
开发者ID:SonicPotions,项目名称:editor,代码行数:101,


示例13: TemplateFileProperty

    };    //==============================================================================    class TemplateFileProperty    : public ComponentTextProperty <Component>    {    public:        TemplateFileProperty (JucerDocument& doc)            : ComponentTextProperty <Component> ("Template file", 2048, false, 0, doc)        {}        void setText (const String& newText) override    { document.setTemplateFile (newText); }        String getText() const override                  { return document.getTemplateFile(); }    };};static const Colour tabColour (Colour (0xff888888));static SourceCodeEditor* createCodeEditor (const File& file, SourceCodeDocument& sourceCodeDoc){    return new SourceCodeEditor (&sourceCodeDoc,                                 new CppCodeEditorComponent (file, sourceCodeDoc.getCodeDocument()));}//==============================================================================JucerDocumentEditor::JucerDocumentEditor (JucerDocument* const doc)    : document (doc),      tabbedComponent (TabbedButtonBar::TabsAtTop),      compLayoutPanel (0),      lastViewportX (0),      lastViewportY (0),      currentZoomLevel (1.0)
开发者ID:Harrisson-,项目名称:BGU-MIDI-Emulator,代码行数:31,


示例14: deviceManager

//==============================================================================AudioDemoPlaybackPage::AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_)    : deviceManager (deviceManager_),      thread ("audio file preview"),      directoryList (0, thread),      zoomLabel (0),      explanation (0),      zoomSlider (0),      thumbnail (0),      startStopButton (0),      fileTreeComp (0){    addAndMakeVisible (zoomLabel = new Label (String::empty,                                              "zoom:"));    zoomLabel->setFont (Font (15.0000f, Font::plain));    zoomLabel->setJustificationType (Justification::centredRight);    zoomLabel->setEditable (false, false, false);    zoomLabel->setColour (TextEditor::textColourId, Colours::black);    zoomLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));    addAndMakeVisible (explanation = new Label (String::empty,                                                "Select an audio file in the treeview above, and this page will display its waveform, and let you play it.."));    explanation->setFont (Font (14.0000f, Font::plain));    explanation->setJustificationType (Justification::bottomRight);    explanation->setEditable (false, false, false);    explanation->setColour (TextEditor::textColourId, Colours::black);    explanation->setColour (TextEditor::backgroundColourId, Colour (0x0));    addAndMakeVisible (zoomSlider = new Slider (String::empty));    zoomSlider->setRange (0, 1, 0);    zoomSlider->setSliderStyle (Slider::LinearHorizontal);    zoomSlider->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);    zoomSlider->addListener (this);    zoomSlider->setSkewFactor (2);    addAndMakeVisible (thumbnail = new DemoThumbnailComp (formatManager, transportSource, *zoomSlider));    addAndMakeVisible (startStopButton = new TextButton (String::empty));    startStopButton->setButtonText ("Play/Stop");    startStopButton->addListener (this);    startStopButton->setColour (TextButton::buttonColourId, Colour (0xff79ed7f));    addAndMakeVisible (fileTreeComp = new FileTreeComponent (directoryList));    //[UserPreSize]    //[/UserPreSize]    setSize (600, 400);    //[Constructor] You can add your own custom stuff here..    formatManager.registerBasicFormats();    directoryList.setDirectory (File::getSpecialLocation (File::userHomeDirectory), true, true);    thread.startThread (3);    fileTreeComp->setColour (FileTreeComponent::backgroundColourId, Colours::white);    fileTreeComp->addListener (this);    deviceManager.addAudioCallback (&audioSourcePlayer);    audioSourcePlayer.setSource (&transportSource);    //[/Constructor]}
开发者ID:adrien59cadri,项目名称:test,代码行数:64,


示例15: addAndMakeVisible

//==============================================================================RhythmicGateAudioProcessorEditor::RhythmicGateAudioProcessorEditor (){    //[Constructor_pre] You can add your own custom stuff here..    //[/Constructor_pre]    addAndMakeVisible (slider = new Slider ("new slider"));    slider->setRange (0, 1, 0.01);    slider->setSliderStyle (Slider::LinearBar);    slider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider->setColour (Slider::backgroundColourId, Colour (0x4ef78181));    slider->addListener (this);    addAndMakeVisible (slider2 = new Slider ("new slider"));    slider2->setRange (0, 1, 0.01);    slider2->setSliderStyle (Slider::LinearBar);    slider2->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider2->addListener (this);    addAndMakeVisible (slider3 = new Slider ("new slider"));    slider3->setRange (0, 1, 0.01);    slider3->setSliderStyle (Slider::LinearBar);    slider3->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider3->addListener (this);    addAndMakeVisible (slider4 = new Slider ("new slider"));    slider4->setRange (0, 1, 0.01);    slider4->setSliderStyle (Slider::LinearBar);    slider4->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider4->addListener (this);    addAndMakeVisible (slider5 = new Slider ("new slider"));    slider5->setRange (0, 1, 0.01);    slider5->setSliderStyle (Slider::LinearBar);    slider5->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider5->setColour (Slider::backgroundColourId, Colour (0x4ef78181));    slider5->addListener (this);    addAndMakeVisible (slider6 = new Slider ("new slider"));    slider6->setRange (0, 1, 0.01);    slider6->setSliderStyle (Slider::LinearBar);    slider6->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider6->addListener (this);    addAndMakeVisible (slider7 = new Slider ("new slider"));    slider7->setRange (0, 1, 0.01);    slider7->setSliderStyle (Slider::LinearBar);    slider7->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider7->addListener (this);    addAndMakeVisible (slider8 = new Slider ("new slider"));    slider8->setRange (0, 1, 0.01);    slider8->setSliderStyle (Slider::LinearBar);    slider8->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider8->addListener (this);    addAndMakeVisible (slider9 = new Slider ("new slider"));    slider9->setRange (0, 1, 0.01);    slider9->setSliderStyle (Slider::LinearBar);    slider9->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider9->setColour (Slider::backgroundColourId, Colour (0x4ef78181));    slider9->addListener (this);    addAndMakeVisible (slider10 = new Slider ("new slider"));    slider10->setRange (0, 1, 0.01);    slider10->setSliderStyle (Slider::LinearBar);    slider10->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider10->addListener (this);    addAndMakeVisible (slider11 = new Slider ("new slider"));    slider11->setRange (0, 1, 0.01);    slider11->setSliderStyle (Slider::LinearBar);    slider11->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider11->addListener (this);    addAndMakeVisible (slider12 = new Slider ("new slider"));    slider12->setRange (0, 1, 0.01);    slider12->setSliderStyle (Slider::LinearBar);    slider12->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider12->addListener (this);    addAndMakeVisible (slider13 = new Slider ("new slider"));    slider13->setRange (0, 1, 0.01);    slider13->setSliderStyle (Slider::LinearBar);    slider13->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider13->setColour (Slider::backgroundColourId, Colour (0x4ef78181));    slider13->addListener (this);    addAndMakeVisible (slider14 = new Slider ("new slider"));    slider14->setRange (0, 1, 0.01);    slider14->setSliderStyle (Slider::LinearBar);    slider14->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider14->addListener (this);    addAndMakeVisible (slider15 = new Slider ("new slider"));    slider15->setRange (0, 1, 0.01);    slider15->setSliderStyle (Slider::LinearBar);    slider15->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);    slider15->addListener (this);//.........这里部分代码省略.........
开发者ID:eriser,项目名称:blankenhain,代码行数:101,


示例16: get_gl_drawable

bool Viewer::on_expose_event( GdkEventExpose* /*event*/ ){	Glib::RefPtr<Gdk::GL::Drawable> gldrawable = get_gl_drawable();	if ( !gldrawable )	{		return false;	}	if ( !gldrawable->gl_begin(get_gl_context()) )	{		return false;	}	// Start drawing	draw_init( get_width(), get_height() );	// Transform the world gnomon	for( int i = 0; i < 4; i += 1 )	{		m_gnomonTrans[i] = m_viewing * m_gnomon[i];	}	// Draw the world gnomon	set_colour( Colour(0.1, 0.1, 1.0) );	draw_line2D( m_gnomonTrans[0], m_gnomonTrans[1] );	draw_line2D( m_gnomonTrans[0], m_gnomonTrans[2] );	draw_line2D( m_gnomonTrans[0], m_gnomonTrans[3] );	// Draw the modelling gnomon	set_colour( Colour(0.1, 1.0, 0.1) );	draw_modellingGnomon();	// Draw the unit cube	set_colour( Colour(0.1, 0.1, 0.1) );	draw_unitCube();	// Initialize the viewport	if ( !m_viewflag )	{		m_viewport[0] = ( Point2D(get_width() * 0.05, get_height() * 0.05) );		m_viewport[1] = ( Point2D(get_width() * 0.95, get_height() * 0.05) );		m_viewport[2] = ( Point2D(get_width() * 0.95, get_height() * 0.95) );		m_viewport[3] = ( Point2D(get_width() * 0.05, get_height() * 0.95) );		m_viewflag    = true;	}	// Draw the viewport	set_colour( Colour(0.1, 0.1, 0.1) );	draw_line( m_viewport[0], m_viewport[1] );	draw_line( m_viewport[1], m_viewport[2] );	draw_line( m_viewport[2], m_viewport[3] );	draw_line( m_viewport[3], m_viewport[0] );	// Finish drawing	draw_complete();	// Update the information bar	update_infobar();	// Swap the contents of the front and back buffers so we see what we	// just drew. This should only be done if double buffering is enabled.	gldrawable->swap_buffers();	gldrawable->gl_end();	return true;}
开发者ID:jemartti,项目名称:Cubes,代码行数:66,


示例17: paint

 void paint (Graphics& g) override {     g.fillAll (Colour (0xff4d4d4d)); }
开发者ID:AlessandroGiacomini,项目名称:pyplasm,代码行数:4,


示例18: Vec3f

void Furniture::HandlePickup(int pickupId){  m_handlePickup = false;  // pickupId is the new owner  if (pickupId == 0)  {    // DROP    #ifdef PICKUP_DEBUGstd::cout << "Got drop msg... ";#endif    // Set down: change height to player height. Put player on top.    if (m_pickupId == 0)    {#ifdef PICKUP_DEBUGstd::cout << *this << " Got drop msg but no previous owner!/n";#endif    }    else    {#ifdef PICKUP_DEBUGstd::cout << *this << " Got drop msg; previous owner ID " << m_pickupId << "/n";#endif      GameObject* go = TheGame::Instance()->GetGameObject(m_pickupId);      if (go)      {        float y = go->GetPos().y;        m_pos.y = y;        float h = m_aabb.GetYSize();        go->SetPos(go->GetPos() + Vec3f(0, h + 10.0f, 0)); // 10 is TEMP TEST        Player* p = dynamic_cast<Player*>(go); // TODO Always a player ?        if (p)        {          p->SetCarrying(0);        }      }    }    // This looks very wrong - the server should set the position of the object when it is put down.    // At the very least, only the player who moved the item should position it!?    if (m_pickupId == GetLocalPlayerId())    {      TheObjectUpdater::Instance()->SendPosUpdateReq(GetId(), m_pos, m_location);      // Hide drop button      //TheGSMain::Instance()->ShowDropButton(this, false);      m_sceneNode->SetColour(Colour(1, 1, 1, 1));      //m_sceneNode->SetBlended(false);    }  }  else  {    // Pick up msg    GameObject* go = TheGame::Instance()->GetGameObject(pickupId);    if (go)    {#ifdef PICKUP_DEBUGstd::cout << *this << " got picked up by " << *go << "/n";#endif      if (pickupId == GetLocalPlayerId())      {std::cout << "That's me! Local player picked up this object!/n";        // Show drop button        //TheGSMain::Instance()->ShowDropButton(this, true);        m_sceneNode->SetColour(Colour(1, 1, 1, 0.5f));        //m_sceneNode->SetBlended(true);      }      Player* p = dynamic_cast<Player*>(go); // TODO Always a player ?      if (p)      {        p->SetCarrying(this);           }    }    else    {#ifdef PICKUP_DEBUGstd::cout << *this << " got picked up by object " << pickupId << " but this object not created yet!!/n";#endif    }  }#ifdef PICKUP_DEBUGstd::cout << "Setting m_pickupId to " << pickupId << "/n";#endif  m_pickupId = pickupId;}
开发者ID:jason-amju,项目名称:amjulib,代码行数:94,


示例19: oscHandler

MainContentComponent::MainContentComponent():oscHandler(),clippingLed( *this ),audioIOComponent(),audioRecorder(),delayLine(),sourceImagesHandler(),ambi2binContainer(){    // set window dimensions    setSize (650, 700);        // specify the required number of input and output channels    setAudioChannels (2, 2);        // add to change listeners    oscHandler.addChangeListener(this);        // add audioIOComponent as addAudioCallback for adc input    deviceManager.addAudioCallback(&audioIOComponent);        //==========================================================================    // INIT GUI ELEMENTS        // add GUI sub-components    addAndMakeVisible(audioIOComponent);    addAndMakeVisible(clippingLed);    clippingLed.setAlwaysOnTop(true);        // setup logo image    logoImage = ImageCache::getFromMemory(BinaryData::evertims_logo_512_png, BinaryData::evertims_logo_512_pngSize);    logoImage = logoImage.rescaled(logoImage.getWidth()/2, logoImage.getHeight()/2);        // init log text box    addAndMakeVisible (logTextBox);    logTextBox.setMultiLine (true);    logTextBox.setReturnKeyStartsNewLine (true);    logTextBox.setReadOnly (true);    logTextBox.setScrollbarsShown (true);    logTextBox.setCaretVisible (false);    logTextBox.setPopupMenuEnabled (true);    logTextBox.setColour (TextEditor::textColourId, Colours::whitesmoke);    logTextBox.setColour (TextEditor::backgroundColourId, Colour(PixelARGB(200,30,30,30)));    logTextBox.setColour (TextEditor::outlineColourId, Colours::whitesmoke);    logTextBox.setColour (TextEditor::shadowColourId, Colours::darkorange);        // init text buttons    buttonMap.insert({        { &saveIrButton, "Save RIRs to Desktop" },        { &saveOscButton, "Save OSC state to Desktop" },        { &clearSourceImageButton, "Clear" }    });    for (auto& pair : buttonMap)    {        auto& obj = pair.first;        const auto& param = pair.second;        obj->setButtonText(param);        obj->addListener (this);        obj->setEnabled (true);        addAndMakeVisible(obj);    }    saveIrButton.setColour (TextButton::buttonColourId, Colours::transparentBlack);    saveOscButton.setColour (TextButton::buttonColourId, Colour(PixelARGB(160,0,0,0)));    clearSourceImageButton.setColour (TextButton::buttonColourId, Colours::indianred);        // init combo boxes    comboBoxMap.insert({        { &numFrequencyBandsComboBox, {"3", "10"} },        { &srcDirectivityComboBox, {"omni", "directional"} },    });    for (auto& pair : comboBoxMap)    {        auto& obj = pair.first;        const auto& param = pair.second;        addAndMakeVisible(obj);        obj->setEditableText(false);        obj->setJustificationType(Justification::right);        obj->setColour(ComboBox::backgroundColourId, Colour(PixelARGB(200,30,30,30)));        obj->setColour(ComboBox::buttonColourId, Colour(PixelARGB(200,30,30,30)));        obj->setColour(ComboBox::outlineColourId, Colour(PixelARGB(200,30,30,30)));        obj->setColour(ComboBox::textColourId, Colours::whitesmoke);        obj->setColour(ComboBox::arrowColourId, Colours::whitesmoke);        obj->addListener (this);        for( int i = 0; i < param.size(); i++ ){ obj->addItem(param[i], i+1); }        obj->setSelectedId(1);    }        // init sliders    sliderMap.insert({        { &gainReverbTailSlider, { 0.0, 2.0, 1.0} }, // min, max, value        { &gainDirectPathSlider, { 0.0, 2.0, 1.0} },        { &gainEarlySlider, { 0.0, 2.0, 1.0} },        { &crossfadeStepSlider, { 0.001, 0.2, 0.1} }    });    for (auto& pair : sliderMap)    {        auto& obj = pair.first;        const auto& param = pair.second;        addAndMakeVisible(obj);        obj->setRange( param[0], param[1] );//.........这里部分代码省略.........
开发者ID:EVERTims,项目名称:auralization_engine_evertims,代码行数:101,


示例20: Colour

Colour Colour::operator *(const Colour& other) {	return Colour(m_data[0]*other.m_data[0],		m_data[1]*other.m_data[1],		m_data[2]*other.m_data[2]);}
开发者ID:natashad,项目名称:RayTracer,代码行数:5,


示例21: Colour

//==============================================================================void DownButton::paint (Graphics& g){    //[UserPrePaint] Add your own custom painting code here..    if(!state)    {    //[/UserPrePaint]    g.fillAll (Colour (0xff2b2b2b));    g.setGradientFill (ColourGradient (Colours::white,                                       40.0f, 32.0f,                                       Colour (0xffe4e4e4),                                       56.0f, 24.0f,                                       true));    g.fillPath (internalPath1);    g.setColour (Colour (0xff777777));    g.strokePath (internalPath1, PathStrokeType (3.0000f, PathStrokeType::curved, PathStrokeType::rounded));    //[UserPaint] Add your own custom painting code here..    }    else    {        g.setGradientFill (ColourGradient (Colours::white,                                       40.0f, 32.0f,                                       Colour (0xffe4e4e4),                                       56.0f, 24.0f,                                       true));        g.fillPath (internalPath1);        g.setGradientFill (ColourGradient (Colour (0xe0ffffff),                                       50.0f, 50.0f,                                       //x, y,                                       Colour(0xD000ff00),                                       75.0f, 75.0f,                                       true));    //Draw pad border    g.strokePath (internalPath1, PathStrokeType (4.0000f, PathStrokeType::curved, PathStrokeType::rounded));    g.setGradientFill (ColourGradient (Colour (0x309d9d9d),                                       50.0f, 50.0f,                                       //x, y,                                       Colours::red,                                       150.0f, 50.0f,                                       true));    g.fillEllipse(30.0f - pressure/2.0f, 16.0f - pressure/2.0f, pressure, pressure);    //g.setColour(Colour((uint8)0,(uint8)0,(uint8)0,(uint8)100));    g.setGradientFill (ColourGradient (Colour (0x309d9d9d),                                       50.0f, 50.0f,                                       //x, y,                                       Colours::red,                                       150.0f, 50.0f,                                       true));    //Pressure border    g.drawEllipse(30.0f - pressure/2.0f, 16.0f - pressure/2.0f, pressure, pressure,pressure/7.0f);    g.setColour(Colour (0xff101010));    g.strokePath (internalPath1, PathStrokeType (1.0000f, PathStrokeType::curved, PathStrokeType::rounded));}    //[/UserPaint]}
开发者ID:connerlacy,项目名称:QuNeoDemo,代码行数:67,


示例22: main

//.........这里部分代码省略.........                    DisplayListofMeters(Meters, ecpiwwMeter);                    UpdateMetersonStick(hStick, wMBUSStick, Meters, ecpiwwMeter, InfoFlag);                 }                 else                    printf("Index not defined/n");            }        }        // switch to S2 mode        if(key == 's')        {            wMBus_SwitchMode( hStick,wMBUSStick, RADIOS2,InfoFlag);            wMBus_GetRadioMode(hStick, wMBUSStick, &ReturnValue, InfoFlag);             if(InfoFlag > SILENTMODE) {                printf("wM-BUS %s Mode/n", (ReturnValue == RADIOT2) ? "T2" : "S2");            }        }        // switch to T2 mode        if(key == 't')        {            wMBus_SwitchMode( hStick,wMBUSStick, RADIOT2,InfoFlag);            wMBus_GetRadioMode(hStick, wMBUSStick, &ReturnValue, InfoFlag);             if(InfoFlag > SILENTMODE) {                printf("wM-BUS %s Mode/n", (ReturnValue == RADIOT2) ? "T2" : "S2");            }        }        if(key == 'h')        {            wMBus_GetLastError( hStick,wMBUSStick);            wMBus_GetDataByHand();        }        if(key == 'x')        {            printf("/n/nStatus from Stick/n");            wMBus_GetStickStatus( hStick, wMBUSStick, InfoFlag);        }        //check whether there are new data from the EnergyCams        if (IsNewMinute() || (key == 'u')) {            if(wMBus_GetMeterDataList() > 0) {                iCheck = 0;                for(iX=0; iX<Meters; iX++) {                    if((0x01<<iX) & wMBus_GetMeterDataList()) {                        ecMBUSData RFData;                        int iMul=1;                        int iDiv=1;                        wMBus_GetData4Meter(iX, &RFData);                        if(RFData.exp < 0) {  //GAS                            for(iK=RFData.exp; iK<0; iK++)                               iDiv=iDiv*10;                            csvValue = ((double)RFData.value)/iDiv;                        } else {                            for(iK=0; iK<RFData.exp; iK++)                                iMul=iMul*10;                            csvValue = (double)RFData.value*iMul;                        }                        // Log Meter alive                        Colour(PRINTF_GREEN, false);                        printf("/nMeter #%d : %04x %08x %02x %02x", iX+1, ecpiwwMeter[iX].manufacturerID, ecpiwwMeter[iX].ident, ecpiwwMeter[iX].type, ecpiwwMeter[iX].version);                        if((RFData.pktInfo & PACKET_WAS_ENCRYPTED)      ==  PACKET_WAS_ENCRYPTED)     printf(" Decryption OK    ");                        if((RFData.pktInfo & PACKET_DECRYPTIONERROR)    ==  PACKET_DECRYPTIONERROR)   printf(" Decryption ERROR ");                        if((RFData.pktInfo & PACKET_WAS_NOT_ENCRYPTED)  ==  PACKET_WAS_NOT_ENCRYPTED) printf(" not encrypted    ");                        if((RFData.pktInfo & PACKET_IS_ENCRYPTED)       ==  PACKET_IS_ENCRYPTED)      printf(" is encrypted     ");                        printf(" RSSI=%i dbm, #%d ", RFData.rssiDBm, RFData.accNo);                        Colour(0,false);                        // Log to File                        Log2File(CommandlineDatPath, LogMode, iX, InfoFlag, csvValue, &RFData, &ecpiwwMeter[iX]);                    }                }            }            else {                Colour(PRINTF_YELLOW, false);                if(iCheck == 0) printf("/n");                printf(".");                iCheck++;                Colour(0, false);            }        }    } // end while    if(hStick >0) wMBus_CloseDevice(hStick, wMBUSStick);    //save Meter config to file    if(Meters > 0) {        if ((hDatFile = fopen("meter.dat", "wb")) != NULL) {            fwrite((void*)ecpiwwMeter, sizeof(ecwMBUSMeter), MAXMETER, hDatFile);            fclose(hDatFile);        }    }    return 0;}
开发者ID:mpruessmeier,项目名称:eccwmbus,代码行数:101,



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


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