本文整理汇总了C++中PicArray::LastX方法的典型用法代码示例。如果您正苦于以下问题:C++ PicArray::LastX方法的具体用法?C++ PicArray::LastX怎么用?C++ PicArray::LastX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PicArray
的用法示例。
在下文中一共展示了PicArray::LastX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HFilter
void HFilter( PicArray& pic_data, const OneDArray<int>& filter, const int bits )
{
ValueType* line_data = new ValueType[pic_data.LengthX()];
const int offset = (1<<(bits-1));
int sum;
for (int j=0; j<pic_data.LengthY(); ++j)
{
// Do the first bit
for (int i=0; i<filter.Last(); ++i)
{
sum = offset;
for (int k=filter.Last(); k>=filter.First(); --k)
sum += filter[k]*pic_data[j][std::max(i-k,0)];
sum >>= bits;
sum = std::min( 127, std::max( -128, sum) );
line_data[i] = ValueType( sum );
}// i
// Do the middle bit
for (int i=filter.Last(); i<=pic_data.LastX()+filter.First(); ++i)
{
sum = offset;
for (int k=filter.Last(); k>=filter.First(); --k)
sum += filter[k]*pic_data[j][i-k];
sum >>= bits;
sum = std::min( 127, std::max( -128, sum) );
line_data[i] = ValueType( sum );
}// i
// Do the last bit
for (int i=pic_data.LastX()+filter.First()+1; i<pic_data.LengthX(); ++i)
{
sum = offset;
for (int k=filter.Last(); k>=filter.First(); --k)
sum += filter[k]*pic_data[j][std::min(i-k,pic_data.LastX())];
sum >>= bits;
sum = std::min( 127, std::max( -128, sum) );
line_data[i] = ValueType( sum );
}// i
// Copy data back
for (int i=0; i<pic_data.LengthX(); ++i )
pic_data[j][i] = line_data[i];
}// j
delete[] line_data;
}
示例2: CWMFilterComponent
void dirac::CWMFilterComponent( PicArray& pic_data, const int strength )
{
// Do centre-weighted median denoising
PicArray pic_copy( pic_data );
const int width( 3 );
const int offset( (width-1)/2 );
const int centre_weight = std::max(1, (width*width+1)-strength );
const int list_length = centre_weight+(width*width)-1;
ValueType* val_list = new ValueType[list_length];
for (int j=offset; j<pic_data.LengthY()-offset; ++j){
for (int i=offset; i<pic_data.LastX()-offset; ++i){
// Make the value list
int pos=0;
for (; pos<centre_weight-1; ++pos)
val_list[pos] = pic_copy[j][i];
for (int s=-offset; s<=offset; ++s){
for (int r=-offset; r<=offset; ++r){
val_list[pos]=pic_copy[j+s][i+r];
pos++;
}// r
}// s
pic_data[j][i] = Median( val_list, list_length );
}// i
}// j
delete[] val_list;
}
示例3: initPicData
void WaveletTransformTest::initPicData( PicArray& pic_data )
{
for (int j=pic_data.FirstY() ; j<=pic_data.LastY() ; ++j)
{
for (int i=pic_data.FirstX() ; i<=pic_data.LastX() ; ++i)
{
pic_data[j][i] = (((i-j) % 13)*1024)/13;
}// i
}// j
}
示例4: PreMotionEstmationFilter
void FieldSequenceCompressor::PreMotionEstmationFilter(PicArray& comp)
{
//Special case for first row
for (int i = comp.FirstX(); i <= comp.LastX(); ++i)
{
comp[comp.FirstY()][i] = (3*comp[comp.FirstY()][i] +
comp[comp.FirstY()+1][i] +2 )>>2;
}
//Middle section
for (int j = comp.FirstY()+1; j < comp.LastY(); ++j)
{
for (int i = comp.FirstX(); i <= comp.LastX(); ++i)
{
comp[j][i] = (comp[j-1][i] + 2*comp[j][i] + comp[j+1][i] + 2)>>2;
}
}
//Special case for last row
for (int i = comp.FirstX(); i <= comp.LastX(); ++i)
{
comp[comp.LastY()][i] = (comp[comp.LastY()-1][i] +
3*comp[comp.LastY()][i] + 2)>>2;
}
}