diff options
| author | Felipe Corr??a da Silva Sanches <juca@members.fsf.org> | 2007-08-04 06:50:50 +0000 |
|---|---|---|
| committer | jucablues <jucablues@users.sourceforge.net> | 2007-08-04 06:50:50 +0000 |
| commit | 18e5b82371737127114b0df06bba0a6771ed2723 (patch) | |
| tree | 548fd52ac1f36667daa63c2eec6e1a311db65c70 /src/display | |
| parent | boilerplate code for the remaining filters. My next commits will (diff) | |
| download | inkscape-18e5b82371737127114b0df06bba0a6771ed2723.tar.gz inkscape-18e5b82371737127114b0df06bba0a6771ed2723.zip | |
setting of attributes and default values for feColorMatrix.
refactornig: moved read_kernel_matrix to helper-fns.h and renamed it to
helperfns_read_vector. Used it on sp-fecolormatrix.cpp
(bzr r3364)
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/nr-filter-colormatrix.cpp | 22 | ||||
| -rw-r--r-- | src/display/nr-filter-colormatrix.h | 8 |
2 files changed, 29 insertions, 1 deletions
diff --git a/src/display/nr-filter-colormatrix.cpp b/src/display/nr-filter-colormatrix.cpp index 060703ada..417a106c1 100644 --- a/src/display/nr-filter-colormatrix.cpp +++ b/src/display/nr-filter-colormatrix.cpp @@ -36,7 +36,15 @@ int FilterColorMatrix::render(FilterSlot &slot, Matrix const &trans) { unsigned char *out_data = NR_PIXBLOCK_PX(out); //IMPLEMENT ME! - + printf("type = %d\n", type); + if (type==0){ + for (int i=0;i<20;i++){ + printf("values[%d]=%f\n", i, values[i]); + } + } else { + printf("value = %f\n", value); + } + out->empty = FALSE; slot.set(_output, out); return 0; @@ -46,6 +54,18 @@ void FilterColorMatrix::area_enlarge(NRRectL &area, Matrix const &trans) { } +void FilterColorMatrix::set_type(int t){ + type = t; +} + +void FilterColorMatrix::set_value(gdouble v){ + value = v; +} + +void FilterColorMatrix::set_values(std::vector<gdouble> v){ + values = v; +} + } /* namespace NR */ /* diff --git a/src/display/nr-filter-colormatrix.h b/src/display/nr-filter-colormatrix.h index cf93a75cb..e87145c00 100644 --- a/src/display/nr-filter-colormatrix.h +++ b/src/display/nr-filter-colormatrix.h @@ -14,6 +14,7 @@ #include "display/nr-filter-primitive.h" #include "display/nr-filter-slot.h" +#include<vector> namespace NR { @@ -25,6 +26,13 @@ public: virtual int render(FilterSlot &slot, Matrix const &trans); virtual void area_enlarge(NRRectL &area, Matrix const &trans); + virtual void set_type(int type); + virtual void set_value(gdouble value); + virtual void set_values(std::vector<gdouble> values); +private: + std::vector<gdouble> values; + gdouble value; + int type; }; } /* namespace NR */ |
