本文整理汇总了C++中setFilter函数的典型用法代码示例。如果您正苦于以下问题:C++ setFilter函数的具体用法?C++ setFilter怎么用?C++ setFilter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setFilter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
uint8_t MD_TCS230::readFSM(uint8_t s)
// Finite State Machine to read a value (internal function)
{
static const uint8_t seq[] = { TCS230_RGB_R, TCS230_RGB_G, TCS230_RGB_B };
static uint8_t currCol; // index for seq above
switch(s)
{
case 0: // enable the hardware for reading
DUMPS("\n0");
currCol = 0; // RGB_R but we don't care
setEnable(true);
s++;
// fall through to the next state
case 1: // select a filter and start a reading
DUMPS("\n1");
setFilter(seq[currCol]);
FreqCount.begin(1000/_readDiv);
s++;
break;
case 2: // see if a value is available
DUMPS("2");
if (FreqCount.available())
{
DUMP(" VALUE ", FreqCount.read());
// read the value and save it
_Fo.value[seq[currCol++]] = FreqCount.read() * _readDiv;
if (currCol < RGB_SIZE)
{
// loop around again on next call to available()
s--;
}
else
{
// end this reading session
FreqCount.end();
setEnable(false);
RGBTransformation();
s = 0;
}
}
break;
}
return(s);
}
示例2: setFilter
UIConfig::UIConfig()
{
m_Scale = 1;
m_band = 0;
m_column = 0;
m_row = 0;
debug = 0;
setFilter( NN_FILTER );
setCoordMode( ANA_MODE );
m_delta_treshold = 0;
m_translate = true;
m_sync = true;
m_aim = true;
}
示例3: setFilter
Node::~Node()
{
#if FZ_GL_SHADERS
setFilter(NULL);
setGLProgram(nullptr);
#endif
if(p_camera)
delete p_camera;
Node *child;
FZ_LIST_FOREACH_MUTABLE(m_children, child)
{
child->setParent(NULL);
child->release();
}
示例4: sim_bandstack_cb
void sim_bandstack_cb(GtkWidget *widget, gpointer data) {
BANDSTACK_ENTRY *entry;
fprintf(stderr,"sim_bandstack_cb\n");
if(function) {
entry=bandstack_entry_previous();
} else {
entry=bandstack_entry_next();
}
setFrequency(entry->frequencyA);
setMode(entry->mode);
FILTER* band_filters=filters[entry->mode];
FILTER* band_filter=&band_filters[entry->filter];
setFilter(band_filter->low,band_filter->high);
vfo_update(NULL);
}
示例5: transformPreview
void LensDistortionTool::preparePreview()
{
double m = d->mainInput->value();
double e = d->edgeInput->value();
double r = d->rescaleInput->value();
double b = d->brightenInput->value();
LensDistortionFilter transformPreview(&d->previewRasterImage, 0, m, e, r, b, 0, 0);
transformPreview.startFilterDirectly();
d->maskPreviewLabel->setPixmap(transformPreview.getTargetImage().convertToPixmap());
ImageIface* const iface = d->previewWidget->imageIface();
setFilter(new LensDistortionFilter(iface->original(), this, m, e, r, b, 0, 0));
}
示例6: m_idMatchMethod
Message::Message(const std::string& message)
: m_command (),
m_commandStr (),
m_idPattern (),
m_filterBits (Filter::Global),
m_idMatchMethod (nullptr),
m_tagMatchMethod (nullptr)
{
if (!message.empty())
{
setFilter(message);
std::size_t startPos = message.find_first_of(']');
m_command << (startPos == std::string::npos ? message : message.substr(std::min(message.length() - 1, message.find_first_not_of(' ', startPos + 1))));
}
}
示例7: setFilter
bool MultiQFileDialog::eventFilter(QObject *obj, QEvent *e)
{
if (e->type() == QEvent::KeyPress)
{
QKeyEvent* keyEvent = dynamic_cast<QKeyEvent*>(e);
Qt::KeyboardModifiers modifiers = QApplication::queryKeyboardModifiers();
if (modifiers.testFlag(Qt::ControlModifier) && keyEvent && keyEvent->key() == Qt::Key_H)
{
if (showHidden)
{
if (multiSelect)
{
setFilter(QDir::AllDirs | QDir::AllEntries | QDir::NoDotAndDotDot);
}
else
{
setFilter(QDir::AllDirs | QDir::NoDotAndDotDot);
}
}
else
{
if (multiSelect)
{
setFilter(QDir::AllDirs | QDir::AllEntries | QDir::Hidden | QDir::System | QDir::NoDotAndDotDot);
}
else
{
setFilter(QDir::AllDirs | QDir::Hidden | QDir::System | QDir::NoDotAndDotDot);
}
}
showHidden = !showHidden;
}
}
return QFileDialog::eventFilter(obj, e);
}
示例8: QDirModel
ImageViewerDirModel::ImageViewerDirModel(QObject *parent /*= 0*/)
: QDirModel(parent) {
//insertColumn(1);
QStringList nameFilterList;
QList<QByteArray> formats = QImageReader::supportedImageFormats();
for (QList<QByteArray>::iterator it = formats.begin();
it != formats.end();
++it) {
QString filter("*.");
filter.append(it->data());
nameFilterList << filter;
}
setNameFilters(nameFilterList);
setFilter(QDir::Files);
}
示例9: killTimers
void KNoteTip::timerEvent(QTimerEvent *)
{
killTimers();
if(!isVisible())
{
startTimer(15000); // show the tooltip for 15 sec
reposition();
show();
}
else
{
setFilter(false);
hide();
}
}
示例10: dassert
Status ParsedUpdate::parseQueryToCQ() {
dassert(!_canonicalQuery.get());
const ExtensionsCallbackReal extensionsCallback(_opCtx, &_request->getNamespaceString());
// The projection needs to be applied after the update operation, so we do not specify a
// projection during canonicalization.
auto qr = stdx::make_unique<QueryRequest>(_request->getNamespaceString());
qr->setFilter(_request->getQuery());
qr->setSort(_request->getSort());
qr->setCollation(_request->getCollation());
qr->setExplain(_request->isExplain());
// Limit should only used for the findAndModify command when a sort is specified. If a sort
// is requested, we want to use a top-k sort for efficiency reasons, so should pass the
// limit through. Generally, a update stage expects to be able to skip documents that were
// deleted/modified under it, but a limit could inhibit that and give an EOF when the update
// has not actually updated a document. This behavior is fine for findAndModify, but should
// not apply to update in general.
if (!_request->isMulti() && !_request->getSort().isEmpty()) {
qr->setLimit(1);
}
// $expr is not allowed in the query for an upsert, since it is not clear what the equality
// extraction behavior for $expr should be.
MatchExpressionParser::AllowedFeatureSet allowedMatcherFeatures =
MatchExpressionParser::kAllowAllSpecialFeatures;
if (_request->isUpsert()) {
allowedMatcherFeatures &= ~MatchExpressionParser::AllowedFeatures::kExpr;
}
boost::intrusive_ptr<ExpressionContext> expCtx;
auto statusWithCQ = CanonicalQuery::canonicalize(
_opCtx, std::move(qr), std::move(expCtx), extensionsCallback, allowedMatcherFeatures);
if (statusWithCQ.isOK()) {
_canonicalQuery = std::move(statusWithCQ.getValue());
}
if (statusWithCQ.getStatus().code() == ErrorCodes::QueryFeatureNotAllowed) {
// The default error message for disallowed $expr is not descriptive enough, so we rewrite
// it here.
return {ErrorCodes::QueryFeatureNotAllowed,
"$expr is not allowed in the query predicate for an upsert"};
}
return statusWithCQ.getStatus();
}
示例11: glGenTextures
bool Image::loadVolatilePOT()
{
glGenTextures(1,(GLuint *)&texture);
bindTexture(texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
float p2width = next_p2(width);
float p2height = next_p2(height);
float s = width/p2width;
float t = height/p2height;
vertices[1].t = t;
vertices[2].t = t;
vertices[2].s = s;
vertices[3].s = s;
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGBA8,
(GLsizei)p2width,
(GLsizei)p2height,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
0);
glTexSubImage2D(GL_TEXTURE_2D,
0,
0,
0,
(GLsizei)width,
(GLsizei)height,
GL_RGBA,
GL_UNSIGNED_BYTE,
data->getData());
setMipmapSharpness(mipmapsharpness);
setFilter(filter);
setWrap(wrap);
return true;
}
示例12: QSqlTableModel
FilmModel::FilmModel(QObject *parent) :
QSqlTableModel(parent)
{
setTable("films");
setEditStrategy(QSqlTableModel::OnManualSubmit);
setSort(0, Qt::AscendingOrder);
setFilter("");
select();
setHeaderData(1, Qt::Horizontal, "Name");
setHeaderData(2, Qt::Horizontal, "Year");
setHeaderData(3, Qt::Horizontal, "Country");
setHeaderData(4, Qt::Horizontal, "Director");
setHeaderData(5, Qt::Horizontal, "Actors");
setHeaderData(6, Qt::Horizontal, "Type");
setHeaderData(7, Qt::Horizontal, "Genre");
setHeaderData(8, Qt::Horizontal, "Score");
}
示例13: foreach
void ActionEditor::setFormWindow(QDesignerFormWindowInterface *formWindow)
{
if (formWindow != 0 && formWindow->mainContainer() == 0)
formWindow = 0;
// we do NOT rely on this function to update the action editor
if (m_formWindow == formWindow)
return;
if (m_formWindow != 0) {
const ActionList actionList = m_formWindow->mainContainer()->findChildren<QAction*>();
foreach (QAction *action, actionList)
disconnect(action, SIGNAL(changed()), this, SLOT(slotActionChanged()));
}
m_formWindow = formWindow;
m_actionView->model()->clearActions();
m_actionEdit->setEnabled(false);
#ifndef QT_NO_CLIPBOARD
m_actionCopy->setEnabled(false);
m_actionCut->setEnabled(false);
#endif
m_actionDelete->setEnabled(false);
if (!formWindow || !formWindow->mainContainer()) {
m_actionNew->setEnabled(false);
m_filterWidget->setEnabled(false);
return;
}
m_actionNew->setEnabled(true);
m_filterWidget->setEnabled(true);
const ActionList actionList = formWindow->mainContainer()->findChildren<QAction*>();
foreach (QAction *action, actionList)
if (!action->isSeparator() && core()->metaDataBase()->item(action) != 0) {
// Show unless it has a menu. However, listen for change on menu actions also as it might be removed
if (!action->menu())
m_actionView->model()->addAction(action);
connect(action, SIGNAL(changed()), this, SLOT(slotActionChanged()));
}
setFilter(m_filter);
}
示例14: sim_band_cb
void sim_band_cb(GtkWidget *widget, gpointer data) {
BAND* band;
BANDSTACK_ENTRY *entry;
fprintf(stderr,"sim_band_cb\n");
int b=band_get_current();
if(function) {
b--;
if(b<0) {
b=BANDS-1;
}
#ifdef LIMESDR
if(protocol!=LIMESDR_PROTOCOL) {
if(b==band3400) {
b=band6;
}
}
#endif
} else {
b++;
if(b>=BANDS) {
b=0;
}
#ifdef LIMESDR
if(protocol!=LIMESDR_PROTOCOL) {
if(b==band70) {
b=bandGen;
}
}
#endif
}
band=band_set_current(b);
entry=bandstack_entry_get_current();
setFrequency(entry->frequencyA);
setMode(entry->mode);
FILTER* band_filters=filters[entry->mode];
FILTER* band_filter=&band_filters[entry->filter];
setFilter(band_filter->low,band_filter->high);
band=band_get_current_band();
set_alex_rx_antenna(band->alexRxAntenna);
set_alex_tx_antenna(band->alexTxAntenna);
set_alex_attenuation(band->alexAttenuation);
vfo_update(NULL);
}
示例15: KFileDialog
RKImportDialog::RKImportDialog (const QString &context_id, QWidget *parent) : KFileDialog (KUrl (), QString (), parent, format_selector=new RKImportDialogFormatSelector ()) {
RK_TRACE (DIALOGS);
setModal (false);
context = RKComponentMap::getContext (context_id);
if (!context) {
KMessageBox::sorry (this, i18n ("No plugins defined for context '%1'", context_id));
return;
}
component_ids = context->components ();
QString formats = "*|" + i18n ("All Files") + " (*)\n";
int format_count = 0;
for (QStringList::const_iterator it = component_ids.constBegin (); it != component_ids.constEnd (); ++it) {
if (format_count++) formats.append ('\n');
RKComponentHandle *handle = RKComponentMap::getComponentHandle (*it);
if (!handle) {
RK_ASSERT (false);
continue;
}
QString filter = handle->getAttributeValue ("format");
QString label = handle->getAttributeLabel ("format");
QString elabel = label;
elabel.replace ('/', "\\/");
elabel.replace ('|', "\\|");
formats.append (filter + '|' + elabel + " (" + filter + ')');
format_labels.append (label);
filters.append (filter);
}
// file format selection box
format_selector->combo->insertItems (0, format_labels);
// initialize
setMode (KFile::File | KFile::ExistingOnly | KFile::LocalOnly);
setFilter (formats);
connect (this, SIGNAL (filterChanged(QString)), this, SLOT (filterWasChanged(QString)));
filterWasChanged (QString ());
show ();
}