public abstract class ImageLineSetDefault<T extends IImageLine> extends Object implements IImageLineSet<T>
IImageLineSet
.
Supports all modes: single cursor, full rows, or partial. This should not be used for
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 nlinesx,
int noffsetx,
int stepx) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
createImageLine() |
static <T extends IImageLine> |
createImageLineSetFactoryFromImageLineFactory(IImageLineFactory<T> ifactory)
utility function, given a factory for one line, returns a factory for a set
|
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
|
T |
getImageLineRawNum(int r)
does not check for valid range
|
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 nlinesx, int noffsetx, int stepx)
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 T getImageLineRawNum(int r)
getImageLineRawNum
in interface IImageLineSet<T extends IImageLine>
r
- Should normally go from 0 to IImageLineSet.size()
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 <T extends IImageLine> IImageLineSetFactory<T> createImageLineSetFactoryFromImageLineFactory(IImageLineFactory<T> ifactory)
public static IImageLineSetFactory<ImageLineInt> getFactoryInt()
ImageLineInt
public static IImageLineSetFactory<ImageLineByte> getFactoryByte()
ImageLineByte
Copyright © 2014. All rights reserved.