QTransform m.
img.transformed(m).copy()

will create one copy. But:

QTransform m.
m.rotate(10);
img.transformed(m).copy()

will copy image twice; On embedded device, if you do some video decoding it
is a problem :)

2016-07-11 12:52 GMT+01:00 Giuseppe D'Angelo <dange...@gmail.com>:

> On Mon, Jul 11, 2016 at 1:40 PM, Tomasz Olszak <olszak.tom...@gmail.com>
> wrote:
> > The problem here is that you can't say if transformed returns shallow or
> > deep copy. Result depends on argument value. Of course the transform
> > returning shallow copy on identity matrix is nice but should be
> documented
> > somewhere. After reading docs I expected deep copy like from copy
> function.
> > But maybe it's only me :)
>
> Then always deep copy and then move on with the processing? Because
> relying on shallow copies is a bit of a gamble -- by the same
> reasoning, can you be sure that setPixel(x, y, color) always detaches?
> What if it gets implemented in a way that first checks if the pixel
> already has that color, and if so, it doesn't do anything?
>
> --
> Giuseppe D'Angelo
>
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to