Calligra/Libs/Pigment
Pigment is the Color Manipulation System library for KOffice, this include but it is not limited to full Calligra/Color management. Originating from Krita it provides a generic KoColor class wich represents the notion of a color. The same color can often be specified in different colorspaces. Some colors however can only be specified in some colorspaces.
Convolution and composition are two operations on pixels that need not happen to all channels. Which channels are operated on can be determined using a QBitArray named channelsFlag. The operation will be executed using the given parameters on all selected channels. Other operations, like color adjustments, can be executed with different parameters for different channels, but are always executed on all channels in a pixel, possibly with a zero op configuration for some channels.
Note the difference between a color and a pixel. Colors in Pigment are described by KoColor. Pixels are low-level C-arrays of quint8 that are channelsize * channels * pixels bytes long. There is no pixel class: it would be prohibitively expensive to create an object for every pixel.