diff options
| author | Jason Rumney | 2002-11-15 23:29:20 +0000 |
|---|---|---|
| committer | Jason Rumney | 2002-11-15 23:29:20 +0000 |
| commit | 35624c0374f83c9a68d33e42e889a4b99a621819 (patch) | |
| tree | b6b03ee4297ea87f5952a0e5819605c1c279fc24 /src | |
| parent | aab83f9115b4fe83257b3f78eedd41554511ffcb (diff) | |
| download | emacs-35624c0374f83c9a68d33e42e889a4b99a621819.tar.gz emacs-35624c0374f83c9a68d33e42e889a4b99a621819.zip | |
(x_create_x_image_and_pixmap): Fill in palette for
depth of 1.
(xbm_read_bitmap_data): Invert bits as xbm is read in.
(XPutPixel): Don't invert bits here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 19b4d90a79e..6be0521dc24 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -9352,6 +9352,17 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap) | |||
| 9352 | header->biClrUsed = palette_colors; | 9352 | header->biClrUsed = palette_colors; |
| 9353 | 9353 | ||
| 9354 | /* TODO: fill in palette. */ | 9354 | /* TODO: fill in palette. */ |
| 9355 | if (depth == 1) | ||
| 9356 | { | ||
| 9357 | (*ximg)->info.bmiColors[0].rgbBlue = 0; | ||
| 9358 | (*ximg)->info.bmiColors[0].rgbGreen = 0; | ||
| 9359 | (*ximg)->info.bmiColors[0].rgbRed = 0; | ||
| 9360 | (*ximg)->info.bmiColors[0].rgbReserved = 0; | ||
| 9361 | (*ximg)->info.bmiColors[1].rgbBlue = 255; | ||
| 9362 | (*ximg)->info.bmiColors[1].rgbGreen = 255; | ||
| 9363 | (*ximg)->info.bmiColors[1].rgbRed = 255; | ||
| 9364 | (*ximg)->info.bmiColors[1].rgbReserved = 0; | ||
| 9365 | } | ||
| 9355 | 9366 | ||
| 9356 | hdc = get_frame_dc (f); | 9367 | hdc = get_frame_dc (f); |
| 9357 | 9368 | ||
| @@ -9918,9 +9929,9 @@ xbm_read_bitmap_data (contents, end, width, height, data) | |||
| 9918 | int val = value; | 9929 | int val = value; |
| 9919 | expect (XBM_TK_NUMBER); | 9930 | expect (XBM_TK_NUMBER); |
| 9920 | 9931 | ||
| 9921 | *p++ = val; | 9932 | *p++ = ~ val; |
| 9922 | if (!padding_p || ((i + 2) % bytes_per_line)) | 9933 | if (!padding_p || ((i + 2) % bytes_per_line)) |
| 9923 | *p++ = value >> 8; | 9934 | *p++ = ~ (value >> 8); |
| 9924 | 9935 | ||
| 9925 | if (LA1 == ',' || LA1 == '}') | 9936 | if (LA1 == ',' || LA1 == '}') |
| 9926 | match (); | 9937 | match (); |
| @@ -9935,7 +9946,7 @@ xbm_read_bitmap_data (contents, end, width, height, data) | |||
| 9935 | int val = value; | 9946 | int val = value; |
| 9936 | expect (XBM_TK_NUMBER); | 9947 | expect (XBM_TK_NUMBER); |
| 9937 | 9948 | ||
| 9938 | *p++ = val; | 9949 | *p++ = ~ val; |
| 9939 | 9950 | ||
| 9940 | if (LA1 == ',' || LA1 == '}') | 9951 | if (LA1 == ',' || LA1 == '}') |
| 9941 | match (); | 9952 | match (); |
| @@ -10711,9 +10722,9 @@ static void XPutPixel (ximg, x, y, color) | |||
| 10711 | rowbytes += 4 - (rowbytes % 4); | 10722 | rowbytes += 4 - (rowbytes % 4); |
| 10712 | 10723 | ||
| 10713 | pixel = ximg->data + y * rowbytes + x * 3; | 10724 | pixel = ximg->data + y * rowbytes + x * 3; |
| 10714 | *pixel = 255 - GetRValue (color); | 10725 | *pixel = GetRValue (color); |
| 10715 | *(pixel + 1) = 255 - GetGValue (color); | 10726 | *(pixel + 1) = GetGValue (color); |
| 10716 | *(pixel + 2) = 255 - GetBValue (color); | 10727 | *(pixel + 2) = GetBValue (color); |
| 10717 | } | 10728 | } |
| 10718 | 10729 | ||
| 10719 | 10730 | ||