本文整理汇总了C++中image_type::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ image_type::begin方法的具体用法?C++ image_type::begin怎么用?C++ image_type::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image_type
的用法示例。
在下文中一共展示了image_type::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fft_shift_z
void fft_shift_z(image_type& I)
{
int wh = I.plane_size();
int half_size = I.size() >> 1;
int half_size_1 = half_size-wh;
int quater_size = half_size >> 1;
typename image_type::iterator iter1 = I.begin();
typename image_type::iterator iter2 = iter1+half_size;
typename image_type::iterator end = iter1+wh;
for(;iter1 != end;++iter1,++iter2)
{
for(int z = 0,rz = half_size_1;z < quater_size;z+=wh,rz-=wh)
{
std::swap(iter1[z],iter1[rz]);
std::swap(iter2[z],iter2[rz]);
}
}
}
示例2: fft_shift_x
void fft_shift_x(image_type& I)
{
int half_w = I.width() >> 1;
int half_w_1 = half_w-1;
int w_1 = I.width()-1;
int quater_w = half_w >> 1;
typename image_type::iterator iter1 = I.begin();
typename image_type::iterator end = I.end();
for(;iter1 != end;iter1 += I.width())
{
typename image_type::iterator iter2 = iter1+half_w;
for(int x = 0,rx = half_w_1;x < quater_w;++x,--rx)
{
std::swap(iter1[x],iter1[rx]);
std::swap(iter2[x],iter2[rx]);
}
}
}
示例3: fft_shift_y
void fft_shift_y(image_type& I)
{
int w = I.width();
int half_wh = I.plane_size() >> 1;
int half_wh_1 = half_wh-w;
int quater_wh = half_wh >> 1;
typename image_type::iterator iter1 = I.begin();
typename image_type::iterator end = I.end();
for(;iter1 != end;iter1 += I.plane_size())
{
typename image_type::iterator iter1_x = iter1;
typename image_type::iterator iter1_x_end = iter1+w;
typename image_type::iterator iter2_x = iter1_x+half_wh;
for(;iter1_x != iter1_x_end;++iter1_x,++iter2_x)
for(int y = 0,ry = half_wh_1;y < quater_wh;y+=w,ry-=w)
{
std::swap(iter1_x[y],iter1_x[ry]);
std::swap(iter2_x[y],iter2_x[ry]);
}
}
}