0

renamed uppertile to compositetile (makes more sense)

This reverts commit d4c6e40d59, and
re-applies it with a renamed uppertile.
This commit is contained in:
Aaron Griffith
2011-12-12 15:15:36 -05:00
parent 4b622b1333
commit cc95799d1a
2 changed files with 14 additions and 14 deletions

View File

@@ -270,7 +270,7 @@ class QuadtreeGen(object):
return chunklist
def get_uppertiles(self,zoom):
def get_compositetiles(self,zoom):
"""Returns the inner tiles at the given zoom level that need to be rendered
"""
@@ -282,7 +282,7 @@ class QuadtreeGen(object):
yield [self,tilepath, name]
def render_uppertile(self, dest, name):
def render_compositetile(self, dest, name):
"""
Renders a tile at os.path.join(dest, name)+".ext" by taking tiles from
os.path.join(dest, name, "{0,1,2,3}.png")
@@ -337,7 +337,7 @@ class QuadtreeGen(object):
# quit now if we don't need rerender
if not needs_rerender:
return
#logging.debug("writing out uppertile {0}".format(imgpath))
#logging.debug("writing out compositetile {0}".format(imgpath))
# Create the actual image now
img = Image.new("RGBA", (384, 384), self.bgcolor)
@@ -825,7 +825,7 @@ class Tile(object):
"""A simple container class that represents a single render-tile.
A render-tile is a tile that is rendered, not a tile composed of other
tiles (upper-tile).
tiles (composite-tile).
"""
__slots__ = ("col", "row", "path")

View File

@@ -353,13 +353,13 @@ class RenderNode(object):
self.print_statusline(0, total, level, True)
# Same deal as above. _apply_render_uppertile adds tiles in batch
# Same deal as above. _apply_render_compositetile adds tiles in batch
# to the worker pool and yields result objects that return the
# number of tiles rendered.
#
# XXX Some quadtrees may not have tiles at this zoom level if we're
# not assuming they all have the same depth!!
for result in self._apply_render_uppertile(pool, zoom,batch_size):
for result in self._apply_render_compositetile(pool, zoom,batch_size):
results.append(result)
# every second drain some of the queue
timestamp2 = time.time()
@@ -389,7 +389,7 @@ class RenderNode(object):
# Do the final one right here:
for q in quadtrees:
q.render_uppertile(os.path.join(q.destdir, q.tiledir), "base")
q.render_compositetile(os.path.join(q.destdir, q.tiledir), "base")
def _get_dirty_tiles(self, procs):
"""Returns two items:
@@ -489,8 +489,8 @@ class RenderNode(object):
if len(batch):
yield pool.apply_async(func=render_worldtile_batch, args= [batch])
def _apply_render_uppertile(self, pool, zoom,batch_size):
"""Same as _apply_render_worltiles but for the uppertile routine.
def _apply_render_compositetile(self, pool, zoom,batch_size):
"""Same as _apply_render_worltiles but for the compositetile routine.
Returns an iterator that yields result objects from tasks that have
been applied to the pool.
"""
@@ -500,7 +500,7 @@ class RenderNode(object):
batch = []
jobcount = 0
# roundrobin add tiles to a batch job (thus they should all roughly work on similar chunks)
iterables = [q.get_uppertiles(zoom) for q in self.quadtrees if zoom <= q.p]
iterables = [q.get_compositetiles(zoom) for q in self.quadtrees if zoom <= q.p]
for job in util.roundrobin(iterables):
# fixup so the worker knows which quadtree this is
job[0] = job[0]._render_index
@@ -509,11 +509,11 @@ class RenderNode(object):
jobcount += 1
if jobcount >= batch_size:
jobcount = 0
yield pool.apply_async(func=render_uppertile_batch, args= [batch])
yield pool.apply_async(func=render_compositetile_batch, args= [batch])
batch = []
if jobcount > 0:
yield pool.apply_async(func=render_uppertile_batch, args= [batch])
yield pool.apply_async(func=render_compositetile_batch, args= [batch])
########################################################################################
@@ -542,7 +542,7 @@ def render_worldtile_batch(batch):
return count
@catch_keyboardinterrupt
def render_uppertile_batch(batch):
def render_compositetile_batch(batch):
global child_rendernode
rendernode = child_rendernode
count = 0
@@ -551,7 +551,7 @@ def render_uppertile_batch(batch):
count += 1
quadtree = rendernode.quadtrees[job[0]]
dest = quadtree.full_tiledir+os.sep+job[1]
quadtree.render_uppertile(dest=dest,name=job[2])
quadtree.render_compositetile(dest=dest,name=job[2])
return count
@catch_keyboardinterrupt