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


C++ Encoder类代码示例

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


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

示例1: GetEncoderDirection

/**
 * The last direction the encoder value changed.
 *
 * @param aSlot The digital module slot for the A Channel on the encoder
 * @param aChannel The channel on the digital module for the A Channel of the encoder
 * @param bSlot The digital module slot for the B Channel on the encoder
 * @param bChannel The channel on the digital module for the B Channel of the encoder
 * @return The last direction the encoder value changed.
 */
bool GetEncoderDirection(UINT32 aSlot, UINT32 aChannel, UINT32 bSlot, UINT32 bChannel)
{
	Encoder *encoder = AllocateEncoder(aSlot, aChannel, bSlot, bChannel);
	if (encoder != NULL)
		return encoder->GetDirection();
	else
		return false;
}
开发者ID:Techbrick,项目名称:MainWorkingCode,代码行数:17,代码来源:CEncoder.cpp

示例2: GetEncoderStopped

/**
 * Determine if the encoder is stopped.
 * Using the MaxPeriod value, a boolean is returned that is true if the encoder is considered
 * stopped and false if it is still moving. A stopped encoder is one where the most recent pulse
 * width exceeds the MaxPeriod.
 *
 * @param aChannel The channel on the digital module for the A Channel of the encoder
 * @param bChannel The channel on the digital module for the B Channel of the encoder
 * @return True if the encoder is considered stopped.
 */
bool GetEncoderStopped(UINT32 aChannel, UINT32 bChannel)
{
	Encoder *encoder = AllocateEncoder(aChannel, bChannel);
	if (encoder != NULL)
		return encoder->GetStopped();
	else
		return false;
}
开发者ID:Techbrick,项目名称:MainWorkingCode,代码行数:18,代码来源:CEncoder.cpp

示例3: GetEncoderRate

/**
 * Get the current rate of the encoder.
 * Units are distance per second as scaled by the value from SetEncoderDistancePerPulse().
 * 
 * @return The current rate of the encoder.
 *
 * @param aSlot The digital module slot for the A Channel on the encoder
 * @param aChannel The channel on the digital module for the A Channel of the encoder
 * @param bSlot The digital module slot for the B Channel on the encoder
 * @param bChannel The channel on the digital module for the B Channel of the encoder
  */
double GetEncoderRate(UINT32 aSlot, UINT32 aChannel, UINT32 bSlot, UINT32 bChannel)
{
	Encoder *encoder = AllocateEncoder(aSlot, aChannel, bSlot, bChannel);
	if (encoder != NULL)
		return encoder->GetRate();
	else
		return 0.0;
}
开发者ID:Techbrick,项目名称:MainWorkingCode,代码行数:19,代码来源:CEncoder.cpp

示例4: GetEncoder

/**
 * Gets the current count.
 * Returns the current count on the Encoder.
 * This method compensates for the decoding type.
 *
 * @deprecated Use GetEncoderDistance() in favor of this method.  This returns unscaled pulses and GetDistance() scales using value from SetEncoderDistancePerPulse().
 *
 * @return Current count from the Encoder.
 * 
 * @param aChannel The channel on the digital module for the A Channel of the encoder
 * @param bChannel The channel on the digital module for the B Channel of the encoder
 */
INT32 GetEncoder(UINT32 aChannel, UINT32 bChannel)
{
	Encoder *encoder = AllocateEncoder(aChannel, bChannel);
	if (encoder != NULL)
		return encoder->Get();
	else
		return 0;
}
开发者ID:Techbrick,项目名称:MainWorkingCode,代码行数:20,代码来源:CEncoder.cpp

示例5: GetEncoderPeriod

/**
 * Returns the period of the most recent pulse.
 * Returns the period of the most recent Encoder pulse in seconds.
 * This method compenstates for the decoding type.
 * 
 * @deprecated Use GetEncoderRate() in favor of this method.  This returns unscaled periods and GetEncoderRate() scales using value from SetEncoderDistancePerPulse().
 *
 * @return Period in seconds of the most recent pulse.
 * 
 * @param aChannel The channel on the digital module for the A Channel of the encoder
 * @param bChannel The channel on the digital module for the B Channel of the encoder
 */
double GetEncoderPeriod(UINT32 aChannel, UINT32 bChannel)
{
	Encoder *encoder = AllocateEncoder(aChannel, bChannel);
	if (encoder != NULL)
		return encoder->GetPeriod();
	else
		return 0.0;
}
开发者ID:Techbrick,项目名称:MainWorkingCode,代码行数:20,代码来源:CEncoder.cpp

示例6: x265_encoder_log

void x265_encoder_log(x265_encoder* enc, int argc, char **argv)
{
    if (enc)
    {
        Encoder *encoder = static_cast<Encoder*>(enc);
        encoder->writeLog(argc, argv);
    }
}
开发者ID:andrinux,项目名称:x265,代码行数:8,代码来源:api.cpp

