Enum ChannelType

    • Method Detail

      • values

        public static ChannelType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ChannelType c : ChannelType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ChannelType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • makeChannelType

        public static ChannelType makeChannelType​(int channels)
        Creates a ChannelType out of the numbers of channels
        Parameters:
        channels - the number of channels
        Returns:
        the channel type matching the number of channels
      • isValidValue

        public boolean isValidValue​(double val,
                                    int channel)
        Checks if the given value is valid for the given channel in this ChannelType
        Parameters:
        val - to be checked
        channel - in which channel is checked
        Returns:
        true iff value is valid for the channel
      • getMinVal

        public double getMinVal​(int channel)
        Get the min val of the given channel
        Parameters:
        channel - channel to get value
        Returns:
        the min value for the channel
      • getMaxVal

        public double getMaxVal​(int channel)
        Get the max val of the given channel
        Parameters:
        channel - channel to get value
        Returns:
        the max value for the channel
      • scaleToChannel

        public double scaleToChannel​(double value,
                                     int channel,
                                     double oldMin,
                                     double oldMax)
        Scales the given pixel value to a new range defined
        Parameters:
        value - current value to be scaled
        channel - channel position of the value
        oldMin - min value of the old range associated with the current value
        oldMax - max value of the old range associated with the current value
        Returns:
        pixel value within the current ChannelType definition
        Since:
        2.0
      • scaleFromChannel

        public double scaleFromChannel​(double value,
                                       int channel,
                                       double newMin,
                                       double newMax)
        Scales the given pixel value of this Channeltype to a new range defined
        Parameters:
        value - current value to be scaled
        channel - channel position of the value
        newMin - min value of the target range associated with the resulting value
        newMax - max value of the target range associated with the resulting value
        Returns:
        pixel value within the current ChannelType definition
        Since:
        2.0
      • scaleToChannel

        public static double scaleToChannel​(double value,
                                            double oldMin,
                                            double oldMax,
                                            double newMin,
                                            double newMax)
        Scales the given pixel value to a new range defined
        Parameters:
        value - current value to be scaled
        oldMin - min value of the old range associated with the current value
        oldMax - max value of the old range associated with the current value
        newMin - min value of the new range associated with the resulting value
        newMax - max value of the new range associated with the resulting value
        Returns:
        pixel value within the given target range
        Since:
        2.0