def translate_image(self, dest_parent, source_obj): image = source_obj.handler.get_display_image(self.sk2_doc.cms) m11, m12, m21, m22, v1, v2 = source_obj.trafo v1 += self.dx v2 += self.dy trafo = model.Trafo(m11, m12, m21, m22, v1, v2) dest_image = model.SK1Image(trafo, id(image), image) return dest_image
def translate_image(self, dest_parent, source_obj): image_stream = StringIO() if source_obj.colorspace == uc2const.IMAGE_CMYK: image_stream.write(source_obj.bitmap) else: if source_obj.cache_cdata is None: libimg.update_image(self.sk2_doc.cms, source_obj) source_obj.cache_cdata.write_to_png(image_stream) image_stream.seek(0) image = Image.open(image_stream) image.load() m11, m12, m21, m22, v1, v2 = source_obj.trafo v1 += self.dx v2 += self.dy trafo = model.Trafo(m11, m12, m21, m22, v1, v2) dest_image = model.SK1Image(trafo, id(image), image) return dest_image