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


C++ AContainer类代码示例

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


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

示例1: addScale

        void addScale( const AContainer& aligner, Point<double> scale ){
            vector<ModifiedPlane> scales;
            scales.reserve( aligner.maskCount() );
            for( unsigned i=0; i<aligner.maskCount(); i++ ){
                auto& mask = aligner.mask( i );
                scales.emplace_back( getScaled( mask, (mask.getSize() * scale).round() ) );
            }
            items.emplace_back( scales );
        }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例2: _lastRelease

//最后一步真正的释放对象
//释放自己,也释放关注自己的对象
void AWinControlBase::_lastRelease()
{
    AContainer* pcParent = dynamic_cast<AContainer*>(GetParent());
    if( pcParent )
        pcParent->GetUICore()->RemoveWatcher(this);

    m_aWatchDelete.Clear();
    Release();
}
开发者ID:emuikernel,项目名称:BaijieCppUILib,代码行数:11,代码来源:AWinControlBase.cpp

示例3: setLimit

static void setLimit( QCustomPlot& plot, const AContainer& images, Point<bool> moves ){
    auto min_point = images.minPoint();
    auto max_point = images.maxPoint();
    
    plot.xAxis->setRange( moves.x ? min_point.x : 0, moves.x ? max_point.x : images.count() );
    plot.yAxis->setRange( moves.y ? min_point.y : 0, moves.y ? max_point.y : images.count() );
    
    plot.yAxis->setLabel( moves.y ? QObject::tr("Y") : QObject::tr("Id") );
    plot.xAxis->setLabel( moves.y ? QObject::tr("X") : QObject::tr("Id") );
}
开发者ID:spillerrec,项目名称:Overmix,代码行数:10,代码来源:MovementGraph.cpp

示例4: display

void display( ostream & out, const AContainer & C )
{
  out << "C = ";
  for ( typename AContainer::const_iterator it = C.begin(), it_end = C.end();
        it != it_end; ++it )
    {
      out << " (" << (*it).first << "," << (*it).second << ")";
    }
  out << std::endl;
}
开发者ID:Jeremy-Gaillard,项目名称:DGtal,代码行数:10,代码来源:testLabelledMap.cpp

示例5: render

ImageEx EstimatorRender::render(const AContainer &group, AProcessWatcher *watcher) const {
    auto planes_amount = group.image(0).size();
    auto min_point = group.minPoint();
    ProgressWrapper( watcher ).setTotal( planes_amount * iterations * group.count() );
    
    auto est = AverageRender().render( group ); //Starting estimate
    est.scaleFactor( upscale_factor );
    auto beta = color::WHITE * this->beta / group.count();
    for( unsigned c=0; c<planes_amount; ++c ){
        for( int i=0; i<iterations; i++ ){
            if( ProgressWrapper(watcher).shouldCancel() )
                return {};
            auto output_copy = est[c];
            
            //Improve estimate
            for( unsigned j=0; j<group.count(); j++, ProgressWrapper( watcher ).add() )
                sign( output_copy, degrade( est[c], {group, j, c} ), group.image(j)[c], group.pos(j)-min_point
                    , beta, channelScale(group, j, c)*upscale_factor );
            
            //Regularization
            if( lambda > 0.0 )
                regularize( est[c], output_copy, reg_size, alpha, beta, lambda );
            else
                est[c] = output_copy;
        }
        
        //DEBUG: See how close our model gets to the input data
        for( unsigned j=0; j<group.count(); j++ ){
            save( degrade( est[c], {group, j, c} ), "deg" + QString::number(c) + "-" + QString::number(j) );
            save( group.image(j)[c],                "low" + QString::number(c) + "-" + QString::number(j) );
        }
    }

    return est;
}
开发者ID:zjucsxxd,项目名称:Overmix,代码行数:35,代码来源:EstimatorRender.cpp

示例6: align

        virtual void align( AContainer& container, AProcessWatcher* ) const override{
            //Validate input
            auto max_frames = amount * repeats;
            if( amount < 1 || repeats < 1 )
                throw std::runtime_error( "Invalid arguments, no frames would be generated" );
            if( max_frames < offset )
                throw std::runtime_error( "Offset is bigger than frames per cycle" );
            
            //Calculate offsets
            for( unsigned i=0; i<container.count(); i++ )
                container.setFrame( i, ((i + max_frames - offset)/repeats) % amount );
                //Adding max_frames to be sure it is positive before MOD
        }
