Example #1
0
QVector<Data*> FColor::run(QVector<Data*> dat)
{
    QVector<Data*> ans;
    DImage1* d = dynamic_cast<DImage1*>(dat[0]);

    Mat inimg = d->getImage();

    Mat oimg(inimg.rows,inimg.cols, CV_8UC3);

    for (int y = 0; y < inimg.rows; y++)
    {
        for (int x = 0; x < inimg.cols; x++)
        {
            unsigned char c = inimg.at<unsigned char>(y,x);
            double d = c / 100.0;
            oimg.at<Vec3b>(y,x) = Vec3b(d * dialog.amountBlue(), d * dialog.amountGreen(), d * dialog.amountRed());
        }
    }

    DImage3* out = new DImage3();
    out->setImage(oimg);

    ans.push_back(out);

    return ans;
}
Example #2
0
winlist::winlist(QWidget *parent, const char *name) : QPushButton(parent, name)
{
	setFixedSize(defaults::tc_height, defaults::tc_height);
	wmenu = new QPopupMenu(this);
	CHECK_PTR(wmenu);
	connect(wmenu, SIGNAL(highlighted(int)), SLOT(highlight_pager(int)));

	int wh = defaults::tc_height-4;
	QImage oimg(qapp::get_cfile("winlist.xpm"));
	QImage timg(qapp::get_cfile("tiled.xpm"));

	if(! oimg.isNull())  // scale pixmap
		winlistpix.convertFromImage(oimg.smoothScale(wh, wh));

	if(! timg.isNull()) 
		tiledpix.convertFromImage(timg.smoothScale(wh, wh));
}