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


C++ setResolution函数代码示例

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


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

示例1: setResolution

uint8_t DS18B20::hasAlarm() {
    uint8_t oldResolution = selectedResolution;
    setResolution(9);
    float temp = getTempC();
    setResolution(oldResolution);
    return ((temp <= selectedScratchpad[ALARM_LOW]) || (temp >= selectedScratchpad[ALARM_HIGH]));
}
开发者ID:matmunk,项目名称:DS18B20,代码行数:7,代码来源:DS18B20.cpp

示例2: GlRender

GlAndroidContext::GlAndroidContext(const XCHAR *title, int width, int height) {
	_render = new GlRender(width, height);
	printGraphicInformation();
	setResolution(width, height);
	setFullscreen(true);
	_Context = this;
}
开发者ID:WNeZRoS,项目名称:Hunger,代码行数:7,代码来源:GlAndroidContext.cpp

示例3: l_RenderWindow_setResolution

static int l_RenderWindow_setResolution(lua_State *L) {
    auto renderWindow = lua_torenderwindow(L, 1);
    integerType width = luaL_checkint(L, 2);
    integerType height = luaL_checkint(L, 3);
    renderWindow->setResolution(width, height);
    return 0;
}
开发者ID:benzap,项目名称:Kampf,代码行数:7,代码来源:l_RenderWindow.cpp

示例4: closeFrameBuffer

void ExternalDisplay::processUEventOnline(const char *str) {
    const char *s1 = str + (strlen(str)-strlen(DEVICE_NODE_FB1));
    // check if it is for FB1
    if(strncmp(s1,DEVICE_NODE_FB1, strlen(DEVICE_NODE_FB1))== 0) {
        if(isHDMIConfigured()) {
            // HDMI connect event.
            // Tear-down WFD if it is active.
            if(mExternalDisplay == EXTERN_DISPLAY_FB2) {
                closeFrameBuffer();
                setExternalDisplay(EXTERN_DISPLAY_NONE);
                triggerRefresh();
            }
        }
        readResolution();
        //Get the best mode and set
        setResolution(getBestMode());
        enableHDMIVsync(EXTERN_DISPLAY_FB1);
        setExternalDisplay(EXTERN_DISPLAY_FB1);
        triggerRefresh();
    }
    else if(strncmp(s1, DEVICE_NODE_FB2, strlen(DEVICE_NODE_FB2)) == 0) {
        // WFD connect event
        if(mExternalDisplay  == EXTERN_DISPLAY_FB1) {
            // HDMI has higher priority.
            // Do Not Override.
        }else {
            // WFD is connected
            openFrameBuffer(EXTERN_DISPLAY_FB2);
            setExternalDisplay(EXTERN_DISPLAY_FB2);
            triggerRefresh();
        }
    }
}
开发者ID:sattarvoybek,项目名称:android_hardware_qcom_display-legacy-caf,代码行数:33,代码来源:hwc_external.cpp

示例5: ALOGD_IF

void ExtDisplayObserver::handleUEvent(char* str){
    int connected = 0;
    // TODO: check for fb2(WFD) driver also
    if(!strcasestr(str, DEVICE_NODE))
    {
        ALOGD_IF(EXT_OBSERVER_DEBUG, "%s: Not Ext Disp Event ", __FUNCTION__);
        return;
    }
    // Event will be of the form:
    // [email protected]/devices/virtual/graphics/fb1 ACTION=change
    // DEVPATH=/devices/virtual/graphics/fb1
    // SUBSYSTEM=graphics HDCP_STATE=FAIL MAJOR=29
    // for now just parse the online or offline are important for us.
    if(!(strncmp(str,"[email protected]",strlen("[email protected]")))) {
        ALOGD_IF(EXT_OBSERVER_DEBUG, "%s: external disp online", __FUNCTION__);
        connected = 1;
        readResolution();
        //Get the best mode and set
        // TODO: DO NOT call this for WFD
        setResolution(getBestMode());
    } else if(!(strncmp(str,"[email protected]",strlen("[email protected]")))) {
        ALOGD_IF(EXT_OBSERVER_DEBUG, "%s: external disp online", __FUNCTION__);
        connected = 0;
        close(fd);
    }
    setExternalDisplayStatus(connected);
}
开发者ID:threader,项目名称:hardware_qcom_display,代码行数:27,代码来源:hwc_ext_observer.cpp

