public bool Equals(BitmapPixel operand) { if (operand == null) { return(false); } return((A == operand.A) && (R == operand.R) && (G == operand.G) && (B == operand.B)); }
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); }
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)); }
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; }
/// <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; } } }
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; } } }