public class ObjectColorLayout extends LocalAbstractObject implements BinarySerializable
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected byte[] |
CbCoeff |
protected byte[] |
CrCoeff |
protected byte[] |
YCoeff |
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
ObjectColorLayout(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectColorLayout loaded from binary input buffer.
|
|
ObjectColorLayout(java.io.BufferedReader stream)
Creates a new instance of ObjectColorLayout from stream.
|
|
ObjectColorLayout(byte[] YCoeff,
byte[] CbCoeff,
byte[] CrCoeff)
Creates a new instance of ObjectColorLayout.
|
Modifier and Type | Method and Description |
---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the
output . |
LocalAbstractObject |
cloneRandomlyModify(java.lang.Object... args)
Creates and returns a randomly modified copy of this vector.
|
boolean |
dataEquals(java.lang.Object obj)
Indicates whether some other object has the same data as this one.
|
int |
dataHashCode()
Returns a hash code value for the data of this object.
|
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes.
|
protected float |
getDistanceImpl(LocalAbstractObject obj,
float distThreshold)
The actual implementation of the metric function (see
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject) for full explanation). |
int |
getSize()
Returns the size of this object in bytes.
|
protected static float |
sumCoeff(byte[] weights,
byte[] coeffs1,
byte[] coeffs2) |
void |
writeData(java.io.OutputStream stream)
Write object to text stream
|
clearSurplusData, clone, clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceLowerBound, getDistanceLowerBoundImpl, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceUpperBound, getDistanceUpperBoundImpl, getFieldsForNames, getMaxDistance, getNormDistance, getPrecomputedDistance, getPrecomputedDistance, getRandomChar, getRandomNormal, chainDestroy, chainFilter, includeUsingPrecompDist, isDistanceCompatible, parseObjectComment, peekNextChar, readAttributesFromStream, readObjectComments, readObjectCommentsWithoutData, unchainFilter, write, write, writeAttributesToStream, writeObjectComment
clone, getLocatorURI, getNoDataObject, getObjectKey, getObjectKey, getObjectLocatorURI, setObjectKey, toString
protected byte[] YCoeff
protected byte[] CbCoeff
protected byte[] CrCoeff
public ObjectColorLayout(byte[] YCoeff, byte[] CbCoeff, byte[] CrCoeff)
public ObjectColorLayout(java.io.BufferedReader stream) throws java.io.IOException, java.lang.NumberFormatException, java.lang.IndexOutOfBoundsException
java.io.IOException
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException
protected ObjectColorLayout(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectColorLayout fromserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error reading from the bufferpublic void writeData(java.io.OutputStream stream) throws java.io.IOException
writeData
in class LocalAbstractObject
stream
- the stream to store this object tojava.io.IOException
- if there was an error while writing to streampublic int getSize()
LocalAbstractObject
getSize
in class LocalAbstractObject
public boolean dataEquals(java.lang.Object obj)
LocalAbstractObject
dataEquals
in class LocalAbstractObject
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.public int dataHashCode()
LocalAbstractObject
dataHashCode
in class LocalAbstractObject
protected float getDistanceImpl(LocalAbstractObject obj, float distThreshold)
LocalAbstractObject
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject)
for full explanation).
The implementation should not increment distanceComputations statistics.getDistanceImpl
in class LocalAbstractObject
obj
- the object to compute distance todistThreshold
- the threshold value on the distanceprotected static float sumCoeff(byte[] weights, byte[] coeffs1, byte[] coeffs2)
public LocalAbstractObject cloneRandomlyModify(java.lang.Object... args) throws java.lang.CloneNotSupportedException
cloneRandomlyModify
in class LocalAbstractObject
args
- expected size of the array is 2: minVector vector with minimal values in all positions
maxVector vector with maximal values in all positionsjava.lang.CloneNotSupportedException
- if the object's class does not support cloning or there was an errorpublic int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
LocalAbstractObject
output
.binarySerialize
in interface BinarySerializable
binarySerialize
in class LocalAbstractObject
output
- the output that this object is binary-serialized intoserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error during serializationpublic int getBinarySize(BinarySerializator serializator)
LocalAbstractObject
getBinarySize
in interface BinarySerializable
getBinarySize
in class LocalAbstractObject
serializator
- the serializator used to write objects