net.sourceforge.jiu.data

Class MemoryGray8Image

Implemented Interfaces:
ByteChannelImage, Gray8Image, GrayImage, GrayIntegerImage, IntegerImage, PixelImage

public class MemoryGray8Image
extends MemoryByteChannelImage
implements Gray8Image

An implementation of Gray8Image that keeps the complete image in memory. This class inherits most of its functionality from its parent class MemoryByteChannelImage, using one byte channel.
Author:
Marco Schmidt

Field Summary

Fields inherited from class net.sourceforge.jiu.data.MemoryByteChannelImage

data, firstChannel, height, numChannels, numPixels, width

Constructor Summary

MemoryGray8Image(int width, int height)
Creates a new MemoryGray8Image object with the specified resolution.

Method Summary

PixelImage
createCompatibleImage(int width, int height)
Creates an instance of the same class as this one, with width and height given by the arguments.
Class
getImageType()
If there is a single interface or class that describes the image data type of this class, the java.lang.Class object associated with that interface (or class) is returned (or null otherwise).
boolean
isBlack(int x, int y)
boolean
isWhite(int x, int y)
void
putBlack(int x, int y)
void
putWhite(int x, int y)

Methods inherited from class net.sourceforge.jiu.data.MemoryByteChannelImage

checkPositionAndNumber, clear, clear, clear, clear, createCompatibleImage, createCopy, getAllocatedMemory, getBitsPerPixel, getByteSample, getByteSample, getByteSamples, getHeight, getMaxSample, getNumChannels, getSample, getSample, getSamples, getWidth, putByteSample, putByteSample, putByteSamples, putSample, putSample, putSamples

Constructor Details

MemoryGray8Image

public MemoryGray8Image(int width,
                        int height)
Parameters:
width - the horizontal resolution, must be non-zero and positive
height - the vertical resolution, must be non-zero and positive

Method Details

createCompatibleImage

public PixelImage createCompatibleImage(int width,
                                        int height)
Creates an instance of the same class as this one, with width and height given by the arguments.
Specified by:
createCompatibleImage in interface PixelImage
Overrides:
createCompatibleImage in interface MemoryByteChannelImage
Parameters:
width - the horizontal resolution of the new image
height - the vertical resolution of the new image
Returns:
the new image

getImageType

public Class getImageType()
Specified by:
getImageType in interface PixelImage

isBlack

public boolean isBlack(int x,
                       int y)
Specified by:
isBlack in interface GrayImage

isWhite

public boolean isWhite(int x,
                       int y)
Specified by:
isWhite in interface GrayImage

putBlack

public void putBlack(int x,
                     int y)
Specified by:
putBlack in interface GrayImage

putWhite

public void putWhite(int x,
                     int y)
Specified by:
putWhite in interface GrayImage