Esempio n. 1
0
 public void LogSize(Size pixelCount, BinaryWriter binWrite, TextWriter tw, string name)
 {
     binWrite.Write(pixelCount.Width);
     tw.WriteLine("{0} Width: {1}", name, pixelCount.Width);
     binWrite.Write(pixelCount.Height);
     tw.WriteLine("{0} Height: {1}", name, pixelCount.Height);
 }
Esempio n. 2
0
        public BlockMap(Size pixelSize, int maxBlockSize)
        {
            PixelCount = pixelSize;
            BlockCount = new Size(
                Calc.DivRoundUp(PixelCount.Width, maxBlockSize),
                Calc.DivRoundUp(PixelCount.Height, maxBlockSize));
            CornerCount = BlockToCornerCount(BlockCount);

            AllBlocks = new RectangleC(BlockCount);
            AllCorners = new RectangleC(CornerCount);

            Corners = InitCorners();
            BlockAreas = new RectangleGrid(Corners);
            BlockCenters = InitBlockCenters();
            CornerAreas = InitCornerAreas();
        }
Esempio n. 3
0
 public BinaryMap(Size size)
     : this(size.Width, size.Height)
 {
 }
Esempio n. 4
0
 static Size CornerToBlockCount(Size CornerCount)
 {
     return new Size(CornerCount.Width - 1, CornerCount.Height - 1);
 }
Esempio n. 5
0
 static Size BlockToCornerCount(Size BlockCount)
 {
     return new Size(BlockCount.Width + 1, BlockCount.Height + 1);
 }
Esempio n. 6
0
 public PointGrid(Size size)
 {
     AllX = new int[size.Width];
     AllY = new int[size.Height];
 }
Esempio n. 7
0
 public void LogSize(Size pixelCount, BinaryWriter binWrite, TextWriter tw, string name)
 {
     binWrite.Write(pixelCount.Width);
     tw.WriteLine("{0} Width: {1}", name, pixelCount.Width);
     binWrite.Write(pixelCount.Height);
     tw.WriteLine("{0} Height: {1}", name, pixelCount.Height);
 }