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


C++ ofColor::set方法代码示例

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


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

示例1: stroke

 void stroke(float gray, float alpha)
 {
     m_strokeColor.set(gray, gray, gray, alpha);
     m_hasStroke = true;
     
     if( m_inSetup )
         m_defaultStrokeColor = m_strokeColor;
 }
开发者ID:JosephLaurino,项目名称:ofx-experiments,代码行数:8,代码来源:processing.cpp

示例2: fill

 void fill(float gray, float alpha)
 {
     m_hasFill = true;
     m_fillColor.set(gray,alpha);
     
     if( m_inSetup )
         m_defaultFillColor = m_fillColor;
 }
开发者ID:JosephLaurino,项目名称:ofx-experiments,代码行数:8,代码来源:processing.cpp

示例3: parseXml

 void parseXml() {
     m_settings.pushTag("AppConfig");
     
     // parse output values
     m_settings.pushTag("output");
     m_output_projector_width = m_settings.getValue("projector_width", 0);
     m_output_projector_height = m_settings.getValue("projector_height", 0);
     m_output_buffer_width = m_settings.getValue("buffer_width", 0);
     m_output_buffer_height = m_settings.getValue("buffer_height", 0);
     m_settings.popTag();
     
     // parse Kinect values
     m_settings.pushTag("kinect");
     m_kinect_crop_buffer_width = m_settings.getValue("crop_buffer_width", 0);
     m_kinect_crop_buffer_height = m_settings.getValue("crop_buffer_height", 0);
     m_settings.popTag();
     
     // parse vector field values
     m_settings.pushTag("vector_field");
     m_vector_field_subdivision_x = m_settings.getValue("subdivision_x", 0);
     m_vector_field_subdivision_y = m_settings.getValue("subdivision_y", 0);
     m_settings.popTag();
     
     // parse particle system values
     m_settings.pushTag("particle_system");
     m_particle_system_count = m_settings.getValue("count", 0);
     m_particle_system_min_radius = m_settings.getValue("min_radius", 0);
     m_particle_system_max_radius = m_settings.getValue("max_radius", 0.0);
     m_settings.popTag();
     
     // parse marching squares values
     m_settings.pushTag("marching_squares");
     m_marching_squares_columns = m_settings.getValue("columns", 0);
     m_marching_squares_rows = m_settings.getValue("rows", 0);
     m_settings.popTag();
     
     m_settings.pushTag("colors");
     parseHsb(m_background_color, "background");
     parseHsb(m_metaballs_color, "metaballs");
     m_background_clear_color.set(m_background_color);
     m_background_clear_color.a = 0.f;
     m_settings.popTag();
     
     m_settings.popTag();
 }
开发者ID:davidbeermann,项目名称:timely-matter,代码行数:45,代码来源:AppConfig.hpp

示例4: setup

