public Img8(Img24 img)
 {
     cols = img.GetCols();
     rows = img.GetRows();
     data = new byte[cols * rows];
     DataRgbToGrayscale(img.GetData(), data);
 }
Exemple #2
0
        public bool EqualsTo(Img24 img)
        {
            if (cols != img.cols || rows != img.rows)
            {
                return(false);
            }

            int len = rows * cols * pixelLength;

            for (int i = 0; i < len; i += pixelLength)
            {
                if (data[i] != img.data[i] || data[i + 1] != img.data[i + 1] || data[i + 2] != img.data[i + 2])
                {
                    return(false);
                }
            }
            return(true);
        }
Exemple #3
0
 public Img24(Img24 img)
 {
     rows = img.rows;
     cols = img.cols;
     data = img.CopyData();
 }