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