-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[color addon] Add XYZ, xyY, Lab and LCH color spaces. #716
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit awkward how some of these functions return invalid colors... should we add al_color_is_valid to help validate the resultant colors?
void al_color_xyz_to_rgb(float x, float y, float z, | ||
float *red, float *green, float *blue) | ||
{ | ||
double r = 3.2406 * x + (- 1.5372 * y) + (- 0.4986 * z); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up with the weird space after the negation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You clearly must not like Haskell :P
int cy = (-example.color[ci].b * 511.0 / 2) + 511.0 / 2; | ||
int r = 2; | ||
/* | ||
* 1234561 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah! What's this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to comment this. Basically we loop around the selected color in the center to find the pixels with a certain ciede2000 distance. We start around the center then go 1, 2 to the right. Then we go 1, 2 down. Then 1, 2 left. Then 1, 2 up. Then we jump to a bigger radius and start over with 1, 2, 3, 4 right, 1, 2, 3, 4 down... The diagram shows how exactly :)
* commit 'ff5297c92a6b45d45712e6329f38ff64e1672977': (41 commits) Fix NULL dereference when destroying an unbuilt GLSL shader. [color addon] Add XYZ, xyY, Lab and LCH color spaces. (liballeg#716) Destabilize al_clear_keyboard_state. Log when the keyboard state is cleared in ex_keyboard_events. Implement Mac OS X keyboard driver clear state function Fix bug in X11 keyboard module where local last key press state was not cleared, resulting in failure to detect consecutive presses of same key. Implement optional key up batch event dispatch as suggested by SiegeLord. Implement al_clear_keyboard_state function in order to remedy issue liballeg#721. add missing glStencilMaskSeparate prototype remove '\n's, add 's' Fix al_remove_config_section and al_remove_config_key ASSERT crash in al_ref_cstr, when invoked with a NULL section (which conventionally represents the global section). (liballeg#724) fix KEY_CHAR events under X11 with compose key enabled Fix warnings "__NSAutoreleaseNoPool(): Object ? of class ? autoreleased with no pool in place - just leaking" when building or modifying menus under Mac OS X 10.6. Fix build in Mac OS X 10.6. The default compiler provided by XCode 4.2 is llvm-gcc-4.2 which fails to compile modules for which gl_ext.h redefines type ALLEGRO_OGL_EXT_LIST. This isn't an issue for later versions of GCC which allow for such redefinitions. This fix is important, though, because that's the latest GCC officially released by Apple for such system, and I couldn't build an working Allegro using compilers provided by MacPorts, since although builds were successfully completed, Allegro systematically segfaulted at misaligned_stack_error system function for any program. Fix ALLEGRO_EVENT_TOUCH_BEGIN formatting. Fix make_doc on Windows. Allow setting the buffer size for ALSA. Place a copy of allegro5.cfg into the docs. Document if you set both ALLEGRO_VIDEO_BITMAP and ALLEGRO_MEMORY_BITMAP you're gonna have a bad time. Improvements to save dialogs on systems using Gtk (liballeg#705) ...
No description provided.