[lazarus] Wrong colours in win32

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Nov 27 13:17:32 EST 2003


On Thu, 27 Nov 2003 17:17:50 +0100  Micha Nelissen
<M.Nelissen at student.tue.nl> wrote:

> Hi,
> 
> Very recently colours are wrong on win32. It happens only when using 
> -dUseFPImage. I think it has to do with recent "fpImage streaming fixed" 
> which I saw in the logs? AFAICS, no colour related things have changed 
> in the win32 interface.

I guess, it has something to do with the calculation of the bit offset in
intfgraphics.pp. Someone changed this a few weeks ago and I didn't notice it
till yesterday, that this broke the gtk side.

Probably it is related to the "Byte Order" misunderstanding.
As I said, I didn't implemented it yet, because I hoped, that it is solely
processor dependent and we do not yet support powerpc.
But it seems that even win32 and X do not use the same byte/bit order for
images. So, we have to implement it now.
That means a further IF in the Get/SetPixel function, which is a very time
critical function. I suggest to implement one all rounder function plus
several optimized functions for commong formats. The Get/SetPixel then uses
an event.

ToDo:
- first you have to find out the byte and bit order under win32. (Draw some
very simple images (5x5, 8x8, 13x13, 18x18, 26x26 and 34x34) with a few
lines. 
- fix the Get/SetPixel code (with some IFDEFs). 
- you have to try 15/16/24/32 bit depths of the window dektop. 
- then we can add the missing BitOrder/ByteOrder to the TRawImageDescription
- then we can implement the all rounder functions.
- then we add the optimized functions.

I hope, this was clear. If not, just mail.


Mattias






More information about the Lazarus mailing list