HP Forums
GETPIX_P values - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: GETPIX_P values (/thread-505.html)



GETPIX_P values - Graan - 01-24-2014 12:44 PM

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


RE: GETPIX_P values - eried - 01-24-2014 01:41 PM

Pixels are formatted as ARGB1555 (5 bits per color + 1 alpha)


RE: GETPIX_P values - patrice - 01-24-2014 02:07 PM

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;



RE: GETPIX_P values - Graan - 01-24-2014 03:18 PM

Thank you for the replies. I did not see this in the manual, but maybe its there.