Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-11

Win32 fpimage support + cleanups (affects gtk)

12 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Micha Nelissen

Hi,

Several cleanups. Gtk people, please test your compilation, I don't have cross-compile ...

Are there test cases / examples for fpimage support?

Regards,

Micha.

Reply by email

Micha Nelissen
to Micha Nelissen
Mattias Gaertner wrote 9 lines
On Mon, 10 Nov 2003 17:17:43 +0100 Micha Nelissen wrote: >Are there test cases / examples for fpimage support? None yet. Simply load some bmp, xpm or png files. Or you can try the jpeglazarus package on lazarus-ccr.

Heh, tried an updated version of speedtest.pp. To penguin turns up blue+pink :). Is RRGGBB swapped incorrectly then?

Regards,

Micha.

Reply by email

Micha Nelissen
to Micha Nelissen: Several cleanups. Gtk people, please test your compilation, I don't have cross-compile ...
Mattias Gaertner wrote 26 lines
On Wed, 12 Nov 2003 22:09:55 +0100 Micha Nelissen wrote: >Mattias Gaertner wrote: > > >>On Mon, 10 Nov 2003 17:17:43 +0100 >>Micha Nelissen wrote: >> >> >>>Are there test cases / examples for fpimage support? >> >> >>None yet. >>Simply load some bmp, xpm or png files. Or you can try the jpeglazarus >>package on lazarus-ccr. > >Heh, tried an updated version of speedtest.pp. To penguin turns up >blue+pink :). Is RRGGBB swapped incorrectly then? The penguin is like any other penguin black and white. If you got colors, then - the xpm color map loading is buggy - the creation of the pixels is buggy.

Do the raw images support ByteOrder already? I changed it, but it doesn't seem to have an effect. I also can't find any mention of ByteOrder intfgraphics.pas.

Micha.

Reply by email

Micha Nelissen
to Micha Nelissen: Several cleanups. Gtk people, please test your compilation, I don't have cross-compile ...
Mattias Gaertner wrote 30 lines
On Wed, 12 Nov 2003 22:09:55 +0100 Micha Nelissen wrote: >Mattias Gaertner wrote: > > >>On Mon, 10 Nov 2003 17:17:43 +0100 >>Micha Nelissen wrote: >> >> >>>Are there test cases / examples for fpimage support? >> >> >>None yet. >>Simply load some bmp, xpm or png files. Or you can try the jpeglazarus >>package on lazarus-ccr. > >Heh, tried an updated version of speedtest.pp. To penguin turns up >blue+pink :). Is RRGGBB swapped incorrectly then? The penguin is like any other penguin black and white. If you got colors, then - the xpm color map loading is buggy - the creation of the pixels is buggy. Please check the CreatePixmapIndirect function in the win32 intf. Or: wait till we find a clean solution for rawimages and you and I will have implemented it.

I am trying this with the rawimages :). I now have the colours of the main bitmap ok, but the alpha bitmap is still a problem. It looks weird, not the outline of the penguin, but...can't really tell. I have specified alphabitperpixel = 1, is that valid?

Micha.

Reply by email

Mattias Gaertner
to Micha Nelissen: Several cleanups. Gtk people, please test your compilation, I don't have cross-compile ...
I have a very strange troubles with current lazarus and current fpc development branches. I have full cvs of FPC installed, and /usr/src/fpc is written in "fpc path". But no fpc unit (including system) is found by codetools.

You can see what the codetools found in your FPC source directory: Source Editor -> popup Menu -> Unit Info -> Show Codetools Values -> #UnitLinks

If there are no units, maybe the cache needs to be rebuild: Change the FPC Src Dir to something , leave the environment options dialog (ignore warning), then set the correct path.

Mattias

Reply by email

Micha Nelissen
to Micha Nelissen: Several cleanups. Gtk people, please test your compilation, I don't have cross-compile ...
Mattias Gaertner wrote 18 lines
On Thu, 13 Nov 2003 21:34:01 +0100 Micha Nelissen wrote: >Mattias Gaertner wrote: > >>The penguin is like any other penguin black and white. >>If you got colors, then >>- the xpm color map loading is buggy >>- the creation of the pixels is buggy. > >Do the raw images support ByteOrder already? I changed it, but it >doesn't seem to have an effect. I also can't find any mention of >ByteOrder intfgraphics.pas. No, it does not yet. I thought, we need it for powerpc, not intel. Feel free to implement.

That's because intel is the 'illogical' way, the bytes are reversed relative what you think it should be, like: 3 2 1 0 7 6 5 4 ... 3 is least significant; i use low significance = low memory address :). Powerpc is the 'right' way.

Micha.

Reply by email

Mattias Gaertner
to Micha Nelissen: Several cleanups. Gtk people, please test your compilation, I don't have cross-compile ...
Show quoted text 14 lines
Mattias Gaertner wrote: > On Mon, 10 Nov 2003 17:17:43 +0100 > Micha Nelissen wrote: > >>Are there test cases / examples for fpimage support? > > > None yet. > Simply load some bmp, xpm or png files. Or you can try the jpeglazarus > package on lazarus-ccr. Heh, tried an updated version of speedtest.pp. To penguin turns up blue+pink :). Is RRGGBB swapped incorrectly then?

