public class SampledRange
extends java.lang.Object
from
to to
. Moreover, the range of values can
optionally be sub-sampled by the samplingFactor
factor.
Only non-negative ranges are allowed.
If the from
value is greater than or equal to the to
value, the range is empty.
For further examples about sampled range, see ISO/IEC 15444-9 section C.2.3, C.4.5, C.4.6, C.4.7
Modifier and Type | Field and Description |
---|---|
private int |
from
Lower bound of the range.
|
private int |
samplingFactor
Sub-sampling factor (an step).
|
private int |
to
Upper bound of the range.
|
Constructor and Description |
---|
SampledRange()
Constructor.
|
SampledRange(int from,
int to)
Constructor.
|
SampledRange(int from,
int to,
int samplingFactor)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int[] |
getAsArray()
Returns a one-dimensional array with the range values.
|
int |
getFrom()
Returns the
from attribute. |
int |
getSamplingFactor()
Returns the
samplingFactor attribute. |
int |
getTo()
Returns the
to attribute. |
boolean |
isEmpty() |
void |
list(java.io.PrintStream out)
Prints this CADIPoint out to the specified output stream.
|
void |
reset()
Sets the attributes to its initial values.
|
void |
setFrom(int from)
Sets the
from attribute. |
void |
setSamplingFactor(int samplingFactor) |
void |
setTo(int to) |
java.lang.String |
toString()
For debugging purpose
|
private int from
It is included.
private int to
Its inclusion depends on the samplingFactor
.
private int samplingFactor
public SampledRange()
Creates a empty range.
public SampledRange(int from, int to)
Default sub-sampling factor is 1.
public SampledRange(int from, int to, int samplingFactor)
from
- definition in from
to
- definition in to
samplingFactor
- definition in samplingFactor
public void setFrom(int from)
from
attribute.
- public void setTo(int to)
public void setSamplingFactor(int samplingFactor)
public int getFrom()
from
attribute.public int getTo()
to
attribute.public int getSamplingFactor()
samplingFactor
attribute.public boolean isEmpty()
public int[] getAsArray()
public void reset()
public java.lang.String toString()
toString
in class java.lang.Object
public void list(java.io.PrintStream out)
out
- an output stream.
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)