Re: [fpc-pascal] Unable to compile FPC after revision 36407

2017-06-03 Thread Michael Van Canneyt



On Sat, 3 Jun 2017, Florian Klämpfl wrote:


On Sat, 3 Jun 2017, Victor Campillo wrote:


Hi,

After revision 36407 I got this error trying to compile FPC.

"Compilation of "BuildUnit_rtl_unicode.pp" failed"

My system is Linux x86_64 and I am using FPC 3.0.2  to compile trunk.


I just did a 'make clean all PP=ppcx64-3.0.2' and that works fine ?


OK. Turns out I forgot to svn add a file:

https://bugs.freepascal.org/view.php?id=31962


Maybe you can ask alb42 to get subscribed to one of his jenkins builds?


And get even more messages ? No thank you :)

Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-03 Thread Stefan V. Pantazi
The easiest workaround I could figure was to add a parameter to the 
Agg2D object constructor. That should, in theory, allow the use of any 
pixel format available in AggPas.


The ptcpas/ptcgraph units I used are the ones that came with fpc 3.0.1, 
there was no need to download anything. They worked fine, except for one 
48 bytes memory leak reported by heaptrc and that I left unfixed.


Stefan

On 06/03/2017 03:37 PM, Graeme Geldenhuys wrote:

On 2017-06-03 17:45, Stefan V. Pantazi wrote:

Also, for the example
to work, the agg object constructor must be modified as well, I included
all the info in the example header.


I noted the remarks on the image buffer format being hard-coded for the
Agg_2D unit. I'll make a plan for improving that, using some Factory
(design) Pattern to register the pixel buffer format of interest.



I think the example program
(aggpas_ptcgraph_output.pas) fits well together with the other demos in
fpGUI and PtcPas/ptcgraph packages, so adding it to the packages would
help, regardless whether graph.PutImage documentation is updated.


Thanks. I'll download the ptcgraph unit and give it a test. I'll all the
demo to fpGUI's AggPas demos too. It will be a good addition.

Regards,
  Graeme


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Unable to compile FPC after revision 36407

2017-06-03 Thread Florian Klämpfl
Am 03.06.2017 um 20:33 schrieb Michael Van Canneyt:
> 
> 
> On Sat, 3 Jun 2017, Michael Van Canneyt wrote:
> 
>>
>>
>> On Sat, 3 Jun 2017, Victor Campillo wrote:
>>
>>> Hi,
>>>
>>> After revision 36407 I got this error trying to compile FPC.
>>>
>>> "Compilation of "BuildUnit_rtl_unicode.pp" failed"
>>>
>>> My system is Linux x86_64 and I am using FPC 3.0.2  to compile trunk.
>>
>> I just did a 'make clean all PP=ppcx64-3.0.2' and that works fine ?
> 
> OK. Turns out I forgot to svn add a file:
> 
> https://bugs.freepascal.org/view.php?id=31962

Maybe you can ask alb42 to get subscribed to one of his jenkins builds?

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-03 Thread Graeme Geldenhuys

On 2017-06-03 17:45, Stefan V. Pantazi wrote:

Also, for the example
to work, the agg object constructor must be modified as well, I included
all the info in the example header.


I noted the remarks on the image buffer format being hard-coded for the 
Agg_2D unit. I'll make a plan for improving that, using some Factory 
(design) Pattern to register the pixel buffer format of interest.




I think the example program
(aggpas_ptcgraph_output.pas) fits well together with the other demos in
fpGUI and PtcPas/ptcgraph packages, so adding it to the packages would
help, regardless whether graph.PutImage documentation is updated.


Thanks. I'll download the ptcgraph unit and give it a test. I'll all the 
demo to fpGUI's AggPas demos too. It will be a good addition.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Unable to compile FPC after revision 36407

2017-06-03 Thread Victor Campillo

On 03/06/17 20:33, Michael Van Canneyt wrote:


I use "make clean all" also and I can compile revision 36406 without 
problems, my complete command to compile is

"make -j 9 clean all install INSTALL_PREFIX= OPT="-O- -O1 -gl"

I saw this message when the compilation is aborted

"collation_de.pas(147,4) Fatal: Cannot open include file 
"collation_de_le.inc"


I searched in my fpc local copy and I don't found this file, maybe it 
was not added with your commit?


Yep. Mails crossed.

Next time you report an error, please include the error message. It's 
a useful hint :)


Michael.

Sorry, I saw the message "Compilation of "BuildUnit_rtl_unicode.pp" 
failed" and overlooked the relevant one.


Everything work fine now, thank very much for your quick fix.

Best Regards.

--
Victor Campillo

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Unable to compile FPC after revision 36407

2017-06-03 Thread Michael Van Canneyt



On Sat, 3 Jun 2017, Victor Campillo wrote:


