Record Class DecodedPng
java.lang.Object
java.lang.Record
cloud.opencode.base.image.codec.png.DecodedPng
- Record Components:
width- image width in pixels | 图像宽度(像素)height- image height in pixels | 图像高度(像素)rgb- interleaved RGB bytes, length = width*height*3 | 交错的 RGB 字节,长度 = width*height*3alpha- per-pixel alpha bytes (length = width*height) ornullif opaque | 每像素 alpha 字节(长度 = width*height);不透明则为null
Result of
PngDecoder.decode(byte[]).
PngDecoder.decode(byte[]) 的结果。
The rgb array stores 3 bytes per pixel in row-major order
(top-left to bottom-right, R-G-B per pixel). When the source PNG had no
alpha information, alpha is null; otherwise it stores
one byte per pixel in the same row-major order with 0 = transparent and
0xFF = opaque.
rgb 数组按行优先顺序(左上到右下,每像素 R-G-B)存储 3 字节。
若源 PNG 无 alpha 信息,alpha 为 null;否则按相同顺序
存储每像素 1 字节,0 = 完全透明,0xFF = 完全不透明。
- Since:
- JDK 25, opencode-base-image-codec V1.0.4
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDecodedPng(int width, int height, byte[] rgb, byte[] alpha) Creates an instance of aDecodedPngrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]alpha()Returns the value of thealpharecord component.final 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
-
DecodedPng
public DecodedPng(int width, int height, byte[] rgb, byte[] alpha) Creates an instance of aDecodedPngrecord class.
-
-
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
-
alpha
-