Recent

Author Topic: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???  (Read 5837 times)

ozznixon

  • Full Member
  • ***
  • Posts: 119
    • http://www.modernpascal.com/
Working on a simple demo, using FPC and Apache Module - I have all that working... now I want to demo using TJPeg or TPng, a simple Page Counter... however, my requirements are no TObject/TClass... specifically no use of Forms. I have rewritten TJpeg to raw functions, no object - again the goal is to be as lean as possible.

I know normally, put text on a tpanel on a tform, using tcanvas to capture into a tbitmap and save using tjpeg... but, the goal is zero "t" ;-)

Thanks,
Ozz
---
Want to kick the tires to a Free Pascal like script engine? http://www.ModernPascal.com/

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #1 on: March 03, 2017, 06:10:08 pm »
again the goal is to be as lean as possible.

I can't figure out what you're saying. Are you writing desktop software that will pull images from the server? If so, then your goal of "leanness" makes no sense to me. Are you writing Web-based software? Then the LCL component discussion makes no sense, since you would use JavaScript on the client side to display the image, like this:

https://macpgmr.github.io/MacXPlatform/WebAppOverview.html

Maybe you could educate us on what you're actually trying to do and why.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #2 on: March 03, 2017, 06:20:50 pm »
- again the goal is to be as lean as possible.

1. Handcode everything in assembler. Report back in 10 years when you are ready :-)
2. don't use compressed image format, emit uncompressed bmps. Compression is expensive. (*)

Seriously, while the basic jpeg support is procedural, most of the image code in FPC is classes based.

Image data is typically not slower with classes, since it is usually an image per class, not an class per pixel.

That said, FPC's imaging support is not exactly efficient. If you want something performant look elsewhere (e.g. lazarus tlazintfimage, or maybe BGRAbitmap)

(*) a very old cgi bmp counter shows how simple it is to write a simple bmp http://www.stack.nl/~marcov/cntbmp.pp

sky_khan

  • Guest
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #3 on: March 03, 2017, 07:03:28 pm »
Why ? Do you afraid of attack of the cloned objects ?
( Maybe the cube, the pyramid and the sphere of delphi 2-4 in particular? )
Yeah I still remember how it was, to learn oop after you get used to procedural programming, 20 something years ago.

Btw, you know you can still use graphics classes like TBitmap or TJPEG without forms, dont you ?
« Last Edit: March 03, 2017, 07:06:00 pm by SkyKhan »

ozznixon

  • Full Member
  • ***
  • Posts: 119
    • http://www.modernpascal.com/
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #4 on: March 04, 2017, 01:34:52 pm »
again the goal is to be as lean as possible.

I can't figure out what you're saying. Are you writing desktop software that will pull images from the server? If so, then your goal of "leanness" makes no sense to me. Are you writing Web-based software? Then the LCL component discussion makes no sense, since you would use JavaScript on the client side to display the image, like this:

https://macpgmr.github.io/MacXPlatform/WebAppOverview.html

Maybe you could educate us on what you're actually trying to do and why.

I have written www.ModernPascal.com -- a FPC script engine, and I am putting together some demonstrations of simple things like Page Counter. ModernPascal runs cross-platform (anywhere I can compile the core code using FPC) and it's Celerity engine is an Apache Module... like PHP. I have been vague, as I have much more documentation to do before I want to unveil to the world. But, people have to know the why to initial the help.

So... now that you know, what's the answer? How can I generate a page counter, with zero t objects, as there isn't a desktop to render to. :-D

O.
---
Want to kick the tires to a Free Pascal like script engine? http://www.ModernPascal.com/

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #5 on: March 04, 2017, 03:44:26 pm »
You seem to confuse GUI controls with objects in general.

Most objects are non visual, including FPC fcl-image libraries.

sky_khan

  • Guest
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #6 on: March 04, 2017, 05:01:36 pm »
Well, Lets keep this forum pseudo-question-ish advertisements free. Shall we ?
You should have used 3rd Party announcement forum for this.

ozznixon

  • Full Member
  • ***
  • Posts: 119
    • http://www.modernpascal.com/
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #7 on: March 14, 2017, 09:28:07 pm »
I am not promoting anything (it was answering this is not a laz possible project), and no I am not confusing objects with GUI. I have been developing compilers for over two decades.

* My question is how would I build a simple web page counter - pushing out JPG or PNG, without using TForm, TPanel, T* GUI and doing it raw ... or is this too advance for this group?
---
Want to kick the tires to a Free Pascal like script engine? http://www.ModernPascal.com/

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #8 on: March 15, 2017, 05:12:04 am »
* My question is how would I build a simple web page counter - pushing out JPG or PNG, without using TForm, TPanel, T* GUI and doing it raw ... or is this too advance for this group?
I get the first requirement and it surely is easily doable, but I have no idea what the image is for.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #9 on: March 15, 2017, 08:59:32 am »
I am not promoting anything (it was answering this is not a laz possible project), and no I am not confusing objects with GUI. I have been developing compilers for over two decades.

* My question is how would I build a simple web page counter - pushing out JPG or PNG, without using TForm, TPanel, T* GUI and doing it raw ... or is this too advance for this group?

And you already had your answer. I already posted a working bmp cgi, and you can change it to jpg/png using fcl-image.   The jpg support in fcl-image (which is NON GUI, but classes based) is based on the procedural pasjpeg. All of these libraries come with examples, study them

sky_khan

  • Guest
Re: Possible to do - FPC Apache Module Page Counter, w/o TForm, etc.???
« Reply #10 on: March 15, 2017, 10:17:55 am »

Freepascal has fcl-image library* which provides operating system and widget-set independent classes for working with in-memory images.
If you insist you cannot use any class then there are low-level units you can use without classes in freepascal like pasjpeg package.
If you are not able to find a way to use any of these, even you're developing compilers for over two decades, well... then I cannot help you
and I dont think you can find anybody who has time or will to write a pure procedural image library from scratch for your pleasure.

* http://wiki.freepascal.org/fcl-image

 

TinyPortal © 2005-2018