Ejemplo n.º 1
0
        public bool Equals(BitmapPixel operand)
        {
            if (operand == null)
            {
                return(false);
            }

            return((A == operand.A) && (R == operand.R) && (G == operand.G) && (B == operand.B));
        }
Ejemplo n.º 2
0
        public BitmapDifferenceMask(Bitmap mask)
        {
            // Use default to color for ignored pixels
            differenceMaskColor = Color.Cyan;

            // Set mask size
            differenceMaskSize.Width  = mask.Width;
            differenceMaskSize.Height = mask.Height;

            // Initialize mask of size width x height
            differenceMask = new bool[differenceMaskSize.Width, differenceMaskSize.Height];

            // Fill
            AddMask(mask);
        }
Ejemplo n.º 3
0
        public override bool Equals(Object operand)
        {
            if (operand == null)
            {
                return(false);
            }

            BitmapPixel bitmapPixeloperand = operand as BitmapPixel;

            if ((Object)(bitmapPixeloperand) == null)
            {
                return(false);
            }

            return(Equals(bitmapPixeloperand));
        }
Ejemplo n.º 4
0
        public void SetPixel(int x, int y, BitmapPixel value)
        {
            int pixelOffset = GetPixelOffset(x, y);

            // A component - not all formats have Alpha component
            if (editorSourceOffsetA >= 0)
            {
                editorSourceBytes[pixelOffset + editorSourceOffsetA] = value.A;
            }

            // R component
            editorSourceBytes[pixelOffset + editorSourceOffsetR] = value.R;

            // G component
            editorSourceBytes[pixelOffset + editorSourceOffsetG] = value.G;

            // B component
            editorSourceBytes[pixelOffset + editorSourceOffsetB] = value.B;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// BitmapDifference constructor initializes to state: no pixels are marked as different.
        /// </summary>
        /// <param name="bitmap">Bitmap serving as base image on which differences will be marked.</param>
        public BitmapDifference(Bitmap bitmap)
        {
            differenceColor     = Color.Cyan;
            differenceMaskColor = Color.Cyan;
            differenceBaseImage = new Bitmap(bitmap);
            //differenceMask = new BitmapDifferenceMask(differenceBaseImage.Width, differenceBaseImage.Height);
            differenceMask = new bool[differenceBaseImage.Width, differenceBaseImage.Height];
            //differenceMap = new BitmapDiffereceFlag[differenceBaseImage.Width, differenceBaseImage.Height];
            differenceMap = new bool[differenceBaseImage.Width, differenceBaseImage.Height];

            width  = differenceBaseImage.Width;
            height = differenceBaseImage.Height;

            for (int y = 0; y < height; ++y)
            {
                for (int x = 0; x < width; ++x)
                {
                    // Initial state will say that all pixels are identical
                    differenceMap[x, y] = false;
                }
            }
        }
Ejemplo n.º 6
0
        public BitmapDifferenceMask(int width, int height)
        {
            // Use default to color for ignored pixels
            differenceMaskColor = Color.Cyan;

            // Set mask size
            differenceMaskSize.Width  = width;
            differenceMaskSize.Height = height;

            // Initialize mask of size width x height
            differenceMask = new bool[differenceMaskSize.Width, differenceMaskSize.Height];

            // By default, no pixels will be ignored
            for (int y = 0; y < differenceMaskSize.Height; ++y)
            {
                for (int x = 0; x < differenceMaskSize.Width; ++x)
                {
                    // Initial state will be that all pixels are not masked
                    differenceMask[x, y] = false;
                }
            }
        }