net.sourceforge.jiu.data

Class MemoryGray16Image

Implemented Interfaces:
Gray16Image, GrayImage, GrayIntegerImage, IntegerImage, PixelImage, ShortChannelImage

public class MemoryGray16Image
extends MemoryShortChannelImage
implements Gray16Image

An implementation of Gray16Image that keeps the complete image in memory. This class inherits most of its functionality from its parent class MemoryShortChannelImage, using one short channel.
Author:
Marco Schmidt
Since:
0.11.0

Field Summary

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

data, firstChannel, height, numChannels, numPixels, width

Constructor Summary

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

Method Summary

PixelImage
createCompatibleImage(int width, int height)
Class
getImageType()
boolean
isBlack(int x, int y)
Returns if the pixel specified by the location in the arguments is black.
boolean
isWhite(int x, int y)
Returns if the pixel specified by the location in the arguments is white.
void
putBlack(int x, int y)
Sets a pixel to black (minimum intensity value).
void
putWhite(int x, int y)
Sets a pixel to white (maximum intensity value).

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

checkPositionAndNumber, clear, clear, clear, clear, createCompatibleImage, createCopy, getAllocatedMemory, getBitsPerPixel, getHeight, getMaxSample, getNumChannels, getSample, getSample, getSamples, getShortSample, getShortSample, getShortSamples, getWidth, putSample, putSample, putSamples, putShortSample, putShortSample, putShortSamples

Constructor Details

MemoryGray16Image

public MemoryGray16Image(int width,
                         int height)
Parameters:
width - the horizontal resolution, must be larger than zero
height - the vertical resolution, must be larger than zero

Method Details

createCompatibleImage

public PixelImage createCompatibleImage(int width,
                                        int height)
Specified by:
createCompatibleImage in interface PixelImage
Overrides:
createCompatibleImage in interface MemoryShortChannelImage

getImageType

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

isBlack

public boolean isBlack(int x,
                       int y)
Returns if the pixel specified by the location in the arguments is black.
Specified by:
isBlack in interface GrayImage
Parameters:
x - the horizontal location of the pixel
y - the vertical location of the pixel

isWhite

public boolean isWhite(int x,
                       int y)
Returns if the pixel specified by the location in the arguments is white.
Specified by:
isWhite in interface GrayImage
Parameters:
x - the horizontal location of the pixel
y - the vertical location of the pixel

putBlack

public void putBlack(int x,
                     int y)
Sets a pixel to black (minimum intensity value).
Specified by:
putBlack in interface GrayImage
Parameters:
x - horizontal position of the pixel's location
y - vertical position of the pixel's location

putWhite

public void putWhite(int x,
                     int y)
Sets a pixel to white (maximum intensity value).
Specified by:
putWhite in interface GrayImage
Parameters:
x - horizontal position of the pixel's location
y - vertical position of the pixel's location