Kelvin,

That is exactly what happens, I suggest 2 bits but I get back 8.  It seems
that you can only get GraphicsDevice's (and hence GraphicsConfiguration's)
that are related to the actual screen display device.
When using an offscreen buffer I wanted to specify the capabilities of that
buffer, in my case only say 2 bits.
The GraphicsDevice class has a "getType" method that returns the type as
one of TYPE_RASTER_SCREEN,
TYPE_PRINTER or TYPE_IMAGE_BUFFER, but at this point I don't see how to get
one that is not from the screen?  Is this possible?

 - John


On Friday, August 11, 2000 6:48 PM, Kelvin Chung
[SMTP:[EMAIL PROTECTED]] wrote:
> Hi John,
>
>     The GraphicsConfigTemplate specific the minimum requirement
> to render:
>
> /**
>  * This class is used to obtain a valid GraphicsConfiguration that
>  * can be used by Java 3D.
>  * A user instantiates one of these objects and then sets all
>  * non-default attributes as desired.  The getGraphicsConfiguration
>  * method found in the GraphicsDevice class is then called with this
>  * GraphicsConfigTemplate.  A valid GraphicsConfiguration is returned
>  * that meets or exceeds what was requested in the
GraphicsConfigTemplate.
>   * @see GraphicsConfigTemplate
>  * @see GraphicsDevice
>  * @see GraphicsConfiguration
>  */
>
> So if you suggest 2 bit per color Java3D may return 8 bit per color
> to render. However if you suggest 16 bit per color and current system
> don't support, Java3D will fail to initialize the graphics.
>
> Internally ChoosePixelFormat() (under window) or
> glXChooseVisual() (under solaris) is used to select pixelformat
> for OpenGL verson.
>
> - Kelvin
> ---------------
> Java 3D Team
> Sun Microsystems Inc.
>
>
> >MIME-Version: 1.0
> >Content-Transfer-Encoding: 7bit
> >Date: Fri, 11 Aug 2000 13:56:40 +0100
> >From: John Mosley <[EMAIL PROTECTED]>
> >Subject: [JAVA3D] Controlling the number of colors rendered
> >Comments: To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]
asoft.com>
> >To: [EMAIL PROTECTED]
> >
> >I am using offscreen rendering to create a BufferedImage which I save to
> >disk as a GIF file.  This works fine except for the number of colors
that
> >are in the image. For a GIF file this is limited to 256, so there appear
to
> >be 2 choices:
> >
> >    1) use a filter to reduce the number of colors in the BufferedImage
> >that is populated by J3D
> >
> >    2) configure J3D to only use a limited number of colors
> >
> >Option 1) would seem possible but time consuming to execute, option 2)
> >would therefore appear to be the favored solution.
> >
> >Looking at GraphicsEnvironment, GraphicsDevice and
GraphicsConfiguration,
> >it hints at this but I can't figure out how to get a GraphicsDevice
> >configured for a offscreen image?  In fact all the examples I have seen
use
> >GraphicsEnvironment.getDefaultScreenDevice() to get the GraphicsDevice,
> >even when using offscreen rendering.  As GraphicsConfigTemplate3D only
sets
> >the minimum requirements, that doesn't seem to help in this case.
> >
> >So the question is can J3D be configured to use a limited number of
colors
> >(say 2 bits per color), alternatively have anyone any experience in
> >reducing the number of colors in a existing BufferedImage?
> >
> >Thanks
> > - John
> >
>
>=======================================================================
====
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> >of the message "signoff JAVA3D-INTEREST".  For general help, send email
to
> >[EMAIL PROTECTED] and include in the body of the message "help".
>
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to