From 157b01d10a4c81206dae4fa05a623539e764717f Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 14 Apr 2010 21:50:00 +0000 Subject: Add Openmp directives git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1188 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- editor/pampaintspill.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/pampaintspill.c b/editor/pampaintspill.c index a5063775..1ba1aedc 100644 --- a/editor/pampaintspill.c +++ b/editor/pampaintspill.c @@ -224,10 +224,12 @@ locatePaintSources(struct pam * const pamP, paintSources.size = 0; paintSources.alloc = 0; + #pragma omp parallel for for (row = 0; row < pamP->height; ++row) { unsigned int col; for (col = 0; col < pamP->width; ++col) { if (!tupleEqualColor(pamP, tuples[row][col], bgColor)) + #pragma omp critical (addPaintSource) addPaintSource(row, col, &paintSources); } } @@ -360,6 +362,7 @@ produceOutputImage(struct pam * const pamP, unsigned int rowsComplete; rowsComplete = 0; + #pragma omp parallel for for (row = 0; row < pamP->height; ++row) { struct coords target; double * newColor; @@ -406,6 +409,7 @@ produceOutputImage(struct pam * const pamP, (sample) (newColor[plane] / totalWeight); } } + #pragma omp critical (rowTally) reportProgress(++rowsComplete, pamP->height); free(newColor); -- cgit 1.4.1