#1 Nearest Color (original: G. Seguin)

closed-accepted
None
5
2001-02-21
2000-09-11
No

Discussion

  • Scott Tringali

    Scott Tringali - 2000-09-11

    None

     
    Attachments
  • Scott Tringali

    Scott Tringali - 2000-09-11
    • summary: Nearest Color (original, G. Seguin) --> Nearest Color (original: G. Seguin)
     
  • Scott Tringali

    Scott Tringali - 2000-09-11

    This patch may have performance problems due to the use of XQueryColor in a loop. A better solution would be to use XQueryColors do get the entire map at once.

     
  • Scott Tringali

    Scott Tringali - 2000-11-14

    I've done a little more work on this. I converted it to XQueryColors which seems to work okay.

    However, on a 16-bit or deeper display, the call takes forever. There just doesn't seem to be a way to look through the color map efficiently. A simple fix only does the lookups in 8-bit mode under the assumption that in 16-bit mode the requested colors will be available.

    Additionally, by cycling through the colormap, there seems to be no way to check if the candidate color is read-only or read-write, or even valid at all! It may be possible to recycle a writable color owned by another app, which would produce the wrong results.

    Modulo these two things, it does seem to be a net gain, however.

     
  • Scott Tringali

    Scott Tringali - 2001-02-16

    New version of patch submitted. It works with the new best-visual feature, and more importantly, it legally acquires the close-enough color via XAllocColor.

    To test it out, use a 256-color X server, startup Netscape first (which swallows all colors), and then try syntax highlighting a file.

     
  • Scott Tringali

    Scott Tringali - 2001-02-21

    Fix committed: highlight.c 1.9
    Built and tested just fine on OSF and SGI.

     
  • Scott Tringali

    Scott Tringali - 2001-02-21
    • assigned_to: nobody --> tringali
    • status: open-accepted --> closed-accepted
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks