[fpc-pascal] Implementing AggPas with PtcGraph

James Richters james at productionautomation.net
Thu Jun 29 14:04:02 CEST 2017


>Your palette looks like standard Int Mode 13h VGA palette (yes, I'm older). This are the RGB values (I'm quite sure):

Thank you, I appreciate the help identifying the format I have and the conversion to RGB.  I was able to also find methods to convert RGB to RGB565 and back by looking in  the aggpas pf_rgb565.inc file.

{ make_pix_565 }
function make_pix_565(r ,g ,b : unsigned ) : int16u;
begin
 result:=
  ((r and $F8 ) shl 8 ) or
  ((g and $FC ) shl 3 ) or
   (b shr 3 );

end;

{ make_color_565 }
procedure make_color_565(var color : aggclr; p : int16u_ptr );
begin
 color.ConstrInt(
  (p^ shr 8 ) and $F8 ,
  (p^ shr 3 ) and $FC ,
  (p^ shl 3 ) and $F8 );

end;   

James




More information about the fpc-pascal mailing list