Пример #1
0
def draw_riversmap(world, target):
    sea_color = (255, 255, 255, 255)
    land_color = (0, 0, 0, 255)

    for y in range(world.height):
        for x in range(world.width):
            target.set_pixel(x, y, sea_color if world.is_ocean((x, y)) else land_color)

    draw_rivers_on_image(world, target, factor=1)
Пример #2
0
def draw_riversmap(world, target):
    sea_color = (255, 255, 255, 255)
    land_color = (0, 0, 0, 255)

    for y in range(world.height):#TODO: numpy
        for x in range(world.width):
            if world.ocean[y, x]:
                target.set_pixel(x, y, sea_color)
            else:
                target.set_pixel(x, y, land_color)

    draw_rivers_on_image(world, target, factor=1)
Пример #3
0
def draw_riversmap(world, target):
    sea_color = (255, 255, 255, 255)
    land_color = (0, 0, 0, 255)

    for y in range(world.height):  #TODO: numpy
        for x in range(world.width):
            if world.ocean[y, x]:
                target.set_pixel(x, y, sea_color)
            else:
                target.set_pixel(x, y, land_color)

    draw_rivers_on_image(world, target, factor=1)
Пример #4
0
 def test_draw_rivers_on_image(self):
     target = PixelCollector(self.w.width * 2, self.w.height * 2)
     draw_rivers_on_image(self.w, target, factor=2)
     self._assert_img_equal("rivers_28070_factor2", target)
Пример #5
0
 def test_draw_rivers_on_image(self):
     target = PNGWriter.rgba_from_dimensions(self.w.width * 2, self.w.height * 2)
     draw_rivers_on_image(self.w, target, factor=2)
     self._assert_img_equal("rivers_28070_factor2", target)
 def test_draw_rivers_on_image(self):
     target = PNGWriter.rgba_from_dimensions(self.w.width * 2,
                                             self.w.height * 2)
     draw_rivers_on_image(self.w, target, factor=2)
     self._assert_img_equal("rivers_28070_factor2", target)
 def test_draw_rivers_on_image(self):
     target = PixelCollector(self.w.width * 2, self.w.height * 2)
     draw_rivers_on_image(self.w, target, factor=2)
     self._assert_img_equal("rivers_28070_factor2", target)