Skip to content

Commit

Permalink
Fixed typo + integer array sizes because Numpy threatens to deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeKamentsky committed Jul 29, 2016
1 parent 6ac8a45 commit 8818d78
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rh_renderer/multiple_tiles_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ def crop(self, from_x, from_y, to_x, to_y):
elif self.blend_type == 1: # Averaging
# Do the calculation on a uint16 image (for overlapping areas), and convert to uint8 at the end
res = np.zeros(
(round(to_y + 1 - from_y), round(to_x + 1 - from_x)),
(int(round(to_y + 1 - from_y)),
int(round(to_x + 1 - from_x))),
np.float32)
res_mask = np.zeros(
(round(to_y + 1 - from_y), round(to_x + 1 - from_x)),
(int(round(to_y + 1 - from_y)), int(round(to_x + 1 - from_x))),
np.float32)

# render only relevant parts, and stitch them together
Expand All @@ -83,7 +84,7 @@ def crop(self, from_x, from_y, to_x, to_y):
t_mask, _, _ = AlphaTileRenderer(t).crop(
from_x, from_y, to_x, to_y)
res[t_start_point[1] - from_y: t_img.shape[0] + (t_start_point[1] - from_y),
t_start_point[0] - from_x: t_img.shape[1] + (t_start_point[0] - from_x)] += t_img.astype(res.type)
t_start_point[0] - from_x: t_img.shape[1] + (t_start_point[0] - from_x)] += t_img.astype(res.dtype)
res_mask[t_start_point[1] - from_y: t_img.shape[0] + (t_start_point[1] - from_y),
t_start_point[0] - from_x: t_img.shape[1] + (t_start_point[0] - from_x)] += t_mask

Expand Down

0 comments on commit 8818d78

Please sign in to comment.