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

    Constructors
    Constructor
    Description
    Histogram(int[] counts, int channel, int min, int max, double mean)
    Compact constructor with validation.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the channel record component.
    int[]
    Return a defensive copy of the counts array.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    max()
    Returns the value of the max record component.
    double
    Returns the value of the mean record component.
    int
    min()
    Returns the value of the min record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • channel

      public int channel()
      Returns the value of the channel record component.
      Returns:
      the value of the channel record component
    • min

      public int min()
      Returns the value of the min record component.
      Returns:
      the value of the min record component
    • max

      public int max()
      Returns the value of the max record component.
      Returns:
      the value of the max record component
    • mean

      public double mean()
      Returns the value of the mean record component.
      Returns:
      the value of the mean record component