sj.opencv
Class IplImage

java.lang.Object
  extended by sj.opencv.BasePointer
      extended by sj.opencv.IplImage

public class IplImage
extends BasePointer

Author: siggi Date: Jul 28, 2010


Method Summary
 void clear()
          Clears the image buffer by setting all values to zero.
 java.nio.ByteBuffer getByteBuffer()
           
 byte[] getBytePixel(int n)
          Returns the pixel values at the given index.
 void getBytePixel(int n, byte[] pixel)
          Copies the pixel values at the given index into the given destination array.
 byte[] getBytePixel(int x, int y)
          Returns the pixel values at the given coordinate pair.
 void getBytePixel(int x, int y, byte[] pixel)
          Copies the pixel values at the given coordinate pair into the given destination array.
 Constants.ColorModel getColorModel()
          Returns the color model of the image.
 double[] getDoublePixel(int n)
          Returns the pixel values at the given index.
 void getDoublePixel(int n, double[] pixel)
          Copies the pixel values at the given index into the given destination array.
 double[] getDoublePixel(int x, int y)
          Returns the pixel values at the given coordinate pair.
 void getDoublePixel(int x, int y, double[] pixel)
          Copies the pixel values at the given coordinate pair into the given destination array.
 float[] getFloatPixel(int n)
          Returns the pixel values at the given index.
 void getFloatPixel(int n, float[] pixel)
          Copies the pixel values at the given index into the given destination array.
 float[] getFloatPixel(int x, int y)
          Returns the pixel values at the given coordinate pair.
 void getFloatPixel(int x, int y, float[] pixel)
          Copies the pixel values at the given coordinate pair into the given destination array.
 int getHeight()
          Returns the height of the image.
 java.nio.ByteBuffer getImageData()
          Returns the byte buffer containing the pixel data of the image.
 java.nio.DoubleBuffer getImageDataAsDouble()
          Returns a view to the image byte buffer as a double buffer.
 java.nio.FloatBuffer getImageDataAsFloat()
          Returns a view to the image byte buffer as a float buffer.
 java.nio.ShortBuffer getImageDataAsShort()
          Returns a view to the image byte buffer as a short buffer.
 int getNumberOfChannels()
          Returns the number of channels in the image.
 Constants.PixelDepth getPixelDepth()
          Returns the depth of the image.
 short[] getShortPixel(int n)
          Returns the pixel values at the given index.
 short[] getShortPixel(int x, int y)
          Returns the pixel values at the given coordinate pair.
 void getShortPixel(int x, int y, short[] pixel)
          Copies the pixel values at the given coordinate pair into the given destination array.
 void getShortPixel(int n, short[] pixel)
          Copies the pixel values at the given index into the given destination array.
 int getWidth()
          Returns the width of the image.
 int getWidthStep()
           
 void putImageData(java.nio.ByteBuffer src)
          Copies the given byte buffer into the image's byte buffer.
 void putImageData(java.nio.DoubleBuffer src)
          Copies the given double buffer into the image's byte buffer.
 void putImageData(java.nio.FloatBuffer src)
          Copies the given float buffer into the image's byte buffer.
 void putImageData(java.nio.ShortBuffer src)
          Copies the given short buffer into the image's byte buffer.
 void setBytePixel(int n, byte[] pixel)
          Sets the pixel values at the given index to the values in the given array.
 void setBytePixel(int x, int y, byte[] pixel)
          Sets the pixel values at the given coordinate pair to the values in the given array.
 void setDoublePixel(int n, double[] pixel)
          Sets the pixel values at the given index to the values in the given array.
 void setDoublePixel(int x, int y, double[] pixel)
          Sets the pixel values at the given coordinate pair to the values in the given array.
 void setFloatPixel(int n, float[] pixel)
          Sets the pixel values at the given index to the values in the given array.
 void setFloatPixel(int x, int y, float[] pixel)
          Sets the pixel values at the given coordinate pair to the values in the given array.
 void setShortPixel(int x, int y, short[] pixel)
          Sets the pixel values at the given coordinate pair to the values in the given array.
 void setShortPixel(int n, short[] pixel)
          Sets the pixel values at the given index to the values in the given array.
 
Methods inherited from class sj.opencv.BasePointer
getPointer, isDeallocated, markAsDeallocated
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getByteBuffer

public java.nio.ByteBuffer getByteBuffer()

getPixelDepth

public Constants.PixelDepth getPixelDepth()
Returns the depth of the image. The possible depths are specified by the enum Depth.

Returns:
An enum Depth value indicating the image depth.

getColorModel

