本文整理匯總了C++中Filter函數的典型用法代碼示例。如果您正苦於以下問題:C++ Filter函數的具體用法?C++ Filter怎麽用?C++ Filter使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Filter函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: Filter
void DynConfig::Init()
{
s_sDataPath = Filter(Utils::GetStringBetween(NETRIPPER_SETTINGS, "<data_path>", "</data_path>"));
s_sPlainText = Filter(Utils::GetStringBetween(NETRIPPER_SETTINGS, "<plaintext>", "</plaintext>"));
s_sDataLimit = Filter(Utils::GetStringBetween(NETRIPPER_SETTINGS, "<datalimit>", "</datalimit>"));
s_sStringFinder = Filter(Utils::GetStringBetween(NETRIPPER_SETTINGS, "<stringfinder>", "</stringfinder>"));
}
示例2: Select
bool CglList::KeyPressed(unsigned short k, bool isRepeat)
{
if (k == SDLK_ESCAPE) {
if (cancelPlace >= 0) {
place = cancelPlace;
Select();
return true;
}
} else if (k == SDLK_UP) {
UpOne();
return true;
} else if (k == SDLK_DOWN) {
DownOne();
return true;
} else if (k == SDLK_PAGEUP) {
UpPage();
return true;
} else if (k == SDLK_PAGEDOWN) {
DownPage();
return true;
} else if (k == SDLK_RETURN) {
Select();
return true;
} else if (k == SDLK_BACKSPACE) {
query = query.substr(0, query.length() - 1);
return Filter(true);
} else if ((k & ~0xFF) != 0) {
// This prevents isalnum from asserting on msvc debug crt
// We don't actually need to process the key tho;)
} else if (isalnum(k)) {
query += tolower(k);
return Filter(false);
}
return false;
}
示例3: iluEdgeDetectP
ILboolean ILAPIENTRY iluEdgeDetectP()
{
ILubyte *HPass, *VPass;
ILuint i;
ILboolean Palette = IL_FALSE, Converted = IL_FALSE;
ILenum Type = 0;
iluCurImage = ilGetCurImage();
if (iluCurImage == NULL) {
ilSetError(ILU_ILLEGAL_OPERATION);
return IL_FALSE;
}
if (iluCurImage->Format == IL_COLOUR_INDEX) {
Palette = IL_TRUE;
ilConvertImage(ilGetPalBaseType(iluCurImage->Pal.PalType), IL_UNSIGNED_BYTE);
}
else if (iluCurImage->Type > IL_UNSIGNED_BYTE) {
Converted = IL_TRUE;
Type = iluCurImage->Type;
ilConvertImage(iluCurImage->Format, IL_UNSIGNED_BYTE);
}
HPass = Filter(iluCurImage, filter_h_prewitt, filter_h_prewitt_scale, filter_h_prewitt_bias);
VPass = Filter(iluCurImage, filter_v_prewitt, filter_v_prewitt_scale, filter_v_prewitt_bias);
if (!HPass || !VPass) {
ifree(HPass);
ifree(VPass);
return IL_FALSE;
}
// Combine the two passes
// Optimization by Matt Denham
for (i = 0; i < iluCurImage->SizeOfData; i++) {
if (HPass[i] == 0)
iluCurImage->Data[i] = VPass[i];
else if (VPass[i] == 0)
iluCurImage->Data[i] = HPass[i];
else
iluCurImage->Data[i] = (ILubyte)sqrt(HPass[i]*HPass[i]+VPass[i]*VPass[i]);
}
/*for (i = 0; i < iluCurImage->SizeOfData; i++) {
iluCurImage->Data[i] = (ILubyte)sqrt(HPass[i]*HPass[i]+VPass[i]*VPass[i]);
}*/
ifree(HPass);
ifree(VPass);
if (Palette)
ilConvertImage(IL_COLOUR_INDEX, IL_UNSIGNED_BYTE);
else if (Converted)
ilConvertImage(iluCurImage->Format, Type);
return IL_TRUE;
}
示例4: Filter
void List::RefreshQuery() {
if (query != "") {
int t = topIndex;
std::string q = query;
Filter(true);
query = q;
Filter(false);
topIndex = t;
}
}
示例5: Filter
void CglList::KeyPress(int k)
{
if (k == SDLK_BACKSPACE) {
query = query.substr(0, query.length() - 1);
Filter(true);
} else if (isalnum(k)) {
query += tolower(k);
Filter(false);
}
}
示例6: preProcess
void preProcess(IplImage *prv,IplImage *cur,IplImage *nxt,IplImage *wrt)
{
//
//cvSub(cur,prv,pImagePool[0]);
//Detect(pImagePool[0],wrt,Robert);
switch ( whichKernel)
{
case 0:
// diff two img
cvSub(cur,prv,wrt);
break;
case 1:
Detect(wrt, cur,Robert);
break;
case 2:
Detect(wrt, cur,Prewitt);
break;
case 3:
Detect(wrt, cur,LapLas);
break;
case 4:
histogramNormalize(wrt, cur);
break;
case 5:
histogramNormalize(pImagePool[0], cur);
Detect(wrt,pImagePool[0],Prewitt);
break;
case 6:
{
imgDFT(wrt, cur);
}
break;
case 7:
{
Detect(wrt, cur,FreiChen);
break;
}
case 8:
{
Filter(wrt, cur);
break;
}
case 9:
{
transRGB2Gray( pImagePool[0], cur);
Filter(wrt, pImagePool[0],averageFilter);
}
default:
break;
}
}
示例7: Rec
static void Rec(int index)
{
if (index == 7)
return;
Filter();
Rec(index + 1);
Number[index] = 100;
Filter();
Rec(index + 1);
Number[index] = 0;
}
示例8: Filter
void Filters::init() {
list.clear();
// Video
list["noise"] = Filter(tr("add noise"), "noise", "9ah:5ah");
list["deblock"] = Filter(tr("deblock"), "pp", "vb/hb");
list["denoise_normal"] = Filter(tr("normal denoise"), "hqdn3d");
list["denoise_soft"] = Filter(tr("soft denoise"), "hqdn3d", "2:1:2");
// Audio
list["volnorm"] = Filter(tr("volume normalization"), "volnorm", "1");
}
示例9: SetExtSerialPacket
/* Function: SetExtSerialPacket ================================================
* Abstract:
* Sets (sends) the contents of an ExtSerialPacket on the comm line. This
* includes the packet's buffer as well as all serial communication overhead
* associated with the packet.
*
* EXT_NO_ERROR is returned on success, EXT_ERROR on failure.
*/
PUBLIC boolean_T SetExtSerialPacket(ExtSerialPacket *pkt, ExtSerialPort *portDev)
{
uint32_T i;
uint32_T newByteCnt = 0; /* Num bytes after filtering. */
boolean_T error = EXT_NO_ERROR;
char Buffer[sizeof(uint32_T)*2]; /* Local buffer for converting escape chars. */
/* If not connected, return immediately. */
if (!portDev->fConnected) return false;
/* Initialize some fields of the packet. */
pkt->head[0] = packet_head;
pkt->head[1] = packet_head;
pkt->tail[0] = packet_tail;
pkt->tail[1] = packet_tail;
pkt->state = ESP_NoPacket;
pkt->cursor = 0;
pkt->DataCount = 0;
pkt->inQuote = false;
/* Send the packet header. */
error = ExtSerialPortSetData(portDev, pkt->head, HEAD_SIZE);
if (error != EXT_NO_ERROR) goto EXIT_POINT;
/* Send the packet type. */
newByteCnt = Filter(Buffer, &(pkt->PacketType), PACKET_TYPE_SIZE);
error = ExtSerialPortSetData(portDev, Buffer, newByteCnt);
if (error != EXT_NO_ERROR) goto EXIT_POINT;
/* Send the size of the packet buffer. */
newByteCnt = Num2String(Buffer, pkt->size, true, portDev->isLittleEndian);
error = ExtSerialPortSetData(portDev, Buffer, newByteCnt);
if (error != EXT_NO_ERROR) goto EXIT_POINT;
/* Send the variable-sized packet buffer data. */
for (i=0; i<pkt->size; i++)
{
newByteCnt = Filter(Buffer, &(pkt->Buffer[i]), 1);
error = ExtSerialPortSetData(portDev, Buffer, newByteCnt);
if (error != EXT_NO_ERROR) goto EXIT_POINT;
}
/* Send the packet tail. */
error = ExtSerialPortSetData(portDev, pkt->tail, TAIL_SIZE);
if (error != EXT_NO_ERROR) goto EXIT_POINT;
EXIT_POINT:
return error;
} /* end SetExtSerialPacket */
示例10: CheckDir
void CheckDir( GtkWidget * list,char * directory )
{
struct stat fs;
int i;
glob_t gg;
if ( !fsFilter[0] ) return;
gtk_widget_hide( list );
gtk_clist_clear( GTK_CLIST( list ) );
clist_append_fname(list, ".", dpixmap, dmask);
clist_append_fname(list, "..", dpixmap, dmask);
glob( "*",0,NULL,&gg );
for( i=0;(unsigned)i<gg.gl_pathc;i++ )
{
stat( gg.gl_pathv[i],&fs );
if( !S_ISDIR( fs.st_mode ) ) continue;
clist_append_fname(list, gg.gl_pathv[i], dpixmap, dmask);
}
globfree( &gg );
if ( strchr( fsFilter,',' ) )
{
char tmp[8];
int i,c,glob_param = 0;
for ( i=0,c=0;i<(int)strlen( fsFilter ) + 1;i++,c++ )
{
tmp[c]=fsFilter[i];
if ( ( tmp[c] == ',' )||( tmp[c] == '\0' ) )
{
tmp[c]=0; c=-1;
glob( Filter( tmp ),glob_param,NULL,&gg );
glob_param=GLOB_APPEND;
}
}
} else glob( Filter( fsFilter ),0,NULL,&gg );
for( i=0;(unsigned)i<gg.gl_pathc;i++ )
{
stat( gg.gl_pathv[i],&fs );
if( S_ISDIR( fs.st_mode ) ) continue;
clist_append_fname(list, gg.gl_pathv[i], fpixmap, fmask);
}
globfree( &gg );
gtk_clist_set_column_width( GTK_CLIST( list ),0,17 );
gtk_clist_select_row( GTK_CLIST( list ),0,1 );
gtk_widget_show( list );
}
示例11: ResetGraph
void Filterer::Plot(ChannelEvent *event_){
///The limits of the vertical axis
static float axisMin, axisMax;
// Draw the trace
if(event_->size != x_vals.size()){ // The length of the trace has changed.
resetGraph_ = true;
}
if (resetGraph_) {
ResetGraph(event_->size);
axisMax = 0;
axisMin = 1E9;
}
// Run the fast filter (trigger) on the trace.
Filter(event_->yvals, event_->size, fast_filter_y, trig_rise, trig_flat);
// Run the slow filter (energy) on the trace.
Filter(event_->yvals, event_->size, slow_filter_y, energy_rise, energy_flat);
for (size_t i = 0; i < event_->size ; i++) {
graph->SetPoint(i, x_vals[i], event_->yvals[i]);
f_fast->SetPoint(i, x_vals[i], fast_filter_y[i]);
f_slow->SetPoint(i, x_vals[i], slow_filter_y[i]);
}
if (graph->GetYaxis()->GetXmax() > axisMax) axisMax = graph->GetYaxis()->GetXmax();
if (graph->GetYaxis()->GetXmin() < axisMin) axisMin = graph->GetYaxis()->GetXmin();
if (f_fast->GetYaxis()->GetXmax() > axisMax) axisMax = f_fast->GetYaxis()->GetXmax();
if (f_fast->GetYaxis()->GetXmin() < axisMin) axisMin = f_fast->GetYaxis()->GetXmin();
if (f_slow->GetYaxis()->GetXmax() > axisMax) axisMax = f_slow->GetYaxis()->GetXmax();
if (f_slow->GetYaxis()->GetXmin() < axisMin) axisMin = f_slow->GetYaxis()->GetXmin();
graph->GetYaxis()->SetLimits(axisMin, axisMax);
graph->GetYaxis()->SetRangeUser(axisMin, axisMax);
graph->Draw("APL");
f_fast->Draw("LSAME");
f_slow->Draw("LSAME");
canvas->Update();
num_displayed++;
num_traces++;
}
示例12: initializeFilterCallBack
bool initializeFilterCallBack(laser_package::update_filter::Request &req, laser_package::update_filter::Response &res)
{
Eigen::MatrixXd initial_state(5,1);
initial_state << req.initial_x, req.initial_x_velocity, req.initial_y, req.initial_y_velocity, req.initial_turn_rate;
filter_1 = Filter(initial_state, req.sampling_interval, noise_data[FILTER_1], UM);
filter_2 = Filter(initial_state, req.sampling_interval, noise_data[FILTER_2], CT);
updateStateMessage(&filter_1, &state_msg_1, req);
updateStateMessage(&filter_2, &state_msg_2, req);
state_pub_1.publish(state_msg_1);
state_pub_2.publish(state_msg_2);
ROS_INFO("Filter initialized");
}
示例13:
Factory::Factory() {
this->m_filters.append(Filter(
QString::fromStdString(CurvatureProvider::getTitle()),
QString::fromStdString(CurvatureProvider::getName())));
this->m_filters.append(Filter(
QString::fromStdString(GeodesicProvider::getTitle()),
QString::fromStdString(GeodesicProvider::getName())));
this->m_filters.append(Filter(
QString::fromStdString(HarmonicProvider::getTitle()),
QString::fromStdString(HarmonicProvider::getName())));
this->m_filters.append(Filter(
QString::fromStdString(HeatKernelProvider::getTitle()),
QString::fromStdString(HeatKernelProvider::getName())));
this->m_filters.append(Filter(
QString::fromStdString(MidedgeProvider::getTitle()),
QString::fromStdString(MidedgeProvider::getName())));
this->m_filters.append(Filter(
QString::fromStdString(PartawareProvider::getTitle()),
QString::fromStdString(PartawareProvider::getName())));
this->m_filters.append(Filter(
QString::fromStdString(SamplingProvider::getTitle()),
QString::fromStdString(SamplingProvider::getName())));
this->m_filters.append(Filter(
QString::fromStdString(ThinPlateProvider::getTitle()),
QString::fromStdString(ThinPlateProvider::getName())));
}
示例14: FMeterTick
//*****************************************************************************
//
// Function : FMeter tick; called each time the OS tick timer is called
//
// Arguments: none
//
// Result : none
//
//*****************************************************************************
void FMeterTick (void)
{
if (FMeterInitialized != 0)
{
if (FMeterMeasurementRunning == 1)
{
if (FMeterTickCounter == 0)
{
// Timer1 & Timer3 start counting now
TCCR1B = 7; // external pin is the source, rising edge
TCCR3B = 7;
EIMSK |= (1<<INT4);
}
else
{
// do nothing
}
FMeterTickCounter++;
if (FMeterTickCounter == (MEASUREMENT_TICKS + 1))
{
// Timer1 & Timer3 stop counting now
TCCR1B = 0; // Timer is stopped
TCCR3B = 0;
EIMSK &= ~(1<<INT4);
FMeterMeasurementRunning = 0;
FMeterMeasurementComplete = 1;
//Filter measurement values
FMeterTimerResult1 = Filter(TCNT1, FREQ1);
FMeterTimerResult3 = Filter(TCNT3, FREQ3);
FMeterTimerResultS = Filter(SpeedCounter, FREQS);
DetermineSpeed(FMeterTimerResultS);
FMeterStartMeasurement();
}
}
}
}
示例15: Filter
void CServerBrowserFilter::CServerFilter::Sort()
{
// create filtered list
Filter();
// sort
switch(g_Config.m_BrSort)
{
case IServerBrowser::SORT_NAME:
std::stable_sort(m_pSortedServerlist, m_pSortedServerlist+m_NumSortedServers, SortWrap(this, &CServerBrowserFilter::CServerFilter::SortCompareName));
break;
case IServerBrowser::SORT_PING:
std::stable_sort(m_pSortedServerlist, m_pSortedServerlist+m_NumSortedServers, SortWrap(this, &CServerBrowserFilter::CServerFilter::SortComparePing));
break;
case IServerBrowser::SORT_MAP:
std::stable_sort(m_pSortedServerlist, m_pSortedServerlist+m_NumSortedServers, SortWrap(this, &CServerBrowserFilter::CServerFilter::SortCompareMap));
break;
case IServerBrowser::SORT_NUMPLAYERS:
std::stable_sort(m_pSortedServerlist, m_pSortedServerlist+m_NumSortedServers, SortWrap(this,
(m_SortHash&IServerBrowser::FILTER_SPECTATORS) ? &CServerBrowserFilter::CServerFilter::SortCompareNumPlayers : &CServerBrowserFilter::CServerFilter::SortCompareNumClients));
break;
case IServerBrowser::SORT_GAMETYPE:
std::stable_sort(m_pSortedServerlist, m_pSortedServerlist+m_NumSortedServers, SortWrap(this, &CServerBrowserFilter::CServerFilter::SortCompareGametype));
}
m_SortHash = GetSortHash();
}