The penguin is like any other penguin black and white. If you got colors, then
- the xpm color map loading is buggy
- the creation of the pixels is buggy.

Please check the CreatePixmapIndirect function in the win32 intf.

Or: wait till we find a clean solution for rawimages and you and I will have implemented it.

Mattias

Reply by email

Micha Nelissen
to Micha Nelissen: Several cleanups. Gtk people, please test your compilation, I don't have cross-compile ...
Micha Nelissen wrote 36 lines
Mattias Gaertner wrote: > On Wed, 12 Nov 2003 22:09:55 +0100 > Micha Nelissen wrote: > > >> Mattias Gaertner wrote: >> >> >>> On Mon, 10 Nov 2003 17:17:43 +0100 >>> Micha Nelissen wrote: >>> >>> >>>> Are there test cases / examples for fpimage support? >>> >>> >>> >>> None yet. Simply load some bmp, xpm or png files. Or you can try the >>> jpeglazarus >>> package on lazarus-ccr. >> >> >> Heh, tried an updated version of speedtest.pp. To penguin turns up >> blue+pink :). Is RRGGBB swapped incorrectly then? > > > > The penguin is like any other penguin black and white. > If you got colors, then > - the xpm color map loading is buggy > - the creation of the pixels is buggy. Do the raw images support ByteOrder already? I changed it, but it doesn't seem to have an effect. I also can't find any mention of ByteOrder intfgraphics.pas.

Attached patch seems to make things a little better, but still the right and left half of the image are swapped. Mattias, maybe it gives you a hint? Alpha bitmaps are monochrome on win32 afaik, so this functionality is crucial.

Micha.

Index: intfgraphics.pas
=================================================================== RCS file: /FPC/CVS/projects/lazarus/lcl/intfgraphics.pas,v retrieving revision 1.10
diff -u -b -r1.10 intfgraphics.pas
--- intfgraphics.pas 7 Nov 2003 22:50:44 -0000 1.10 +++ intfgraphics.pas 13 Nov 2003 21:20:05 -0000
@@ -803,6 +803,8 @@

   BitOffset:=FDataDescription.AlphaBitsPerPixel*cardinal(x)+Position.Bit;
   Position.Bit:=BitOffset and 7;
   inc(Position.Byte,BitOffset shr 3);

+ if FDataDescription.ByteOrder = riboLSBFirst then
+ Position.Byte := (Position.Byte and not $3) + (3 - (Position.Byte and $3)); end;

 procedure TLazIntfImage.LoadFromDevice(DC: HDC);

Reply by email

Micha Nelissen
to Micha Nelissen: Several cleanups. Gtk people, please test your compilation, I don't have cross-compile ...
Micha Nelissen wrote 25 lines
Mattias Gaertner wrote: > On Wed, 12 Nov 2003 22:09:55 +0100 > Micha Nelissen wrote: > > >> Heh, tried an updated version of speedtest.pp. To penguin turns up >> blue+pink :). Is RRGGBB swapped incorrectly then? > > > The penguin is like any other penguin black and white. > If you got colors, then > - the xpm color map loading is buggy > - the creation of the pixels is buggy. > > Please check the CreatePixmapIndirect function in the win32 intf. > > Or: wait till we find a clean solution for rawimages and you and I > will have > implemented it. I am trying this with the rawimages :). I now have the colours of the main bitmap ok, but the alpha bitmap is still a problem. It looks weird, not the outline of the penguin, but...can't really tell. I have

Now I think I see it: it seems the bytes are swapped within the dwords or so. Weird that the bitmap looks good, but the alpha mask does not.

Micha.

Reply by email

Mattias Gaertner
to Micha Nelissen: Several cleanups. Gtk people, please test your compilation, I don't have cross-compile ...
Show quoted text 32 lines
Mattias Gaertner wrote: > On Wed, 12 Nov 2003 22:09:55 +0100 > Micha Nelissen wrote: > > >>Mattias Gaertner wrote: >> >> >>>On Mon, 10 Nov 2003 17:17:43 +0100 >>>Micha Nelissen wrote: >>> >>> >>>>Are there test cases / examples for fpimage support? >>> >>> >>>None yet. >>>Simply load some bmp, xpm or png files. Or you can try the jpeglazarus >>>package on lazarus-ccr. >> >>Heh, tried an updated version of speedtest.pp. To penguin turns up >>blue+pink :). Is RRGGBB swapped incorrectly then? > > > The penguin is like any other penguin black and white. > If you got colors, then > - the xpm color map loading is buggy > - the creation of the pixels is buggy. Do the raw images support ByteOrder already? I changed it, but it doesn't seem to have an effect. I also can't find any mention of ByteOrder intfgraphics.pas.

No, it does not yet. I thought, we need it for powerpc, not intel. Feel free to implement.

Mattias

Reply by email