Record Class Bitmap
java.lang.Object
java.lang.Record
cloud.opencode.base.image.codec.font.Bitmap
- Record Components:
width- pixel width | 像素宽height- pixel height | 像素高alpha- alpha bytes, length =width * height| alpha 字节, 长度 =width * height
Single-channel 8-bit alpha bitmap, row-major, top-down.
单通道 8 位 alpha 位图,行优先,从上到下。
0 = fully transparent, 255 = fully opaque. Composite against any color by
multiplying alpha into the target pixel. Produced by
Font.rasterizeCodepoint(int, float) and
Font.rasterize(String, float).
0 = 完全透明,255 = 完全不透明。可与任意颜色合成 — 将 alpha 乘到目标像素。
由 Font.rasterizeCodepoint(int, float) 与
Font.rasterize(String, float) 产出。
Security | 安全性:
- Thread-safe: Yes - record with effectively immutable fields (the
alphaarray reference is final; record components are returned by reference per Java semantics, callers must not mutate). - 线程安全: 是 — record 字段有效不可变(alpha数组引用为 final; Java 语义按引用返回 record 组件,调用方不应修改)。 - Bounds-checked: constructor validates dimensions and array length agreement. - 边界检查:构造函数校验尺寸与数组长度一致。
- Since:
- JDK 25, opencode-base-image-codec V1.0.4
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBitmap(int width, int height, byte[] alpha) Compact constructor validates invariants. -
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.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
Bitmap
public Bitmap(int width, int height, byte[] alpha) Compact constructor validates invariants. 紧凑构造函数校验不变式。
-
-
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
-
alpha
-