com.lizardtech.djvu
Class GPixelReference

java.lang.Object
  extended by com.lizardtech.djvu.GPixel
      extended by com.lizardtech.djvu.GPixelReference
All Implemented Interfaces:
java.lang.Cloneable

public final class GPixelReference
extends GPixel

DOCUMENT ME!

Version:
$Revision: 1.10 $
Author:
$author$

Field Summary
 
Fields inherited from class com.lizardtech.djvu.GPixel
BLACK, BLUE, GREEN, NUMELEMS, RED, WHITE
 
Constructor Summary
GPixelReference(GMap parent, int offset)
          Creates a createGPixelReference object.
GPixelReference(GMap parent, int row, int column)
          Creates a createGPixelReference object.
 
Method Summary
 byte blueByte()
          Query the blue pixel value.
 GPixelReference duplicate()
          Create a duplicate of this GPixelReference.
 void fillRGBPixels(int x, int y, int w, int h, int[] pixels, int off, int scansize)
          Fills an array of pixels from the specified values.
 byte greenByte()
          Query the green pixel value.
 void incOffset()
          Step to the next pixel.
 void incOffset(int offset)
          Skip past the specified number of pixels.
 byte redByte()
          Query the red pixel value.
 void setBGR(int blue, int green, int red)
          Set the blue, green, and red values of the current pixel.
 void setBlue(byte blue)
          Set the blue pixel value.
 void setGreen(byte green)
          Set the green pixel value.
 void setOffset(int offset)
          Set the map image pixel we are refering to.
 void setOffset(int row, int column)
          Set the map image pixel we are refering to.
 void setPixels(GPixelReference ref, int length)
          Copy the pixel values.
 void setRed(byte red)
          Set the red pixel value.
 void YCC_to_RGB(int count)
          Convert the following number of pixels from YCC to RGB.
 
Methods inherited from class com.lizardtech.djvu.GPixel
clone, equals, getBlue, getGreen, getRed, hashCode, set, setBlue, setGray, setGray, setGreen, setRed
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GPixelReference

public GPixelReference(GMap parent,
                       int offset)
Creates a createGPixelReference object.

Parameters:
parent - the image map to refere to
offset - the initial pixel position to refere to

GPixelReference

public GPixelReference(GMap parent,
                       int row,
                       int column)
Creates a createGPixelReference object.

Parameters:
parent - DOCUMENT ME!
row - DOCUMENT ME!
column - DOCUMENT ME!
Method Detail

setPixels

public final void setPixels(GPixelReference ref,
                            int length)
Copy the pixel values.

Parameters:
ref - pixel to copy

setOffset

public void setOffset(int offset)
Set the map image pixel we are refering to.

Parameters:
offset - pixel position

setOffset

public void setOffset(int row,
                      int column)
Set the map image pixel we are refering to.

Parameters:
row - vertical position
column - horizontal position

YCC_to_RGB

public void YCC_to_RGB(int count)
Convert the following number of pixels from YCC to RGB. The offset will be advanced to the end.

Parameters:
count - The number of pixels to convert.

setBGR

public void setBGR(int blue,
                   int green,
                   int red)
Set the blue, green, and red values of the current pixel.

Overrides:
setBGR in class GPixel
Parameters:
blue - pixel value
green - pixel value
red - pixel value

setBlue

public void setBlue(byte blue)
Set the blue pixel value.

Overrides:
setBlue in class GPixel
Parameters:
blue - pixel value

blueByte

public byte blueByte()
Query the blue pixel value.

Overrides:
blueByte in class GPixel
Returns:
blue pixel value

duplicate

public GPixelReference duplicate()
Create a duplicate of this GPixelReference.

Returns:
the newly created GPixelReference

fillRGBPixels

public void fillRGBPixels(int x,
                          int y,
                          int w,
                          int h,
                          int[] pixels,
                          int off,
                          int scansize)
Fills an array of pixels from the specified values.

Parameters:
x - the x-coordinate of the upper-left corner of the region of pixels
y - the y-coordinate of the upper-left corner of the region of pixels
w - the width of the region of pixels
h - the height of the region of pixels
pixels - the array of pixels
off - the offset into the pixel array
scansize - the distance from one row of pixels to the next in the array

setGreen

public void setGreen(byte green)
Set the green pixel value.

Overrides:
setGreen in class GPixel
Parameters:
green - pixel value

greenByte

public byte greenByte()
Query the green pixel value.

Overrides:
greenByte in class GPixel
Returns:
green pixel value

incOffset

public void incOffset()
Step to the next pixel. Care should be taken when stepping past the end of a row.


incOffset

public void incOffset(int offset)
Skip past the specified number of pixels. Care should be taken when stepping past the end of a row.

Parameters:
offset - number of pixels to step past.

setRed

public void setRed(byte red)
Set the red pixel value.

Overrides:
setRed in class GPixel
Parameters:
red - pixel value

redByte

public byte redByte()
Query the red pixel value.

Overrides:
redByte in class GPixel
Returns:
red pixel value