Experimental right-alignment for hover layer tools

This is not necessarily a permanent commit, but one I'm going to try for
a few days to see how I like it.  One of the problems with PD's current
"hover options" on the Layer box is that they can easily be accidentally
hit when rapidly clicking from the canvas to the layer menu.

To prevent this, I'm considering right-aligning the hover menu.  This
provides a few benefits: it provides more empty clickable space on the
left-side of the layer toolbox (the side nearest the image canvas),
preventing accidental clicks.  It also makes the "visibility" toggle
adhere better to Fitt's Law, by sticking it on the far right-side of the
layers panel.

That said, the new arrangement looks funny to me, but it could just be
because I'm accustomed to the old alignment.  Will revisit in a few days
after having time to test it.
Re-merge missing high-DPI fixes

No idea what happened here; it's like a sync on my Win 7 PC failed
halfway through, because only half of my high-DPI commit is showing up
in my primary Win7 PC!  Damn GitHub for Windows...
Merge pull request #124 from audioglider/master

Added additional blend modes.  Many thanks to audioglider for his excellent help!
Change case of blend mode names to match PD convention
Force the blend mode dropdown to display the full list of modes

In an ideal world, we'd simply display separators between the various
layer mode groups.  But that requires a fully owner-drawn combo box,
which is a huge project, and not something I want to spend time on right
now.

In the meantime, this will at least allow users to see the full list of
blend modes without manual scrolling.

(FYI: I don't think this technique works on XP.)
Fix memory leak in Image -> Rotate Arbitrary
Display mousewheel hint on invalid use

For reasons I don't understand, random users keep asking me why
PhotoDemon doesn't support the mousewheel for zooming.  There must be
photo editors out there that don't adhere to the standard Ctrl + Wheel
convention for zooming???

To that end, if the user uses the mousewheel when the current image is
not scrollable, a message will appear that describes PD's mousewheel
conventions.

I debated allowing the mousewheel to control zoom if no scroll bars are
active, but the inconsistency that introduces would probably just make
the matter worse...
Improve contribution notes
Refactor a bunch of selection tool code

Not glamorous work, but it needed to be done.  The goal is to slowly
unify most tool handling under a few core functions; this is a step in
that direction.
Initial implementation of non-destructive on-canvas layer resizing

Wrapping my head around this whole non-destructive concept has proven
incredibly difficult.  There are *so many* interactions to deal with
here, and catering to them all is a big mess.

That said, this initial commit works pretty damn well, and the code is
surprisingly light and clean, all things considered.  A few items left
for me to resolve include:

1) Bounds checking to make sure the user doesn't try to resize a layer
to negative width/height.  (It would be nice if that just
flipped/mirrored the image, but our resize functions don't work that
way, and it's a lot of work to change them - so at least at first, such
actions will simply be disallowed.)

2) Interaction with selections.  I don't think I can handle the math
necessary to keep the non-destructive behavior working with selections.
What does this mean?  Basically, when the user applies an action to a
resized layer *while a selection is active*, it will commit the current
layer size permanently.  This is on my to-do list.

3) Any other actions that require "committing" a resized layer, such as
image-level changes (resize, rotate, etc), need to be handled properly.

4) Tons of testing and debugging.
Uncomment important compositor code

I commented some stuff while debugging the compositor and forgot to
uncomment it when done - oops!
Prevent the user from resizing layers into oblivion

They must be at least 1px by 1px; this is now properly enforced.
Add additional canvas transform checks to the MergeLayer function
Make on-canvas layer transforms permanent when necessary

For the most part, PD's on-canvas layer transforms (e.g. resizing) are
non-destructive.  This means that you can resize a layer as much as you
want, without actually affecting the original layer contents.  This even
extends to applying adjustments - applying adjustments to a transformed
layer will result in an application to the *original* data, not the
transformed data, for true non-destructiveness!

However, under some circumstances, it is necessary to make any
transforms permanent, in order to assure correct behavior of other
transforms.  For example - before arbitrarily rotating an image, any
layer transforms must be made permanent; otherwise, the rotation will
only apply to the original layer data, and because cartesian coordinate
transforms are not associative (e.g. resize -> rotate does not produce
the same result as rotate -> resize), the resulting image will be
incorrect.

The same goes for selections.  When a selection is created over the top
of a layer with non-destructive transforms active, any actions applied
to that selection can't be applied to the original layer data (because
it's not representative of the selection the user sees on the screen).
Thus, we must make the on-canvas transforms permanent, to ensure proper
treatment of the selected area.

I have tried to be careful about when non-destructive transforms must be
made permanent.  As a result, all Adjustments and Effects do not require
a permanent application of non-destructive layer transforms - UNLESS a
selection is active, in which case, any transforms will be made
permanent.  This is perhaps not ideal, because per-pixel area transforms
like "blur" or "sharpen" might better be performed on the transformed
data rather than the original (to ensure the user gets what they want),
but I'm not sure how best to deal with that, so I'm erring on the side
of "maintain non-destructiveness as much as possible".

(This commit description probably makes no sense, but hey - I tried.
This shit is complicated!  :p)
Add blend modes: Hue, Saturation, Color, Luminosity

This should complete the list of all desirable blend modes.  Woohoo!

Also included in this commit is a super-fast RGB to HSV transform,
courtesy of http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv.  Many
thanks to "sam" for his great optimizations.

Still to-do (possibly with help from @audioglider): figure out which
transforms need bounds checking (e.g. "if r > 1 then r = 1") and which
do not.  Most the blend modes do not need these checks, which provides a
minor but welcome speed boost.  I plan to use
http://www.pegtop.net/delphi/articles/blendmodes/ as my reference for
this, but additional testing would be welcome, "just to be safe".
Further optimize blend mode math

- Only perform under/overflow checks when explicitly required by a blend
mode.

- Avoid costly alpha blend step if top layer is opaque (alpha = 255)

- Fix Divide blend mode to use 1 if denominator is 0. (Technically, the
new value is undefined, but it should tend toward infinity instead of 0
- this provides identical results to GIMP, and avoids unsightly
per-channel distortion if only some channels are undefined).

- Avoid costly HSL transforms on Color and Luminosity modes for the
layer that's only supplying luminance values.  (Instead, just calculate
luminance directly.)
Fix potential image thumbnail bug

Not sure why this was triggering under GDI+ only (not FreeImage), but it
should be fixed now.
Fix FreeImage JPEG loading quality

Turns out the Fast/Accurate flag *does* make a difference!  PD will now
always require Accurate transforms.
Greatly simplify render pipeline thanks to recent compositor improvements

Because the new getCompositedRect function works so well, I can finally
drop the separate render pipeline branches for zoomed in vs zoomed out
vs 100% zoom.  All viewport rendering now uses the same code, regardless
of zoom level.

(The only remaining difference for zoomed in vs zoomed out viewport
rendering is the interpolation method used; high-quality bicubic
resampling with prefiltering is used when zoomed out, while nearest
neighbor is used when zoomed-in.)
Fix auto-numbering problem when duplicating layers