本文整理汇总了C++中QColor::blueF方法的典型用法代码示例。如果您正苦于以下问题:C++ QColor::blueF方法的具体用法?C++ QColor::blueF怎么用?C++ QColor::blueF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QColor
的用法示例。
在下文中一共展示了QColor::blueF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setBGColor
void VtkVisPipeline::setBGColor(const QColor &color)
{
QSettings settings;
settings.setValue("VtkBackgroundColor", color);
_renderer->SetBackground(color.redF(), color.greenF(), color.blueF());
}
示例2: draw
void QVGPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect) const
{
if (src.isNull())
return;
if (src.pixmapData()->classId() != QPixmapData::OpenVGClass) {
// The pixmap data is not an instance of QVGPixmapData, so fall
// back to the default colorize filter implementation.
QPixmapColorizeFilter::draw(painter, dest, src, srcRect);
return;
}
QVGPixmapData *pd = static_cast<QVGPixmapData *>(src.pixmapData());
VGImage srcImage = pd->toVGImage();
if (srcImage == VG_INVALID_HANDLE)
return;
QSize size = pd->size();
VGImage dstImage = QVGImagePool::instance()->createTemporaryImage
(VG_sARGB_8888_PRE, size.width(), size.height(),
VG_IMAGE_QUALITY_FASTER, pd);
if (dstImage == VG_INVALID_HANDLE)
return;
// Determine the weights for the matrix from the color and strength.
QColor c = color();
VGfloat strength = this->strength();
VGfloat weights[3];
VGfloat invweights[3];
VGfloat alpha = c.alphaF();
weights[0] = c.redF() * alpha;
weights[1] = c.greenF() * alpha;
weights[2] = c.blueF() * alpha;
invweights[0] = (1.0f - weights[0]) * strength;
invweights[1] = (1.0f - weights[1]) * strength;
invweights[2] = (1.0f - weights[2]) * strength;
// Grayscale weights.
static const VGfloat redGray = 11.0f / 32.0f;
static const VGfloat greenGray = 16.0f / 32.0f;
static const VGfloat blueGray = 1.0f - (redGray + greenGray);
VGfloat matrix[5][4];
matrix[0][0] = redGray * invweights[0] + (1.0f - strength);
matrix[0][1] = redGray * invweights[1];
matrix[0][2] = redGray * invweights[2];
matrix[0][3] = 0.0f;
matrix[1][0] = greenGray * invweights[0];
matrix[1][1] = greenGray * invweights[1] + (1.0f - strength);
matrix[1][2] = greenGray * invweights[2];
matrix[1][3] = 0.0f;
matrix[2][0] = blueGray * invweights[0];
matrix[2][1] = blueGray * invweights[1];
matrix[2][2] = blueGray * invweights[2] + (1.0f - strength);
matrix[2][3] = 0.0f;
matrix[3][0] = 0.0f;
matrix[3][1] = 0.0f;
matrix[3][2] = 0.0f;
matrix[3][3] = 1.0f;
matrix[4][0] = weights[0] * strength;
matrix[4][1] = weights[1] * strength;
matrix[4][2] = weights[2] * strength;
matrix[4][3] = 0.0f;
vgColorMatrix(dstImage, srcImage, matrix[0]);
VGImage child = VG_INVALID_HANDLE;
if (srcRect.isNull() ||
(srcRect.topLeft().isNull() && srcRect.size() == size)) {
child = dstImage;
} else {
QRect src = srcRect.toRect();
child = vgChildImage(dstImage, src.x(), src.y(), src.width(), src.height());
}
qt_vg_drawVGImage(painter, dest, child);
if(child != dstImage)
vgDestroyImage(child);
QVGImagePool::instance()->releaseImage(0, dstImage);
}
示例3: setColor
void setColor(QColor c) {
float alpha = c.alphaF();
glColor4f(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha);
}
示例4: fromNormalisedChannelsValue
void KoRgbU16ColorSpace::fromQColor(const QColor& c, quint8 *dst, const KoColorProfile * /*profile*/) const
{
QVector<float> channelValues;
channelValues << c.blueF() << c.greenF() << c.redF() << c.alphaF();
fromNormalisedChannelsValue(dst, channelValues);
}
示例5: applyTo
// copied from openframeworks superfast blur and modified
void applyTo(QImage &mask, const QColor &color, int radius) {
if (radius < 1 || mask.isNull())
return;
setSize(mask.size());
setRadius(radius);
const int w = s.width();
const int h = s.height();
uchar *a = valpha.data();
const uchar *inv = vinv.constData();
int *min = vmin.data();
int *max = vmax.data();
const int xmax = mask.width()-1;
for (int x=0; x<w; ++x) {
min[x] = qMin(x + radius + 1, xmax);
max[x] = qMax(x - radius, 0);
}
const uchar *c_bits = mask.constBits()+3;
uchar *it = a;
for (int y=0; y<h; ++y, c_bits += (mask.width() << 2)) {
int sum = 0;
for(int i=-radius; i<=radius; ++i)
sum += c_bits[qBound(0, i, xmax) << 2];
for (int x=0; x<w; ++x, ++it) {
sum += c_bits[min[x] << 2];
sum -= c_bits[max[x] << 2];
*it = inv[sum];
}
}
const int ymax = mask.height()-1;
for (int y=0; y<h; ++y){
min[y] = qMin(y + radius + 1, ymax)*w;
max[y] = qMax(y - radius, 0)*w;
}
uchar *bits = mask.bits();
const double coef = color.alphaF();
const double r = color.redF()*coef;
const double g = color.greenF()*coef;
const double b = color.blueF()*coef;
const uchar *c_it = a;
for (int x=0; x<w; ++x, ++c_it){
int sum = 0;
int yp = -radius*w;
for(int i=-radius; i<=radius; ++i, yp += w)
sum += c_it[qMax(0, yp)];
uchar *p = bits + (x << 2);
for (int y=0; y<h; ++y, p += (xmax << 2)){
const uchar a = inv[sum];
if (p[3] < 255) {
*p++ = a*b;
*p++ = a*g;
*p++ = a*r;
*p++ = a*coef;
} else {
p += 4;
}
sum += c_it[min[y]];
sum -= c_it[max[y]];
}
}
}
示例6: writeFilter
void XMLizer::writeFilter( QDomDocument &document, QDomNode &parent, bool audio, QSharedPointer<Filter> f )
{
QString s = audio ? "AudioFilter" : "VideoFilter";
QDomElement n1 = document.createElement( s );
parent.appendChild( n1 );
createText( document, n1, "Name", f->getIdentifier() );
createDouble( document, n1, "PosInTrack", f->getPosition() );
if ( f->getPositionOffset() > 0 )
createDouble( document, n1, "PosOffset", f->getPositionOffset() );
createDouble( document, n1, "Length", f->getLength() );
createInt( document, n1, "SnapMode", f->getSnap() );
QList<Parameter*> params = f->getParameters();
for ( int i = 0; i < params.count(); ++i ) {
Parameter *p = params[i];
QDomElement pel = document.createElement( "Parameter" );
n1.appendChild( pel );
pel.setAttribute( "name", p->id );
switch ( p->type ) {
case Parameter::PDOUBLE: {
pel.setAttribute( "type", "double" );
pel.setAttribute( "value", QString::number( p->value.toDouble(), 'e', 17 ) );
break;
}
case Parameter::PINPUTDOUBLE: {
pel.setAttribute( "type", "inputdouble" );
pel.setAttribute( "value", QString::number( p->value.toDouble(), 'e', 17 ) );
break;
}
case Parameter::PINT: {
pel.setAttribute( "type", "int" );
pel.setAttribute( "value", QString::number( p->value.toInt() ) );
break;
}
case Parameter::PBOOL: {
pel.setAttribute( "type", "bool" );
pel.setAttribute( "value", QString::number( p->value.toInt() ) );
break;
}
case Parameter::PRGBCOLOR: {
pel.setAttribute( "type", "rgb" );
pel.setAttribute( "value", p->value.value<QColor>().name() );
break;
}
case Parameter::PRGBACOLOR: {
QColor col = p->value.value<QColor>();
pel.setAttribute( "type", "rgba" );
pel.setAttribute( "value", col.name() + "." + QString::number( col.alpha() ) );
break;
}
case Parameter::PCOLORWHEEL: {
QColor col = p->value.value<QColor>();
pel.setAttribute( "type", "colorwheel" );
pel.setAttribute( "value", QString::number( col.blueF(), 'e', 17 ) );
pel.setAttribute( "hue", QString::number( col.redF(), 'e', 17 ) );
pel.setAttribute( "saturation", QString::number( col.greenF(), 'e', 17 ) );
break;
}
case Parameter::PSTRING: {
pel.setAttribute( "type", "string" );
pel.setAttribute( "value", p->value.toString().replace( "\n", QString::fromUtf8("¶") ) );
break;
}
case Parameter::PSHADEREDIT: {
pel.setAttribute( "type", "shader" );
pel.setAttribute( "value", Parameter::getShaderName( p->value.toString() ) );
break;
}
case Parameter::PSTATUS: {
pel.setAttribute( "type", "status" );
pel.setAttribute( "value", "" );
break;
}
}
for ( int i = 0; i < p->graph.keys.count(); ++i ) {
QDomElement ke = document.createElement( "Key" );
pel.appendChild( ke );
QString type;
switch ( p->graph.keys[i].keyType ) {
case AnimationKey::CONSTANT: type = "constant"; break;
case AnimationKey::CURVE: type = "curve"; break;
default: type = "linear";
}
ke.setAttribute( "type", type );
ke.setAttribute( "position", QString::number( p->graph.keys[i].x, 'e', 17 ) );
ke.setAttribute( "value", QString::number( p->getUnnormalizedKeyValue( i ), 'e', 17 ) );
}
}
}
示例7: setColor
void AdaptiveGrid::setColor(const QColor & color)
{
m_program->bind();
m_program->setUniformValue("color", QVector3D(color.redF(), color.greenF(), color.blueF()));
m_program->release();
}
示例8: QString
QString GLC_WorldTo3dxml::colorToString(const QColor& color)
{
return QString('[' + QString::number(color.redF()) + ',' + QString::number(color.greenF()) + ',' + QString::number(color.blueF()) + ']');
}
示例9: setRgb
//.........这里部分代码省略.........
QColor c(0, 0, 0);
c.setAlphaF(a);
QCOMPARE(c.alphaF(), a);
}
}
for (int R = 0; R <= USHRT_MAX; ++R) {
{
// 0-255
int r = R >> 8;
QRgb rgb = qRgb(r, 0, 0);
color.setRgb(r, 0, 0);
QCOMPARE(color.red(), r);
QCOMPARE(color.rgb(), rgb);
color.setRgb(rgb);
QCOMPARE(color.red(), r);
QCOMPARE(color.rgb(), rgb);
int r2, g, b, a;
color.getRgb(&r2, &g, &b, &a);
QCOMPARE(r2, r);
}
{
// 0.0-1.0
qreal r = R / qreal(USHRT_MAX);
color.setRgbF(r, 0.0, 0.0);
QCOMPARE(color.redF(), r);
qreal r2, g, b, a;
color.getRgbF(&r2, &g, &b, &a);
QCOMPARE(r2, r);
}
}
for (int G = 0; G <= USHRT_MAX; ++G) {
{
// 0-255
int g = G >> 8;
QRgb rgb = qRgb(0, g, 0);
color.setRgb(0, g, 0);
QCOMPARE(color.green(), g);
QCOMPARE(color.rgb(), rgb);
color.setRgb(rgb);
QCOMPARE(color.green(), g);
QCOMPARE(color.rgb(), rgb);
int r, g2, b, a;
color.getRgb(&r, &g2, &b, &a);
QCOMPARE(g2, g);
}
{
// 0.0-1.0
qreal g = G / qreal(USHRT_MAX);
color.setRgbF(0.0, g, 0.0);
QCOMPARE(color.greenF(), g);
qreal r, g2, b, a;
color.getRgbF(&r, &g2, &b, &a);
QCOMPARE(g2, g);
}
}
for (int B = 0; B <= USHRT_MAX; ++B) {
{
// 0-255
int b = B >> 8;
QRgb rgb = qRgb(0, 0, b);
color.setRgb(0, 0, b);
QCOMPARE(color.blue(), b);
QCOMPARE(color.rgb(), rgb);
color.setRgb(rgb);
QCOMPARE(color.blue(), b);
QCOMPARE(color.rgb(), rgb);
int r, g, b2, a;
color.getRgb(&r, &g, &b2, &a);
QCOMPARE(b2, b);
}
{
// 0.0-1.0
qreal b = B / qreal(USHRT_MAX);
color.setRgbF(0.0, 0.0, b);
QCOMPARE(color.blueF(), b);
qreal r, g, b2, a;
color.getRgbF(&r, &g, &b2, &a);
QCOMPARE(b2, b);
}
}
}
示例10: writeVarName
QString ShaderCodeGenerator::writeVarName(const DinSocket *insocket)
{
if(!insocket->getCntdSocket()){
QString value;
QColor col;
double fl;
int i;
Vector v;
switch(insocket->getType().getType())
{
case COLOR:
col = insocket->getProperty().getData<QColor>();
value = "color(";
value += QString::number(col.redF()) + ", ";
value += QString::number(col.greenF()) + ", ";
value += QString::number(col.blueF()) + ")";
break;
case FLOAT:
fl = insocket->getProperty().getData<float>();
value = QString::number(fl);
break;
case STRING:
value = insocket->getProperty().getData<QString>();
break;
case INTEGER:
i = insocket->getProperty().getData<int>();
value = QString::number(i);
break;
case VECTOR:
v = insocket->getProperty().getData<Vector>();
value = "vector(";
value += QString::number(v.x) + ", ";
value += QString::number(v.y) + ", ";
value += QString::number(v.z) + ")";
break;
case POINT:
v = insocket->getProperty().getData<Vector>();
value = "point(";
value += QString::number(v.x) + ", ";
value += QString::number(v.y) + ", ";
value += QString::number(v.z) + ")";
break;
case NORMAL:
v = insocket->getProperty().getData<Vector>();
value = "normal(";
value += QString::number(v.x) + ", ";
value += QString::number(v.y) + ", ";
value += QString::number(v.z) + ")";
break;
default:
break;
}
return value;
}
const DoutSocket *prevsocket = insocket->getCntdSocket();
const DNode *node = prevsocket->getNode();
switch(node->getNodeType())
{
case COLORNODE:
return writeColor(prevsocket);
case FLOATNODE:
return writeFloat(prevsocket);
case STRINGNODE:
return writeString(prevsocket);
case VECTORNODE:
return writeVector(prevsocket);
case ADD:
case SUBTRACT:
case MULTIPLY:
case DIVIDE:
case DOTPRODUCT:
return createMath(prevsocket);
case GREATERTHAN:
case SMALLERTHAN:
case EQUAL:
case AND:
case OR:
case NOT:
return createCondition(prevsocket);
case CONTAINER:
return writeVarName(node->getDerivedConst<ContainerNode>()->getSocketInContainer(prevsocket)->toIn());
case INSOCKETS:
return writeVarName(node->getDerivedConst<SocketNode>()->getContainer()->getSocketOnContainer(prevsocket)->toIn());
default:
return getVariable(prevsocket);
}
}
示例11: a
void
TextRenderer::renderText(float x,
float y,
float scalex,
float scaley,
const QString &text,
const QColor &color,
const QFont &font) const
{
glCheckError();
boost::shared_ptr<TextRendererPrivate> p;
FontRenderers::iterator it = _imp->renderers.find(font);
if ( it != _imp->renderers.end() ) {
p = (*it).second;
} else {
p = boost::shared_ptr<TextRendererPrivate>( new TextRendererPrivate(font) );
_imp->renderers[font] = p;
}
assert(p);
GLuint savedTexture;
glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint*)&savedTexture);
{
GLProtectAttrib a(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_TRANSFORM_BIT);
GLProtectMatrix pr(GL_MODELVIEW);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
GLuint texture = 0;
glTranslatef(x, y, 0);
glColor4f( color.redF(), color.greenF(), color.blueF(), color.alphaF() );
for (int i = 0; i < text.length(); ++i) {
CharBitmap *c = p->createCharacter(text[i]);
if (!c) {
continue;
}
if (texture != c->texID) {
texture = c->texID;
glBindTexture(GL_TEXTURE_2D, texture);
assert( glIsTexture(texture) );
}
glCheckError();
glBegin(GL_QUADS);
glTexCoord2f(c->xTexCoords[0], c->yTexCoords[0]);
glVertex2f(0, 0);
glTexCoord2f(c->xTexCoords[1], c->yTexCoords[0]);
glVertex2f(c->w * scalex, 0);
glTexCoord2f(c->xTexCoords[1], c->yTexCoords[1]);
glVertex2f(c->w * scalex, c->h * scaley);
glTexCoord2f(c->xTexCoords[0], c->yTexCoords[1]);
glVertex2f(0, c->h * scaley);
glEnd();
glCheckErrorIgnoreOSXBug();
glTranslatef(c->w * scalex, 0, 0);
glCheckError();
}
} // GLProtectAttrib a(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_TRANSFORM_BIT);
glBindTexture(GL_TEXTURE_2D, savedTexture);
glCheckError();
} // renderText
示例12: if
void iA3DLabelledVolumeVis::renderLengthDistribution( vtkColorTransferFunction* ctFun, vtkFloatArray* extents, double halfInc, int filterID, double const * range )
{
// clear existing points
oTF->RemoveAllPoints();
cTF->RemoveAllPoints();
cTF->AddRGBPoint(0, 0.0, 0.0, 0.0);
for ( size_t objID = 0; objID < m_objectTable->GetNumberOfRows(); ++objID )
{
double ll = m_objectTable->GetValue(objID, m_columnMapping->value(iACsvConfig::Length)).ToDouble();
QColor color = getLengthColor( ctFun, objID );
if ( filterID == iAFeatureScoutObjectType::Fibers )
{
if ( ll >= range[0] && ll < extents->GetValue( 0 ) + halfInc )
{
oTF->AddPoint( objID + 1 - 0.5, 0.0 );
oTF->AddPoint( objID + 1 + 0.3, 0.0 );
oTF->AddPoint( objID + 1, 1.0 );
}
else if ( ll >= extents->GetValue( 0 ) + halfInc && ll < extents->GetValue( 1 ) + halfInc )
{
oTF->AddPoint( objID + 1 - 0.5, 0.0 );
oTF->AddPoint( objID + 1 + 0.3, 0.0 );
oTF->AddPoint( objID + 1, 0.03 );
}
else if ( ll >= extents->GetValue( 1 ) + halfInc && ll < extents->GetValue( 2 ) + halfInc )
{
oTF->AddPoint( objID + 1 - 0.5, 0.0 );
oTF->AddPoint( objID + 1 + 0.3, 0.0 );
oTF->AddPoint( objID + 1, 0.03 );
}
else if ( ll >= extents->GetValue( 2 ) + halfInc && ll < extents->GetValue( 5 ) + halfInc )
{
oTF->AddPoint( objID + 1 - 0.5, 0.0 );
oTF->AddPoint( objID + 1 + 0.3, 0.0 );
oTF->AddPoint( objID + 1, 0.015 );
}
else if ( ll >= extents->GetValue( 5 ) + halfInc && ll <= extents->GetValue( 7 ) + halfInc )
{
oTF->AddPoint( objID + 1 - 0.5, 0.0 );
oTF->AddPoint( objID + 1 + 0.3, 0.0 );
oTF->AddPoint( objID + 1, 1.0 );
}
}
else
{
if ( ll >= range[0] && ll < extents->GetValue( 0 ) + halfInc )
{
oTF->AddPoint( objID + 1 - 0.5, 0.0 );
oTF->AddPoint( objID + 1 + 0.3, 0.0 );
oTF->AddPoint( objID + 1, 0.5 );
}
else if ( ll >= extents->GetValue( 0 ) + halfInc && ll < extents->GetValue( 1 ) + halfInc )
{
oTF->AddPoint( objID + 1 - 0.5, 0.0 );
oTF->AddPoint( objID + 1 + 0.3, 0.0 );
oTF->AddPoint( objID + 1, 0.5 );
}
else if ( ll >= extents->GetValue( 5 ) + halfInc && ll <= extents->GetValue( 2 ) + halfInc )
{
oTF->AddPoint( objID + 1 - 0.5, 0.0 );
oTF->AddPoint( objID + 1 + 0.3, 0.0 );
oTF->AddPoint( objID + 1, 0.5 );
}
}
cTF->AddRGBPoint( objID + 1, color.redF(), color.greenF(), color.blueF() );
cTF->AddRGBPoint( objID + 1 - 0.5, color.redF(), color.greenF(), color.blueF() );
cTF->AddRGBPoint( objID + 1 + 0.3, color.redF(), color.greenF(), color.blueF() );
}
updateRenderer();
}
示例13: BackColor
void iA3DLabelledVolumeVis::renderSelection( std::vector<size_t> const & sortedSelInds, int classID, QColor const & classColor, QStandardItem* activeClassItem )
{
QColor BackColor(128, 128, 128, 0);
double backRGB[3];
backRGB[0] = BackColor.redF(); backRGB[1] = BackColor.greenF(); backRGB[2] = BackColor.blueF(); // background color
double red = 0.0, green = 0.0, blue = 0.0, alpha = 0.5, backAlpha = 0.00, classRGB[3], selRGB[3];
selRGB[0] = SelectedColor.redF();
selRGB[1] = SelectedColor.greenF();
selRGB[2] = SelectedColor.blueF();
classRGB[0] = classColor.redF();
classRGB[1] = classColor.greenF();
classRGB[2] = classColor.blueF();
// clear existing points
oTF->RemoveAllPoints();
cTF->RemoveAllPoints();
oTF->ClampingOff();
cTF->ClampingOff();
oTF->AddPoint( 0, backAlpha, 0.5, 1.0 );
cTF->AddRGBPoint( 0, backRGB[0], backRGB[1], backRGB[2], 0.5, 1.0 );
int hid = 0, next_hid = 1, prev_hid = -1, selectionIndex = 0, previous_selectionIndex = 0;
bool starting = false, hid_isASelection = false, previous_hid_isASelection = false;
int countClass = activeClassItem->rowCount();
int countSelection = sortedSelInds.size();
for ( size_t j = 0; j < countClass; ++j )
{
hid = activeClassItem->child( j )->text().toInt();
if ( countSelection > 0 )
{
if (hid-1 == sortedSelInds[selectionIndex] )
{
hid_isASelection = true;
red = SelectedColor.redF(), green = SelectedColor.greenF(), blue = SelectedColor.blueF();
if ( selectionIndex + 1 < sortedSelInds.size() )
selectionIndex++;
}
else
{
hid_isASelection = false;
red = classRGB[0]; green = classRGB[1]; blue = classRGB[2];
}
if ( prev_hid > 0 )
{
if (prev_hid-1 == sortedSelInds[previous_selectionIndex])
{
previous_hid_isASelection = true;
if ( previous_selectionIndex + 1 < sortedSelInds.size())
previous_selectionIndex++;
}
else
previous_hid_isASelection = false;
}
}
else
{
red = classRGB[0]; green = classRGB[1]; blue = classRGB[2];
}
// If we are not yet at the last object (of the class) get the next hid
if ( ( j + 1 ) < countClass )
{
next_hid = activeClassItem->child( j + 1 )->text().toInt();
}
else // If hid = the last object (of the class) we have to set the last object points
{
if ( starting ) // If we are in a sequence we have to set the ending (\)
{
oTF->AddPoint( hid - 1 + 0.3, alpha, 0.5, 1.0 );
oTF->AddPoint( hid - 0.5, alpha, 0.5, 1.0 );
oTF->AddPoint( hid, alpha, 0.5, 1.0 );
oTF->AddPoint( hid + 0.3, backAlpha, 0.5, 1.0 );
if ( hid_isASelection )
{
cTF->AddRGBPoint( hid - 0.5, 1.0, 0.0, 0.0, 0.5, 1.0 );
cTF->AddRGBPoint( hid, 1.0, 0.0, 0.0, 0.5, 1.0 );
cTF->AddRGBPoint( hid + 0.3, backRGB[0], backRGB[1], backRGB[2], 0.5, 1.0 );
}
else
{
cTF->AddRGBPoint( hid - 0.5, classRGB[0], classRGB[1], classRGB[2], 0.5, 1.0 );
cTF->AddRGBPoint( hid, classRGB[0], classRGB[1], classRGB[2], 0.5, 1.0 );
cTF->AddRGBPoint( hid + 0.3, backRGB[0], backRGB[1], backRGB[2], 0.5, 1.0 );
}
if ( previous_hid_isASelection )
cTF->AddRGBPoint( hid - 1 + 0.3, 1.0, 0.0, 0.0, 0.5, 1.0 );
else
cTF->AddRGBPoint( hid - 1 + 0.3, classRGB[0], classRGB[1], classRGB[2], 0.5, 1.0 );
break;
}
else // if we are not in a sequence we have to create the last tooth (/\)
{
oTF->AddPoint( hid - 0.5, backAlpha, 0.5, 1.0 );
//.........这里部分代码省略.........
示例14: glColor
inline void glColor( const QColor & color ) { glColor( color.redF(), color.greenF(), color.blueF(), color.alphaF() ); }
示例15: ToVectorRGBA
QVector4D ToVectorRGBA(QColor color)
{
return QVector4D(color.redF(), color.greenF(), color.blueF(), color.alphaF());
}