Record Class FixedSize
java.lang.Object
java.lang.Record
qupath.bioimageio.spec.tensor.sizes.FixedSize
- All Implemented Interfaces:
Size
A fixed axis size. Basically an int with extra steps.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intgetMin()Gets the minimum shape for this axis.intgetStep()Get the step size of this axis size.intgetTargetSize(int target) Get a size as close as possible to a target.final inthashCode()Returns a hash code value for this object.intsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.voidvalidate(List<? extends BaseTensor> tensors) Validate a tensor's size, ensuring that all internal fields are valid and resolving links between tensor objects.
-
Constructor Details
-
FixedSize
public FixedSize(int size) Create a fixed size instance- Parameters:
size- The fixed size in pixels.
-
-
Method Details
-
getTargetSize
public int getTargetSize(int target) Description copied from interface:SizeGet a size as close as possible to a target.- Specified by:
getTargetSizein interfaceSize- Parameters:
target- The target size.- Returns:
- The fixed output size,
Size.NO_SIZEor as close as we can get to the target size.
-
getStep
public int getStep()Description copied from interface:SizeGet the step size of this axis size.- Specified by:
getStepin interfaceSize- Returns:
Size.NO_SIZEfor any axis without a step size, otherwise the size.
-
getMin
public int getMin()Description copied from interface:SizeGets the minimum shape for this axis. -
validate
Description copied from interface:SizeValidate a tensor's size, ensuring that all internal fields are valid and resolving links between tensor objects. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
size
public int size()Returns the value of thesizerecord component.
-