From: <enl...@li...> - 2001-06-12 05:14:09
|
Enlightenment CVS committal Author : mej Project : eterm Module : Eterm Dir : eterm/Eterm/src Modified Files: options.c pixmap.c Log Message: Mon Jun 11 22:04:08 PDT 2001 Michael Jennings <me...@et...> Fixed the --shade and --tint options. This issue was pointed out by Laurence J. Lane <lj...@de...>. =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/options.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -3 -r1.84 -r1.85 --- options.c 2001/06/12 01:04:45 1.84 +++ options.c 2001/06/12 05:14:09 1.85 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: options.c,v 1.84 2001/06/12 01:04:45 mej Exp $"; +static const char cvs_ident[] = "$Id: options.c,v 1.85 2001/06/12 05:14:09 mej Exp $"; #include "config.h" #include "feature.h" @@ -3033,6 +3033,7 @@ sprintf(buff, "0x%03x", ((100 - rs_shade) << 8) / 100); rs_cmod_image = STRDUP(buff); + D_PIXMAP(("--shade value of %d converted to cmod value of %s\n", rs_shade, rs_cmod_image)); } if (rs_tint) { char buff[10]; @@ -3078,6 +3079,8 @@ if (n > 2) { iml->mod->gamma = (int) strtol(get_pword(3, rs_cmod_image), (char **) NULL, 0); } + D_PIXMAP(("From image cmod string %s to brightness %d, contrast %d, and gamma %d\n", rs_cmod_image, + iml->mod->brightness, iml->mod->contrast, iml->mod->gamma)); FREE(rs_cmod_image); } if (rs_cmod_red) { @@ -3095,7 +3098,10 @@ if (n > 2) { iml->rmod->gamma = (int) strtol(get_pword(3, rs_cmod_red), (char **) NULL, 0); } + D_PIXMAP(("From red cmod string %s to brightness %d, contrast %d, and gamma %d\n", rs_cmod_red, + iml->rmod->brightness, iml->rmod->contrast, iml->rmod->gamma)); FREE(rs_cmod_red); + update_cmod(iml->rmod); } if (rs_cmod_green) { unsigned char n = num_words(rs_cmod_green); @@ -3112,7 +3118,10 @@ if (n > 2) { iml->gmod->gamma = (int) strtol(get_pword(3, rs_cmod_green), (char **) NULL, 0); } + D_PIXMAP(("From green cmod string %s to brightness %d, contrast %d, and gamma %d\n", rs_cmod_green, + iml->gmod->brightness, iml->gmod->contrast, iml->gmod->gamma)); FREE(rs_cmod_green); + update_cmod(iml->gmod); } if (rs_cmod_blue) { unsigned char n = num_words(rs_cmod_blue); @@ -3129,7 +3138,14 @@ if (n > 2) { iml->bmod->gamma = (int) strtol(get_pword(3, rs_cmod_blue), (char **) NULL, 0); } + D_PIXMAP(("From blue cmod string %s to brightness %d, contrast %d, and gamma %d\n", rs_cmod_blue, + iml->bmod->brightness, iml->bmod->contrast, iml->bmod->gamma)); FREE(rs_cmod_blue); + update_cmod(iml->bmod); + } + if (images[image_bg].norm->iml->im) { + imlib_context_set_image(images[image_bg].norm->iml->im); + update_cmod_tables(images[image_bg].norm->iml); } if (rs_cache_size == (unsigned long) -1) { =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/pixmap.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -3 -r1.62 -r1.63 --- pixmap.c 2001/05/24 07:17:03 1.62 +++ pixmap.c 2001/06/12 05:14:09 1.63 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: pixmap.c,v 1.62 2001/05/24 07:17:03 mej Exp $"; +static const char cvs_ident[] = "$Id: pixmap.c,v 1.63 2001/06/12 05:14:09 mej Exp $"; #include "config.h" #include "feature.h" @@ -1309,9 +1309,11 @@ void update_cmod(colormod_t *cmod) { - ASSERT(cmod != NULL); + /* When a particular R/G/B color modifier is changed, this function must be called + to resync the Imlib2 color modifier (imlib_mod) with our new brightness, + contrast, and gamma values. */ if (cmod->imlib_mod) { imlib_context_set_color_modifier(cmod->imlib_mod); imlib_reset_color_modifier(); @@ -1339,10 +1341,12 @@ REQUIRE(mod || rmod || gmod || bmod); + /* When any changes is made to any individual color modifier for an image, + this function must be called to update the overall Imlib2 color modifier. */ + D_PIXMAP(("Updating color modifier tables for %8p\n", iml)); if (!mod) { mod = iml->mod = create_colormod(); iml->mod->imlib_mod = imlib_create_color_modifier(); - iml->mod->brightness = iml->mod->contrast = iml->mod->gamma = 0x100; imlib_context_set_color_modifier(mod->imlib_mod); } else if (!mod->imlib_mod) { mod->imlib_mod = imlib_create_color_modifier(); @@ -1379,14 +1383,15 @@ } } -# ifdef PIXMAP_OFFSET -# define MOD_IS_SET(mod) ((mod) && ((mod)->brightness != 0x100 || (mod)->contrast != 0x100 || (mod)->gamma != 0x100)) +# define MOD_IS_SET(mod) ((mod) && ((mod)->brightness != 0x100 || (mod)->contrast != 0x100 || (mod)->gamma != 0x100)) unsigned char need_colormod(register imlib_t *iml) { if (MOD_IS_SET(iml->mod) || MOD_IS_SET(iml->rmod) || MOD_IS_SET(iml->gmod) || MOD_IS_SET(iml->bmod)) { + D_PIXMAP(("Color modifier active.\n")); return 1; } else { + D_PIXMAP(("No color modifier active.\n")); return 0; } } @@ -1605,6 +1610,7 @@ } } +# ifdef PIXMAP_OFFSET void colormod_trans(Pixmap p, imlib_t *iml, GC gc, unsigned short w, unsigned short h) { |