X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdisplay%2Fnr-filter-primitive.h;h=fba4c634419484fc1b83c50a3c277161ce49e357;hb=ae5f81d1dccb2f382e3a548b95c1220485c667ec;hp=64625f4c22e3d153b9c5de2028a92d0bdfbda509;hpb=a72861cd83f11ef8b1247abca181a3ad31df0307;p=inkscape.git diff --git a/src/display/nr-filter-primitive.h b/src/display/nr-filter-primitive.h index 64625f4c2..fba4c6344 100644 --- a/src/display/nr-filter-primitive.h +++ b/src/display/nr-filter-primitive.h @@ -7,25 +7,44 @@ * Author: * Niko Kiirala * - * Copyright (C) 2006 Niko Kiirala + * Copyright (C) 2006-2007 Niko Kiirala * * Released under GNU GPL, read the file 'COPYING' for more information */ +#include "display/nr-filter-slot.h" #include "libnr/nr-pixblock.h" #include "libnr/nr-matrix.h" +#include "libnr/nr-rect-l.h" #include "svg/svg-length.h" namespace NR { +/* + * Different filter effects need different types of inputs. This is what + * traits are used for: one can specify, what special restrictions + * there are for inputs. + * + * Example: gaussian blur requires that x- and y-axis of input image + * are paraller to blurred object's x- and y-axis, respectively. + * Otherwise blur wouldn't rotate with the object. + * + * Values here should be powers of two, so these can be used as bitfield. + * That is: any combination ef existing traits can be specified. (excluding + * TRAIT_ANYTHING, which is alias for no traits defined) + */ +enum FilterTraits { + TRAIT_ANYTHING = 0, + TRAIT_PARALLER = 1 +}; + class FilterPrimitive { public: FilterPrimitive(); virtual ~FilterPrimitive(); - int render(NRPixBlock **pb, NRMatrix const *trans); - virtual int render(NRPixBlock **pb, Matrix const &trans) = 0; - virtual int get_enlarge(Matrix const &m); + virtual int render(FilterSlot &slot, FilterUnits const &units) = 0; + virtual void area_enlarge(NRRectL &area, Matrix const &m); /** * Sets the input slot number 'slot' to be used as input in rendering @@ -81,6 +100,14 @@ public: */ void reset_region(); + /** + * Queries the filter, which traits it needs from its input buffers. + * At the time of writing this, only one trait was needed, having + * user coordinate system and input pixelblock coordinates paraller to + * each other. + */ + virtual FilterTraits get_input_traits(); + protected: int _input; int _output;