Package limn.graphics
Record Class ImageEncodeOptions
java.lang.Object
java.lang.Record
limn.graphics.ImageEncodeOptions
- Record Components:
format- the format to write; never nullquality- 1 (smallest) to 100 (best) for a lossy format. A lossless format ignores it entirely: PNG output is byte-identical at every quality, so this value never explains a size difference there. It is not a compression level; nothing in this toolkit lets you trade PNG encode time against file size.
What an encode should produce: the
ImageFormat, plus the knobs a lossy
format needs. A record rather than a hierarchy of parameter classes: a format
that gains a knob gains a component here, and every caller keeps compiling
because the format-only constructor stays.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe qualityImageEncodeOptions(ImageFormat)uses: high, still lossy. -
Constructor Summary
ConstructorsConstructorDescriptionImageEncodeOptions(ImageFormat format) Encodes asformatatDEFAULT_QUALITY.ImageEncodeOptions(ImageFormat format, int quality) Creates an instance of aImageEncodeOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.format()Returns the value of theformatrecord component.final inthashCode()Returns a hash code value for this object.intquality()Returns the value of thequalityrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_QUALITY
public static final int DEFAULT_QUALITYThe qualityImageEncodeOptions(ImageFormat)uses: high, still lossy.- See Also:
-
-
Constructor Details
-
ImageEncodeOptions
Creates an instance of aImageEncodeOptionsrecord class. -
ImageEncodeOptions
Encodes asformatatDEFAULT_QUALITY.
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
format
Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-
quality
public int quality()Returns the value of thequalityrecord component.- Returns:
- the value of the
qualityrecord component
-