discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNUstep cookbook: screen grab with X11. Misc.


From: Alexander Malmberg
Subject: Re: GNUstep cookbook: screen grab with X11. Misc.
Date: Tue, 23 Sep 2003 18:43:41 +0200

Marko Riedel wrote:
[snip]
> 1. I looked at the code in XGServer where improvements are
>    solicited. As far as I can see this code tries to guess the bitmap
>    structure of TrueColor pixels by trying different combinations,
>    sending them as a pixel value to the server, reading the component
>    values that the server returned and checking whether the guess was
>    correct. Shouldn't we be able to do without guessing? It seems to
>    me that we need only look at the fields "red_mask", "green_mask"
>    and "blue_mask" of the visual, the way I do in my recipe. 

It should. back-art uses the masks.

> That way
>    we could handle all pixel structures and not just the few that are
>    hardcoded into XGServer.

Not all, only the ones that can be described using these three masks.
You still need to query the server for pseudo-color visuals, and I don't
think it'd help with grayscale visuals (although I guess those are rare
today).

[snip]
> 3. Stefan Urbanek asked whether we could use the code from my recipe
>    in a color picker. I don't quite understand what he means.
[snip]

I think what he means is that the color picker should have a function
that lets you click on a location on the screen and have the color
picker grab the color of a nearby pixel.

The answer is that the color picker couldn't use this code directly
(it's X-specific), but similar code could be added in the implementation
in back-x11 of a GSReadPixelFromScreen operator (or something) and the
color picker could use that.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]