Exemplo n.º 1
0
void MythPainter::DrawEllipse(const QRect &area, const QBrush &fillBrush,
                              const QPen &linePen, int alpha)
{
    MythImage *im = GetImageFromRect(area, 0, 1, fillBrush, linePen);
    if (im)
        DrawImage(area.x(), area.y(), im, alpha);
}
Exemplo n.º 2
0
void MythPainter::DrawRoundRect(const QRect &area, int cornerRadius,
                                const QBrush &fillBrush, const QPen &linePen,
                                int alpha)
{
    MythImage *im = GetImageFromRect(area, cornerRadius, 0, fillBrush, linePen);
    if (im)
        DrawImage(area.x(), area.y(), im, alpha);
}
void MythQImagePainter::DrawRoundRect(const QRect &area, int radius, 
                                      bool drawFill, const QColor &fillColor, 
                                      bool drawLine, int lineWidth,
                                      const QColor &lineColor)
{
    MythImage *im = GetImageFromRect(area.size(), radius, drawFill, fillColor,
                                     drawLine, lineWidth, lineColor);
    if (im)
        DrawImage(area, im, QRect(0, 0, area.width(), area.height()), 255);
}
Exemplo n.º 4
0
void MythPainter::DrawRect(const QRect &area, const QBrush &fillBrush,
                           const QPen &linePen, int alpha)
{
    MythImage *im = GetImageFromRect(area, 0, 0, fillBrush, linePen);
    if (im)
    {
        DrawImage(area.x(), area.y(), im, alpha);
        im->DecrRef();
    }
}
Exemplo n.º 5
0
void MythYUVAPainter::DrawRect(const QRect &area, const QBrush &fillBrush,
                               const QPen &linePen, int alpha)
{
    QBrush brush(fillBrush);

    switch (fillBrush.style())
    {
    case Qt::LinearGradientPattern:
    case Qt::RadialGradientPattern:
    case Qt::ConicalGradientPattern:
        {
        QGradient gradient = *fillBrush.gradient();
        QGradientStops stops = gradient.stops();
        for (QGradientStops::iterator it = stops.begin(); it != stops.end(); ++it)
        {
            it->second = rgb_to_yuv(it->second);
            it->second.setAlpha(alpha);
        }
        gradient.setStops(stops);
        brush = gradient;
        }
        break;
    default:
        brush.setColor(rgb_to_yuv(brush.color()));
        break;
    }

    QPen pen(linePen);
    pen.setColor(rgb_to_yuv(pen.color()));

    // We pull an image here, in the hopes that when DrawRect
    // pulls an image this will still be in the cache and have
    // the right properties.
    MythImage *im = GetImageFromRect(area, 0, 0, brush, pen);
    if (im)
    {
        im->SetToYUV();
        im->DecrRef();
        im = NULL;
    }

    MythQImagePainter::DrawRect(area, brush, pen, alpha);
}
Exemplo n.º 6
0
void MythYUVAPainter::DrawEllipse(const QRect &area, const QBrush &fillBrush,
                                  const QPen &linePen, int alpha)
{
    QBrush brush(fillBrush);
    brush.setColor(rgb_to_yuv(brush.color()));
    QPen pen(linePen);
    pen.setColor(rgb_to_yuv(pen.color()));

    // We pull an image here, in the hopes that when DrawRect
    // pulls an image this will still be in the cache and have
    // the right properties.
    MythImage *im = GetImageFromRect(area, 0, 1, brush, pen);
    if (im)
    {
        im->SetToYUV();
        im->DecrRef();
        im = NULL;
    }

    MythQImagePainter::DrawEllipse(area, brush, pen, alpha);
}