public Constants.ColorModel getColorModel()
Returns the color model of the image. The possible color models are specified by the enum ColorModel. If the image was constructed without a color model the method returns null.

Returns:
An enum ColorModel value indicating the color model of the image, or null if the image was constructed without a color model.

getWidth

public int getWidth()
Returns the width of the image.

Returns:
An integer indicating the image width.

getHeight

public int getHeight()
Returns the height of the image.

Returns:
An integer indicating the image height.

getWidthStep

public int getWidthStep()

getImageData

public java.nio.ByteBuffer getImageData()
Returns the byte buffer containing the pixel data of the image. Any change to this buffer will be visible in the image.

Returns:
A byte buffer containing the image data.

getImageDataAsShort

public java.nio.ShortBuffer getImageDataAsShort()
                                         throws java.lang.UnsupportedOperationException
Returns a view to the image byte buffer as a short buffer. This operation is only available when the image has depth SHORT.

Returns:
A short buffer containing the image data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth SHORT.

getImageDataAsFloat

public java.nio.FloatBuffer getImageDataAsFloat()
                                         throws java.lang.UnsupportedOperationException
Returns a view to the image byte buffer as a float buffer. This operation is only available when the image has depth FLOAT.

Returns:
A float buffer containing the image data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth FLOAT.

getImageDataAsDouble

public java.nio.DoubleBuffer getImageDataAsDouble()
                                           throws java.lang.UnsupportedOperationException
Returns a view to the image byte buffer as a double buffer. This operation is only available when the image has depth DOUBLE.

Returns:
A double buffer containing the image data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth DOUBLE.

getNumberOfChannels

public int getNumberOfChannels()
Returns the number of channels in the image.

Returns:
An integer indicating the number of channels in the image.

putImageData

public void putImageData(java.nio.ByteBuffer src)
                  throws java.lang.IllegalArgumentException
Copies the given byte buffer into the image's byte buffer. Both buffers should have the same capacity.

Parameters:
src - A byte buffer with image data.
Throws:
java.lang.IllegalArgumentException - If the given byte buffer has a different capacity from the image's byte buffer.

putImageData

public void putImageData(java.nio.ShortBuffer src)
                  throws java.lang.UnsupportedOperationException,
                         java.lang.IllegalArgumentException
Copies the given short buffer into the image's byte buffer. The capacity of the short buffer should be equivalent to the capacity of the byte buffer. This operation is only available to images with depth SHORT.

Parameters:
src - A short buffer with image data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth SHORT.
java.lang.IllegalArgumentException - If the capacity of the short buffer does not match the capacity of the image's byte buffer.

putImageData

public void putImageData(java.nio.FloatBuffer src)
                  throws java.lang.UnsupportedOperationException,
                         java.lang.IllegalArgumentException
Copies the given float buffer into the image's byte buffer. The capacity of the float buffer should be equivalent to the capacity of the byte buffer. This operation is only available to images with depth FLOAT.

Parameters:
src - A float buffer with image data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth FLOAT.
java.lang.IllegalArgumentException - If the capacity of the float buffer does not match the capacity of the image's byte buffer.

putImageData

public void putImageData(java.nio.DoubleBuffer src)
                  throws java.lang.UnsupportedOperationException,
                         java.lang.IllegalArgumentException
Copies the given double buffer into the image's byte buffer. The capacity of the double buffer should be equivalent to the capacity of the byte buffer. This operation is only available to images with depth DOUBLE.

Parameters:
src - A double buffer with image data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth DOUBLE.
java.lang.IllegalArgumentException - If the capacity of the double buffer does not match the capacity of the image's byte buffer.

getBytePixel

public byte[] getBytePixel(int x,
                           int y)
                    throws java.lang.UnsupportedOperationException,
                           java.lang.IndexOutOfBoundsException
Returns the pixel values at the given coordinate pair. This operation is only available for images of depth BYTE. The returned byte array has length equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
Returns:
A byte array containing the pixel values for each channel.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth BYTE.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.

getBytePixel

public void getBytePixel(int x,
                         int y,
                         byte[] pixel)
                  throws java.lang.UnsupportedOperationException,
                         java.lang.IndexOutOfBoundsException,
                         java.lang.IllegalArgumentException
Copies the pixel values at the given coordinate pair into the given destination array. This operation is only available for images of depth BYTE. The length of the byte array must be equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
pixel - A byte array with length equal to the number of channels of the image.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth BYTE.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

getBytePixel

public byte[] getBytePixel(int n)
                    throws java.lang.UnsupportedOperationException,
                           java.lang.IndexOutOfBoundsException
Returns the pixel values at the given index. This operation is only available for images of depth BYTE. The returned byte array has length equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
Returns:
A byte array containing the pixel values for each channel.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth BYTE.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.