On 03/06/17 20:02, Michael Van Canneyt wrote:


I just did a 'make clean all PP=ppcx64-3.0.2' and that works fine ?

Michael.

I use "make clean all" also and I can compile revision 36406 without 
problems, my complete command to compile is

"make -j 9 clean all install INSTALL_PREFIX= OPT="-O- -O1 -gl"

I saw this message when the compilation is aborted

"collation_de.pas(147,4) Fatal: Cannot open include file 
"collation_de_le.inc"


I searched in my fpc local copy and I don't found this file, maybe it 
was not added with your commit?


Yep. Mails crossed.

Next time you report an error, please include the error message. 
It's a useful hint :)


Michael.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Unable to compile FPC after revision 36407

2017-06-03 Thread Michael Van Canneyt



On Sat, 3 Jun 2017, Michael Van Canneyt wrote:




On Sat, 3 Jun 2017, Victor Campillo wrote:


Hi,

After revision 36407 I got this error trying to compile FPC.

"Compilation of "BuildUnit_rtl_unicode.pp" failed"

My system is Linux x86_64 and I am using FPC 3.0.2  to compile trunk.


I just did a 'make clean all PP=ppcx64-3.0.2' and that works fine ?


OK. Turns out I forgot to svn add a file:

https://bugs.freepascal.org/view.php?id=31962

Fixed in rev 36409.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Unable to compile FPC after revision 36407

2017-06-03 Thread Victor Campillo

On 03/06/17 20:02, Michael Van Canneyt wrote:


I just did a 'make clean all PP=ppcx64-3.0.2' and that works fine ?

Michael.

I use "make clean all" also and I can compile revision 36406 without 
problems, my complete command to compile is

"make -j 9 clean all install INSTALL_PREFIX= OPT="-O- -O1 -gl"

I saw this message when the compilation is aborted

"collation_de.pas(147,4) Fatal: Cannot open include file 
"collation_de_le.inc"


I searched in my fpc local copy and I don't found this file, maybe it 
was not added with your commit?


--
Victor Campillo

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Unable to compile FPC after revision 36407

2017-06-03 Thread Michael Van Canneyt



On Sat, 3 Jun 2017, Victor Campillo wrote:


Hi,

After revision 36407 I got this error trying to compile FPC.

"Compilation of "BuildUnit_rtl_unicode.pp" failed"

My system is Linux x86_64 and I am using FPC 3.0.2  to compile trunk.


I just did a 'make clean all PP=ppcx64-3.0.2' and that works fine ?

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Unable to compile FPC after revision 36407

2017-06-03 Thread Victor Campillo

Hi,

After revision 36407 I got this error trying to compile FPC.

"Compilation of "BuildUnit_rtl_unicode.pp" failed"

My system is Linux x86_64 and I am using FPC 3.0.2  to compile trunk.

Best Regards.

--
Victor Campillo

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-03 Thread Stefan V. Pantazi
I seem to have some problems with logging on the bug tracker. I've used 
it in the recent past a couple of time but I am unable to log on for 
some reason. I will try later to create a new account and submit a fpc 
doc bug report.


At any rate, I attached the updated example based on Nikolay's recent 
post which had the correct information. There was a third "reserved" 
parameter that had to be added to the bitmap buffer structure. Without 
it, the output was slightly clipped to the right. Also, for the example 
to work, the agg object constructor must be modified as well, I included 
all the info in the example header. I think the example program 
(aggpas_ptcgraph_output.pas) fits well together with the other demos in 
fpGUI and PtcPas/ptcgraph packages, so adding it to the packages would 
help, regardless whether graph.PutImage documentation is updated.


Stefan

On 06/03/2017 06:52 AM, Graeme Geldenhuys wrote:

On 2017-06-03 01:56, Stefan V. Pantazi wrote:

http://pascal.net.ru/PutImage+(en)
[...]
"BitMap is an untyped parameter that contains the height and width of
the region, and the bit image that will be put onto the screen."
[...]



Could you file a FPC Documentation bug report and ask that this
information be added. As you found out (very difficultly), this is vital
information.


Regards,
  Graeme

