Example #1
0
void SplitColorOp:: operator()(const imagein::Image* image, const std::map<const imagein::Image*, std::string>&) {

    for(unsigned int c = 0; c < image->getNbChannels(); ++c) {
        GrayscaleImage* resImg = new GrayscaleImage(image->getWidth(), image->getHeight());
        for(unsigned int j = 0; j < resImg->getHeight(); ++j) {
            for(unsigned int i = 0; i < resImg->getWidth(); ++i) {
                resImg->setPixel(i, j, image->getPixel(i, j, c));
            }
        }
        QString name("");
        name += Tools::colorName(c, image->getNbChannels());
        this->outImage(resImg, name.toStdString());
    }

}