本文整理汇总了C#中IImageByte.width方法的典型用法代码示例。如果您正苦于以下问题:C# IImageByte.width方法的具体用法?C# IImageByte.width怎么用?C# IImageByte.width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IImageByte
的用法示例。
在下文中一共展示了IImageByte.width方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: blur_x
public void blur_x(IImageByte img, int radius)
{
throw new NotImplementedException();
#if false
if(radius < 1) return;
int x, y, xp, i;
int stack_ptr;
int stack_start;
color_type pix;
color_type* stack_pix;
calculator_type sum;
calculator_type sum_in;
calculator_type sum_out;
int w = img.width();
int h = img.height();
int wm = w - 1;
int div = radius * 2 + 1;
int div_sum = (radius + 1) * (radius + 1);
int mul_sum = 0;
int shr_sum = 0;
int max_val = base_mask;
if(max_val <= 255 && radius < 255)
{
mul_sum = stack_blur_tables.g_stack_blur8_mul[radius];
shr_sum = stack_blur_tables.g_stack_blur8_shr[radius];
}
m_buf.allocate(w, 128);
m_stack.allocate(div, 32);
for(y = 0; y < h; y++)
{
sum.clear();
sum_in.clear();
sum_out.clear();
pix = img.pixel(0, y);
for(i = 0; i <= radius; i++)
{
m_stack[i] = pix;
sum.add(pix, i + 1);
sum_out.add(pix);
}
for(i = 1; i <= radius; i++)
{
pix = img.pixel((i > wm) ? wm : i, y);
m_stack[i + radius] = pix;
sum.add(pix, radius + 1 - i);
sum_in.add(pix);
}
stack_ptr = radius;
for(x = 0; x < w; x++)
{
if(mul_sum) sum.calc_pix(m_buf[x], mul_sum, shr_sum);
else sum.calc_pix(m_buf[x], div_sum);
sum.sub(sum_out);
stack_start = stack_ptr + div - radius;
if(stack_start >= div) stack_start -= div;
stack_pix = &m_stack[stack_start];
sum_out.sub(*stack_pix);
xp = x + radius + 1;
if(xp > wm) xp = wm;
pix = img.pixel(xp, y);
*stack_pix = pix;
sum_in.add(pix);
sum.add(sum_in);
++stack_ptr;
if(stack_ptr >= div) stack_ptr = 0;
stack_pix = &m_stack[stack_ptr];
sum_out.add(*stack_pix);
sum_in.sub(*stack_pix);
}
img.copy_color_hspan(0, y, w, &m_buf[0]);
}
#endif
}