本文整理汇总了C++中View2类的典型用法代码示例。如果您正苦于以下问题:C++ View2类的具体用法?C++ View2怎么用?C++ View2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了View2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: transform_pixels_locator
GIL_FORCEINLINE F transform_pixels_locator(const View1& src1, const Rect<std::ptrdiff_t>& src1Rod, const View2& src2,
const Rect<std::ptrdiff_t>& src2Rod, const View2& src3,
const Rect<std::ptrdiff_t>& src3Rod, const ViewDst& dst,
const Rect<std::ptrdiff_t>& dstRod, const Rect<std::ptrdiff_t>& renderWin,
const F& fun)
{
const std::ptrdiff_t renderWidth = renderWin.x2 - renderWin.x1;
typename View1::xy_locator s1loc = src1.xy_at(renderWin.x1 - src1Rod.x1, renderWin.y1 - src1Rod.y1);
typename View2::xy_locator s2loc = src2.xy_at(renderWin.x1 - src2Rod.x1, renderWin.y1 - src2Rod.y1);
typename View3::xy_locator s3loc = src3.xy_at(renderWin.x1 - src3Rod.x1, renderWin.y1 - src3Rod.y1);
for(std::ptrdiff_t y = renderWin.y1; y < renderWin.y2; ++y)
{
typename ViewDst::x_iterator dstIt = dst.x_at(dstRod.x1, y - dstRod.y1);
for(std::ptrdiff_t x = renderWin.x1; x < renderWin.x2; ++x, ++s1loc.x(), ++s2loc.x(), ++s3loc.x(), ++dstIt)
{
*dstIt = fun(s1loc, s2loc, s3loc);
}
s1loc.x() -= renderWidth;
++s1loc.y();
s2loc.x() -= renderWidth;
++s2loc.y();
s3loc.x() -= renderWidth;
++s3loc.y();
}
return fun;
}
开发者ID:aoblet,项目名称:TuttleOFX,代码行数:26,代码来源:transform_pixels.hpp
示例2: operator
void operator () (View1 to, View2 from)
{
auto w = std::min(to.GetWidth(), from.GetWidth());
auto h = std::min(to.GetHeight(), from.GetHeight());
for (size_t i = 0; i < h; i++)
{
auto p1 = to.BeginRow(i);
auto p2 = from.BeginRow(i);
for (size_t j = 0; j < w; j++, p1++, p2++)
{
*p1 = *p2;
}
}
}
开发者ID:hweom,项目名称:ccb,代码行数:14,代码来源:BitmapAlgorithm.hpp
示例3: transform_pixels_progress
GIL_FORCEINLINE
F transform_pixels_progress( const View1& src, const View2& dst, const F& fun, IProgress& p )
{
assert( src.dimensions() == dst.dimensions() );
for( std::ptrdiff_t y = 0; y < src.height(); ++y )
{
typename View1::x_iterator srcIt = src.row_begin( y );
typename View2::x_iterator dstIt = dst.row_begin( y );
for( std::ptrdiff_t x = 0; x < src.width(); ++x )
dstIt[x] = fun( srcIt[x] );
if( p.progressForward( dst.width() ) )
return fun;
}
return fun;
}
开发者ID:morphimac,项目名称:TuttleOFX,代码行数:15,代码来源:algorithm.hpp
示例4: apply_ukernel
void
apply_ukernel(View0 in0,
View1 in1,
View2 in2,
View3 out)
{
dda::Data<typename View0::block_type, dda::in> data0(in0.block());
dda::Data<typename View1::block_type, dda::in> data1(in1.block());
dda::Data<typename View2::block_type, dda::in> data2(in2.block());
dda::Data<typename View3::block_type, dda::out> data3(out.block());
assert(data0.stride(1) == 1);
assert(data1.stride(1) == 1);
assert(data2.stride(1) == 1);
assert(data3.stride(1) == 1);
example::Cblock kernel((uintptr_t)data0.ptr(), data0.stride(0),
(uintptr_t)data1.ptr(), data1.stride(0),
(uintptr_t)data2.ptr(), data2.stride(0),
(uintptr_t)data3.ptr(), data3.stride(0),
out.size(0), out.size(1));
vsip_csl::ukernel::Ukernel<example::Cblock> uk(kernel);
uk();
}
开发者ID:bambang,项目名称:vsipl,代码行数:26,代码来源:cblock.cpp
示例5: tbb_copy_pixels
GIL_FORCEINLINE void tbb_copy_pixels( const View1& src, const View2& dst)
{
assert(src.dimensions()==dst.dimensions());
tbb::parallel_for( tbb::blocked_range<std::size_t>( 0, src.height()),
detail::make_tbb_copy_pixels_fun( src, dst),
GIL_TBB_ALGORITHMS_DEFAULT_PARTITIONER());
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:7,代码来源:tbb_copy.hpp
示例6: transform_pixels_locator_progress
GIL_FORCEINLINE
F transform_pixels_locator_progress( const View1& src1, const OfxRectI& src1Rod,
const View2& src2, const OfxRectI& src2Rod,
const ViewDst& dst, const OfxRectI& dstRod,
const OfxRectI& renderWin, const F& fun, IProgress& p )
{
const std::ptrdiff_t renderWidth = renderWin.x2 - renderWin.x1;
typename View1::xy_locator s1loc = src1.xy_at( renderWin.x1-src1Rod.x1, renderWin.y1-src1Rod.y1 );
typename View2::xy_locator s2loc = src2.xy_at( renderWin.x1-src2Rod.x1, renderWin.y1-src2Rod.y1 );
for( std::ptrdiff_t y = renderWin.y1; y < renderWin.y2; ++y )
{
typename ViewDst::x_iterator dstIt = dst.x_at( dstRod.x1, y-dstRod.y1 );
for( std::ptrdiff_t x = renderWin.x1;
x < renderWin.x2;
++x, ++s1loc.x(), ++s2loc.x(), ++dstIt )
{
*dstIt = fun( s1loc, s2loc );
}
s1loc.x() -= renderWidth; ++s1loc.y();
s2loc.x() -= renderWidth; ++s2loc.y();
if( p.progressForward( renderWidth ) )
return fun;
}
return fun;
}
开发者ID:morphimac,项目名称:TuttleOFX,代码行数:25,代码来源:algorithm.hpp
示例7: apply_ukernel
void
apply_ukernel(View0 in0,
View1 in1,
View2 in2,
View3 out)
{
dda::Ext_data<typename View0::block_type> ext0(in0.block());
dda::Ext_data<typename View1::block_type> ext1(in1.block());
dda::Ext_data<typename View2::block_type> ext2(in2.block());
dda::Ext_data<typename View3::block_type> ext3(out.block());
assert(ext0.stride(1) == 1);
assert(ext1.stride(1) == 1);
assert(ext2.stride(1) == 1);
assert(ext3.stride(1) == 1);
example::Cblock kernel((uintptr_t)ext0.data(), ext0.stride(0),
(uintptr_t)ext1.data(), ext1.stride(0),
(uintptr_t)ext2.data(), ext2.stride(0),
(uintptr_t)ext3.data(), ext3.stride(0),
out.size(0), out.size(1));
vsip_csl::ukernel::Ukernel<example::Cblock> uk(kernel);
uk();
}
开发者ID:BackupTheBerlios,项目名称:openvsipl,代码行数:26,代码来源:cblock.cpp
示例8: checkNewViewWasAllocated
inline void checkNewViewWasAllocated( View1 const &v1, View2 const &v2 )
{
BOOST_TEST( v1.data() != v2.data() );
BOOST_TEST( (int)View1::rank == (int)View2::rank );
BOOST_TEST( ( std::is_same<typename View1::const_value_type,
typename View2::const_value_type>::value ) );
BOOST_TEST( v1.dimension_0() == v2.dimension_0() );
BOOST_TEST( v1.dimension_1() == v2.dimension_1() );
BOOST_TEST( v1.dimension_2() == v2.dimension_2() );
BOOST_TEST( v1.dimension_3() == v2.dimension_3() );
BOOST_TEST( v1.dimension_4() == v2.dimension_4() );
BOOST_TEST( v1.dimension_5() == v2.dimension_5() );
BOOST_TEST( v1.dimension_6() == v2.dimension_6() );
BOOST_TEST( v1.dimension_7() == v2.dimension_7() );
}
开发者ID:ORNL-CEES,项目名称:DataTransferKit,代码行数:17,代码来源:tstDetailsDistributedSearchTreeImpl.cpp
示例9: check_alias
void
check_alias(
View1<T1, Block1>& vec1,
View2<T2, Block2>& vec2)
{
fill_block(vec1.block(), 2);
test_assert(check_vector(vec1, 2));
test_assert(check_vector(vec2, 2));
fill_block(vec2.block(), 3);
test_assert(check_vector(vec1, 3));
test_assert(check_vector(vec2, 3));
}
开发者ID:BackupTheBerlios,项目名称:openvsipl,代码行数:13,代码来源:vector.cpp
示例10: checkViewWasNotAllocated
inline void checkViewWasNotAllocated( View1 const &v1, View2 const &v2 )
{
// NOTE: cannot use operator== here because array layout may "change" for
// rank-1 views
BOOST_TEST( v1.data() == v2.data() );
BOOST_TEST( v1.span() == v2.span() );
BOOST_TEST( (int)View1::rank == (int)View2::rank );
BOOST_TEST( ( std::is_same<typename View1::const_value_type,
typename View2::const_value_type>::value ) );
BOOST_TEST( ( std::is_same<typename View1::memory_space,
typename View2::memory_space>::value ) );
BOOST_TEST( v1.dimension_0() == v2.dimension_0() );
BOOST_TEST( v1.dimension_1() == v2.dimension_1() );
BOOST_TEST( v1.dimension_2() == v2.dimension_2() );
BOOST_TEST( v1.dimension_3() == v2.dimension_3() );
BOOST_TEST( v1.dimension_4() == v2.dimension_4() );
BOOST_TEST( v1.dimension_5() == v2.dimension_5() );
BOOST_TEST( v1.dimension_6() == v2.dimension_6() );
BOOST_TEST( v1.dimension_7() == v2.dimension_7() );
}
开发者ID:ORNL-CEES,项目名称:DataTransferKit,代码行数:22,代码来源:tstDetailsDistributedSearchTreeImpl.cpp
示例11: checkNewViewWasAllocated
inline void checkNewViewWasAllocated( View1 const &v1, View2 const &v2,
bool &success,
Teuchos::FancyOStream &out )
{
TEST_INEQUALITY( v1.data(), v2.data() );
TEST_EQUALITY( (int)View1::rank, (int)View2::rank );
TEST_ASSERT( ( std::is_same<typename View1::const_value_type,
typename View2::const_value_type>::value ) );
TEST_EQUALITY( v1.dimension_0(), v2.dimension_0() );
TEST_EQUALITY( v1.dimension_1(), v2.dimension_1() );
TEST_EQUALITY( v1.dimension_2(), v2.dimension_2() );
TEST_EQUALITY( v1.dimension_3(), v2.dimension_3() );
TEST_EQUALITY( v1.dimension_4(), v2.dimension_4() );
TEST_EQUALITY( v1.dimension_5(), v2.dimension_5() );
TEST_EQUALITY( v1.dimension_6(), v2.dimension_6() );
TEST_EQUALITY( v1.dimension_7(), v2.dimension_7() );
}
开发者ID:Rombur,项目名称:DataTransferKit,代码行数:19,代码来源:tstDetailsDistributedSearchTreeImpl.cpp
示例12: check_not_alias
void
check_not_alias(
View1<T1, Block1>& vec1,
View2<T2, Block2>& vec2)
{
fill_block(vec1.block(), 2);
fill_block(vec2.block(), 3);
// Make sure that updates to vec2 do not affect vec1.
test_assert(check_vector(vec1, 2));
// And visa-versa.
fill_block(vec1.block(), 4);
test_assert(check_vector(vec2, 3));
}
开发者ID:BackupTheBerlios,项目名称:openvsipl,代码行数:15,代码来源:vector.cpp
示例13: checkViewWasNotAllocated
inline void checkViewWasNotAllocated( View1 const &v1, View2 const &v2,
bool &success,
Teuchos::FancyOStream &out )
{
// NOTE: cannot use operator== here because array layout may "change" for
// rank-1 views
TEST_EQUALITY( v1.data(), v2.data() );
TEST_EQUALITY( v1.span(), v2.span() );
TEST_EQUALITY( (int)View1::rank, (int)View2::rank );
TEST_ASSERT( ( std::is_same<typename View1::const_value_type,
typename View2::const_value_type>::value ) );
TEST_ASSERT( ( std::is_same<typename View1::memory_space,
typename View2::memory_space>::value ) );
TEST_EQUALITY( v1.dimension_0(), v2.dimension_0() );
TEST_EQUALITY( v1.dimension_1(), v2.dimension_1() );
TEST_EQUALITY( v1.dimension_2(), v2.dimension_2() );
TEST_EQUALITY( v1.dimension_3(), v2.dimension_3() );
TEST_EQUALITY( v1.dimension_4(), v2.dimension_4() );
TEST_EQUALITY( v1.dimension_5(), v2.dimension_5() );
TEST_EQUALITY( v1.dimension_6(), v2.dimension_6() );
TEST_EQUALITY( v1.dimension_7(), v2.dimension_7() );
}
开发者ID:Rombur,项目名称:DataTransferKit,代码行数:24,代码来源:tstDetailsDistributedSearchTreeImpl.cpp
示例14: AssignFunctor
AssignFunctor( const View1 view_1, View2 view_2 )
: _view_1( view_1 )
, _view_2( view_2 )
{
static_assert( std::is_same<typename View1::traits::value_type,
typename View2::traits::value_type>::value,
"View data types must be the same" );
static_assert( std::is_same<typename View1::traits::device_type,
typename View2::traits::device_type>::value,
"View device types must be the same" );
static_assert( static_cast<unsigned>( View1::Rank ) == 2,
"View ranks must be 2" );
static_assert( static_cast<unsigned>( View2::Rank ) == 2,
"View ranks must be 2" );
DTK_REQUIRE( view_1.extent( 0 ) == view_2.extent( 0 ) );
DTK_REQUIRE( view_1.extent( 1 ) == view_2.extent( 1 ) );
}
开发者ID:ORNL-CEES,项目名称:DataTransferKit,代码行数:17,代码来源:tstKokkosView.cpp
示例15: QWidget
MapEditorForm::MapEditorForm(QWidget *parent) :
QWidget(parent),
ui(new Ui::MapEditorForm)
{
ui->setupUi(this);
is_turf_selected_ = false;
InitSettersForTypes();
scene_ = new GraphicsScene;
map_editor_ = new MapEditor(scene_);
connect(scene_, &GraphicsScene::mousePressed, map_editor_, &MapEditor::mousePressedEvent);
connect(scene_, &GraphicsScene::keyboardPressed, map_editor_, &MapEditor::keyPressedEvent);
connect(scene_, &GraphicsScene::rightClick, this, &MapEditorForm::mapClicked);
connect(map_editor_, &MapEditor::newSelectionSetted, this, &MapEditorForm::newSelectionSetted);
map_editor_->Resize(100, 100, 1);
map_editor_->SetPointer(2, 2);
ui->graphicsView->setScene(scene_);
SetSpriter(new SpriteHolder);
for (auto it = (*itemList()).begin(); it != (*itemList()).end(); ++it)
{
IMainObject* loc = it->second(0);
IOnMapObject* bloc = castTo<IOnMapObject>(loc);
if (!bloc)
{
//delete loc;
continue;
}
bool is_turf = false;
if (castTo<ITurf>(loc))
{
is_turf = true;
}
ViewInfo* view_info = bloc->GetView();
if ( view_info->GetBaseFrameset().GetSprite() == ""
|| view_info->GetBaseFrameset().GetState() == "")
{
continue;
}
QVector<QPixmap> images;
View2 view;
view.LoadViewInfo(*view_info);
if (view.GetBaseFrameset().GetMetadata() == nullptr)
{
continue;
}
for (size_t dir = 0; dir < view.GetBaseFrameset().GetMetadata()->dirs; ++dir)
{
int current_frame_pos = view.GetBaseFrameset().GetMetadata()->first_frame_pos + dir;
int image_state_h_ = current_frame_pos / view.GetBaseFrameset().GetSprite()->FrameW();
int image_state_w_ = current_frame_pos % view.GetBaseFrameset().GetSprite()->FrameW();
SDL_Surface* s = view.GetBaseFrameset().GetSprite()->GetSDLSprite()->frames
[image_state_w_ * view.GetBaseFrameset().GetSprite()->FrameH() + image_state_h_];
QImage img(static_cast<uchar*>(s->pixels),
s->w, s->h, QImage::Format_ARGB32);
images.push_back(QPixmap::fromImage(img));
}
map_editor_->AddItemType(it->first, images);
QListWidgetItem* new_item
= new QListWidgetItem(QIcon(images[0]), bloc->T_ITEM().c_str());
if (!is_turf)
{
types_.push_back(it->first);
ui->listWidget->addItem(new_item);
}
else
{
turf_types_.push_back(it->first);
map_editor_->AddTurfType(it->first);
ui->listWidgetTurf->addItem(new_item);
}
}
}
开发者ID:Heldmaschine,项目名称:karya-valya,代码行数:91,代码来源:mapeditorform.cpp
注:本文中的View2类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论