Ejemplo n.º 1
0
void DisneyLayeredBRDF::evaluate_inputs(
    const ShadingContext&       shading_context,
    InputEvaluator&             input_evaluator,
    const ShadingPoint&         shading_point,
    const size_t                offset) const
{
    char* ptr = reinterpret_cast<char*>(input_evaluator.data());
    DisneyBRDFInputValues* values = reinterpret_cast<DisneyBRDFInputValues*>(ptr + offset);
    memset(values, 0, sizeof(DisneyBRDFInputValues));

    Color3d base_color(0.0);

    for (size_t i = 0, e = m_parent->get_layer_count(); i < e; ++i)
    {
        const DisneyMaterialLayer& layer =
            m_parent->get_layer(i, shading_context.get_thread_index());

        layer.evaluate_expressions(
            shading_point,
            shading_context.get_oiio_texture_system(),
            base_color,
            *values);
    }

    // Colors in SeExpr are always in the sRGB color space.
    base_color = srgb_to_linear_rgb(base_color);
    values->m_base_color = Color3f(base_color);
    values->precompute_tint_color();
}
Ejemplo n.º 2
0
void DBoxFE_Splash::drawContents( QPainter* painter ) {
  int position;
  QColor base_color( 255, 255, 255 );

  painter->setPen( Qt::NoPen );
  painter->setBrush( QColor( 255, 255, 255 ) );
  painter->drawEllipse( 51, 7, 9, 9 );
  painter->drawEllipse( 62, 7, 9, 9 );
  painter->drawEllipse( 73, 7, 9, 9 );

  for ( int i = 0; i < progress_bar_size; i++ ) {
    position = ( state + i ) % ( 2 * progress_bar_size - 1 );
    painter->setBrush( QColor( base_color.red() - 18 * i, base_color.green() - 10 * i, base_color.blue() - 28 * i ) );

    if ( position < 3 )
      painter->drawEllipse( 51 + position * 11, 7, 9, 9 );
  }

  painter->setPen( QColor( 255, 255, 255 ) );

  QFont fnt( "Verdena" );
  fnt.setPointSize( 12 );
  painter->setFont( fnt );

  if ( m_string.length() > 40 ) {
    m_string.truncate( 39 );
    m_string += "...";
  }

  painter->drawText( 90, 16, m_string );
}
Ejemplo n.º 3
0
FancyTabWidget::FancyTabWidget(QWidget *parent)
    : QWidget(parent)
{
    /////..
    QColor base_color(0, 90, 255);
    StyleHelper::setBaseColor(base_color);
    /////..

    m_tabBar = new FancyTabBar(this);

    m_selectionWidget = new QWidget(this);
    QVBoxLayout *selectionLayout = new QVBoxLayout;
    selectionLayout->setSpacing(0);
    selectionLayout->setMargin(0);

    StyledBar *bar = new StyledBar;
    /////..
    bar->setMinimumHeight(20);
    /////..
    QHBoxLayout *layout = new QHBoxLayout(bar);
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addWidget(new FancyColorButton(this));
    selectionLayout->addWidget(bar);

    selectionLayout->addWidget(m_tabBar);
    m_selectionWidget->setLayout(selectionLayout);
    m_selectionWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);

    m_modesStack = new QStackedLayout;

    QVBoxLayout *vlayout = new QVBoxLayout;
    vlayout->setMargin(0);
    vlayout->setSpacing(0);
    vlayout->addLayout(m_modesStack);

    QHBoxLayout *mainLayout = new QHBoxLayout;
    mainLayout->setMargin(0);
    mainLayout->setSpacing(0);
    mainLayout->addWidget(m_selectionWidget);
    mainLayout->addLayout(vlayout);
    setLayout(mainLayout);

    connect(m_tabBar, SIGNAL(currentChanged(int)), this, SLOT(showWidget(int)));
}
Ejemplo n.º 4
0
void KDevSplashScreen::drawContents (QPainter* painter)
{
	int position;
	QColor base_color (201,229,165); // Base green color

	// Draw background circles
	painter->setPen(NoPen);
	painter->setBrush(QColor(215,234,181));
	painter->drawEllipse(51,7,9,9);
	painter->drawEllipse(62,7,9,9);
	painter->drawEllipse(73,7,9,9);

	// Draw animated circles, increments are chosen
	// to get close to background's color
	// (didn't work well with QColor::light function)
	for (int i=0; i < progress_bar_size; i++)
	{
		position = (state+i)%(2*progress_bar_size-1);
		painter->setBrush(QColor(base_color.red()-18*i,
								 base_color.green()-10*i,
								 base_color.blue()-28*i));

		if (position < 3) painter->drawEllipse(51+position*11,7,9,9);
	}

	painter->setPen(QColor(74,112,18));
	QFont fnt(KGlobalSettings::generalFont());
	fnt.setPointSize(8);
	painter->setFont(fnt);

	// Draw version number
	QRect r = rect();
    r.setRect(r.x() + 5, r.y() + 5, r.width() - 10, r.height() - 10);
    painter->drawText(r, Qt::AlignRight, i18n("Version %1").arg( VERSION ));

	// Draw message at given position, limited to 43 chars
	// If message is too long, string is truncated
	if (m_string.length() > 40) {m_string.truncate(39); m_string += "...";}
	painter->drawText (90, 16, m_string, 42);

}