本文整理汇总了C++中px函数的典型用法代码示例。如果您正苦于以下问题:C++ px函数的具体用法?C++ px怎么用?C++ px使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了px函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pointer_constructor
void pointer_constructor()
{
{
boost::interprocess::intrusive_ptr<X, VP> px(0);
BOOST_TEST(px.get() == 0);
}
{
boost::interprocess::intrusive_ptr<X, VP> px(0, false);
BOOST_TEST(px.get() == 0);
}
{
boost::interprocess::offset_ptr<X> p = new X;
BOOST_TEST(p->use_count() == 0);
boost::interprocess::intrusive_ptr<X, VP> px(p);
BOOST_TEST(px.get() == p);
BOOST_TEST(px->use_count() == 1);
}
{
boost::interprocess::offset_ptr<X> p = new X;
BOOST_TEST(p->use_count() == 0);
intrusive_ptr_add_ref(p.get());
BOOST_TEST(p->use_count() == 1);
boost::interprocess::intrusive_ptr<X, VP> px(p, false);
BOOST_TEST(px.get() == p);
BOOST_TEST(px->use_count() == 1);
}
}
开发者ID:LocutusOfBorg,项目名称:poedit,代码行数:33,代码来源:intrusive_ptr_test.cpp
示例2: area
bool tAoi::overlap( tAoi const& area_ )const {
int s0 = area();
int s1 = area_.area();
if( s0 > s1 ) {
int xend = area_.px() + area_.sx();
int yend = area_.py() + area_.sy();
for( int y = area_.py(); y < yend; y++ ) {
for( int x = area_.px(); x < xend; x++ ) {
if( inside( int32_xy( x, y ) ) != false ) {
return true;
}
}
}
} else {
int xend = px() + sx();
int yend = py() + sy();
for( int y = py(); y < yend; y++ ) {
for( int x = px(); x < xend; x++ ) {
if( area_.inside( int32_xy( x, y ) ) != false ) {
return true;
}
}
}
}
return false;
}
开发者ID:rleofield,项目名称:image_read_write,代码行数:31,代码来源:rimg_aoi.cpp
示例3: st_setOutputWnd
int st_setOutputWnd(int x, int y, int w, int h)
{
cJSON *param = cJSON_CreateObject();
cJSON_AddItemToObject(param, "x_pos", px(x));
cJSON_AddItemToObject(param, "y_pos", px(y));
cJSON_AddItemToObject(param, "width", px(w));
cJSON_AddItemToObject(param, "height", px(h));
return st_command(elcmd_setOutputWnd, param);
}
开发者ID:ElecardSTB,项目名称:elecard-apps,代码行数:9,代码来源:stsdk.c
示例4: xfmt16
static inline unsigned int xfmt16 (char *s, char const *key)
{
register unsigned int j = 0 ;
j += px((unsigned char)key[0] >> 4) ;
j += px((unsigned char)key[0] & 15) ;
j += px((unsigned char)key[1] >> 4) ;
j += px((unsigned char)key[1] & 15) ;
return j ? j : (*s = '0', 1) ;
}
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-skalibs,代码行数:9,代码来源:ip6_fmt.c
示例5: switch
float Statistics::calcInformationMeasures1()
{
float result = 0;
for (int direction = 0; direction < 4; direction++)
{
float** com = 0;
switch(direction)
{
case 0:
com = this->m_cooc0;
break;
case 1:
com = this->m_cooc1;
break;
case 2:
com = this->m_cooc2;
break;
case 3:
com = this->m_cooc3;
break;
}
//calculate HXY1
float HXY1 = 0;
for (int i = 0; i < this->m_numColors; i++)
{
for (int j = 0; j < this->m_numColors; j++)
{
HXY1 += com[i][j] * log(px(com, i) * py(com, j) + Statistics::epsilon);
}
}
HXY1 *= -1;
//calculate HX and HY
float HX = 0, HY = 0;
for (int i = 0; i < this->m_numColors; i++)
{
HX += px(com, i) * log(px(com, i) + Statistics::epsilon);
HY += py(com, i) * log(py(com, i) + Statistics::epsilon);
}
HX *= -1;
HY *= -1;
//calculate HXY
float HXY = calcEntropy(com);
//calculate information measures 1
result += (HXY - HXY1) / max(HX, HY);
}
return result / 4;
}
开发者ID:Degot,项目名称:Las-Vegas-Reconstruction,代码行数:51,代码来源:Statistics.cpp
示例6: print
void print(int n) {
if(n<0) {
n=-n;
px('-');
}
int i=10;
char o[10];
do {
o[--i] = (n%10) + '0'; n/=10;
}while(n);
do {
px(o[i]);
}while(++i<10);
}
开发者ID:sourcecode123,项目名称:online-coding-contests,代码行数:14,代码来源:SDSQUARE.c
示例7: px
bool tAoi::inside( int32_xy const& p )const {
bool ret = false;
int x = p.x();
int y = p.y();
if( x >= px() &&
x < static_cast<int>( ( px() + sx() ) ) &&
y >= py() &&
y < static_cast<int>( ( py() + sy() ) ) ) {
ret = true;
}
return ret;
}
开发者ID:rleofield,项目名称:image_read_write,代码行数:14,代码来源:rimg_aoi.cpp
示例8: NonMaximumSuppression
/* the local maximal Gabor inhibits overlapping Gabors */
void NonMaximumSuppression(int img, int mo, int mx, int my)
{
int x, y, orient, x1, y1, orient1, i, here, shift, startx0, endx0, starty0, endy0, trace[2];
float *f, maxResponse, maxResponse1;
double *fc;
/* inhibit on the SUM1 maps */
for (orient=0; orient<numOrient; orient++)
{
f = SUM1map[orient*numImage+img];
fc = Correlation[mo+orient*numOrient];
for (x=MAX(1, mx-2*halfFilterSize); x<=MIN(sizex, mx+2*halfFilterSize); x++)
for (y=MAX(1, my-2*halfFilterSize); y<=MIN(sizey, my+2*halfFilterSize); y++)
{
f[px(x, y, sizex, sizey)] *=
fc[px(x-mx+2*halfFilterSize+1, y-my+2*halfFilterSize+1, 4*halfFilterSize+1, 4*halfFilterSize+1)];
}
}
/* update the MAX1 maps */
startx0 = floor((mx-2*halfFilterSize)/subsample)-locationShiftLimit+1;
starty0 = floor((my-2*halfFilterSize)/subsample)-locationShiftLimit+1;
endx0 = floor((mx+2*halfFilterSize)/subsample)+locationShiftLimit;
endy0 = floor((my+2*halfFilterSize)/subsample)+locationShiftLimit;
for (orient=0; orient<numOrient; orient++)
{
i = orient*numImage+img;
for (x=MAX(startx, startx0); x<=MIN(endx, endx0); x++)
for (y=MAX(starty, starty0); y<=MIN(endy, endy0); y++)
{ /* go over the locations that may be affected */
here = px(x, y, sizexSubsample, sizeySubsample);
maxResponse = MAX1map[i][here];
shift = trackMap[i][here];
orient1 = orientShifted[orient][shift];
x1 = x*subsample + xShift[orient][shift];
y1 = y*subsample + yShift[orient][shift];
if ((x1-mx>=-2*halfFilterSize)&&(x1-mx<=2*halfFilterSize)&&
(y1-my>=-2*halfFilterSize)&&(y1-my<=2*halfFilterSize))
{ /* if the previous local maximum is within the inhibition range */
if(Correlation[mo+orient1*numOrient]
[px(x1-mx+2*halfFilterSize+1,y1-my+2*halfFilterSize+1,4*halfFilterSize+1,4*halfFilterSize+1)]==0.)
{ /* if it is indeed inhibited */
maxResponse1 = LocalMaximumPooling(img, orient, x*subsample, y*subsample, trace);
trackMap[i][here] = trace[0];
MAX1map[i][here] = maxResponse1;
pooledMax1map[orient][here] += (maxResponse1-maxResponse);
}
}
}
}
}
开发者ID:uknowhuan,项目名称:AOT,代码行数:50,代码来源:CsharedSketch.c
示例9: p
Point3d PlaneDetector::depthCloseToPoint(Point2d p, PointCloud<PointXYZ>& pcl,
int maxDelta) {
for (int delta = 0; delta <= maxDelta; delta++) {
for (int y = p.y - delta; y <= p.y + delta; y++) {
for (int x = p.x - delta; x <= p.x + delta; x++) {
if (!isnan(pcl.points[px(x, y)].z)) {
Point3d p(pcl.points[px(x, y)].x, pcl.points[px(x, y)].y,
pcl.points[px(x, y)].z);
return p;
}
}
}
}
return Point3d(-1, -1, -1);
}
开发者ID:Zorgie,项目名称:Robotics,代码行数:15,代码来源:PlaneDetector.cpp
示例10: MultiScaleQuadrature
MultiScaleQuadrature()
:
super( std::pow(2,ioption("msi.level"))+1 )
{
int gridsize = std::pow(2,ioption("msi.level"));
// build rules in x and y direction
weights_type wx( gridsize+1 );
weights_type px( gridsize+1 );
double tmp=-1;
for ( int i = 0; i <=gridsize ; i++ )
{
// computes the weight of the k-th node
this->M_w( i ) = 2./(gridsize+1) ;// wx( i );
this->M_points( 0, i ) = tmp ;
tmp+=2./gridsize ;
}
boost::shared_ptr<GT_Lagrange<1,1,1, Hypercube,T> > gm( new GT_Lagrange<1, 1, 1, Hypercube, T> );
boost::shared_ptr<face_quad_type> face_qr( new face_quad_type );
// construct face quadratures
this->constructQROnFace( Reference<Hypercube<1, 1>, 1, 1>(), gm, face_qr );
}
开发者ID:LANTZT,项目名称:feelpp,代码行数:26,代码来源:multiscalequadrature.hpp
示例11: px
QPixmap ImageProcessor::drawPiece(int i, int j, const QPainterPath &shape, const Puzzle::Creation::Correction &corr)
{
QPainter p;
QPixmap px(_p->descriptor.unitSize.width() + corr.widthCorrection + 1,
_p->descriptor.unitSize.height() + corr.heightCorrection + 1);
px.fill(Qt::transparent);
p.begin(&px);
p.setRenderHint(QPainter::SmoothPixmapTransform);
p.setRenderHint(QPainter::Antialiasing);
p.setRenderHint(QPainter::HighQualityAntialiasing);
p.setClipping(true);
p.setClipPath(shape);
p.drawPixmap(_p->descriptor.tabFull + corr.xCorrection + corr.sxCorrection,
_p->descriptor.tabFull + corr.yCorrection + corr.syCorrection,
_p->pixmap,
i * _p->descriptor.unitSize.width() + corr.sxCorrection,
j * _p->descriptor.unitSize.height() + corr.syCorrection,
_p->descriptor.unitSize.width() * 2,
_p->descriptor.unitSize.height() * 2);
p.end();
return px;
}
开发者ID:Jornason,项目名称:puzzle-master,代码行数:25,代码来源:imageprocessor.cpp
示例12: px
/**
* Fit to a function.
* @param fun :: A function.
*/
void Chebfun2DSpline::fit( AFunction2D fun )
{
auto& xv = m_xBase->x;
auto& yv = m_yBase->x;
std::vector<double> px(nx() + 1);
std::vector<double> py(ny() + 1);
for(size_t ix = 0; ix < m_xFuns.size(); ++ix)
{
const double y = m_yLines[ix];
for( size_t i = 0 ; i < px.size(); ++i)
{
px[i] = fun(xv[i], y);
}
m_xFuns[ix].setP( px );
}
for(size_t iy = 0; iy < m_yFuns.size(); ++iy)
{
const double x = m_xLines[iy];
for( size_t i = 0 ; i < py.size(); ++i)
{
py[i] = fun(x, yv[i]);
}
m_yFuns[iy].setP( py );
}
}
开发者ID:rrnntt,项目名称:SmallProject,代码行数:29,代码来源:Chebfun2DSpline.cpp
示例13: DrawElement
//mark
void DrawElement(float *Template, int mo, int mx, int my, double w)
{
int x, y, here;
float a;
for (x=mx-halfFilterSize; x<=mx+halfFilterSize; x++)
for (y=my-halfFilterSize; y<=my+halfFilterSize; y++)
if ((x>=1)&&(x<=sizex)&&(y>=1)&&(y<=sizey))
{
a = allSymbol[mo][px(x-mx+halfFilterSize+1, y-my+halfFilterSize+1,
2*halfFilterSize+1, 2*halfFilterSize+1)]*w;
here = px(x, y, sizex, sizey);
if (Template[here]<a)
Template[here] = a;
}
}
开发者ID:uknowhuan,项目名称:AOT,代码行数:17,代码来源:mexc_SharedSketch.cpp
示例14: gen2
void gen2()
{
const int unit = 64;
resetGlobalIdx();
Operand pz(IntPtr, unit);
Operand px(IntPtr, unit);
Operand py(IntPtr, unit);
std::string name = "add128";
Function f(name, Void, pz, px, py);
beginFunc(f);
Operand x = load(px);
Operand y = load(py);
x = zext(x, 128);
y = zext(y, 128);
x = add(x, y);
Operand L = trunc(x, 64);
store(L, pz);
Operand xH = load(getelementptr(px, makeImm(32, 1)));
Operand yH = load(getelementptr(py, makeImm(32, 1)));
x = trunc(lshr(x, 64), 64);
x = add(x, xH);
x = add(x, yH);
store(x, getelementptr(pz, makeImm(32, 1)));
ret(Void);
endFunc();
}
开发者ID:herumi,项目名称:opti,代码行数:27,代码来源:gen.cpp
示例15: draw
void Screen::draw(Drawable *drawable,bool isflip){
if(!isflip){
draw(drawable);
}
else{
vector<Pixel> result;
//Hitung sumbu vertikal
vector<Pixel> group_of_point=drawable->getPixels();
vector<Pixel>::iterator it;
int vertical_axis=0;
int numb=0;
for(it=group_of_point.begin();it!=group_of_point.end();it++){
vertical_axis+=(it->getPosition()).x;numb++;
}
vertical_axis/=numb;
//transformasi
for(it=group_of_point.begin();it!=group_of_point.end();it++){
int temp=(it->getPosition()).x;
temp=2*vertical_axis-temp;
Point pt(temp,(it->getPosition()).y);
Pixel px(pt,it->getColor());
result.push_back(px);
}
for(it=result.begin();it!=result.end();it++)
drawPixel(*it);
}
}
开发者ID:daniarherikurniawan,项目名称:BattleOfYu,代码行数:28,代码来源:Screen.cpp
示例16: px
GLuint FileAssociatedTexture::getOrCreateCube(
const QString & fileNames
, OpenGLFunctions & gl
, const GLenum mag_filter
, const GLenum min_filter)
{
if (s_texturesByFilePath.contains(fileNames))
return s_texturesByFilePath[fileNames];
QString px(fileNames); px.replace("?", "px");
QString nx(fileNames); nx.replace("?", "nx");
QString py(fileNames); py.replace("?", "py");
QString ny(fileNames); ny.replace("?", "ny");
QString pz(fileNames); pz.replace("?", "pz");
QString nz(fileNames); nz.replace("?", "nz");
QStringList files = QStringList() << px << nx << py << ny << pz << nz;
QStringList absolutes;
foreach(const QString & file, files)
{
QFileInfo fi(file);
if (!fi.exists())
{
qWarning() << file << " does not exist: texture has no associated file.";
return -1;
}
absolutes << fi.absoluteFilePath();
}
开发者ID:hpicgs,项目名称:cg2sandbox,代码行数:28,代码来源:FileAssociatedTexture.cpp
示例17: px
bool SizeParam::fromString(const std::string& str)
{
if (str.length() < 2)
return false;
std::string temp;
if (str[ 0 ] == 'p')
{
temp = str.substr(1, str.length() - 1);
px(utility::parseInt(temp));
}
else if (str[ 0 ] == 'f')
{
if (str[ 1 ] == 'f')
mFlMode = FM_FREE_SPACE;
else if (str[ 1 ] == 'p')
mFlMode = FM_PARENT;
else
MYGUI_EXCEPT("Second character of float mode in SizeParam is invalid!");
temp = str.substr(2, str.length() - 2);
mFl = utility::parseFloat(temp);
}
else MYGUI_EXCEPT("First character in SizeParam is invalid!");
return true;
}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:30,代码来源:MyGUI_SizeDescription.cpp
示例18: InitializeMAX1map
/* Initialize MAX1 maps */
void InitializeMAX1map()
{
int img, orient, x, y, here, i, trace[2];
/* calculate MAX1 maps and record the shifts */
pooledMax1map = float_matrix(numOrient, sizexSubsample*sizeySubsample);
MAX1map = float_matrix(numImage*numOrient, sizexSubsample*sizeySubsample);
trackMap = int_matrix(numImage*numOrient, sizexSubsample*sizeySubsample);
startx = floor((halfFilterSize+1)/subsample)+1+locationShiftLimit;
endx = floor((sizex-halfFilterSize)/subsample)-1-locationShiftLimit;
starty = floor((halfFilterSize+1)/subsample)+1+locationShiftLimit;
endy = floor((sizey-halfFilterSize)/subsample)-1-locationShiftLimit;
for (x=startx; x<=endx; x++)
for (y=starty; y<=endy; y++)
{
here = px(x, y, sizexSubsample, sizeySubsample);
for (orient=0; orient<numOrient; orient++)
{
pooledMax1map[orient][here] = 0.;
for (img=0; img<numImage; img++)
{
i = orient*numImage+img;
MAX1map[i][here] = LocalMaximumPooling(img, orient, x*subsample, y*subsample, trace);
trackMap[i][here] = trace[0];
pooledMax1map[orient][here] += MAX1map[i][here];
}
}
}
}
开发者ID:uknowhuan,项目名称:AOT,代码行数:29,代码来源:CsharedSketch.c
示例19: dest
void FAMS::saveModeImg(const std::string& filename, bool pruned,
const std::vector<multi_img::BandDesc>& ref) {
size_t n = (pruned ? prunedModes.size() : modes.size());
if (n < 1)
return;
bool full = (n == h_ * w_);
int h = (full ? h_ : n), w = (full ? w_ : 1);
multi_img dest(h, w, modes[0].data.size());
dest.minval = minVal_;
dest.maxval = maxVal_;
for (int y = 0; y < h; ++y) {
for (int x = 0; x < w; ++x) {
multi_img::Pixel px(dest.size());
std::vector<unsigned short> &src
= (pruned ? prunedModes[x*y] : modes[x*y].data);
for (size_t d = 0; d < src.size(); ++d)
px[d] = ushort2value(src[d]);
dest.setPixel(y, x, px);
}
}
dest.meta = ref;
dest.write_out(filename);
}
开发者ID:ajaskier,项目名称:gerbil,代码行数:27,代码来源:io.cpp
示例20: QDialog
ImageViewer::ImageViewer(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
connect(lowerSpinBox, SIGNAL(valueChanged(double)),
SLOT(slotUpdate()));
connect(upperSpinBox, SIGNAL(valueChanged(double)),
SLOT(slotUpdate()));
connect(flipCheckBox, SIGNAL(stateChanged(int)),
SLOT(slotUpdate()));
connect(opaqueCheckBox, SIGNAL(stateChanged(int)),
SLOT(slotUpdate()));
QPixmap px(32, 32);
QPainter p(&px);
p.fillRect(0, 0, 32, 32, Qt::white);
p.fillRect(0, 0, 16, 16, QColor(193, 193, 193));
p.fillRect(16, 16, 16, 16, QColor(193, 193, 193));
p.end();
QPalette pal = scrollAreaWidgetContents->palette();
pal.setBrush(QPalette::Background,
QBrush(px));
pal.setBrush(QPalette::Base,
QBrush(px));
scrollAreaWidgetContents->setPalette(pal);
}
开发者ID:float-tw,项目名称:apitrace,代码行数:27,代码来源:imageviewer.cpp
注:本文中的px函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论