Rings
Version 0.3

threeD.raytracer.graphics
Class GraphicsConverter

java.lang.Object
  extended bythreeD.raytracer.graphics.GraphicsConverter

public class GraphicsConverter
extends java.lang.Object

The GraphicsConverter class provides static methods that allow conversion between colors and images stored as RGB objects and those stored as AWT colors.


Constructor Summary
GraphicsConverter()
           
 
Method Summary
static java.awt.Color convertToAWTColor(RGB color)
          Converts the specified RGB object to an AWT Color object.
static java.awt.Image convertToAWTImage(RGB[][] image)
          Converts the specified array of RGB objects to an AWT Image object.
static RGB convertToRGB(java.awt.Color color)
          Converts the specified AWT Color object to an RGB object.
static RGB[][] convertToRGBArray(java.awt.Image image)
          Converts the specified AWT Image object to an array of RGB objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsConverter

public GraphicsConverter()
Method Detail

convertToRGB

public static RGB convertToRGB(java.awt.Color color)
Converts the specified AWT Color object to an RGB object.


convertToAWTColor

public static java.awt.Color convertToAWTColor(RGB color)
Converts the specified RGB object to an AWT Color object.


convertToRGBArray

public static RGB[][] convertToRGBArray(java.awt.Image image)
Converts the specified AWT Image object to an array of RGB objects. The array locations map to pixels in the image. The image will be converted to the standard RGB color model if it is not already and the alpha channel will be ignored.


convertToAWTImage

public static java.awt.Image convertToAWTImage(RGB[][] image)
Converts the specified array of RGB objects to an AWT Image object. The array locations map to pixels in the image. The image produced uses the RGB color model with no alpha channel.


Rings
Version 0.3

Copyright 2003-05 Mike Murray