开发者ID:spillerrec,项目名称:Overmix,代码行数:13,代码来源:FrameCalculatorAligner.hpp

示例7: imagesMoves

static Point<bool> imagesMoves( const AContainer& container ){
    if( container.count() == 0 )
        return { false, false };
    
    Point<bool> moves{ false, false };
    auto base = container.pos( 0 );
    for( unsigned i=1; i<container.count(); ++i ){
        auto current = container.pos( i );
        moves.x = moves.x || (base.x != current.x);
        moves.y = moves.y || (base.y != current.y);
    }
    
    return moves;
}
开发者ID:zjucsxxd,项目名称:Overmix,代码行数:14,代码来源:MovementGraph.cpp

示例8: render

ImageEx PlaneRender::render( const AContainer& aligner, AProcessWatcher* watcher ) const{
    unsigned planes_amount = aligner.image(0).size();
    planes_amount = min( planes_amount, max_planes );
    Progress progress( "PlaneRender", planes_amount, watcher );
    
    //Render all planes
    auto color_space = aligner.image(0).getColorSpace();
    ImageEx img( (planes_amount==1) ? color_space.changed( Transform::GRAY ) : color_space );
    for( unsigned c=0; c<planes_amount; ++c ){
        if( progress.shouldCancel() )
            return {};
        img.addPlane( renderPlane( aligner, c, progress.makeSubtask() ) );
    }
    return img;
}
开发者ID:spillerrec,项目名称:Overmix,代码行数:15,代码来源:PlaneRender.cpp

示例9: align

void LinearAligner::align( AContainer& container, AProcessWatcher* watcher ) const {
    LinearFunc hor, ver;//, both;
    for( unsigned i=0; i<container.count(); i++ ){
        hor.add( i, container.pos(i).x );
        ver.add( i, container.pos(i).y );
        //both.add( pos(i).x, pos(i).y );
    }
    
    for( unsigned i=0; i<container.count(); i++ ){
        switch( method ){
            case AlignMethod::BOTH: container.setPos( i, { hor(i), ver(i) } ); break;
            case AlignMethod::VER:  container.setPos( i, { 0, ver(i) } ); break;
            case AlignMethod::HOR:  container.setPos( i, { hor(i), 0 } ); break;
        };
    }
}
开发者ID:spillerrec,项目名称:Overmix,代码行数:16,代码来源:LinearAligner.cpp

示例10: SetChecked

void ARadioButton::SetChecked(bool v)
{
    m_bChecked = v;
    if( v )
    {
        AContainer* pContainer = dynamic_cast<AContainer *>(GetParent());
        for(int i=0;i<pContainer->GetChildControls()->GetCount();i++)
        {
            AControl* pControl = (AControl *)(pContainer->GetChildControls()->operator [](i));
            ARadioButton* pr = dynamic_cast<ARadioButton *>(pControl);
            if( pr == NULL || pr == this || pr->GetGroup() != (int)m_iGroup ) continue;
            pr->SetChecked(false);
        }
    }
    m_pUICore->Refresh(GetAbsPosition());
}
开发者ID:emuikernel,项目名称:BaijieCppUILib,代码行数:16,代码来源:ARadioButton.cpp

示例11: IsContainerScrollBar

bool AScrollBar::IsContainerScrollBar()
{
    bool bIsContainerScrollBar = false;
    AContainer* pContainer = dynamic_cast<AContainer*>(GetParent());
    if( pContainer != NULL )
    {
        if( m_Kind == sbVert )
        {
            if( pContainer->GetVScrollBar() == this ) bIsContainerScrollBar = true;
        }
        else
        {
            if( pContainer->GetHScrollBar() == this ) bIsContainerScrollBar = true;
        }
    }
    return bIsContainerScrollBar;
}
开发者ID:emuikernel,项目名称:BaijieCppUILib,代码行数:17,代码来源:AScrollBar.cpp

示例12: render

