当前位置: 首页>>代码示例>>C++>>正文


C++ QColor::alphaF方法代码示例

本文整理汇总了C++中QColor::alphaF方法的典型用法代码示例。如果您正苦于以下问题:C++ QColor::alphaF方法的具体用法?C++ QColor::alphaF怎么用?C++ QColor::alphaF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QColor的用法示例。


在下文中一共展示了QColor::alphaF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setFromQColor

 void Color::setFromQColor(const QColor &color)
 {
   m_channels[0] = color.redF();
   m_channels[1] = color.greenF();
   m_channels[2] = color.blueF();
   m_channels[3] = color.alphaF();
 }
开发者ID:Algerien1970,项目名称:avogadro,代码行数:7,代码来源:color.cpp

示例2: setColor

void ColorSelectWidget::setColor(const QColor &color, bool hasAlpha) {
	d->hasAlpha = hasAlpha;
	d->alpha->setVisible(d->hasAlpha);
	d->alpha->setValue(d->hasAlpha ? color.alphaF()*100.0 : 100.0);
	d->alphaLabel->setVisible(d->hasAlpha);
	d->color->setCurrentColor(color.rgb());
}
开发者ID:akhilo,项目名称:cmplayer,代码行数:7,代码来源:widgets.cpp

示例3: setColor

void HeadMesh::setColor(QColor c)
{
    color[0] = c.redF();
    color[1] = c.greenF();
    color[2] = c.blueF();
    color[3] = c.alphaF();
}
开发者ID:sijk,项目名称:elapse,代码行数:7,代码来源:headmesh.cpp

示例4: setBackwardColor

void TrajectoryVisualization::setBackwardColor(QColor c)
{
    { boost::mutex::scoped_lock lockit(this->updateMutex);
        backwardColor = osg::Vec4(c.redF(), c.greenF(), c.blueF(), c.alphaF() ); }
    emit propertyChanged("BackwardColor");
    setDirty();
}
开发者ID:maltewi,项目名称:base-types,代码行数:7,代码来源:TrajectoryVisualization.cpp

示例5: qSetColor

static inline void qSetColor(float colorVec[], QColor c)
{
    colorVec[0] = c.redF();
    colorVec[1] = c.greenF();
    colorVec[2] = c.blueF();
    colorVec[3] = c.alphaF();
}
开发者ID:AlexSoehn,项目名称:qt-base-deb,代码行数:7,代码来源:qtlogo.cpp

示例6: qSetColor

void QMesh::qSetColor(QColor c)
{
    faceColor[0] = c.redF();
    faceColor[1] = c.greenF();
    faceColor[2] = c.blueF();
    faceColor[3] = c.alphaF();
}
开发者ID:LaurensVergote,项目名称:Robotic-Hand,代码行数:7,代码来源:qmesh.cpp

示例7: setColor

void ColorSpinBoxGroup::setColor(const QColor &c)
{
    if(c == color_) return;
    noColorUpdate = true;
    ui->opacityBox->setValue(c.alphaF()*100.0);
    if(isRgbColors){
        ui->RedspinBox->setValue(c.red());
        ui->GreenspinBox->setValue(c.green());
        ui->BluespinBox->setValue(c.blue());
    }else{
        ui->RedspinBox->setValue(
                    qBound(0.0, c.hsvHueF()*359, 359.0)
                    );
        ui->GreenspinBox->setValue(
                    qBound(0.0, c.hsvSaturationF()*100, 100.0)
                    );
        ui->BluespinBox->setValue(
                    qBound(0.0, c.valueF()*100, 100.0)
                    );
    }
    color_ = c;

    QPalette p = ui->label->palette();
    p.setColor(QPalette::Background, color_);
    ui->label->setPalette(p);
    noColorUpdate = false;
}
开发者ID:chaserhkj,项目名称:painttyWidget,代码行数:27,代码来源:colorspinboxgroup.cpp

示例8: values

void
KnobGuiColor::onDialogCurrentColorChanged(const QColor & color)
{
    KnobColorPtr knob = _knob.lock();
    if (!knob) {
        return;
    }
    int nDims = knob->getNDimensions();

    std::vector<double> values(nDims);
    values[0] = color.redF();
    convertFromUIToInternalColorspace(&values[0]);
    if (nDims > 1) {
        values[1] =  color.greenF();
        convertFromUIToInternalColorspace(&values[1]);
    }
    if (nDims > 2) {
        values[2] = color.blueF();
        convertFromUIToInternalColorspace(&values[2]);
    }
    if (nDims > 3) {
        values[3] = color.alphaF();
    }

    KnobGuiPtr knobUI = getKnobGui();
    knob->setValueAcrossDimensions(values, DimIdx(0), getView(), eValueChangedReasonUserEdited);
    if ( knobUI->getGui() ) {
        knobUI->getGui()->setDraftRenderEnabled(true);
    }
}
开发者ID:MrKepzie,项目名称:Natron,代码行数:30,代码来源:KnobGuiColor.cpp