示例7: StartEncoder

/**
 * Start the encoder counting.
 *
 * @param aSlot The digital module slot for the A Channel on the encoder
 * @param aChannel The channel on the digital module for the A Channel of the encoder
 * @param bSlot The digital module slot for the B Channel on the encoder
 * @param bChannel The channel on the digital module for the B Channel of the encoder
 */
void StartEncoder(UINT32 aSlot, UINT32 aChannel, UINT32 bSlot, UINT32 bChannel)
{
	Encoder *encoder = AllocateEncoder(aSlot, aChannel, bSlot, bChannel);
	if (encoder != NULL)
	{
		encoder->Start();
	}
}
开发者ID:Techbrick,项目名称:MainWorkingCode,代码行数:16,代码来源:CEncoder.cpp

示例8: GetEncoderDistance

/**
 * Get the distance the robot has driven since the last reset.
 * 
 * @return The distance driven since the last reset as scaled by the value from SetEncoderDistancePerPulse().
 *
 * @param aChannel The channel on the digital module for the A Channel of the encoder
 * @param bChannel The channel on the digital module for the B Channel of the encoder
 */
double GetEncoderDistance(UINT32 aChannel, UINT32 bChannel)
{
	Encoder *encoder = AllocateEncoder(aChannel, bChannel);
	if (encoder != NULL)
		return encoder->GetDistance();
	else
		return 0.0;
}
开发者ID:Techbrick,项目名称:MainWorkingCode,代码行数:16,代码来源:CEncoder.cpp

示例9: x265_encoder_get_stats

void x265_encoder_get_stats(x265_encoder *enc, x265_stats *outputStats, uint32_t statsSizeBytes)
{
    if (enc && outputStats)
    {
        Encoder *encoder = static_cast<Encoder*>(enc);
        encoder->fetchStats(outputStats, statsSizeBytes);
    }
}
开发者ID:andrinux,项目名称:x265,代码行数:8,代码来源:api.cpp

示例10: on_pushButton_clicked

void MainWindow::on_pushButton_clicked()
{
    Encoder encoder;
    int e,d,n;
    encoder.generate_passwords(e,d,n);
    ui->lineE->setText(QString::number(e));
    ui->lineD->setText(QString::number(d));
    ui->lineN->setText(QString::number(n));
}
开发者ID:flp-mazur,项目名称:Project1,代码行数:9,代码来源:mainwindow.cpp

示例11: encodeAsStorageRecord

