mkxp/src
Jonas Kulla 541e24f678 Bitmap: Use more accurate HSV-based hue shift algorithm
The previously YIQ-based algorithm turned out to be both slow,
and horribly inaccurate.

Another algorithm based on rotating the color value in the
RGB cube along the diagonal axis was also considered, which was
acceptable in terms of accuracy, and very fast.

In the end, I decided on a HSV-based one, because it is by far
the most accurate one, while still being a tad faster than the
YIQ solution.
Algorithm source: gamedev.stackexchange.com/a/59808/24839

A very simple GPU time benchmark when shifting a 2048^2 bitmap:

         YIQ rot   RGB rot   HSV shift
radeon   13.4 ms   2.8 ms    11.4 ms
intel    13.0 ms   6.0 ms    10.5 ms

radeon: HD 3650 mobility
intel:  N3540 integrated (Baytrail)

However hue shifting has never shown up as a bottleneck before,
so these are more academic.
2016-10-30 08:50:45 +01:00
..
al-util.h Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
aldatasource.h Load fluidsynth entrypoints dynamically (and make them optional) 2014-09-09 00:08:32 +02:00
alstream.cpp Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
alstream.h Audio: Clean up threading and add AudioStream fadein (RGSS3) 2014-09-30 09:13:12 +02:00
audio.cpp Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
audio.h Pause RGSS execution when moving into background on Android 2015-01-15 08:02:21 +01:00
audiostream.cpp Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
audiostream.h AudioStream: Clarify thread-safe usage of stream flags 2015-03-22 08:42:43 +01:00
autotiles.cpp Tilemap(VX): Factor out common code into tilemap-common.h 2014-11-30 17:46:28 +01:00
autotilesvx.cpp TileAtlasVX: Handle table autotiles properly 2014-08-19 19:47:22 +02:00
binding.h Implement F12 game reset (MRI only) 2014-09-26 06:25:47 +02:00
bitmap.cpp Bitmap: Use more accurate HSV-based hue shift algorithm 2016-10-30 08:50:45 +01:00
bitmap.h Pass value object attributes by reference (instead of pointer) 2014-10-25 23:33:41 +02:00
boost-hash.h BoostSet: Add 'remove' and rename BoostHash::erase to remove 2014-09-05 01:06:08 +02:00
bundledfont.cpp Don't use relative paths when #including xxd output 2014-11-30 17:50:24 +01:00
config.cpp Config: Enable smoothScaling by default 2015-07-21 12:13:24 +02:00
config.h Remove some stuff that was accidentally committed 2015-07-21 12:13:24 +02:00
debugwriter.h Debug: Use native logging on Android 2014-12-31 18:52:20 +01:00
disposable.h Implement F12 game reset (MRI only) 2014-09-26 06:25:47 +02:00
etc-internal.h TilemapVX: Clean up the horrible map viewport calculation code 2015-07-21 12:13:24 +02:00
etc.cpp Serializable, Table: Some general cleanups 2014-11-20 14:45:54 +01:00
etc.h Minor cleanup 2014-10-25 23:38:19 +02:00
eventthread.cpp EventThread: ifdef out broken SDL function on OSX 2016-02-24 17:55:28 +01:00
eventthread.h Pause RGSS execution when moving into background on Android 2015-01-15 08:02:21 +01:00
exception.h Spacing 2014-01-15 00:48:34 +01:00
filesystem.cpp FileSystem: Fix file lookup if unrelated files with same name exist 2015-07-09 15:38:50 +02:00
filesystem.h FileSystem: Fix file lookup if unrelated files with same name exist 2015-07-09 15:38:50 +02:00
flashable.h Sprite: Implement wave effect (RGSS2) 2014-02-03 15:32:50 +01:00
fluid-fun.cpp Android uses the Linux shared object naming convention 2014-12-31 18:52:21 +01:00
fluid-fun.h Reorder some lines 2014-10-20 10:20:08 +02:00
font.cpp Font/MRI: Improve handling of (default_)name attributes 2016-01-05 08:47:52 +01:00
font.h Font/MRI: Improve handling of (default_)name attributes 2016-01-05 08:47:52 +01:00
gl-debug.cpp Rename src/debuglogger -> src/gl-debug 2014-11-29 17:51:37 +01:00
gl-debug.h Rename src/debuglogger -> src/gl-debug 2014-11-29 17:51:37 +01:00
gl-fun.cpp Use compile time strlen 2014-12-31 18:52:20 +01:00
gl-fun.h Call glReleaseShaderCompiler on GLES 2014-12-31 18:52:20 +01:00
gl-meta.cpp GLMeta: Eliminate redundant parameter 2015-07-07 15:25:48 +02:00
gl-meta.h GLMeta: Eliminate redundant parameter 2015-07-07 15:25:48 +02:00
gl-util.h gl-util.h: Unify function qualifier use 2014-12-31 18:52:21 +01:00
global-ibo.h Use safe way to get at a vector's data pointer 2014-10-09 19:02:29 +02:00
glstate.cpp GLState: Constify 2014-12-31 18:52:21 +01:00
glstate.h GLState: Constify 2014-12-31 18:52:21 +01:00
graphics.cpp Graphics: Stub out play_movie 2015-10-30 08:01:36 -07:00
graphics.h Graphics: Stub out play_movie 2015-10-30 08:01:36 -07:00
input.cpp Added support for JHat events. 2014-12-31 16:39:28 +01:00
input.h Introduce F1 menu to reconfigure key bindings at runtime 2014-10-11 20:48:44 +02:00
intrulist.h Implement F12 game reset (MRI only) 2014-09-26 06:25:47 +02:00
keybindings.cpp Added support for JHat events. 2014-12-31 16:39:28 +01:00
keybindings.h Added support for JHat events. 2014-12-31 16:39:28 +01:00
main.cpp SDL hints need to be set before initialization 2015-02-10 15:51:33 +01:00
midisource.cpp Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
plane.cpp Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
plane.h Pass value object attributes by reference (instead of pointer) 2014-10-25 23:33:41 +02:00
quad.h quad.h: Cleanup static functions to use templated Vertex parameter 2014-08-12 21:41:59 +02:00
quadarray.h Use safe way to get at a vector's data pointer 2014-10-09 19:02:29 +02:00
rgssad.cpp Constify 2015-07-09 14:53:59 +02:00
rgssad.h RGSSAD: Add RGSS3 archive reader 2014-07-24 02:45:20 +02:00
scene.cpp Use more explicit vector math via method overloads 2015-02-10 17:04:00 +01:00
scene.h Constify 2015-07-07 16:06:45 +02:00
sdl-util.h Add some general fixes from #111 found by @chosenofbear 2015-06-18 07:21:55 +02:00
sdlsoundsource.cpp Audio: Add MIDI format playback support 2014-08-02 06:42:55 +02:00
serial-util.h Serializable, Table: Some general cleanups 2014-11-20 14:45:54 +01:00
serializable.h Remove Serializable's virtual destructor. It didn't do anything anyway. 2013-09-27 04:39:35 +02:00
settingsmenu.cpp Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
settingsmenu.h Introduce F1 menu to reconfigure key bindings at runtime 2014-10-11 20:48:44 +02:00
shader.cpp Bitmap: Use more accurate HSV-based hue shift algorithm 2016-10-30 08:50:45 +01:00
shader.h Bitmap: Use more accurate HSV-based hue shift algorithm 2016-10-30 08:50:45 +01:00
sharedmidistate.h Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
sharedstate.cpp Font/MRI: Improve handling of (default_)name attributes 2016-01-05 08:47:52 +01:00
sharedstate.h Implement F12 game reset (MRI only) 2014-09-26 06:25:47 +02:00
soundemitter.cpp Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
soundemitter.h SoundEmitter: Make SE source count configurable 2014-08-25 05:34:19 +02:00
sprite.cpp Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
sprite.h Pass value object attributes by reference (instead of pointer) 2014-10-25 23:33:41 +02:00
table.cpp Serializable, Table: Some general cleanups 2014-11-20 14:45:54 +01:00
table.h Serializable, Table: Some general cleanups 2014-11-20 14:45:54 +01:00
texpool.cpp Exception: Constructor now takes printf style arguments 2013-12-29 18:05:11 +01:00
texpool.h Rename 'Tex' to 'TEX' for consistency 2013-09-06 12:26:41 +02:00
tileatlas.cpp TileAtlas: Fix broken atlas generation 2014-07-10 21:48:33 +02:00
tileatlas.h Rename typedef and fix wrong documenting comment 2014-01-16 19:16:09 +01:00
tileatlasvx.cpp Use static lifetime for constant array 2015-07-21 12:13:25 +02:00
tileatlasvx.h TileAtlasVX: Handle table autotiles properly 2014-08-19 19:47:22 +02:00
tilemap-common.h Tilemap: Fix map viewport calculation 2015-07-21 12:13:25 +02:00
tilemap.cpp Tilemap: Fix map viewport calculation 2015-07-21 12:13:25 +02:00
tilemap.h Tilemap/VX: Ensure proxy objects don't outlive their parents 2014-09-26 18:21:50 +02:00
tilemapvx.cpp TilemapVX: Ensure legs of out-of-view table tiles are drawn 2015-07-21 12:13:25 +02:00
tilemapvx.h Tilemap/VX: Ensure proxy objects don't outlive their parents 2014-09-26 18:21:50 +02:00
tilequad.cpp Cosmetic changes 2013-09-21 14:45:27 +02:00
tilequad.h Spacing/spelling 2014-05-07 17:52:11 +02:00
transform.h Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
util.h Use fopen with binary mode everywhere (for Windows compat) 2014-11-17 07:18:39 +01:00
vertex.cpp Use macro from util.h for static array size 2014-07-23 21:26:44 +02:00
vertex.h GLMeta: Add vertex array object support 2014-07-13 14:05:12 +02:00
viewport.cpp Use more explicit vector math via method overloads 2015-02-10 17:04:00 +01:00
viewport.h Pass value object attributes by reference (instead of pointer) 2014-10-25 23:33:41 +02:00
vorbissource.cpp Add some general fixes from #111 found by @chosenofbear 2015-06-18 07:21:55 +02:00
window.cpp Unify float literals to use f suffix and avoid double promotions 2015-07-21 12:13:24 +02:00
window.h Pass value object attributes by reference (instead of pointer) 2014-10-25 23:33:41 +02:00
windowvx.cpp WindowVX: Fix move() not setting the correct dirty flags 2016-07-27 12:03:45 +02:00
windowvx.h Pass value object attributes by reference (instead of pointer) 2014-10-25 23:33:41 +02:00