getBytePixel

public void getBytePixel(int n,
                         byte[] pixel)
                  throws java.lang.UnsupportedOperationException,
                         java.lang.IndexOutOfBoundsException,
                         java.lang.IllegalArgumentException
Copies the pixel values at the given index into the given destination array. This operation is only available for images of depth BYTE. The length of the byte array must be equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
pixel - A byte array with length equal to the number of channels of the image.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth BYTE.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.
java.lang.IllegalArgumentException

getShortPixel

public short[] getShortPixel(int x,
                             int y)
                      throws java.lang.UnsupportedOperationException,
                             java.lang.IndexOutOfBoundsException
Returns the pixel values at the given coordinate pair. This operation is only available for images of depth SHORT. The returned short array has length equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
Returns:
A short array containing the pixel values for each channel.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth SHORT.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.

getShortPixel

public void getShortPixel(int x,
                          int y,
                          short[] pixel)
                   throws java.lang.UnsupportedOperationException,
                          java.lang.IndexOutOfBoundsException,
                          java.lang.IllegalArgumentException
Copies the pixel values at the given coordinate pair into the given destination array. This operation is only available for images of depth SHORT. The length of the short array must be equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
pixel - A short array with length equal to the number of channels of the image.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth SHORT.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

getShortPixel

public short[] getShortPixel(int n)
                      throws java.lang.UnsupportedOperationException,
                             java.lang.IndexOutOfBoundsException
Returns the pixel values at the given index. This operation is only available for images of depth SHORT. The returned short array has length equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
Returns:
A short array containing the pixel values for each channel.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth SHORT.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.

getShortPixel

public void getShortPixel(int n,
                          short[] pixel)
                   throws java.lang.UnsupportedOperationException,
                          java.lang.IndexOutOfBoundsException,
                          java.lang.IllegalArgumentException
Copies the pixel values at the given index into the given destination array. This operation is only available for images of depth SHORT. The length of the short array must be equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
pixel - A short array with length equal to the number of channels of the image.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth SHORT.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

getFloatPixel

public float[] getFloatPixel(int x,
                             int y)
                      throws java.lang.UnsupportedOperationException,
                             java.lang.IndexOutOfBoundsException
Returns the pixel values at the given coordinate pair. This operation is only available for images of depth FLOAT. The returned float array has length equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
Returns:
A float array containing the pixel values for each channel.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth FLOAT.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.

getFloatPixel

public void getFloatPixel(int x,
                          int y,
                          float[] pixel)
                   throws java.lang.UnsupportedOperationException,
                          java.lang.IndexOutOfBoundsException,
                          java.lang.IllegalArgumentException
Copies the pixel values at the given coordinate pair into the given destination array. This operation is only available for images of depth FLOAT. The length of the float array must be equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
pixel - A float array with length equal to the number of channels of the image.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth FLOAT.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

getFloatPixel

public float[] getFloatPixel(int n)
                      throws java.lang.UnsupportedOperationException,
                             java.lang.IndexOutOfBoundsException
Returns the pixel values at the given index. This operation is only available for images of depth FLOAT. The returned float array has length equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
Returns:
A float array containing the pixel values for each channel.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth FLOAT.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.

getFloatPixel

public void getFloatPixel(int n,
                          float[] pixel)
                   throws java.lang.UnsupportedOperationException,
                          java.lang.IndexOutOfBoundsException,
                          java.lang.IllegalArgumentException
Copies the pixel values at the given index into the given destination array. This operation is only available for images of depth FLOAT. The length of the float array must be equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
pixel - A float array with length equal to the number of channels of the image.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth FLOAT.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

getDoublePixel

public double[] getDoublePixel(int x,
                               int y)
                        throws java.lang.UnsupportedOperationException,
                               java.lang.IndexOutOfBoundsException
Returns the pixel values at the given coordinate pair. This operation is only available for images of depth DOUBLE. The returned double array has length equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
Returns:
A double array containing the pixel values for each channel.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth DOUBLE.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.

getDoublePixel

public void getDoublePixel(int x,
                           int y,
                           double[] pixel)
                    throws java.lang.UnsupportedOperationException,
                           java.lang.IndexOutOfBoundsException,
                           java.lang.IllegalArgumentException
Copies the pixel values at the given coordinate pair into the given destination array. This operation is only available for images of depth DOUBLE. The length of the double array must be equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
pixel - A double array with length equal to the number of channels of the image.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth DOUBLE.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

getDoublePixel

public double[] getDoublePixel(int n)
                        throws java.lang.UnsupportedOperationException,
                               java.lang.IndexOutOfBoundsException
