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