Exemplo n.º 1
0
 def blit_tile_into(self, dst, dst_has_alpha, tx, ty):
     # (used mainly for loading transparent PNGs)
     assert dst_has_alpha is True
     assert dst.dtype == 'uint16', '16 bit dst expected'
     src = self.tile_memory_dict[(tx, ty)]
     assert src.shape[2] == 4, 'alpha required'
     mypaintlib.tile_convert_rgba8_to_rgba16(src, dst)
Exemplo n.º 2
0
 def consume_buf():
     ty = state['ty']-1
     for i in xrange(state['buf'].shape[1]/N):
         tx = x/N + i
         src = state['buf'][:, i*N:(i+1)*N, :]
         if src[:, :, 3].any():
             with self.tile_request(tx, ty, readonly=False) as dst:
                 mypaintlib.tile_convert_rgba8_to_rgba16(src, dst)
Exemplo n.º 3
0
 def consume_buf():
     ty = state['ty'] - 1
     for i in xrange(state['buf'].shape[1] / N):
         tx = x / N + i
         src = state['buf'][:, i * N:(i + 1) * N, :]
         if src[:, :, 3].any():
             with self.tile_request(tx, ty, readonly=False) as dst:
                 mypaintlib.tile_convert_rgba8_to_rgba16(src, dst)
 def consume_buf():
     ty = state['ty']-1
     for i in xrange(state['buf'].shape[1]/N):
         tx = x/N + i
         src = state['buf'][:,i*N:(i+1)*N,:]
         if src[:,:,3].any():
             dst = self.get_tile_memory(tx, ty, readonly=False)
             mypaintlib.tile_convert_rgba8_to_rgba16(src, dst)
Exemplo n.º 5
0
 def consume_buf():
     ty = state['ty']-1
     for i in xrange(state['buf'].shape[1] // N):
         tx = x // N + i
         src = state['buf'][:, i*N:(i+1)*N, :]
         if src[:, :, 3].any():
             with self.tile_request(tx, ty, readonly=False) as dst:
                 mypaintlib.tile_convert_rgba8_to_rgba16(src, dst)
     if state["progress"]:
         try:
             state["progress"].completed(ty - ty0)
         except Exception:
             logger.exception("Progress.completed() failed")
             state["progress"] = None