Returns the pixel values at the given index. This operation is only available for images of depth DOUBLE. The returned double array has length equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
Returns:
A double array containing the pixel values for each channel.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth DOUBLE.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.

getDoublePixel

public void getDoublePixel(int n,
                           double[] pixel)
                    throws java.lang.UnsupportedOperationException,
                           java.lang.IndexOutOfBoundsException,
                           java.lang.IllegalArgumentException
Copies the pixel values at the given index into the given destination array. This operation is only available for images of depth DOUBLE. The length of the double array must be equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
pixel - A double array with length equal to the number of channels of the image.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth DOUBLE.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

setBytePixel

public void setBytePixel(int x,
                         int y,
                         byte[] pixel)
                  throws java.lang.UnsupportedOperationException,
                         java.lang.IndexOutOfBoundsException,
                         java.lang.IllegalArgumentException
Sets the pixel values at the given coordinate pair to the values in the given array. This operation is only available to images of depth BYTE. The byte array must have length equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
pixel - A byte array containing the pixel data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth BYTE.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

setBytePixel

public void setBytePixel(int n,
                         byte[] pixel)
                  throws java.lang.UnsupportedOperationException,
                         java.lang.IndexOutOfBoundsException,
                         java.lang.IllegalArgumentException
Sets the pixel values at the given index to the values in the given array. This operation is only available to images of depth BYTE. The byte array must have length equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
pixel - A byte array containing the pixel data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth BYTE.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

setShortPixel

public void setShortPixel(int x,
                          int y,
                          short[] pixel)
                   throws java.lang.UnsupportedOperationException,
                          java.lang.IndexOutOfBoundsException,
                          java.lang.IllegalArgumentException
Sets the pixel values at the given coordinate pair to the values in the given array. This operation is only available to images of depth SHORT. The short array must have length equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
pixel - A short array containing the pixel data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth SHORT.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

setShortPixel

public void setShortPixel(int n,
                          short[] pixel)
                   throws java.lang.UnsupportedOperationException,
                          java.lang.IndexOutOfBoundsException,
                          java.lang.IllegalArgumentException
Sets the pixel values at the given index to the values in the given array. This operation is only available to images of depth SHORT. The short array must have length equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
pixel - A short array containing the pixel data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth SHORT.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

setFloatPixel

public void setFloatPixel(int x,
                          int y,
                          float[] pixel)
                   throws java.lang.UnsupportedOperationException,
                          java.lang.IndexOutOfBoundsException,
                          java.lang.IllegalArgumentException
Sets the pixel values at the given coordinate pair to the values in the given array. This operation is only available to images of depth FLOAT. The float array must have length equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
pixel - A float array containing the pixel data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth FLOAT.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

setFloatPixel

public void setFloatPixel(int n,
                          float[] pixel)
                   throws java.lang.UnsupportedOperationException,
                          java.lang.IndexOutOfBoundsException,
                          java.lang.IllegalArgumentException
Sets the pixel values at the given index to the values in the given array. This operation is only available to images of depth FLOAT. The float array must have length equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
pixel - A float array containing the pixel data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth FLOAT.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

setDoublePixel

public void setDoublePixel(int x,
                           int y,
                           double[] pixel)
                    throws java.lang.UnsupportedOperationException,
                           java.lang.IndexOutOfBoundsException,
                           java.lang.IllegalArgumentException
Sets the pixel values at the given coordinate pair to the values in the given array. This operation is only available to images of depth DOUBLE. The double array must have length equal to the number of channels of the image.

Parameters:
x - The x-coordinate of the pixel.
y - The y-coordinate of the pixel.
pixel - A double array containing the pixel data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth DOUBLE.
java.lang.IndexOutOfBoundsException - If the given coordinate pair is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

setDoublePixel

public void setDoublePixel(int n,
                           double[] pixel)
                    throws java.lang.UnsupportedOperationException,
                           java.lang.IndexOutOfBoundsException,
                           java.lang.IllegalArgumentException
Sets the pixel values at the given index to the values in the given array. This operation is only available to images of depth DOUBLE. The double array must have length equal to the number of channels of the image.

Note: Images are packed row by row.

Parameters:
n - The index of the pixel.
pixel - A double array containing the pixel data.
Throws:
java.lang.UnsupportedOperationException - If the image is not of depth DOUBLE.
java.lang.IndexOutOfBoundsException - If the given index is out of the image's bounds.
java.lang.IllegalArgumentException - If the length of the array is not equal to the number of channels.

clear

public void clear()
Clears the image buffer by setting all values to zero.