renamed uppertile to compositetile (makes more sense)
This reverts commit d4c6e40d59, and
re-applies it with a renamed uppertile.
This commit is contained in:
@@ -270,7 +270,7 @@ class QuadtreeGen(object):
|
|||||||
|
|
||||||
return chunklist
|
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
|
"""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]
|
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
|
Renders a tile at os.path.join(dest, name)+".ext" by taking tiles from
|
||||||
os.path.join(dest, name, "{0,1,2,3}.png")
|
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
|
# quit now if we don't need rerender
|
||||||
if not needs_rerender:
|
if not needs_rerender:
|
||||||
return
|
return
|
||||||
#logging.debug("writing out uppertile {0}".format(imgpath))
|
#logging.debug("writing out compositetile {0}".format(imgpath))
|
||||||
|
|
||||||
# Create the actual image now
|
# Create the actual image now
|
||||||
img = Image.new("RGBA", (384, 384), self.bgcolor)
|
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 simple container class that represents a single render-tile.
|
||||||
|
|
||||||
A render-tile is a tile that is rendered, not a tile composed of other
|
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")
|
__slots__ = ("col", "row", "path")
|
||||||
|
|||||||
@@ -353,13 +353,13 @@ class RenderNode(object):
|
|||||||
|
|
||||||
self.print_statusline(0, total, level, True)
|
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
|
# to the worker pool and yields result objects that return the
|
||||||
# number of tiles rendered.
|
# number of tiles rendered.
|
||||||
#
|
#
|
||||||
# XXX Some quadtrees may not have tiles at this zoom level if we're
|
# XXX Some quadtrees may not have tiles at this zoom level if we're
|
||||||
# not assuming they all have the same depth!!
|
# 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)
|
results.append(result)
|
||||||
# every second drain some of the queue
|
# every second drain some of the queue
|
||||||
timestamp2 = time.time()
|
timestamp2 = time.time()
|
||||||
@@ -389,7 +389,7 @@ class RenderNode(object):
|
|||||||
|
|
||||||
# Do the final one right here:
|
# Do the final one right here:
|
||||||
for q in quadtrees:
|
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):
|
def _get_dirty_tiles(self, procs):
|
||||||
"""Returns two items:
|
"""Returns two items:
|
||||||
@@ -489,8 +489,8 @@ class RenderNode(object):
|
|||||||
if len(batch):
|
if len(batch):
|
||||||
yield pool.apply_async(func=render_worldtile_batch, args= [batch])
|
yield pool.apply_async(func=render_worldtile_batch, args= [batch])
|
||||||
|
|
||||||
def _apply_render_uppertile(self, pool, zoom,batch_size):
|
def _apply_render_compositetile(self, pool, zoom,batch_size):
|
||||||
"""Same as _apply_render_worltiles but for the uppertile routine.
|
"""Same as _apply_render_worltiles but for the compositetile routine.
|
||||||
Returns an iterator that yields result objects from tasks that have
|
Returns an iterator that yields result objects from tasks that have
|
||||||
been applied to the pool.
|
been applied to the pool.
|
||||||
"""
|
"""
|
||||||
@@ -500,7 +500,7 @@ class RenderNode(object):
|
|||||||
batch = []
|
batch = []
|
||||||
jobcount = 0
|
jobcount = 0
|
||||||
# roundrobin add tiles to a batch job (thus they should all roughly work on similar chunks)
|
# 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):
|
for job in util.roundrobin(iterables):
|
||||||
# fixup so the worker knows which quadtree this is
|
# fixup so the worker knows which quadtree this is
|
||||||
job[0] = job[0]._render_index
|
job[0] = job[0]._render_index
|
||||||
@@ -509,11 +509,11 @@ class RenderNode(object):
|
|||||||
jobcount += 1
|
jobcount += 1
|
||||||
if jobcount >= batch_size:
|
if jobcount >= batch_size:
|
||||||
jobcount = 0
|
jobcount = 0
|
||||||
yield pool.apply_async(func=render_uppertile_batch, args= [batch])
|
yield pool.apply_async(func=render_compositetile_batch, args= [batch])
|
||||||
batch = []
|
batch = []
|
||||||
|
|
||||||
if jobcount > 0:
|
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
|
return count
|
||||||
|
|
||||||
@catch_keyboardinterrupt
|
@catch_keyboardinterrupt
|
||||||
def render_uppertile_batch(batch):
|
def render_compositetile_batch(batch):
|
||||||
global child_rendernode
|
global child_rendernode
|
||||||
rendernode = child_rendernode
|
rendernode = child_rendernode
|
||||||
count = 0
|
count = 0
|
||||||
@@ -551,7 +551,7 @@ def render_uppertile_batch(batch):
|
|||||||
count += 1
|
count += 1
|
||||||
quadtree = rendernode.quadtrees[job[0]]
|
quadtree = rendernode.quadtrees[job[0]]
|
||||||
dest = quadtree.full_tiledir+os.sep+job[1]
|
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
|
return count
|
||||||
|
|
||||||
@catch_keyboardinterrupt
|
@catch_keyboardinterrupt
|
||||||
|
|||||||
Reference in New Issue
Block a user