示例6: eFatal

gFBDC::gFBDC()
{
	fb=new fbClass;

	if (!fb->Available())
		eFatal("[gFBDC] no framebuffer available");

	int xres;
	int yres;
	int bpp;
	fb->getMode(xres, yres, bpp);

	/* we can only use one of these three modes: */
	if (!((xres == 720 && yres == 576)
		|| (xres == 1280 && yres == 720)
		|| (xres == 1920 && yres == 1080)))
	{
		/* fallback to a decent default */
		xres = 720;
		yres = 576;
	}

	surface.clut.data = 0;
	setResolution(xres, yres); // default res

	reloadSettings();
}
开发者ID:kingvuplus,项目名称:ME,代码行数:27,代码来源:gfbdc.cpp

示例7: setResolution

bool			BzfDisplay::doSetDefaultResolution()
{
  if (numResolutions >= 2 && defaultResolution < numResolutions)
    return setResolution(defaultResolution);
  else
    return false;
}
开发者ID:mvanderkolff,项目名称:navi-misc,代码行数:7,代码来源:BzfDisplay.cpp

示例8: while

void DallasTemperature::begin(void) {
    DeviceAddress deviceAddress;

    _wire->reset_search();

    devices = 0; // Reset the number of devices when we enumerate wire devices

    while (_wire->search(deviceAddress)) {
        if (validAddress(deviceAddress)) {
#if REQUIRESPARASITEPOWERAVAILABLE
            if (!parasite && readPowerSupply(deviceAddress)) parasite = true;
#endif			

            ScratchPad scratchPad;
            readScratchPad(deviceAddress, scratchPad);

#if REQUIRESONLY12BITCONVERSION			
            setResolution(deviceAddress, 12);
#else
            //bitResolution = max(bitResolution, getResolution(deviceAddress));
            uint8_t newResolution = getResolution(deviceAddress);
            if (newResolution > bitResolution) { // the max macro may call getResultion multiple times. 
                bitResolution = newResolution;
            }
#endif
            devices++;
        }
    }
}
开发者ID:etk29321,项目名称:BrewPi2-firmware,代码行数:29,代码来源:DallasTemperature.cpp

示例9: Java_com_n0n3m4_q3e_Q3EJNI_init

JNIEXPORT void JNICALL Java_com_n0n3m4_q3e_Q3EJNI_init(JNIEnv *env, jclass c, jstring LibPath, jint width, jint height, jstring GameDir, jstring Cmdline)
{
    char **argv;
    int argc=0;
    jboolean iscopy;
    const char *dir = (*env)->GetStringUTFChars(
                          env, GameDir, &iscopy);
    const char *arg = (*env)->GetStringUTFChars(
                          env, Cmdline, &iscopy);
    chdir(strdup(dir));
    (*env)->ReleaseStringUTFChars(env, GameDir, dir);
    argv = malloc(sizeof(char*) * 255);
    argc = ParseCommandLine(strdup(arg), argv);
    (*env)->ReleaseStringUTFChars(env, Cmdline, arg);

    const char *libpath = (*env)->GetStringUTFChars(
                              env, LibPath, &iscopy);
    loadLib(strdup(libpath));
    (*env)->ReleaseStringUTFChars(env, LibPath, libpath);

    setCallbacks(&initAudio,&writeAudio,&setState);
    setResolution(width, height);

    qmain(argc, argv);
    free(argv);
}
开发者ID:eradicus,项目名称:Quake-3-Android-Port-QIII4A,代码行数:26,代码来源:q3e.c