void ofApp::setup() {
    
    ofEnableSmoothing();
    ofEnableAlphaBlending();
    ofSetFrameRate(60);
    ofSetVerticalSync(true);
    ofEnableDepthTest();
    ofEnableAntiAliasing();

    memset( dmxData_, 0, DMX_DATA_LENGTH );
    
    //open the device
    dmxInterface_ = ofxGenericDmx::createDevice(DmxDevice::DMX_DEVICE_RAW);
    bool opened = dmxInterface_->open();
    if ( dmxInterface_ == 0 || !opened ) {
        printf( "No FTDI Device Found\n" );
    } else {
        printf( "isOpen: %i\n", dmxInterface_->isOpen() );
    }
    
    printf("ofxGenericDmx addon version: %s.%s\n", ofxGenericDmx::VERSION_MAJOR, ofxGenericDmx::VERSION_MINOR);
    
    std::string file = "Lightweave_loops2.json";
    std::string columnsFile = "Lightweave_columns2.json";
    std::string facesFile = "Lightweave_faces2.json";
    
    bool parsingSuccessful = result.open(file);
    
    bool parsingSuccessfulColumn = columnGeometry.open(columnsFile);

    bool parsingSuccessfulFaces = faceGeometry.open(facesFile);

    
    for (int region = 0; region < 6; region++) {
        string blah = "region" + ofToString(region);
        for (int rings = 0; rings < result[blah].size(); rings++) {
            string ring = "ring" + ofToString(rings);
            for (int pointPos = 0; pointPos < 3; pointPos++) {
                string point = "point" + ofToString(pointPos);
            }
        }
    }
        
    //setupUDP();
    
    camWidth = 320;
    camHeight = 240;

    vector<ofVideoDevice> devices = vidGrabber.listDevices();
    for (int i = 0; i < devices.size(); i++) {
        if (devices[i].bAvailable) {
            ofLogNotice() << devices[i].id << ": " << devices[i].deviceName;
        } else {
            ofLogNotice() << devices[i].id << ": " << devices[i].deviceName << " - unavailable ";
        }
    }
    
    for (int i = 0; i < devices.size(); i++) {
        if (!devices[i].deviceName.find("USB")) {
            cout << devices[i].id << endl;
            pcCams.push_back(devices[i].id);
        }
    }
    

    vidGrabber.setDeviceID(pcCams[0]);
//    vidGrabber.setDeviceID(0);

    vidGrabber.initGrabber(320,240);
    
    vidGrabber1.setDeviceID(pcCams[1]);
//    vidGrabber1.setDeviceID(0);

    vidGrabber1.initGrabber(320,240);
    
    colorImg1.allocate(320,240);
    grayImage1.allocate(320,240);
    grayBg1.allocate(320,240);
    grayDiff1.allocate(320,240);
    
    colorImg.allocate(320,240);
    grayImage.allocate(320,240);
    grayBg.allocate(320,240);
    grayDiff.allocate(320,240);
    
    bLearnBackground = true;
    bLearnBackground1 = true;
    threshold = 80;
    drawOne = false;
    
    bottomSwarm.a = 1.1f;
    bottomSwarm.b = (curWidth/4.0);
    bottomSwarm.c = 100.0;
    bottomSwarm.bVel = 1.0;
    
    xPos = 0;
    yPos = 0;
    zPos = 0;
    
    cam.setPosition(result["region0"]["ring0"]["point0"][0].asFloat(),result["region0"]["ring0"]["point0"][1].asFloat(),result["region0"]["ring0"]["point0"][2].asFloat());
//.........这里部分代码省略.........
开发者ID:Future-Cities-Lab,项目名称:DCOpenFrameworks,代码行数:101,代码来源:ofApp.cpp

示例5: keyPressed

//--------------------------------------------------------------
void testApp::keyPressed(int key){

	float smooth;

	switch (key) {
#ifdef TARGET_OSX // only working on Mac at the moment
		case 357: // up key
			//hardware.setTiltAngle(hardware.tilt_angle++);
            artk.setThreshold(++threshold);
			break;
		case 359: // down key
			//hardware.setTiltAngle(hardware.tilt_angle--);
            artk.setThreshold(--threshold);
			break;
			
#endif
		
		case 'm':
		case 'M':
			isMasking = !isMasking;
			recordUser.setUseMaskPixels(isMasking);
			playUser.setUseMaskPixels(isMasking);
			break;
		case 'd':
		case 'D':
			isDebug = !isDebug;
			break;
		case 'b':
		case 'B':
			isCPBkgnd = !isCPBkgnd;
			break;
        case 'c':
        case 'C':
            isCalibrating = !isCalibrating;
            break;
		case '9':
		case '>':
		case '.':
			farThreshold += 50;
			if (farThreshold > recordDepth.getMaxDepth()) farThreshold = recordDepth.getMaxDepth();
			break;
		case '<':
		case ',':
			farThreshold -= 50;
			if (farThreshold < 0) farThreshold = 0;
			break;

		case '+':
		case '=':
			nearThreshold += 50;
			if (nearThreshold > recordDepth.getMaxDepth()) nearThreshold = recordDepth.getMaxDepth();
			break;

		case '-':
		case '_':
			nearThreshold -= 50;
			if (nearThreshold < 0) nearThreshold = 0;
			break;
        case '1':
            intensPas += 1; // Distance between segments
            dMin2 = intensPas * intensPas;
            break;
        case 'q':
        case 'Q':
            if (intensPas>1)
            intensPas -= 1;
            dMin2 = intensPas * intensPas;
            break;
        case '2':
            dMin2 +=1;// Last Mile Drawing close to Charges
            break;
        case 'w':
        case 'W':
            if(dMin2>1)
                dMin2-=1;
            break;
        case '3':
            numFieldIterations += 200;
            break;
        case 'e':
            case 'E':
            numFieldIterations -= 200;
            break;
        case '4':
            lineWeight += .1;
            break;
        case 'r':
        case 'R':    
            if(lineWeight>.1)
                lineWeight-=.1;
            break;
        case '5':
            lineColor.set(lineColor.r+1,lineColor.g,lineColor.b);
            break;
        case 't':
        case 'T':
            lineColor.set(lineColor.r-1,lineColor.g,lineColor.b);
            break;
        case '6':
//.........这里部分代码省略.........
开发者ID:seanmitchellmcdonald,项目名称:Theremin_Inspector_v3,代码行数:101,代码来源:testApp.cpp


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