Record Class Image.State
java.lang.Object
java.lang.Record
org.inspirenxe.strata.api.control.display.Image.State
- Record Components:
sprite- the sprite, or null while something else is shownvisual- the visual, or null while something else is showntint- the tintimageWidth- the image widthimageHeight- the image heightscaling- the scaling; never nullpixels- the pixel buffer, or null while something else is shown
- Enclosing interface:
Image
public static record Image.State(SpriteId sprite, Visual visual, int tint, float imageWidth, float imageHeight, Image.Scaling scaling, PixelBuffer pixels)
extends Record
An image's own state in a
ComponentSnapshot.-
Constructor Summary
ConstructorsConstructorDescriptionState(SpriteId sprite, Visual visual, int tint, float imageWidth, float imageHeight, Image.Scaling scaling) Creates the state of an image that shows no pixel buffer.State(SpriteId sprite, Visual visual, int tint, float imageWidth, float imageHeight, Image.Scaling scaling, PixelBuffer pixels) Checks that at most one of the sprite, the visual and the pixels is set, and the scaling. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatReturns the value of theimageHeightrecord component.floatReturns the value of theimageWidthrecord component.pixels()Returns the value of thepixelsrecord component.scaling()Returns the value of thescalingrecord component.sprite()Returns the value of thespriterecord component.inttint()Returns the value of thetintrecord component.final StringtoString()Returns a string representation of this record class.visual()Returns the value of thevisualrecord component.
-
Constructor Details
-
State
public State(SpriteId sprite, Visual visual, int tint, float imageWidth, float imageHeight, Image.Scaling scaling, PixelBuffer pixels) Checks that at most one of the sprite, the visual and the pixels is set, and the scaling.- Throws:
IllegalArgumentException- if more than one of the sprite, the visual and the pixels is set
-
State
public State(SpriteId sprite, Visual visual, int tint, float imageWidth, float imageHeight, Image.Scaling scaling) Creates the state of an image that shows no pixel buffer.- Parameters:
sprite- the sprite, or nullvisual- the visual, or nulltint- the tintimageWidth- the image widthimageHeight- the image heightscaling- the scaling- Throws:
IllegalArgumentException- if both the sprite and the visual are set
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
sprite
-
visual
-
tint
-
imageWidth
public float imageWidth()Returns the value of theimageWidthrecord component.- Returns:
- the value of the
imageWidthrecord component
-
imageHeight
public float imageHeight()Returns the value of theimageHeightrecord component.- Returns:
- the value of the
imageHeightrecord component
-
scaling
-
pixels
-