示例10: src

ImageReceiver::ImageReceiver ()
  : src (new cv::Mat)
{
  cv::namedWindow ("Live Image", 1);
  setStreaming (true);
  setResolution (640, 480);
}
开发者ID:dongmingdmdm,项目名称:camnavi,代码行数:7,代码来源:imagereceiver.cpp

示例11: ALOGD_IF

void ExternalDisplay::setExternalDisplay(int connected)
{

    hwc_context_t* ctx = mHwcContext;
    if(ctx) {
        ALOGD_IF(DEBUG, "%s: status = %d", __FUNCTION__,
                 connected);
        if(connected) {
            readResolution();
            //Get the best mode and set
            // TODO: Move this to activate
            setResolution(getBestMode());
            setDpyAttr();
            //enable hdmi vsync
        } else {
            // Disable the hdmi vsync
            closeFrameBuffer();
            resetInfo();
        }
        // Store the external display
        mExternalDisplay = connected;
        const char* prop = (connected) ? "1" : "0";
        // set system property
        property_set("hw.hdmiON", prop);
    }
    return;
}
开发者ID:poppy1,项目名称:android_hardware_qcom_display,代码行数:27,代码来源:external.cpp

示例12: fopen

const bool RawivImporter::import( const std::string& filename )
{
    FILE* ifs = fopen( filename.c_str(), "rb" );
    if ( !ifs )
    {
        kvsMessageError( "Cannot open file <%s>.", filename.c_str() );
        return( false );
    }

    fseek( ifs, 8 * sizeof(int), SEEK_SET );

    unsigned int dim[3];
    fread( dim, sizeof(unsigned int), 3, ifs );
    kvs::Endian::Swap( dim, 3 );
    m_resolution = kvs::Vector3ui( dim );

    fseek( ifs, 6 * sizeof(float), SEEK_CUR );
    const size_t nnodes = m_resolution.x() * m_resolution.y() * m_resolution.z();

    kvs::File file( filename );
    const size_t byte_size = file.byteSize();
    if ( ( byte_size - 68 ) == nnodes )
    {
        unsigned char* values = new unsigned char[ nnodes ];
        fread( values, sizeof(unsigned char), nnodes, ifs );
        kvs::Endian::Swap( values, nnodes );
        m_values = kvs::AnyValueArray( kvs::ValueArray<unsigned char>( values, nnodes ) );
        delete [] values;
    }
    else if ( ( byte_size - 68 ) == 2 * nnodes )
    {
        unsigned short* values = new unsigned short[ nnodes ];
        fread( values, sizeof(unsigned short), nnodes, ifs );
        kvs::Endian::Swap( values, nnodes );
        m_values = kvs::AnyValueArray( kvs::ValueArray<unsigned short>( values, nnodes ) );
        delete [] values;
    }
    else
    {
        float* values = new float[ nnodes ];
        fread( values, sizeof(float), nnodes, ifs );
        kvs::Endian::Swap( values, nnodes );
        m_values = kvs::AnyValueArray( kvs::ValueArray<float>( values, nnodes ) );
        delete [] values;
    }

    fclose( ifs );
    
    const kvs::StructuredVolumeObject::GridType grid_type = kvs::StructuredVolumeObject::Uniform;
    
    setGridType( grid_type );
    setResolution( m_resolution );
    setVeclen( 1 );
    setValues( m_values );
    updateMinMaxCoords();
    updateMinMaxValues();
    
    return( true );
}
开发者ID:zkbreeze,项目名称:VisKun,代码行数:59,代码来源:RawivImporter.cpp

示例13: resolution

void QSFMLCanvas::resizeGL(int width, int height)
{
  Vector3 resolution(width,height,32);
  
  setResolution(resolution);
  
  glViewport(0,0,width,height);
}
开发者ID:jsmtux,项目名称:Op3nD,代码行数:8,代码来源:QSFMLCanvas.cpp

