Changeset View
Changeset View
Standalone View
Standalone View
libs/image/krita_utils.cpp
Show First 20 Lines • Show All 371 Lines • ▼ Show 20 Line(s) | 44 | { | |||
---|---|---|---|---|---|
372 | void renderExactRect(QPainter *p, const QRect &rc, const QPen &pen) | 372 | void renderExactRect(QPainter *p, const QRect &rc, const QPen &pen) | ||
373 | { | 373 | { | ||
374 | QPen oldPen = p->pen(); | 374 | QPen oldPen = p->pen(); | ||
375 | p->setPen(pen); | 375 | p->setPen(pen); | ||
376 | renderExactRect(p, rc); | 376 | renderExactRect(p, rc); | ||
377 | p->setPen(oldPen); | 377 | p->setPen(oldPen); | ||
378 | } | 378 | } | ||
379 | 379 | | |||
380 | void renderRectFWithPen(QPainter *p, const QRectF &rc, const QPen &pen) | ||||
381 | { | ||||
382 | QPen oldPen = p->pen(); | ||||
383 | p->setPen(pen); | ||||
384 | p->drawRect(rc); | ||||
385 | p->setPen(oldPen); | ||||
386 | } | ||||
387 | | ||||
380 | QImage convertQImageToGrayA(const QImage &image) | 388 | QImage convertQImageToGrayA(const QImage &image) | ||
381 | { | 389 | { | ||
382 | QImage dstImage(image.size(), QImage::Format_ARGB32); | 390 | QImage dstImage(image.size(), QImage::Format_ARGB32); | ||
383 | 391 | | |||
384 | // TODO: if someone feel bored, a more optimized version of this would be welcome | 392 | // TODO: if someone feel bored, a more optimized version of this would be welcome | ||
385 | const QSize size = image.size(); | 393 | const QSize size = image.size(); | ||
386 | for(int y = 0; y < size.height(); ++y) { | 394 | for(int y = 0; y < size.height(); ++y) { | ||
387 | for(int x = 0; x < size.width(); ++x) { | 395 | for(int x = 0; x < size.width(); ++x) { | ||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |