コード例 #1
0
        public override bool Equals(object obj)
        {
            Block block = obj as Block;

            //block.height = height;
            //block.width = width;
            if (block.Position.X + Width >= AVQ.workImage.Width || block.Position.Y + Height >= AVQ.workImage.Height)
            {
                return(false);
            }


            int blocksDiffedences = AVQ.CompareBlocks(this, block);

            //if (blocksDiffedences == 0)
            //    goto label;


            if (blocksDiffedences > AVQ.Threshold)
            {
                goto label;
            }


            //for (int i = 0; i < Width; i++)
            //{
            //    for (int j = 0; j < Height; j++)
            //    {
            //        if (AVQ.ComparePx(Position.X + i, Position.Y + j, block.Position.X + i, block.Position.Y + j) == false) /* De facut clasa image? */
            //        {
            //            goto label;
            //        }
            //    }
            //}


            //Console.WriteLine(Index + " " + block.Index + " --");
            //AVQ.printBlock(this);
            //AVQ.printBlock(block);

            if (block.Height == 0 && block.Width == 0)
            {
                return(true);
            }

            if (Width == block.Width && Height == block.Height)
            {
                return(true);
            }


            label : return(false);
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            Block block = obj as Block;

            if (block.Position.X + Width >= AVQ.workImage.Width || block.Position.Y + Height >= AVQ.workImage.Height)
            {
                return(false);
            }

            if (!(block.Height == 0 && block.Width == 0) && !(Width == block.Width && Height == block.Height))
            {
                return(false);
            }

            if (AVQ.CompareBlocks(this, block) > AVQ.Threshold)
            {
                return(false);
            }

            return(true);
        }
コード例 #3
0
 public override int GetHashCode()
 {
     return(AVQ.getPx(Position));
 }