Remove SAMPLE from the Makefile, only define it in sample.h.

Add a macro that allows setting a CMS format as being the same as SAMPLE.
Move some common code for rescaling images.

We have to create the same two 1D kernels no matter which is applied first.
Don't check if image row data is allocated on every call to row() or at().

Make check_rowdata_alloc() public and call it once for every row before writing to an image. Assume that all 'source' images are already allocated.
Make row() and at() template methods that change their return type since they're not always storing 8-bit data.
Add an at(x,y,c) template method for accessing a specific component of a pixel.
Further split out the convolution template methods by number of channels.

This hopefully allows the compiler to perform some optimisations on each version of the template methods.
This will also allow specialised versions of these template methods to be written, using vector intrinsics.
Mark the row() and at() methods const.
Use an intermediate template function to avoid the huge nested switch statement in transfer_alpha().
Some small optimisations.