1 /*
2 * feColorMatrix filter primitive renderer
3 *
4 * Authors:
5 * Felipe CorrĂȘa da Silva Sanches <felipe.sanches@gmail.com>
6 *
7 * Copyright (C) 2007 authors
8 *
9 * Released under GNU GPL, read the file 'COPYING' for more information
10 */
12 #include "display/nr-filter-colormatrix.h"
13 namespace NR {
15 FilterColorMatrix::FilterColorMatrix()
16 {
17 g_warning("FilterColorMatrix::render not implemented.");
18 }
20 FilterPrimitive * FilterColorMatrix::create() {
21 return new FilterColorMatrix();
22 }
24 FilterColorMatrix::~FilterColorMatrix()
25 {}
27 int FilterColorMatrix::render(FilterSlot &slot, Matrix const &trans) {
28 NRPixBlock *in = slot.get(_input);
29 NRPixBlock *out = new NRPixBlock;
31 nr_pixblock_setup_fast(out, in->mode,
32 in->area.x0, in->area.y0, in->area.x1, in->area.y1,
33 true);
35 unsigned char *in_data = NR_PIXBLOCK_PX(in);
36 unsigned char *out_data = NR_PIXBLOCK_PX(out);
38 //IMPLEMENT ME!
39 printf("type = %d\n", type);
40 if (type==0){
41 for (int i=0;i<20;i++){
42 printf("values[%d]=%f\n", i, values[i]);
43 }
44 } else {
45 printf("value = %f\n", value);
46 }
48 out->empty = FALSE;
49 slot.set(_output, out);
50 return 0;
51 }
53 void FilterColorMatrix::area_enlarge(NRRectL &area, Matrix const &trans)
54 {
55 }
57 void FilterColorMatrix::set_type(int t){
58 type = t;
59 }
61 void FilterColorMatrix::set_value(gdouble v){
62 value = v;
63 }
65 void FilterColorMatrix::set_values(std::vector<gdouble> v){
66 values = v;
67 }
69 } /* namespace NR */
71 /*
72 Local Variables:
73 mode:c++
74 c-file-style:"stroustrup"
75 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
76 indent-tabs-mode:nil
77 fill-column:99
78 End:
79 */
80 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :