OpenCvSharp.Cv2.AlignSize C# (CSharp) Method

AlignSize() public static method

Aligns buffer size by the certain number of bytes This small inline function aligns a buffer size by the certian number of bytes by enlarging it.
public static AlignSize ( int sz, int n ) : int
sz int
n int
return int
        public static int AlignSize(int sz, int n)
        {
            bool assert = ((n & (n - 1)) == 0); // n is a power of 2
            if(!assert)
                throw new ArgumentException();
            return (sz + n - 1) & -n;
        }
Cv2