void KQtTester::testImageEffects() { QString report = QString("execute %1 times:\n").arg(g_nTimes); report += QString("none:\t%1\tms\n").arg(none()); m_pPainter->translate(g_img.width() + 10, 0); report += QString("gray:\t%1\tms\n").arg(gray()); m_pPainter->translate(g_img.width() + 10, 0); report += QString("watermark:\t%1\tms\n").arg(watermark()); m_pPainter->translate(g_img.width() + 10, 0); report += QString("bilevel:\t%1\tms\n").arg(bilevel()); m_pPainter->resetMatrix(); m_pPainter->translate(0, g_img.height() + 10); report += QString("lightBlue:\t%1\tms\n").arg(lightBlue()); m_pPainter->translate(g_img.width() + 10, 0); report += QString("darkBlue:\t%1\tms\n").arg(darkBlue()); m_pPainter->resetMatrix(); m_pPainter->translate(0, (g_img.height() + 10) * 2); report += QString("colorKey:\t%1\tms\n").arg(colorKey()); m_pPainter->translate(g_img.width() + 10, 0); report += QString("brightness:\t%1\tms\n").arg(brightness()); m_pPainter->translate(g_img.width() + 10, 0); report += QString("contrast:\t%1\tms\n").arg(contrast()); m_pPainter->translate(g_img.width() + 10, 0); report += QString("brown:\t%1\tms\n").arg(brown()); drawReport(report); }
void KQtTester::testCreateInkPaths() { QString report = QString("execute %1 times:\n").arg(g_nTimes); report += QString("createInkPaths:\t%1\tms\n").arg(createInkPaths()); report += QString("drawInkPaths:\t%1\tms\n").arg(drawInkPaths()); drawReport(report); }
void KQtTester::testCreateInkPolygons() { QString report = QString("execute %1 times:\n").arg(g_nTimes); report += QString("createInkPolygons:\t%1\tms\n").arg(createInkPolygons()); report += QString("drawInkPolygons:\t%1\tms\n").arg(drawInkPolygons()); //report += QString("addPolygonsToPath:\t%1\tms\n").arg(addPolygonsToPath()); drawReport(report); }
/// **************************************************** /// /// DRAW MAIN SCREEN /// /// /// **************************************************** void testApp::drawMainScreen() { int yPos = DRAW_SPACE; int xPos = DRAW_SPACE; int draw_H_in_aspect = round((float)DRAW_W/(float)inAspect); int lineH = 12; // draw the incoming, the grayscale, the bg and the thresholded difference //------------------- INPUT ofFill(); ofSetHexColor(0x000000); ofRect(xPos,yPos,DRAW_W,DRAW_H); ofSetHexColor(0xffffff); colorImg.draw(xPos,yPos+draw_H_gap,DRAW_W,draw_H_in_aspect); ofSetHexColor(FONT_COLOR); ofDrawBitmapString(ofToString(currFrameNum), DRAW_SPACE, yPos + DRAW_H-lineH); // red rectangle showing selected area ofPushMatrix(); ofSetHexColor(0xff0000); ofNoFill(); ofSetLineWidth(2); int t = round((float)top/in_draw_scale); int l = round((float)left/in_draw_scale); int tW = round((float)targW/in_draw_scale); int tH = round((float)targH/in_draw_scale); ofRect( DRAW_SPACE+l, DRAW_SPACE+draw_H_gap+t,tW, tH); ofPopMatrix(); //------------------- OUTPUT ofSetHexColor(0x000000); ofRect(xPos+DRAW_W+DRAW_SPACE,yPos,DRAW_W,DRAW_H); ofSetHexColor(0xffffff); outputImg.draw(xPos+DRAW_W+DRAW_SPACE,yPos,DRAW_W,DRAW_H); //------------------- BACKGROUND yPos += DRAW_H+DRAW_SPACE; /* ofSetHexColor(0x000000); ofRect(xPos,yPos,DRAW_W,DRAW_H); ofSetHexColor(0xffffff); bgImage.draw(xPos,yPos+draw_H_gap,DRAW_W,draw_H_in_aspect); */ drawBlendSources(xPos,yPos,DRAW_W,DRAW_H); //-------------------- THRESHOLDED DIFFERENCE xPos += DRAW_W+DRAW_SPACE; /* ofSetHexColor(0x000000); ofRect(xPos,yPos,DRAW_W,DRAW_H); ofSetHexColor(0xffffff); yPos+=draw_H_gap; grayDiff.draw(xPos,yPos,DRAW_W,draw_H_in_aspect); */ // we could draw the whole contour finder // contourFinder.draw(xPos,yPos,DRAW_W,draw_H_in_aspect); //drawBlending(xPos,yPos,DRAW_W,DRAW_H); ofSetHexColor(0x000000); ofRect(xPos,yPos,DRAW_W,DRAW_H); ofSetHexColor(0xffffff); blendImg.draw(xPos,yPos,DRAW_W,DRAW_H); drawReport(xPos, yPos, lineH); // LOGOS yPos = 2*(DRAW_H+DRAW_SPACE); xPos = DRAW_SPACE; yPos = ofGetHeight()-imgLogos.height; ofSetHexColor(0xffffff); imgLogos.draw(0, yPos); // REPORT / MENU }