~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/display/nr-filter-primitive.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#define __NR_FILTER_PRIMITIVE_CPP__
 
2
 
 
3
/*
 
4
 * SVG filters rendering
 
5
 *
 
6
 * Author:
 
7
 *   Niko Kiirala <niko@kiirala.com>
 
8
 *
 
9
 * Copyright (C) 2006 Niko Kiirala
 
10
 *
 
11
 * Released under GNU GPL, read the file 'COPYING' for more information
 
12
 */
 
13
 
 
14
#include "display/nr-filter-primitive.h"
 
15
#include "display/nr-filter-types.h"
 
16
#include "libnr/nr-pixblock.h"
 
17
#include "svg/svg-length.h"
 
18
 
 
19
namespace Inkscape {
 
20
namespace Filters {
 
21
 
 
22
FilterPrimitive::FilterPrimitive()
 
23
{
 
24
    _input = NR_FILTER_SLOT_NOT_SET;
 
25
    _output = NR_FILTER_SLOT_NOT_SET;
 
26
 
 
27
    // These defaults are according to SVG standard.
 
28
    // NB: SVGLength.set takes prescaled percent values: 1 means 100%
 
29
    _region_x.set(SVGLength::PERCENT, 0, 0);
 
30
    _region_y.set(SVGLength::PERCENT, 0, 0);
 
31
    _region_width.set(SVGLength::PERCENT, 1, 0);
 
32
    _region_height.set(SVGLength::PERCENT, 1, 0);
 
33
}
 
34
 
 
35
FilterPrimitive::~FilterPrimitive()
 
36
{
 
37
    // Nothing to do here
 
38
}
 
39
 
 
40
void FilterPrimitive::area_enlarge(NRRectL &/*area*/, Geom::Matrix const &/*m*/)
 
41
{
 
42
    // This doesn't need to do anything by default
 
43
}
 
44
 
 
45
void FilterPrimitive::set_input(int slot) {
 
46
    set_input(0, slot);
 
47
}
 
48
 
 
49
void FilterPrimitive::set_input(int input, int slot) {
 
50
    if (input == 0) _input = slot;
 
51
}
 
52
 
 
53
void FilterPrimitive::set_output(int slot) {
 
54
    if (slot >= 0) _output = slot;
 
55
}
 
56
 
 
57
FilterTraits FilterPrimitive::get_input_traits() {
 
58
    return TRAIT_ANYTHING;
 
59
}
 
60
 
 
61
} /* namespace Filters */
 
62
} /* namespace Inkscape */
 
63
 
 
64
/*
 
65
  Local Variables:
 
66
  mode:c++
 
67
  c-file-style:"stroustrup"
 
68
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
69
  indent-tabs-mode:nil
 
70
  fill-column:99
 
71
  End:
 
72
*/
 
73
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :