Fix broken UTF-8 characters in the PNGreader callback class file.
Check the 'premult_alpha' flag on image formats before (un-)-pre-multiplying with the alpha, and set/unset it when done.
Update to build against YAML-CPP 0.5.

There was a major API change from 0.3.
Mark alpha as premultiplied when PNG and WebP images.
Small fixes to handling of formats and the pre-multiplied alpha flag.

If we're doing a colour transform before multiplying the alpha, we don't use the full destination 'format'. The new Format::copy_with_other_channels() method maked this a little cleaner.
Simplify Image::un_alpha_mult().

Since destination is always the SAMPLE type.
YAML-CPP does have a conversion from bool.

I thought I might need to make a converter for bool, so I left this bit of code commented out.
Woops, uncomment and update code I had left "for later".
We only have to fiddle with the destination format if there is a non-pre-multiplied alpha channel.
Check for out-of-bounds values when multiplying the alpha channel.

Some other tweaks.
Allow JP2 to save from packed images.

This is to allow images with alpha to be saved as a flattened JP2 file.
For now, don't 'prefer' planar image formats.
Handle alpha multiplication in Image::transform_colour{_inplace}().

Have all of the format writers specify wether they 'prefer' premultiplied alpha. (all do, except TIFF, which can handle either)
Also do away with the horribly named Format::copy_with_other_channels().
Also un-multiply alpha in Image::transform_colour{_inplace}().
LCMS2 supports up to 15 channels of image data with the 'MCH15' colour space/model, so we should too.
Rename the maxval<>() template function to "scaleval".

scaleval<>() returns the largest value that should be used for colour and alpha values. It is not necessarily the largest value the type can represent.
Also rename the maxval<>() method in CMS::Format.

Nothing uses it (yet), so only this header is affected.
Fixes and modifications to Kernel2D.

Make a second-level template method for doing the convolution based on the number of channels.
Do the calculations in floating-point and check for out-of-bound values.
Add limitval() template function for limiting a value while converting to another type.

This is better than using scaleval() because we don't need to limit floatin point values, only integers.
Fixes processing of images with alpha.
Use limitval() in Kernel classes. Use floating-point intermediates in Kernel1Dvar.
Harden the compiled code.

Using compiler and linker flags from https://wiki.debian.org/Hardening