aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/image.c b/src/image.c
index 34db5e53367..66b004220d1 100644
--- a/src/image.c
+++ b/src/image.c
@@ -51,7 +51,6 @@ Boston, MA 02111-1307, USA. */
51typedef struct x_bitmap_record Bitmap_Record; 51typedef struct x_bitmap_record Bitmap_Record;
52#define GET_PIXEL(ximg, x, y) XGetPixel(ximg, x, y) 52#define GET_PIXEL(ximg, x, y) XGetPixel(ximg, x, y)
53#define NO_PIXMAP None 53#define NO_PIXMAP None
54#define PNG_BG_COLOR_SHIFT 0
55 54
56#define RGB_PIXEL_COLOR unsigned long 55#define RGB_PIXEL_COLOR unsigned long
57 56
@@ -69,7 +68,6 @@ typedef struct x_bitmap_record Bitmap_Record;
69typedef struct w32_bitmap_record Bitmap_Record; 68typedef struct w32_bitmap_record Bitmap_Record;
70#define GET_PIXEL(ximg, x, y) GetPixel(ximg, x, y) 69#define GET_PIXEL(ximg, x, y) GetPixel(ximg, x, y)
71#define NO_PIXMAP 0 70#define NO_PIXMAP 0
72#define PNG_BG_COLOR_SHIFT 0
73 71
74#define RGB_PIXEL_COLOR COLORREF 72#define RGB_PIXEL_COLOR COLORREF
75 73
@@ -104,7 +102,6 @@ typedef struct mac_bitmap_record Bitmap_Record;
104 102
105#define GET_PIXEL(ximg, x, y) XGetPixel(ximg, x, y) 103#define GET_PIXEL(ximg, x, y) XGetPixel(ximg, x, y)
106#define NO_PIXMAP 0 104#define NO_PIXMAP 0
107#define PNG_BG_COLOR_SHIFT 8
108 105
109#define RGB_PIXEL_COLOR unsigned long 106#define RGB_PIXEL_COLOR unsigned long
110 107
@@ -1172,7 +1169,7 @@ four_corners_best (ximg, width, height)
1172/* Return the `background' field of IMG. If IMG doesn't have one yet, 1169/* Return the `background' field of IMG. If IMG doesn't have one yet,
1173 it is guessed heuristically. If non-zero, XIMG is an existing 1170 it is guessed heuristically. If non-zero, XIMG is an existing
1174 XImage object (or device context with the image selected on W32) to 1171 XImage object (or device context with the image selected on W32) to
1175 use for the heuristic. */ 1172 use for the heuristic. */
1176 1173
1177RGB_PIXEL_COLOR 1174RGB_PIXEL_COLOR
1178image_background (img, f, ximg) 1175image_background (img, f, ximg)
@@ -1205,7 +1202,7 @@ image_background (img, f, ximg)
1205 1202
1206 if (free_ximg) 1203 if (free_ximg)
1207 Destroy_Image (ximg, prev); 1204 Destroy_Image (ximg, prev);
1208 1205
1209 img->background_valid = 1; 1206 img->background_valid = 1;
1210 } 1207 }
1211 1208
@@ -2990,7 +2987,7 @@ xbm_load_image (f, img, contents, end)
2990 non_default_colors = 1; 2987 non_default_colors = 1;
2991 } 2988 }
2992 2989
2993 Create_Pixmap_From_Bitmap_Data (f, img, data, 2990 Create_Pixmap_From_Bitmap_Data (f, img, data,
2994 foreground, background, 2991 foreground, background,
2995 non_default_colors); 2992 non_default_colors);
2996 xfree (data); 2993 xfree (data);
@@ -3857,7 +3854,7 @@ lookup_rgb_color (f, r, g, b)
3857 /* Assemble the pixel color. */ 3854 /* Assemble the pixel color. */
3858 return pr | pg | pb; 3855 return pr | pg | pb;
3859 } 3856 }
3860 3857
3861 for (p = ct_table[i]; p; p = p->next) 3858 for (p = ct_table[i]; p; p = p->next)
3862 if (p->r == r && p->g == g && p->b == b) 3859 if (p->r == r && p->g == g && p->b == b)
3863 break; 3860 break;
@@ -4968,7 +4965,7 @@ pbm_load (f, img)
4968 x_destroy_x_image (ximg); 4965 x_destroy_x_image (ximg);
4969 4966
4970 /* X and W32 versions did it here, MAC version above. ++kfs 4967 /* X and W32 versions did it here, MAC version above. ++kfs
4971 img->width = width; 4968 img->width = width;
4972 img->height = height; */ 4969 img->height = height; */
4973 4970
4974 UNGCPRO; 4971 UNGCPRO;
@@ -5412,9 +5409,9 @@ png_load (f, img)
5412 png_color_16 user_bg; 5409 png_color_16 user_bg;
5413 5410
5414 bzero (&user_bg, sizeof user_bg); 5411 bzero (&user_bg, sizeof user_bg);
5415 user_bg.red = color.red >> PNG_BG_COLOR_SHIFT; 5412 user_bg.red = color.red >> 8;
5416 user_bg.green = color.green >> PNG_BG_COLOR_SHIFT; 5413 user_bg.green = color.green >> 8;
5417 user_bg.blue = color.blue >> PNG_BG_COLOR_SHIFT; 5414 user_bg.blue = color.blue >> 8;
5418 5415
5419 fn_png_set_background (png_ptr, &user_bg, 5416 fn_png_set_background (png_ptr, &user_bg,
5420 PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); 5417 PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
@@ -5438,9 +5435,9 @@ png_load (f, img)
5438 x_query_color (f, &color); 5435 x_query_color (f, &color);
5439 5436
5440 bzero (&frame_background, sizeof frame_background); 5437 bzero (&frame_background, sizeof frame_background);
5441 frame_background.red = color.red; 5438 frame_background.red = color.red >> 8;
5442 frame_background.green = color.green; 5439 frame_background.green = color.green >> 8;
5443 frame_background.blue = color.blue; 5440 frame_background.blue = color.blue >> 8;
5444#endif /* HAVE_X_WINDOWS */ 5441#endif /* HAVE_X_WINDOWS */
5445 5442
5446#ifdef HAVE_NTGUI 5443#ifdef HAVE_NTGUI
@@ -5451,9 +5448,9 @@ png_load (f, img)
5451 x_query_color (f, &color); 5448 x_query_color (f, &color);
5452#endif 5449#endif
5453 bzero (&frame_background, sizeof frame_background); 5450 bzero (&frame_background, sizeof frame_background);
5454 frame_background.red = 256 * GetRValue (color); 5451 frame_background.red = GetRValue (color);
5455 frame_background.green = 256 * GetGValue (color); 5452 frame_background.green = GetGValue (color);
5456 frame_background.blue = 256 * GetBValue (color); 5453 frame_background.blue = GetBValue (color);
5457#endif /* HAVE_NTGUI */ 5454#endif /* HAVE_NTGUI */
5458 5455
5459#ifdef MAC_OS 5456#ifdef MAC_OS