Storage::Record SubresourcesEntry::encodeAsStorageRecord() const
{
    Encoder encoder;
    encoder << m_subresources;

    encoder.encodeChecksum();

    return { m_key, m_timeStamp, { encoder.buffer(), encoder.bufferSize() } , { } };
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:9,代码来源:NetworkCacheSubresourcesEntry.cpp

示例12: averageEncoders

	float RawControl::averageEncoders()
	{
		float traveled;
		traveled=(((abs(wheelEncoderFR->Get()))+(abs(wheelEncoderFL->Get()))+(abs(wheelEncoderBR->Get()))+(abs(wheelEncoderBL->Get())))/4);
		traveled/=250;
		traveled=traveled * 8 * 3.14;	
		traveled=fabs(traveled);
		return traveled;
	}
开发者ID:The-Charge,项目名称:2011_TubeBot,代码行数:9,代码来源:TubeBot.cpp

示例13: memcpy

x265_encoder *x265_encoder_open(x265_param *p)
{
    if (!p)
        return NULL;

    Encoder* encoder = NULL;
    x265_param* param = PARAM_NS::x265_param_alloc();
    x265_param* latestParam = PARAM_NS::x265_param_alloc();
    if (!param || !latestParam)
        goto fail;

    memcpy(param, p, sizeof(x265_param));
    x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", PFX(version_str));
    x265_log(param, X265_LOG_INFO, "build info %s\n", PFX(build_info_str));

    x265_setup_primitives(param, param->cpuid);

    if (x265_check_params(param))
        goto fail;

    if (x265_set_globals(param))
        goto fail;

    encoder = new Encoder;
    if (!param->rc.bEnableSlowFirstPass)
        PARAM_NS::x265_param_apply_fastfirstpass(param);

    // may change params for auto-detect, etc
    encoder->configure(param);
    // may change rate control and CPB params
    if (!enforceLevel(*param, encoder->m_vps))
        goto fail;

    // will detect and set profile/tier/level in VPS
    determineLevel(*param, encoder->m_vps);

    if (!param->bAllowNonConformance && encoder->m_vps.ptl.profileIdc == Profile::NONE)
    {
        x265_log(param, X265_LOG_INFO, "non-conformant bitstreams not allowed (--allow-non-conformance)\n");
        goto fail;
    }

    encoder->create();
    encoder->m_latestParam = latestParam;
    memcpy(latestParam, param, sizeof(x265_param));
    if (encoder->m_aborted)
        goto fail;

    x265_print_params(param);
    return encoder;

fail:
    delete encoder;
    PARAM_NS::x265_param_free(param);
    PARAM_NS::x265_param_free(latestParam);
    return NULL;
}
开发者ID:VIasai,项目名称:x265,代码行数:57,代码来源:api.cpp

示例14: itr

/**
 * Writes a description of the graph to the given stream, using the Dot 
 * language.
 * The method allows for both directed graphs and non-directed graphs, the
 * latter are required for drawing purposes (since Dot will not produce the
 * arrow heads and the splines terminate before reaching the nodes).
 * @param	str			The stream to write to
 * @param	sType		Either "graph" or "digraph"
 * @param	sEdge		The edge connector ("--" or "->")
 * @param	bWriteCall	true to write call information, false otherwise
 */
void GraphWidget::write(QTextStream& str, const QString& sType, 
	const QString& sEdge, bool bWriteCall)
{
	QFont font;
	QDictIterator<GraphNode> itr(m_dictNodes);
	GraphEdge* pEdge;
	Encoder enc;
	
	font = Config().getFont(KScopeConfig::Graph);

	// Header
	str << sType << " G {\n";
	
	// Graph attributes
	str << "\tgraph [rankdir=" << Config().getGraphOrientation() << ", "
		<< "kscope_zoom=" << m_dZoom 
		<< "];\n";
	
	// Default node attributes
	str << "\tnode [shape=box, height=\"0.01\", style=filled, "
		<< "fillcolor=\"" << Config().getColor(KScopeConfig::GraphNode).name()
		<< "\", "
		<< "fontcolor=\"" << Config().getColor(KScopeConfig::GraphText).name()
		<< "\", "
		<< "fontname=\"" << font.family() << "\", "
		<< "fontsize=" << QString::number(font.pointSize())
		<< "];\n";
	
	// Iterate over all nodes
	for (; itr.current(); ++itr) {
		// Write a node
		str << "\t" << itr.current()->getFunc() << ";\n";
		
		// Iterate over all edges leaving this node		
		QDictIterator<GraphEdge> itrEdge(itr.current()->getOutEdges());
		for (; itrEdge.current(); ++itrEdge) {
			pEdge = itrEdge.current();
			str << "\t" << pEdge->getHead()->getFunc() << sEdge
				<< pEdge->getTail()->getFunc();
				
			// Write call information
			if (bWriteCall) {
				str << " ["
					<< "kscope_file=\"" << pEdge->getFile() << "\","
					<< "kscope_line=" << pEdge->getLine() << ","
					<< "kscope_text=\"" << enc.encode(pEdge->getText()) << "\"" 
					<< "]";
			}
			
			str << ";\n";
		}
	}
	
	// Close the graph
	str << "}\n";
}
开发者ID:fredollinger,项目名称:kscope-kde4,代码行数:67,代码来源:graphwidget4.cpp

示例15: X265_MALLOC

x265_encoder *x265_encoder_open(x265_param *p)
{
    if (!p)
        return NULL;

    x265_param *param = X265_MALLOC(x265_param, 1);
    if (!param)
        return NULL;

    memcpy(param, p, sizeof(x265_param));
    x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", x265_version_str);
    x265_log(param, X265_LOG_INFO, "build info %s\n", x265_build_info_str);

    x265_setup_primitives(param, param->cpuid);

    if (x265_check_params(param))
        return NULL;

    if (x265_set_globals(param))
        return NULL;

    Encoder *encoder = new Encoder;
    if (!param->rc.bEnableSlowFirstPass)
        x265_param_apply_fastfirstpass(param);

    // may change params for auto-detect, etc
    encoder->configure(param);
    
    // may change rate control and CPB params
    if (!enforceLevel(*param, encoder->m_vps))
    {
        delete encoder;
        return NULL;
    }

    // will detect and set profile/tier/level in VPS
    determineLevel(*param, encoder->m_vps);

    if (!param->bAllowNonConformance && encoder->m_vps.ptl.profileIdc == Profile::NONE)
    {
        x265_log(param, X265_LOG_INFO, "non-conformant bitstreams not allowed (--allow-non-conformance)\n");
        delete encoder;
        return NULL;
    }

    encoder->create();
    if (encoder->m_aborted)
    {
        delete encoder;
        return NULL;
    }

    x265_print_params(param);

    return encoder;
}
开发者ID:andrinux,项目名称:x265,代码行数:56,代码来源:api.cpp


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