Exemplo 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);
 }
Exemplo 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();
        }
Exemplo n.º 3
0
 public BinaryMap(Size size)
     : this(size.Width, size.Height)
 {
 }
Exemplo n.º 4
0
 static Size CornerToBlockCount(Size CornerCount)
 {
     return new Size(CornerCount.Width - 1, CornerCount.Height - 1);
 }
Exemplo n.º 5
0
 static Size BlockToCornerCount(Size BlockCount)
 {
     return new Size(BlockCount.Width + 1, BlockCount.Height + 1);
 }
Exemplo n.º 6
0
 public PointGrid(Size size)
 {
     AllX = new int[size.Width];
     AllY = new int[size.Height];
 }
Exemplo 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);
 }