Record Class DecodedWebp
java.lang.Object
java.lang.Record
cloud.opencode.base.image.codec.webp.DecodedWebp
- Record Components:
width- image width in pixels (positive) | 图像宽度(像素,正整数)height- image height in pixels (positive) | 图像高度(像素,正整数)data- tightly packed pixels matchingformat| 与format匹配的紧密排列像素format- pixel layout describingdata| 描述data的像素布局
Result of decoding a WebP byte stream into raw pixel data.
解码 WebP 字节流后得到的原始像素结果。
The data buffer is laid out as tightly packed pixels in the order
declared by format, row by row top-to-bottom, with no padding. Total
length is exactly width * height * format.bytesPerPixel().
data 缓冲区按 format 声明的像素顺序紧密排列,自上而下逐行存储,
无填充。总长度恰好为 width * height * format.bytesPerPixel()。
Security | 安全性:
- Thread-safe: Conditionally — record is immutable, but the
dataarray is shared by reference; do not mutate it. - 线程安全: 有条件 — record 不可变,但data数组按引用共享,请勿修改。 - Bounds-checked: constructor enforces
data.length == width * height * format.bytesPerPixel(). - 边界检查: 构造器强制data.length == width * height * format.bytesPerPixel()。
- Since:
- JDK 25, opencode-base-image-codec V1.0.4
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDecodedWebp(int width, int height, byte[] data, WebpFormat format) Compact constructor validatingdatalength matches the dimensions and format. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]data()Returns the value of thedatarecord component.final 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.intheight()Returns the value of theheightrecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
DecodedWebp
Compact constructor validatingdatalength matches the dimensions and format. 紧凑构造器,校验data长度与尺寸、格式匹配。
-
-
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. -
width
-
height
-
data
-
format
-