//Only call after filling mediantexture void gpuEdge(){ DrawSobelRect(&mediantexture,-1.f,-1.f,1.f,1.f,&greysobeltexture); DrawSobelRect(&mediantexture2,-1.f,-1.f,1.f,1.f,&greysobeltexture2); concat1 = greysobeltexture.Save("tex_sobel.png", "sobel", output1); concat2 = greysobeltexture2.Save("tex_sobel2.png", "sobel", output2); hconcat(concat1, concat2, outputImage); }
void gpuBlur() { clock_t begin_proc = clock(); DrawMedianRect(&ytexture,-1.f,-1.f,1.f,1.f,&mediantexture); printf("median time: %f\n", (float)(clock() - begin_proc)/CLOCKS_PER_SEC ); DrawMedianRect(&ytexture2,-1.f,-1.f,1.f,1.f,&mediantexture2); printf("median time: %f\n", (float)(clock() - begin_proc)/CLOCKS_PER_SEC ); clock_t debug_time = clock(); concat1 = mediantexture.Save("tex_blur.png", "blur", output1); concat2 = mediantexture2.Save("tex_blur2.png", "blur", output2); hconcat(concat1, concat2, outputImage); if (debug) imwrite("out.jpg", outputImage); printf("concat time: %f\n", (float)(clock() - debug_time)/CLOCKS_PER_SEC ); }