> "You should not look at the source code. Rather, you should transform
> image after receiving it from Jmol. Get the Image from Jmol, then
> transform the image to a new image where the black pixels have a zero
> alpha channel value. You are going to be laying this image on top of
> something else anyway. This work will be *much* more easily accomplished
> within your own code."
> Thanks for your prompt reply, Miguel. The question is that I need to
> render a stream of molecular dynamics data computed
> in real time and meanwhile generate dynamical Jmol images at a rate of
> about 20 fps on the fly. I suspect that transforming
> the resulting images by locating the black pixels would be a major
> bottleneck.

I don't think it would be difficult to sustain 20 fps, but it
fundamentally depends upon the dimensions of the image that you are
generating.

> Is there any possibility of modifying my own copy of Swing3D to add a
> transparency channel?

You can certainly modify the Swing3D class.

> For example, add them to rgbColorModel and sampleModelBitMasks?
> DirectionColorModel supports alphaMask.

Correct.

Change ...

  final static DirectColorModel rgbColorModel =
    new DirectColorModel(24, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000);

  final static int[] sampleModelBitMasks =
  { 0x00FF0000, 0x0000FF00, 0x000000FF };


BECOMES =>

  final static DirectColorModel rgbColorModel =
    new DirectColorModel(32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);

  final static int[] sampleModelBitMasks =
  { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000};

I believe that is all that will be necessary to enable the alpha channel.

You can then fill your background with an alpha channel of zero.


If you can get it working then we will consider incorporating it into the
main distribution.


Miguel



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to