(*
  This is a minimalistic console application demo derived from the Agg2DConsole.dpr at

  https://github.com/graemeg/fpGUI/tree/develop/src/corelib/render/software/agg-demos

  It uses the Agg2D object in AggPas, which has a much friendlier API, to do all the drawing.

  The drawing buffer is then displayed in a window using ptcgraph and 16 bit RGB565 color format.

  Uses a GraphBitmapBuffer record type that includes the width and height of the image as well as a reserved parameter
  per the info in this post: http://lists.freepascal.org/pipermail/fpc-pascal/2017-June/051524.html

  [...]
  "The structure, used by putimage is as follows:
  3 longints (12 bytes):
  - image width
  - image height
  - reserved
  followed by width*height 16-bit words.
  [...]

  Agg2D object constructor requires a modification to use pixel formats other than rgba32 (e.g., 16 bit RGB565 color format) as follows:
[...]
  public
constructor Construct(pixfmt:define_pixfmt);
destructor  Destruct;
[...]
  { CONSTRUCT }
  constructor Agg2D.Construct(pixfmt:define_pixfmt);
  begin
   	m_rbuf.Construct;

  	pixfmt(m_pixFormat ,@m_rbuf);
  	pixfmt_custom_blend_rgba(m_pixFormatComp ,@m_rbuf ,@comp_op_adaptor_rgba ,rgba_order );
   	pixfmt(m_pixFormatPre ,@m_rbuf);
   	pixfmt_custom_blend_rgba(m_pixFormatCompPre ,@m_rbuf ,@comp_op_adaptor_rgba ,rgba_order);
[...]

ADDITIONAL NOTES:
- although rendering appears to work with pixel formats other than rgba32, custom blending may need further testing.
- there may other implementations of graph units and video modes requiring a different bitmap structure than the one
used below.
- example is tested with fpc 3.0.1 and Agg2D - Version 1.0 Release Milano 3 (AggPas 2.4 RM3)
*)

program aggpas_ptcgraph_output;

{$mode objfpc}{$H+}

uses
  ptcgraph,
  ptccrt,
	agg_pixfmt_rgb_packed, //for pixfmt_rgb565
  agg_2D;

const
  IMAGE_WIDTH = 800;
  IMAGE_HEIGHT = 600;
  RGB_WIDTH =2; //16bit RGB565 format
  LINE_COUNT = 30;

type

TGraphBitmapBuffer=packed record
  width,
  height,
  reserved:	longint;//per info in http://lists.freepascal.org/pipermail/fpc-pascal/2017-June/051524.html
  data: 	array[0..RGB_WIDTH*IMAGE_WIDTH*IMAGE_HEIGHT-1] of byte;
end;

var
  gd,gm : smallint;
  graph_buffer: TGraphBitmapBuffer;

procedure DrawStuff(agg: Agg2D_ptr);
var
  i: Integer;
  x, y, px, py, d: Double;
  c1, c2: Color;
