X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdisplay%2Fnr-filter-colormatrix.cpp;h=74394bfc1909c6a4e9ca48eeb4bb117f4a971cc6;hb=9857ba6e1d24d9769ef3454fb6826934dc83349b;hp=417a106c1f8c980fb7d5a5d41b4849c21b433d74;hpb=0ef926ae59e9cffb15ca7cb8d7de20c2b74807ef;p=inkscape.git diff --git a/src/display/nr-filter-colormatrix.cpp b/src/display/nr-filter-colormatrix.cpp index 417a106c1..74394bfc1 100644 --- a/src/display/nr-filter-colormatrix.cpp +++ b/src/display/nr-filter-colormatrix.cpp @@ -10,11 +10,13 @@ */ #include "display/nr-filter-colormatrix.h" +#include "display/nr-filter-utils.h" +#include + namespace NR { FilterColorMatrix::FilterColorMatrix() { - g_warning("FilterColorMatrix::render not implemented."); } FilterPrimitive * FilterColorMatrix::create() { @@ -34,17 +36,94 @@ int FilterColorMatrix::render(FilterSlot &slot, Matrix const &trans) { unsigned char *in_data = NR_PIXBLOCK_PX(in); unsigned char *out_data = NR_PIXBLOCK_PX(out); + unsigned char r,g,b,a; + int x,y,x0,y0,x1,y1,i; + double a00,a01,a02,a10,a11,a12,a20,a21,a22, coshue, sinhue; + x0=in->area.x0; + y0=in->area.y0; + x1=in->area.x1; + y1=in->area.y1; -//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]); + switch(type){ + case COLORMATRIX_MATRIX: + if (values.size()!=20) { + g_warning("ColorMatrix: values parameter error. Wrong size."); + return -1; + } + for (x=x0;xempty = FALSE; slot.set(_output, out); return 0; @@ -54,7 +133,7 @@ void FilterColorMatrix::area_enlarge(NRRectL &area, Matrix const &trans) { } -void FilterColorMatrix::set_type(int t){ +void FilterColorMatrix::set_type(FilterColorMatrixType t){ type = t; } @@ -62,7 +141,7 @@ void FilterColorMatrix::set_value(gdouble v){ value = v; } -void FilterColorMatrix::set_values(std::vector v){ +void FilterColorMatrix::set_values(std::vector &v){ values = v; }