示例9: getTileFromScreen

QImage DwarfClipboardPng::getTileFromScreen(DFHack::t_screen screen)
{
    QColor foregroundColor = getForegroundColorFromScreen(screen);
    QColor backgroundColor = getBackgroundColorFromScreen(screen);
    QImage tile = tileSet->copy((screen.symbol % 16)*tileWidth,int(screen.symbol/16)*tileHeight,tileWidth,tileHeight);
    QImage resultImage(tileWidth,tileHeight,QImage::Format_ARGB32);
    for(int x = 0;x< tile.width();x++){
        for(int y =0;y<tile.height();y++){
            QColor color;
            color.setRgba(tile.pixel(x,y));
            if(color == QColor("#FF00FF")){ // FF00FF is magenta
                resultImage.setPixel(x,y,backgroundColor.rgb());
            }
            else{
                QColor newColor;
                qreal alpha = color.alphaF();
                qreal alpha_diff = 1-alpha;
                newColor.setRedF((alpha * (color.redF() * foregroundColor.redF() )) + (alpha_diff * backgroundColor.redF()));
                newColor.setGreenF((alpha * (color.greenF() * foregroundColor.greenF() )) + (alpha_diff * backgroundColor.greenF()));
                newColor.setBlueF((alpha * (color.blueF() * foregroundColor.blueF() )) + (alpha_diff * backgroundColor.blueF()));
                resultImage.setPixel(x,y,newColor.rgb());
            }
        }
    }
    return(resultImage);
}
开发者ID:jimhester,项目名称:Dwarf-Clipboard,代码行数:26,代码来源:DwarfClipboardPng.cpp

示例10: qColorToQuadcolor

void RenderThread::qColorToQuadcolor(QColor c, float* result) const
{
    result[0] = c.redF();
    result[1] = c.greenF();
    result[2] = c.blueF();
    result[3] = c.alphaF();
}
开发者ID:furylynx,项目名称:flcolorlines,代码行数:7,代码来源:Controller.RenderThread.cpp

示例11: alphaColor

QColor alphaColor(QColor color, double alpha)
{
    if (alpha >= 1.0)
        return color;
    color.setAlphaF(qMax(0.0, alpha) * color.alphaF());
    return color;
}
开发者ID:TimFW,项目名称:qubes-desktop-linux-kde,代码行数:7,代码来源:plastikclient.cpp

示例12: values

void
KnobGuiColor::onDialogCurrentColorChanged(const QColor & color)
{
    KnobColorPtr knob = _knob.lock();
    bool isSimple = _useSimplifiedUI;
    int nDims = knob->getNDimensions();

    std::vector<double> values(nDims);
    values[0] = isSimple ? color.redF() : Color::from_func_srgb( color.redF() );


    if (nDims >= 3) {
        values[1] = isSimple ? color.greenF() : Color::from_func_srgb( color.greenF() );
        values[2] = isSimple ? color.blueF() : Color::from_func_srgb( color.blueF() );
        if (nDims == 4) {
            values[3] = color.alphaF();
        }
    }

    KnobGuiPtr knobUI = getKnobGui();
    knob->setValueAcrossDimensions(values, DimIdx(0), getView(), eValueChangedReasonUserEdited);
    if ( knobUI->getGui() ) {
        knobUI->getGui()->setDraftRenderEnabled(true);
    }
}
开发者ID:kcotugno,项目名称:Natron,代码行数:25,代码来源:KnobGuiColor.cpp

示例13: _FillArray

inline void _FillArray(const QColor& c, float* arr)
{
	arr[0] = c.redF();
	arr[1] = c.greenF();
	arr[2] = c.blueF();
	arr[3] = c.alphaF();
}
开发者ID:YANG-H,项目名称:straight-skeleton,代码行数:7,代码来源:ss3dwidget.cpp

示例14: d

 Color::Color(const QColor &qcolor) : d(0)
 {
   m_channels[0] = static_cast<float>(qcolor.redF());
   m_channels[1] = static_cast<float>(qcolor.greenF());
   m_channels[2] = static_cast<float>(qcolor.blueF());
   m_channels[3] = static_cast<float>(qcolor.alphaF());
 }
开发者ID:Algerien1970,项目名称:avogadro,代码行数:7,代码来源:color.cpp

示例15: setPenColor

void DkPaintToolBar::setPenColor(const QColor& col) {

	penCol = col;
	penColButton->setStyleSheet("QPushButton {background-color: " + nmc::DkUtils::colorToString(penCol) + "; border: 1px solid #888;}");
	penAlpha = col.alpha();
	alphaBox->setValue(col.alphaF()*100);
}
开发者ID:h0rm,项目名称:nomacs-plugins,代码行数:7,代码来源:DkPaintPlugin.cpp


注:本文中的QColor::alphaF方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。