Exemple #1
0
 public function testRectangularSetRegion()
 {
     $matrix = new BitMatrix(320, 240);
     $this->assertEquals(320, $matrix->getWidth());
     $this->assertEquals(240, $matrix->getHeight());
     $matrix->setRegion(105, 22, 80, 12);
     for ($y = 0; $y < 240; $y++) {
         for ($x = 0; $x < 320; $x++) {
             $this->assertEquals($y >= 22 && $y < 34 && $x >= 105 && $x < 185, $matrix->get($x, $y));
         }
     }
 }