Class SbChannelList


  • public class SbChannelList
    extends Inventor
    List of channel to extract. Specify a list of channel to extract. For instance: {0, 1, 2} represent 3 first channels. SbChannelList is an ordered set. Channels are present only one time and are sorted by order.

    Channels can be accessed with operator[]. Number of channel can be accessed with getNumChannel().

    Note: Because it is an ordered set, for a given SoImageDataAdapter if channelList.getNumChannel() == image.getNumChannel(), this imply that channelList contains all the channels of image.

    • Constructor Detail

      • SbChannelList

        public SbChannelList​(long nbChannel)
        Construct channelList corresponding to all channel from 0 to n-1: {0, 1, 2, ..., n-1}.
      • SbChannelList

        public SbChannelList​(long n,
                             int[] channels)
        SbChannelList(1, {0}) means extract only the 1st channel. SbChannelList(3, {0, 1, 2}) means extract the 3 first channels. For performances reasons, the given list must be an ordered set. Each element must appears only 1 time and must be in order. If it is not the case, an exception error will be thrown.

        example of invalid arguments: SbChannelList(3, {1, 1, 2}) SbChannelList(3, {3, 2, 1})

        Parameters:
        n - number of elements in channels array.

        channels - and ordered set of int listing channel indices.
    • Method Detail

      • getValueAt

        public int getValueAt​(int channelId)
      • getNumChannel

        public int getNumChannel()
        Return number of channel to extract.