public IImageIterator <T> Offset(int steps) { ImageRowIterator <T> result = this; result.Advance(steps); return(result); }
public int Difference(ImageRowIterator <T> rhs) { if (image == rhs.image && row == rhs.row) { return(this.column - rhs.column); } throw new ArgumentException(); }
public int Difference(IImageIterator <T> obj) { if (obj is ImageRowIterator <T> ) { ImageRowIterator <T> rhs = (ImageRowIterator <T>)obj; return(Difference(rhs)); } throw new ArgumentException(); }
public override bool Equals(object obj) { if (obj is ImageRowIterator <T> ) { ImageRowIterator <T> rhs = (ImageRowIterator <T>)obj; return(Equals(rhs)); } return(false); }
/// <summary> /// Performs a one dimensional convolution in the x direction /// </summary> /// <param name="source"></param> /// <param name="target"></param> /// <param name="kernel"></param> private static void SeparableConvolveX(IImage <double> source, IImage <double> target, Kernel1D kernel) { Debug.Assert(kernel.Left <= 0); Debug.Assert(kernel.Right >= 0); int w = source.Width; int h = source.Height; Debug.Assert(w >= kernel.Right - kernel.Left + 1, "Kernel cannot be longer than line"); for (int y = 0; y < h; ++y) { ImageRowIterator <double> rs = source.GetRowIterator(y); ImageRowIterator <double> rsEnd = source.GetRowIterator(source.Width, y); ImageRowIterator <double> rt = target.GetRowIterator(y); ConvolveLine(rs, rsEnd, rt, kernel); } }
public bool Equals(ImageRowIterator <T> rhs) { return(image == rhs.image && row == rhs.row && column == rhs.column); }