Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!wuarchive!bcm!etaylor From: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Newsgroups: comp.windows.x Subject: Re: X and images / R5 wishes Keywords: image Message-ID: <2479@gazette.bcm.tmc.edu> Date: 29 Oct 90 21:50:34 GMT References: <8913@mirsa.inria.fr> Sender: usenet@bcm.tmc.edu Reply-To: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Organization: Baylor College of Medicine, Houston, Tx Lines: 45 Nntp-Posting-Host: wilkins.iaims.bcm.tmc.edu In article <8913@mirsa.inria.fr>, mangin@debussy.inria.fr (Frank Mangin) writes: |> -- |> |> I have been writing an image viewing utility under X, using Motif, and I have some remarks: |> |> - As far as I know, the Intrinsics don't provide any way to create a shell widget with a visual different from the root window's visual. Just try to view RGB images on a pseudo color visual, you will understand... What about XtNvisual? It works but most X's I have dealt with do not support multiple visuals on the same screen. |> |> - Most often, you can't use the default colormap for image viewing. It would be really great to have more than one colormap active at a time (I mean pixels with the same value simultaneously displayed with different colors depending on the window they b|> elong to). I made an image viewer that reuses pixels for multiple invocations. It uses color dithering for VERY nice displays using the default colormap (of course any other viewer will mess it all up). |> |> - I just compiled the sun 24 bits server recently posted on comp.sources.x. It runs fine, anyway there is a problem with decomposed static colormaps: suppose you want to map an image, you know the rgb values, and you need the corresponding pixel values.|> The standard way to do this is XAllocColor, that allocates nothing, but looks up the pixel value in the colormap. But this is one server request per pixel! On a sun sparc station, it takes 1 mn for 1000 pixels... I've had to "count in bits" to guess |> |> |> |> |> |> |> values from the rgb masks (see mit/server/dix/colormap.c for details), and this works only because low pixel values give dark colors for that server. Why not an XLookupColorsss, that would query several values in a single request? Do not use XAllocColor when you do not have to. Use the red_mask, green_mask, and blue_mask of the visual structure. This is only SLIGHTLY bad but works very well. |> |> Frank Mangin |> Inria Phone #93 65 78 66 |> 2004 route des Lucioles Email: mangin@mirsa.inria.fr |> 06560 Valbonne Cedex |> France -- Eric Taylor Baylor College of Medicine etaylor@wilkins.bmc.tmc.edu (713) 798-3776