diff options
| author | Felipe Corr??a da Silva Sanches <juca@members.fsf.org> | 2007-08-06 20:54:33 +0000 |
|---|---|---|
| committer | jucablues <jucablues@users.sourceforge.net> | 2007-08-06 20:54:33 +0000 |
| commit | d0e993a943d9e58ceebdca47f9992b26db2ddfc9 (patch) | |
| tree | b6a6d67e6eacac94daa8ccec6b2580f890a248f7 /src/display | |
| parent | Added my name to the list of authors (diff) | |
| download | inkscape-d0e993a943d9e58ceebdca47f9992b26db2ddfc9.tar.gz inkscape-d0e993a943d9e58ceebdca47f9992b26db2ddfc9.zip | |
handling of default values and checking for invalid values.
(bzr r3401)
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/nr-filter-convolve-matrix.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/src/display/nr-filter-convolve-matrix.cpp b/src/display/nr-filter-convolve-matrix.cpp index 8ce9241fe..562f3ffc4 100644 --- a/src/display/nr-filter-convolve-matrix.cpp +++ b/src/display/nr-filter-convolve-matrix.cpp @@ -15,13 +15,6 @@ namespace NR { FilterConvolveMatrix::FilterConvolveMatrix() -: orderX(3), - orderY(3), - targetX((int)(orderX/2)), - targetY((int)(orderY/2)), - bias(0), - edgeMode((NR::FilterConvolveMatrixEdgeMode) 0), - preserveAlpha(false) {} FilterPrimitive * FilterConvolveMatrix::create() { @@ -55,16 +48,6 @@ int FilterConvolveMatrix::render(FilterSlot &slot, Matrix const &trans) { int width = in->area.x1 - in->area.x0; int height = in->area.y1 - in->area.y0; - double div=0; - - if (divisor != 0){ - div = divisor; - } else { - for (i=0;i<orderX*orderY;i++){ - div += kernelMatrix[i]; - } - } - for (x=targetX; x < width - (orderX - targetX); x++){ for (y=targetY; y < height - (orderY - targetY); y++){ result_R = 0; @@ -82,10 +65,10 @@ int FilterConvolveMatrix::render(FilterSlot &slot, Matrix const &trans) { } } - out_data[4*( x + width*y )] = CLAMP_D_TO_U8(result_R / div + bias); - out_data[4*( x + width*y )+1] = CLAMP_D_TO_U8(result_G / div + bias); - out_data[4*( x + width*y )+2] = CLAMP_D_TO_U8(result_B / div + bias); - out_data[4*( x + width*y )+3] = CLAMP_D_TO_U8(result_A / div + bias); + out_data[4*( x + width*y )] = CLAMP_D_TO_U8(result_R / divisor + bias); + out_data[4*( x + width*y )+1] = CLAMP_D_TO_U8(result_G / divisor + bias); + out_data[4*( x + width*y )+2] = CLAMP_D_TO_U8(result_B / divisor + bias); + out_data[4*( x + width*y )+3] = CLAMP_D_TO_U8(result_A / divisor + bias); } } |
