コード例 #1
0
void RenderArea::nextStep()
{
    ImageAndMask *imageAndMask = new ImageAndMask;

    columnPoints *p;

    for (int i = 0; i < outputPoints->count(); i++)
    {
        p = outputPoints->at(i);

        for (int o = 0; o < p->count(); o++)
        {
            QRgb maskPoint = imageMask->pixel(i, p->count() - 1 - o);
            int outputPoint = p->at(o)->intensity;

            if (qAlpha(maskPoint) == 255 && outputPoint > 0)
            {
                imageMask->setPixel(i,p->count() - 1 - o,qRgba(255,255,255,0));
                imageInput->setPixel(i,p->count() - 1 - o,qRgb(outputPoint,outputPoint,outputPoint));
            }
        }
    }

    imageAndMask->image = imageInput;
    imageAndMask->mask = imageMask;

    images.append(imageAndMask);

    imageMask = new QImage(imageMask->copy());
    imageInput = new QImage(imageInput->copy());

    updateInputPoints();

    emit updateSteps();
}
コード例 #2
0
ファイル: Foo.cpp プロジェクト: ryantuck/lit-halo
void Foo::update()
{
	updateSteps();
	updateFoos();
	updateLEDs();
}