apps.lightrays.gfxlib
Class Pixels

java.lang.Object
  extended by apps.lightrays.gfxlib.Pixels

public class Pixels
extends java.lang.Object

The Class Pixels.


Field Summary
 int height
          The height.
 int[] pixels
          The pixels.
 int width
          The width.
 
Constructor Summary
Pixels(int[] pixels, int w, int h)
          Instantiates a new pixels.
Pixels(int width, int height)
          Instantiates a new pixels.
 
Method Summary
 int getHeight()
          Gets the height.
 int getPixel(int x, int y)
          Gets the pixel.
 int[] getPixels()
          Gets the pixels.
 java.awt.Dimension getSize()
          Gets the size.
 int getWidth()
          Gets the width.
static int rgbToInt(int r, int g, int b)
          Rgb to int.
 void setPixel(int x, int y, int c)
          Sets the pixel.
 void setRGB(int x, int y, int r, int g, int b)
          Sets the rgb.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

height

public int height
The height.


pixels

public int[] pixels
The pixels.


width

public int width
The width.

Constructor Detail

Pixels

public Pixels(int width,
              int height)
Instantiates a new pixels.

Parameters:
width - the width
height - the height

Pixels

public Pixels(int[] pixels,
              int w,
              int h)
Instantiates a new pixels.

Parameters:
pixels - the pixels
w - the w
h - the h
Method Detail

rgbToInt

public static int rgbToInt(int r,
                           int g,
                           int b)
Rgb to int.

Parameters:
r - the r
g - the g
b - the b
Returns:
the int

getHeight

public int getHeight()
Gets the height.

Returns:
the height

getPixel

public int getPixel(int x,
                    int y)
Gets the pixel.

Parameters:
x - the x
y - the y
Returns:
the pixel

getPixels

public int[] getPixels()
Gets the pixels.

Returns:
the pixels

getSize

public java.awt.Dimension getSize()
Gets the size.

Returns:
the size

getWidth

public int getWidth()
Gets the width.

Returns:
the width

setPixel

public void setPixel(int x,
                     int y,
                     int c)
Sets the pixel.

Parameters:
x - the x
y - the y
c - the c

setRGB

public void setRGB(int x,
                   int y,
                   int r,
                   int g,
                   int b)
Sets the rgb.

Parameters:
x - the x
y - the y
r - the r
g - the g
b - the b

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object