Record Class HistogramOp.Histogram
java.lang.Object
java.lang.Record
cloud.opencode.base.image.histogram.HistogramOp.Histogram
- Record Components:
counts- the count of pixels at each intensity level [0..255] | 每个灰度级 [0..255] 的像素计数channel- the channel index (0=gray, 1=R, 2=G, 3=B) | 通道索引(0=灰度, 1=R, 2=G, 3=B)min- the minimum intensity value present | 存在的最小灰度值max- the maximum intensity value present | 存在的最大灰度值mean- the mean intensity value | 灰度均值
- Enclosing class:
HistogramOp
public static record HistogramOp.Histogram(int[] counts, int channel, int min, int max, double mean)
extends Record
Histogram data for a single channel.
单通道直方图数据。
- Since:
- JDK 25, opencode-base-image V2.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionHistogram(int[] counts, int channel, int min, int max, double mean) Compact constructor with validation. -
Method Summary
Modifier and TypeMethodDescriptionintchannel()Returns the value of thechannelrecord component.int[]counts()Return a defensive copy of the counts array.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmax()Returns the value of themaxrecord component.doublemean()Returns the value of themeanrecord component.intmin()Returns the value of theminrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Histogram
public Histogram(int[] counts, int channel, int min, int max, double mean) Compact constructor with validation. 带验证的紧凑构造器。
-
-
Method Details
-
counts
public int[] counts()Return a defensive copy of the counts array. 返回计数数组的防御性副本。- Returns:
- a copy of the counts array | 计数数组的副本
-
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. -
channel
-
min
-
max
-
mean
-