comparison src/image.c @ 101838:a4a5037b3040

(svg_load_image): Fix last change.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 06 Feb 2009 17:19:10 +0000
parents b6df48c94ca5
children 689fbe81edc4
comparison
equal deleted inserted replaced
101837:a308d330b349 101838:a4a5037b3040
8077 init_color_table (); 8077 init_color_table ();
8078 8078
8079 /* Handle alpha channel by combining the image with a background 8079 /* Handle alpha channel by combining the image with a background
8080 color. */ 8080 color. */
8081 specified_bg = image_spec_value (img->spec, QCbackground, NULL); 8081 specified_bg = image_spec_value (img->spec, QCbackground, NULL);
8082 if (STRINGP (specified_bg) 8082 if (!STRINGP (specified_bg)
8083 && x_defined_color (f, SDATA (specified_bg), &background, 0)) 8083 || !x_defined_color (f, SDATA (specified_bg), &background, 0))
8084 {
8085 /* SVG pixmaps specify transparency in the last byte, so right
8086 shift 8 bits to get rid of it, since emacs doesn't support
8087 transparency. */
8088 background.red >>= 8;
8089 background.green >>= 8;
8090 background.blue >>= 8;
8091 }
8092 else
8093 { 8084 {
8094 #ifndef HAVE_NS 8085 #ifndef HAVE_NS
8095 background.pixel = FRAME_BACKGROUND_PIXEL (f); 8086 background.pixel = FRAME_BACKGROUND_PIXEL (f);
8096 x_query_color (f, &background); 8087 x_query_color (f, &background);
8097 #else 8088 #else
8098 ns_query_color(FRAME_BACKGROUND_COLOR (f), &background, 1); 8089 ns_query_color(FRAME_BACKGROUND_COLOR (f), &background, 1);
8099 #endif 8090 #endif
8100 } 8091 }
8092
8093 /* SVG pixmaps specify transparency in the last byte, so right
8094 shift 8 bits to get rid of it, since emacs doesn't support
8095 transparency. */
8096 background.red >>= 8;
8097 background.green >>= 8;
8098 background.blue >>= 8;
8101 8099
8102 /* This loop handles opacity values, since Emacs assumes 8100 /* This loop handles opacity values, since Emacs assumes
8103 non-transparent images. Each pixel must be "flattened" by 8101 non-transparent images. Each pixel must be "flattened" by
8104 calculating the resulting color, given the transparency of the 8102 calculating the resulting color, given the transparency of the
8105 pixel, and the image background color. */ 8103 pixel, and the image background color. */