| Reporter's email: |
max@gustavus.edu |
| Number: |
8821 |
| Category: |
mred |
| Synopsis: |
pixels gotten from monochrome X bitmaps wrong |
| Class: |
sw-bug |
| Responsible: |
mflatt |
| Notify-List: |
|
| Severity: |
serious |
| Priority: |
medium |
| State: |
closed |
| Confidential: |
no |
| Arrival-Date: |
Mon Jul 23 15:50:02 -0400 2007 |
| Closed-Date: |
Wed Jul 25 14:02:32 -0400 2007 |
| Last-Modified: |
Sat Jul 28 08:40:01 -0400 2007 |
| Originator: |
Max Hailperin |
| Organization: |
plt
|
| Submitter-Id: |
unknown |
| Release: |
370p2 |
| Environment: |
unix "Linux max.mcs.gac.edu 2.6.18-1.2239.fc5 #1 Fri Nov 10 13:04:06 EST 2006 i686 i686 i386 GNU/Linux" (i386-linux/3m) (get-display-depth) = 24
Docs Installed:
(("/Net/gac/home/m/a/max/Desktop/plt-370/doc" "r5rs" "mzscheme" "mred" "help" "tour" "drscheme" "srfi" "mzlib" "misclib" "mrlib" "framework" "foreign" "mzc" "tools" "insidemz" "web-server" "swindle" "plot" "release-notes" "t-y-scheme" "tex2page" "beginning" "beginning-abbr" "intermediate" "intermediate-lambda" "advanced" "teachpack" "teachpack-htdc" "profj-beginner" "profj-intermediate" "profj-advanced"))
Human Language: english
(current-memory-use) 56444612
Collections:
(("/Net/gac/home/m/a/max/.plt-scheme/370/collects" "concabs" "info-domain") ("/Net/gac/home/m/a/max/Desktop/plt-370/collects" "icons" "syntax-color" "trace" "tex2page" "slideshow" "texpict" "syntax" "eopl" "launcher" "teachpack" "plot" "algol60" "web-server" "graphics" "wxme" "compiler" "planet" "profjWizard" "lazy" "openssl" "games" "swindle" "mrlib" "framework" "lang" "help" "hierlist" "readline" "config" "errortrace" "drscheme" "parser-tools" "mztake" "profj" "htdp" "string-constants" "tests" "dynext" "browser" "mred" "mzlib" "frtime" "embedded-gui" "slatex" "htdch" "srfi" "stepper" "defaults" "macro-debugger" "mzscheme" "preprocessor" "ffi" "version" "html" "sgl" "net" "make" "xml" "afm" "setup" "r5rs" "info-domain"))
Computer Language: (("Professional Languages" "PLT" "Textual (MzScheme, includes R5RS)") #6(#t write mixed-fraction-e #f #t debug))
|
| Description: |
Under some circumstances on Linux (X windows), but not Mac OS X or Microsoft Windows, the get-pixel and get-argb-pixels methods on bitmap-dc%, and in the latter case also on bitmap%, return incorrect RGB values when applied to a monochrome bitmap. Namely, rather than white pixels showing as 255 for R, G, and B and black pixels showing as 0 for R, G, and B, the values of R and G are always 0 and the B is 0 for white and 1 for black. For example, the code shown in the "Steps to Reproduce" section of this bug report will give a byte string containing the incorrect RGB values under Linux (look for \0\0\1) whereas under MacOS X it gives a byte string contining the correct RGB values. This particular example illustrates the bug in the get-argb-pixels operation on bitmap%; if the bitmap is left set into the dc and the dc's get-argb-pixels operation is used, the problem does not manifest. However, under other circumstances the bitmap-dc% operations (get-argb-pixels and get-pixel)!
can also manifest the same misencoding.
|
| File Attachments: |
|
| How-To-Repeat: |
(let* ((bm (make-object bitmap% 5 5 #t))
(dc (new bitmap-dc% (bitmap bm)))
(pt (lambda (x y) (make-object point% x y)))
(bs (make-bytes 100)))
(send dc clear)
(send dc set-brush (make-object color% 0 0 0) 'solid)
(send dc draw-polygon (list (pt 2 0) (pt 2 4)
(pt 4 4) (pt 4 0)))
(send dc set-bitmap #f)
(send bm get-argb-pixels 0 0 5 5 bs)
bs)
|
| Fix: |
|
| Release-Note: |
|
| Unformatted: |
|