示例14: input_cmd

/******************************************************************************
Description.: process commands, allows to set v4l2 controls
Input Value.: * control specifies the selected v4l2 control's id
                see struct v4l2_queryctr in the videodev2.h
              * value is used for control that make use of a parameter.
Return Value: depends in the command, for most cases 0 means no errors and
              -1 signals an error. This is just rule of thumb, not more!
******************************************************************************/
int input_cmd(int plugin_number, unsigned int control_id, unsigned int group, int value)
{
    int ret = -1;
    int i = 0;
    DBG("Requested cmd (id: %d) for the %d plugin. Group: %d value: %d\n", control_id, plugin_number, group, value);
    switch(group) {
    case IN_CMD_GENERIC: {
            int i;
            for (i = 0; i<pglobal->in[plugin_number].parametercount; i++) {
                if ((pglobal->in[plugin_number].in_parameters[i].ctrl.id == control_id) &&
                    (pglobal->in[plugin_number].in_parameters[i].group == IN_CMD_GENERIC)){
                    DBG("Generic control found (id: %d): %s\n", control_id, pglobal->in[plugin_number].in_parameters[i].ctrl.name);
                    DBG("New %s value: %d\n", pglobal->in[plugin_number].in_parameters[i].ctrl.name, value);
                    return 0;
                }
            }
            DBG("Requested generic control (%d) did not found\n", control_id);
            return -1;
        } break;
    case IN_CMD_V4L2: {
            ret = v4l2SetControl(cams[plugin_number].videoIn, control_id, value, plugin_number, pglobal);
            if(ret == 0) {
                pglobal->in[plugin_number].in_parameters[i].value = value;
            } else {
                DBG("v4l2SetControl failed: %d\n", ret);
            }
            return ret;
        } break;
    case IN_CMD_RESOLUTION: {
        // the value points to the current formats nth resolution
        if(value > (pglobal->in[plugin_number].in_formats[pglobal->in[plugin_number].currentFormat].resolutionCount - 1)) {
            DBG("The value is out of range");
            return -1;
        }
        int height = pglobal->in[plugin_number].in_formats[pglobal->in[plugin_number].currentFormat].supportedResolutions[value].height;
        int width = pglobal->in[plugin_number].in_formats[pglobal->in[plugin_number].currentFormat].supportedResolutions[value].width;
        ret = setResolution(cams[plugin_number].videoIn, width, height);
        if(ret == 0) {
            pglobal->in[plugin_number].in_formats[pglobal->in[plugin_number].currentFormat].currentResolution = value;
        }
        return ret;
    } break;
    case IN_CMD_JPEG_QUALITY:
        if((value >= 0) && (value < 101)) {
            pglobal->in[plugin_number].jpegcomp.quality = value;
            if(IOCTL_VIDEO(cams[plugin_number].videoIn->fd, VIDIOC_S_JPEGCOMP, &pglobal->in[plugin_number].jpegcomp) != EINVAL) {
                DBG("JPEG quality is set to %d\n", value);
                ret = 0;
            } else {
                DBG("Setting the JPEG quality is not supported\n");
            }
        } else {
            DBG("Quality is out of range\n");
        }
        break;
    }
    return ret;
}
开发者ID:wliment,项目名称:mjpg-stream,代码行数:66,代码来源:input_uvc.c

示例15: setZStartIndex

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ImportR3DStack::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
  reader->openFilterGroup(this, index);
  setZStartIndex( reader->readValue("ZStartIndex", getZStartIndex()) );
  setZEndIndex( reader->readValue("ZEndIndex", getZEndIndex()) );
  setOrigin( reader->readValue("Origin", getOrigin()) );
  setResolution( reader->readValue("Resolution", getResolution()) );
  reader->closeFilterGroup();
}
开发者ID:chongbingbao,项目名称:DREAM3D,代码行数:12,代码来源:ImportR3DStack.cpp


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