本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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();
}
}
示例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;
}
示例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);
}
}
示例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));
}
示例11: encodeAsStorageRecord
Storage::Record SubresourcesEntry::encodeAsStorageRecord() const
{
Encoder encoder;
encoder << m_subresources;
encoder.encodeChecksum();
return { m_key, m_timeStamp, { encoder.buffer(), encoder.bufferSize() } , { } };
}
示例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;
}
示例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;
}
示例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";
}
示例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;
}