View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001958 | Lazarus | - | public | 2006-04-02 04:05 | 2014-10-01 17:16 |
Reporter | Assigned To | yang jixian | |||
Priority | normal | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 0.9.15 (SVN) | ||||
Summary | 0001958: TBitmap and Scanline simulation | ||||
Description | I have created many base image procesing functions using fast scanline method in Delphi. Now it is a problem to fast translate all the code to Lazarus, unless translation for TLazIntfImage doens't be finished. I also dobut of speed performance using TLazIntfImage. It would be useful at least to allow simulation of scanline functionality in order to keep Delphi compatibility. For example, a very fast 90 degree 32-bits rotation with Delphi code: procedure SZRotateBmp90(Src, Dest: TBitmap); var x, y : integer; dY : array of PDWORD; // Array for destination scanline sH, dH: integer; // Height variables P : PDWORD; // Source pointer begin if Src.PixelFormat<> pf32bit then Src.PixelFormat := pf32bit; if Dest.PixelFormat<> pf32bit then Dest.PixelFormat := pf32bit; try Dest.Width := Src.Height; Dest.Height := Src.Width; sH:=Src.Height-1; dH:=Dest.Height-1; // Initialize dynamic array SetLength(DY,dH+1); // Save pointers to array for acceleration for y := 0 to dH do DY[y] := Dest.ScanLine[y]; // Copy Src horizontal lines to be Dest vertical by +90 degree for y := 0 to sH do begin P:=Src.ScanLine[y]; for x := dH downto 0 do begin Dy[x]^:=P^; inc(Dy[x]); inc(P); end; end; finally SetLength(DY,0); end; end; | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
LazTarget | - | ||||
Widgetset | Win32/Win64 | ||||
Attached Files |
|
has duplicate | 0009954 | closed | yang jixian | TBitmap has no ScanLine property |
related to | 0021764 | resolved | Marc Weustink | TBitmap.Scanline implementation |
|
Over 2 years open and assigned. Is there any information of availability of this possibility? What exact problems are to "simulate" scanline? |
|
Maybe we should set it to acknowledge and un-assign the issue, then it can be open for another 2-3 years. :-) |
|
Perhaps is better to close it as an "unreal" request and force all to use "The Lazarus way"... Perhaps it is for a forum discussion, but in general, Lazarus have very slow development rate lately. Usually only lot of bug fixes, but releasing 1.0.0 seems far away from 3-5 years... How actually graph of active number of developers working on Lazarus comparing by years looking now? And the same on all platforms claims they are and will be covered? Actually, in general I have strong impression interest for Lazarus and FPC (including Delphi and Pascal respectively) rapidly drops. Despite I'm senior Delphi programmer and mainly spent all my profession life programming in Pascal, I just only regret the situation is, thus time for Pascal passed long time ago... |
|
Yes, this is more for a forum discussion. |
|
Suggestion is still active - you can freely close the issue. |
|
Maybe when FPC 2.6 is released with support for class helpers ;-) |
|
Interesting, Flavio. Can you be more specific about "initiative" (links, discussions)? |
|
@Flávio: As I'm the one who is implementing class helpers: Do you have any specific ideas or examples regarding this issue? I'd like to test them with my current (unfinished) implementation. Regards, Sven |
|
Sasa: rotation based on simple coordinate inversion is not fast. A 4x speed up is easily possible, see http://stackoverflow.com/questions/848025/rotating-bitmaps-in-code maybe even more for 32-bit. Moreover, the number of bytes to jump from (x,y) to (x,y+1) is always constant in bitmaps (but can be negative). This value can be determined by subtracting scanline[1] and scanline[0]. Using this eliminates the need for the array. (see also the URL above. The rowpitch value is ptrint(scanline[1])-ptrint(scanline[0]) Under Delphi I use the following image class (generic): http://www.stack.nl/~marcov/baseimagegen.pas which is fully detached from the GUI. |
|
I prefer scanline too. |
|
@Marco van de Voort At windows and delphi I notice no significant difference moving by fixed pointer or indexed, also for specific task it requite no SSE and prefer no additional memory to store results for faster execution. Sample I gave is a compromise between speed and code simplicity. @yang jixian Waiting to see results. Thanks. This also looks quite promising - BGRABitmap library: http://sourceforge.net/projects/lazpaint/files/ |
|
From https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/applications/lazimageeditor The DLBitmap.pas contains TDLBitmap which has a scanline property. |
|
http://forum.lazarus.freepascal.org/index.php/topic,7914.msg158161.html#msg158161 seems to indicate TBitMap has a scanline property. Is this true? Can this issue be closed? |
|
I tested with trunk on Qt. ScanLine is here and works. It has to be used like this: Bitmap.BeginUpdate; //do some ScanLine job Bitmap.EndUpdate; IMO, this can be resolved. |
|
Thanks for testing, Vojtech! @reporter: Fixed in meantime. Please close if ok or reopen if not. Thank you |
Date Modified | Username | Field | Change |
---|---|---|---|
2006-04-02 04:05 |
|
New Issue | |
2006-04-02 04:05 |
|
Widgetset | => Win32 |
2006-04-02 06:10 | Vincent Snijders | Target | => post 1.0 |
2006-04-02 06:10 | Vincent Snijders | Status | new => acknowledged |
2008-09-16 15:09 | Vincent Snijders | Status | acknowledged => assigned |
2008-09-16 15:09 | Vincent Snijders | Assigned To | => Marc Weustink |
2008-09-16 16:17 | Vincent Snijders | Relationship added | has duplicate 0009954 |
2011-01-19 11:00 |
|
Note Added: 0045299 | |
2011-01-19 11:13 | Vincent Snijders | Note Added: 0045301 | |
2011-01-19 12:25 |
|
Note Added: 0045303 | |
2011-01-19 12:27 |
|
Note Edited: 0045303 | |
2011-01-19 12:46 | Vincent Snijders | Note Added: 0045304 | |
2011-01-19 12:53 |
|
Note Added: 0045305 | |
2011-01-21 08:37 | Flávio Etrusco | Note Added: 0045358 | |
2011-01-22 04:24 |
|
Note Added: 0045390 | |
2011-01-22 10:51 | Sven Barth | Note Added: 0045394 | |
2011-03-23 11:07 | Marco van de Voort | Note Added: 0046765 | |
2011-03-23 11:08 | Marco van de Voort | Note Edited: 0046765 | |
2011-03-23 11:17 | Marco van de Voort | Note Edited: 0046765 | |
2011-03-23 11:20 | Marco van de Voort | Note Edited: 0046765 | |
2011-03-28 10:27 | yang jixian | Assigned To | Marc Weustink => yang jixian |
2011-03-28 10:32 | yang jixian | Note Added: 0046882 | |
2011-04-18 18:21 |
|
Note Added: 0047572 | |
2011-04-18 18:23 |
|
Note Edited: 0047572 | |
2011-04-18 18:28 |
|
Note Edited: 0047572 | |
2011-04-19 16:48 | yang jixian | Note Added: 0047610 | |
2012-02-04 12:03 | Zeljan Rikalo | LazTarget | post 1.0 => 1.2 |
2012-05-19 01:24 | Juha Manninen | Relationship added | related to 0021764 |
2014-01-14 15:16 | Martin Friebe | LazTarget | 1.2 => 1.4 |
2014-09-10 01:02 | Juha Manninen | LazTarget | 1.4 => - |
2014-10-01 10:25 |
|
Note Added: 0077837 | |
2014-10-01 13:38 | Vojtech Cihak | Note Added: 0077846 | |
2014-10-01 17:16 |
|
Note Added: 0077856 | |
2014-10-01 17:16 |
|
Status | assigned => resolved |
2014-10-01 17:16 |
|
Resolution | open => fixed |