Recent

Author Topic: Bitmap Scanline example?  (Read 22545 times)

Pegasus_Seiya

  • New Member
  • *
  • Posts: 25
Bitmap Scanline example?
« on: December 03, 2006, 07:42:02 pm »
Hi

I don't understand how to use scanline on lazarus

example in delphi:


Code: [Select]


a: Pcardinal;

begin

a := bmp.Scanline[index];

end;


how to make it on lazarus.

I need get the pcardinal value.

thanks

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890

Pegasus_Seiya

  • New Member
  • *
  • Posts: 25
RE: Re: Bitmap Scanline example?
« Reply #2 on: December 12, 2006, 08:15:19 pm »
TXLBitmap solve the problem

BuffaloX

  • New Member
  • *
  • Posts: 10
Re: RE: Re: Bitmap Scanline example?
« Reply #3 on: June 22, 2007, 12:09:33 pm »
Quote from: "Pegasus_Seiya"
TXLBitmap solve the problem


What and where is that?

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: RE: Re: Bitmap Scanline example?
« Reply #4 on: June 22, 2007, 12:26:38 pm »
Quote from: "BuffaloX"
What and where is that?


Improved version here: http://www.theo.ch/lazarus/opbitmap1_5.zip

BuffaloX

  • New Member
  • *
  • Posts: 10
Re: RE: Re: Bitmap Scanline example?
« Reply #5 on: June 22, 2007, 11:10:20 pm »
Quote from: "theo"
Quote from: "BuffaloX"
What and where is that?


Improved version here: http://www.theo.ch/lazarus/opbitmap1_5.zip


Thanx
Looks cool,
 
Only problem I see is that the readme says
"However Endianness is not taken care of at the moment and some parts contain intel asm."

The Endianness can be an inconvenience, the asm stuff may make it useless soon.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: RE: Re: Bitmap Scanline example?
« Reply #6 on: June 23, 2007, 11:15:23 am »
Quote from: "BuffaloX"

The Endianness can be an inconvenience, the asm stuff may make it useless soon.


The code in opbitmap.pas does not contain asm, just some codes from GraphicEx do.
Using it for a scanline-like access, you won't need the image-formats reader/writer stuff at all.
The most important Imager readers/writers like JPEG, GIF, PNG, BMP do not use asm either. So it's not "useless" because of this. ;-)

BuffaloX

  • New Member
  • *
  • Posts: 10
Bitmap Scanline example?
« Reply #7 on: June 23, 2007, 12:07:32 pm »
OK it looks very nice.
I installed it to try it out, but I got loads of warnings,
So I decided to use TLazIntfImage for now.

Scanline is supported in TLazIntfImage
and I got over  50 megapixels per second on my 2Ghz Athlon64.
Thats a very impressive performance by Lazarus IMO.

Unfortunately when I wanted to make random colours, the performance dropped to a measly 250.000 pix/sec.

I think I'll do a tiny demo app for Lazarus, just to show the speed of  TLazIntfImage.

opbitmap may be handy later for other stuff, but I haven't looked into it enough yet.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Bitmap Scanline example?
« Reply #8 on: June 24, 2007, 03:36:31 am »
Quote from: "BuffaloX"
OK it looks very nice.
I installed it to try it out, but I got loads of warnings,
So I decided to use TLazIntfImage for now.

opbitmap may be handy later for other stuff, but I haven't looked into it enough yet.


Maybe it's not so clear what OpBitmap is.
I know that from a concrete point of view like LCL, VCL you may ask yourself this question.
It is:
- A completely Widgetset (and X-Server) indepentent Bitmap.
- You can use it without running X-Server in Server Applications.
- It is able to convert Bitmap Formats pf1bit ... pf64bit with color reduction if necessary independent of Widgetsets.
- It is to some degree VCL compatible providing Scanline Access etc which makes it easy to port VCL Imaging Functions (using pf24bit or whatever it takes) and using Palettes.
- It does not Provide direct access to Image Data of the Widgetset, so it does not speed-up in these cases.
-But it is fast in a scenario where you load Images (PNG, JPEG, BMP. GIF etc.) probably resample them, paint a logo on the picture and save it to another Format to disk. Here no Wigetset Interaction is necessary, all plain RTL.
- It has "Bridges" to paint on LCL, VLC. CLX, maybe MSEGUI.
- Plus it has (as a proof of concept) many image reading/writing Formats that come with it. which are partially more capable than current LCL (Progressive JPEG, RLE Bitmaps, GIF) without using external libs.
- The best Bonus: You can write code in Delphi, Kylix, LCL and it should work exactly the same on all compilers / widgetsets.
- The interaction with the LCL only takes place in "lazbridge.pas" and this is only an example which can be improved. (OK, plus all the code in lazopXX.pas which are TFPCustomImageReaders).