Post Reply 
GETPIX_P values
01-24-2014, 12:44 PM
Post: #1
GETPIX_P values
When using a GETPIX_P(Gn,X,Y) command on a white (#FFFFFFh) pixel I get #F8F8F8h, seems the last 3 bits are not detected. GETPIX on a #070707h pixel gives 0. Why?

/Andreas
Find all posts by this user
Quote this message in a reply
01-24-2014, 01:41 PM
Post: #2
RE: GETPIX_P values
Pixels are formatted as ARGB1555 (5 bits per color + 1 alpha)

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-24-2014, 02:07 PM
Post: #3
RE: GETPIX_P values
Screen is in 15 bits colors + 1 bit Alpha, but commands are using 24 bits color coding.
The 24 bits color coding is used because it is the web standard.
So GETPIX is reading the real 15 bits color and converting to 24 bits. The internal white #7fffH is converted to #f8f8f8H
Here is a little program that display all colors
Code:
EXPORT SHOW_CLR()
BEGIN
LOCAL cr, cg, cb, clr, pc, pl;
RECT();
FOR cr FROM 0 TO 31 DO
  pl:= cr MOD 8* 34;
  pc:= IP(cr/8)* 34;
  FOR cg FROM 0 TO 31 DO
    FOR cb FROM 0 TO 31 DO
      clr:= RGB(cr*8,cg*8,cb*8);
      PIXON_P(cb+pl+2,cg+pc+2,clr);
    END;
  END;
END;

REPEAT
UNTIL GETKEY() == -1;
FREEZE;
END;

EXPORT SHOW_BW()
BEGIN
LOCAL cr, cg, cb, clr, pc, pl;
RECT();
FOR cr FROM 0 TO 31 DO
  pl:= cr MOD 8*34;
  pc:= IP(cr/8)*34;
  FOR cg FROM 0 TO 31 DO
    FOR cb FROM 0 TO 31 DO
      clr:= RGB(cr*8,cr*8,cr*8);
      PIXON_P(cb+pl+2,cg+pc+2,clr);
    END;
  END;
END;

REPEAT
UNTIL GETKEY() == -1;
FREEZE;
END;

Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Find all posts by this user
Quote this message in a reply
01-24-2014, 03:18 PM
Post: #4
RE: GETPIX_P values
Thank you for the replies. I did not see this in the manual, but maybe its there.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)