begin
  // draw a full screen graph with grid
  agg^.clearAll(0, 0, 0);
  agg^.lineColor(0, 0, 0, 255);
  agg^.lineWidth(3);
  agg^.rectangle(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
  agg^.lineWidth(1);
  agg^.lineColor(0, 155, 0, 255);
  agg^.rectangle(10, 10, 50, 50);
//  agg^.font(fontfile, 16);
  d := IMAGE_WIDTH / LINE_COUNT;
  agg^.lineColor(0, 0, 0, 100);
  agg^.lineWidth(1);
  for i := 1 to LINE_COUNT - 1 do
  begin
x := i * d;
agg^.line(x, 0, x, IMAGE_HEIGHT);
  end;
  for i := 1 to trunc(IMAGE_HEIGHT / d) do
  begin
y := i * d;
agg^.line(0, y, IMAGE_WIDTH, y);
  end;
  x := 0;
  y := IMAGE_HEIGHT / 2;
  px := x;
  py := y;
  agg^.lineColor(255, 0, 0, 200);
  agg^.fillColor(0, 0, 0, 200);
  agg^.lineWidth(1);
  for i := 0 to LINE_COUNT - 1 do
  begin
x := x + d;
y := y + Random(Round(IMAGE_HEIGHT / 3)) - IMAGE_HEIGHT / 6;
if y < 0 then
  y := IMAGE_HEIGHT / 6;
if y >= IMAGE_HEIGHT then
  y := IMAGE_HEIGHT - IMAGE_HEIGHT / 6;
agg^.line(px, py, x, y);
//agg^.text(x, y, char_ptr(IntToStr(i) + ' point'));
px := x;
py := y;
  end;

  // Star shape
  agg^.LineCap(CapRound);
  agg^.LineWidth(5);
  agg^.LineColor($32 ,$cd ,$32 );
  c1.Construct(0, 0 , 255, 200);
  c2.Construct(0, 0, 255, 50);
  agg^.FillLinearGradient(100, 100, 

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-03 Thread Nikolay Nikolov



On 06/03/2017 01:52 PM, Graeme Geldenhuys wrote:

On 2017-06-03 01:56, Stefan V. Pantazi wrote:

http://pascal.net.ru/PutImage+(en)
[...]
"BitMap is an untyped parameter that contains the height and width of
the region, and the bit image that will be put onto the screen."
[...]



Could you file a FPC Documentation bug report and ask that this 
information be added. As you found out (very difficultly), this is 
vital information.
Even though this is the default implementation (and ptcgraph uses it), 
there may be different graph unit implementations that use a different 
format in some or all of their video modes. Of course, this should also 
be mentioned in the documentation.


Nikolay
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-03 Thread Graeme Geldenhuys

On 2017-06-03 01:56, Stefan V. Pantazi wrote:

http://pascal.net.ru/PutImage+(en)
[...]
"BitMap is an untyped parameter that contains the height and width of
the region, and the bit image that will be put onto the screen."
[...]



Could you file a FPC Documentation bug report and ask that this 
information be added. As you found out (very difficultly), this is vital 
information.



Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-03 Thread Stefan V. Pantazi
An interesting challenge. It works now. I updated your test program, 
made it as minimal as possible (see attached). The key to solving the 
problem was the info available here:


http://pascal.net.ru/PutImage+(en)
[...]
"BitMap is an untyped parameter that contains the height and width of 
the region, and the bit image that will be put onto the screen."

[...]

Enjoy,

Stefan


On 06/02/2017 07:40 AM, James Richters wrote:

Thanks for the help. I was able to make a little progress.


There is another agg unit agg_pixfmt_rgb_packed that seem to have the
565 format that you need. Add it to the uses list and try to replace the
pixfmt_rgba32 calls with pixfmt_rgb565. That will make agg use that format.
The pixfmt_custom_blend_rgba calls may need further hacking too to make things 
work, however, Agg2D should use a 16 bit format if you use
pixfmt_rgb565 callse instead of pixfmt_rgba32. You should also set RGBA_Width 
=2; in your program to reflect the change.


I did as you suggest here and changed my buffer to be an array of words, and I 
am able to get a representation of the image to screen by reading elements of 
the array and using putpixel() to put them on the screen,  however the colors 
are all wrong.  I am wondering if this m_pixformat variable that shows up 
everywhere needs to be set also?   The pixfmt_custom_blend_rgba calls may also 
be the problem with the colors.  There are no corresponding custom blend 
procedures in agg_pixfmt_rgb_packed.


Anyway, this will probably still not make
ptcgraph.putimage(0,0,buf[0],0);

No this still does not work, I am able to use a nested loop and putpixel() but 
that is very slow.  I still think something is missing with putimage because I 
don't see how it knows the shape of the image, maybe I need to actually do a 
getimage() at some point to set the shape of before putimage will work.. I'll 
do some experiments with it.

James

-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Stefan V. Pantazi
Sent: Thursday, June 01, 2017 9:47 AM
To: FPC-Pascal users discussions 
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

Have a look at the agg_2D unit. The agg_2D uses ..
  agg_pixfmt ,
  agg_pixfmt_rgba ,
..

Therefore, the rgba format is pretty much baked in. That is to say that the 
constructor of the main object Agg2D uses the pixfmt_rgba32 to set the pixel 
format.

...
{ CONSTRUCT }
constructor Agg2D.Construct;
begin
  m_rbuf.Construct;

  pixfmt_rgba32   (m_pixFormat ,@m_rbuf );
  pixfmt_custom_blend_rgba(m_pixFormatComp ,@m_rbuf ,@comp_op_adaptor_rgba 
,rgba_order );
  pixfmt_rgba32   (m_pixFormatPre ,@m_rbuf );
  pixfmt_custom_blend_rgba(m_pixFormatCompPre ,@m_rbuf ,@comp_op_adaptor_rgba 
,rgba_order ); ...

There is another agg unit agg_pixfmt_rgb_packed that seem to have the
565 format that you need. Add it to the uses list and try to replace the
pixfmt_rgba32 calls with pixfmt_rgb565. That will make agg use that format.

The pixfmt_custom_blend_rgba calls may need further hacking too to make things 
work, however, Agg2D should use a 16 bit format if you use
pixfmt_rgb565 callse instead of pixfmt_rgba32. You should also set RGBA_Width 
=2; in your program to reflect the change.

Anyway, this will probably still not make

ptcgraph.putimage(0,0,buf[0],0);
work, but that may be a ptcgraph problem.


Hope this helps,

Stefan

On 05/31/2017 02:57 PM, James Richters wrote:

And AggPas already has support for that pixel format


How do I define that as the format I want?  I've been looking all through the 
example and do not see how this is defined.  I've attached a test program, it's 
basically Graeme's sample but going to screen instead of a file.  I just don't 
see where the pixel format is defined.  I have it kind of working in a funny 
way by just forcing the existing pixels to conform to the required format.

-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On
Behalf Of Graeme Geldenhuys
Sent: Wednesday, May 31, 2017 1:17 PM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

On 2017-05-31 18:03, Reimar Grabowski wrote:

I'm not sure what that's called

RGB565, maybe?


And AggPas already has support for that pixel format.

Regards,
   Graeme

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org