ImageEngine/gaffer — pull request #833 by goddardl (2014-05-10 02:30:05+00:00)
Title: GafferImage.Scale node and GafferImage.Reformat refactor.

This pull request adds a new node to GafferImage which scales an image by an arbitrary amount. This was done to address a \todo within the Reformat node to re-implement it with atomic operations.

The end goal here is to replace the guts of both the Reformat and ImageTransform nodes with it and lay the groundwork for a fast Blur node.

In order for the Reformat node to use the output of the scale node, it needs to shift the scaled channel data to compensate for a new format that has an origin that is different to the input one. The reason for this is because the image tiles are all aligned to a grid that has it's origin at 0x0 and so, if the input and output format do not have the same origin, the scaled result has to be offset for the new tiles to match the grid. In the case that the formats do share the same origin, the hash ensures that no extra work is done.

Before anyone pulls this request, does it make sense for me to break out this functionality into a separate Position node which is capable of shifting the image horizontally and vertically? I can't work out if that is overkill or not...