public abstract class ImageLineSetDefault<T extends IImageLine> extends Object implements IImageLineSet<T>
IImageLineSet.
Supports all modes: single cursor, full rows, or partial
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentRow |
protected T |
imageLine |
protected List<T> |
imageLines |
protected ImageInfo |
imgInfo |
| Constructor and Description |
|---|
ImageLineSetDefault(ImageInfo imgInfo,
boolean singleCursor,
int nlines,
int noffset,
int step) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
createImageLine() |
static IImageLineSetFactory<ImageLineByte> |
getFactoryByte()
utility function, returns default factory for
ImageLineByte |
static IImageLineSetFactory<ImageLineInt> |
getFactoryInt()
utility function, returns default factory for
ImageLineInt |
T |
getImageLine(int n)
Retrieves the image line
|
boolean |
hasImageLine(int n)
True if the set contains this image line
|
int |
imageRowToMatrixRow(int imrow)
Converts from real image row to this object row number.
|
int |
imageRowToMatrixRowStrict(int imrow)
Same as
imageRowToMatrixRow(int), but returns negative if
invalid |
int |
matrixRowToImageRow(int mrow)
Converts from matrix row number (0 : nRows-1) to image row number
|
int |
size()
How many lines does this object contain?
|
protected final ImageInfo imgInfo
protected List<T extends IImageLine> imageLines
protected T extends IImageLine imageLine
protected int currentRow
public ImageLineSetDefault(ImageInfo imgInfo, boolean singleCursor, int nlines, int noffset, int step)
protected abstract T createImageLine()
public T getImageLine(int n)
Warning: the argument is the row number in the original image
If this is a cursor, no check is done, always the same row is returned
getImageLine in interface IImageLineSet<T extends IImageLine>public boolean hasImageLine(int n)
Warning: the argument is the row number in the original image
If this works as cursor, this returns true only if that is the number of its "current" line
hasImageLine in interface IImageLineSet<T extends IImageLine>public int size()
size in interface IImageLineSet<T extends IImageLine>public int imageRowToMatrixRowStrict(int imrow)
imageRowToMatrixRow(int), but returns negative if
invalidpublic int matrixRowToImageRow(int mrow)
mrow - Matrix row numberpublic int imageRowToMatrixRow(int imrow)
Warning: this always returns a valid matrix row (clamping on 0 : nrows-1, and rounding down)
Eg: rowOffset=4,rowStep=2 imageRowToMatrixRow(17) returns 6 , imageRowToMatrixRow(1) returns 0
public static IImageLineSetFactory<ImageLineInt> getFactoryInt()
ImageLineIntpublic static IImageLineSetFactory<ImageLineByte> getFactoryByte()
ImageLineByteCopyright © 2013. All rights reserved.