ImageEx JpegConstrainerRender::render(const AContainer &group, AProcessWatcher *watcher) const {
    //Get the one image we want to constrain
    if( group.count() != 1 )
        throw std::runtime_error( "Can only be used on one image" );
    auto img = group.image(0);
    
    //TODO: Check color types
    
    
    Progress progress( "JpegConstrainerRender", img.size(), watcher );
    progress.loopAll( [&]( int c ){
            //Constrain it to the Coeff
            unsigned change=0;
            img[c] = degrader.planes[c].degradeFromJpegPlane( img[c], jpeg.planes[c], change );
        } );
    
    return img;
}
开发者ID:spillerrec,项目名称:Overmix,代码行数:18,代码来源:JpegConstrainerRender.cpp

示例13: render

ImageEx DiffRender::render( const AContainer& aligner, unsigned max_count, AProcessWatcher* watcher ) const{
    if( max_count > aligner.count() )
        max_count = aligner.count();
    
    //Normal render
    ImageEx avg = SimpleRender( SimpleRender::FOR_MERGING ).render( aligner, max_count );
    
    //Find the smallest shared size
    QSize size = aligner.size().size(); //No image is larger than the final result
    for( unsigned i=0; i<max_count; i++ ){
        size.setWidth( min( (unsigned)size.width(), aligner.image(i).get_width() ) );
        size.setHeight( min( (unsigned)size.height(), aligner.image(i).get_height() ) );
    }
    
    //Create final output image based on the smallest size
    ImageEx img( ImageEx::GRAY );
    img.create( size.width(), size.height() );
    Plane& output = img[0];
    
    if( watcher )
        watcher->setTotal( 1000 );
    
    //Iterate over each pixel in the output image
    for( unsigned iy=0; iy<output.get_height(); iy++ ){
        if( watcher )
            watcher->setCurrent( iy * 1000 / output.get_height() );
        
        color_type* out = output.scan_line( iy );
        for( unsigned ix=0; ix<output.get_width(); ix++ ){
            //Set the pixel to the static difference of all the images until max_count
            StaticDiff diff( aligner, avg, ix, iy );
            
            for( unsigned j=0; j<max_count; j++ )
                diff.add_image( j );
            
            out[ix] = diff.result();
        }
    }
    
    img.apply( &Plane::normalize );
    return img;
}
开发者ID:imclab,项目名称:Overmix,代码行数:42,代码来源:DiffRender.cpp

示例14: if

void AScrollBar::_Change(int iSize)
{
    //iSize代表的是VirtualSize中的对应大小
    if( iSize == 0 ) return;


    int pos = (int)GetPosition();
    if( pos + iSize < 0 ) iSize = -pos;
    else if( pos + iSize > (int)GetRange() ) iSize = (int)GetRange() - pos;

    int iDeltaPosition=iSize;
    SetPosition(pos + iSize);

    AMouseEvent evt;
    evt.m_Delta = iDeltaPosition;
    OnScroll.Call(this,&evt);

    AContainer* pc = dynamic_cast<AContainer*>(GetParent());
    if( pc )
    {
        pc->DoLayout();
    }
}
开发者ID:emuikernel,项目名称:BaijieCppUILib,代码行数:23,代码来源:AScrollBar.cpp

示例15: renderPlane

Plane PlaneRender::renderPlane( const AContainer& aligner, int plane, AProcessWatcher* watcher ) const{
    auto scale = aligner.image( 0 )[plane].getSize().to<double>() / aligner.image( 0 )[0].getSize().to<double>();
    
    //Create output plane
    Plane out( (Point<>( aligner.size().size ) * scale).round() );
    out.fill( color::BLACK );
    
    //Initialize PlaneItInfos
    vector<PlaneItInfo> info;
    info.emplace_back( out, (aligner.size().pos * scale).round() );
    
    for( auto align : aligner )
        info.emplace_back( const_cast<Plane&>( align.image()[plane] ), (align.pos() * scale).round() );
        //TODO: FIX!!!
    
    //Execute
    MultiPlaneIterator it( info );
    it.data = data();
    it.iterate_all();
    it.for_all_pixels( pixel(), watcher, 1000 * plane );
    
    return out;
}
开发者ID:spillerrec,项目名称:Overmix,代码行数:23,代码来源:PlaneRender.cpp


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