summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7906742)
raw | patch | inline | side by side (parent: 7906742)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 2 Jan 2009 12:18:25 +0000 (12:18 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 2 Jan 2009 12:18:25 +0000 (12:18 +0000) |
100 files changed:
index ffeaebe8e57fa823fb223d40b9e8b8c9ecc2a764..dd1419f2b845528c3a7ebc596aaf3ebb5d988431 100644 (file)
@@ -136,11 +136,11 @@ void compute_surface_normal(Fvector &N, gdouble ss, NRPixBlock *in, int i, int j
//std::cout << "(" << N[X_3D] << ", " << N[Y_3D] << ", " << N[Z_3D] << ")" << std::endl;
}
-void convert_coord(gdouble &x, gdouble &y, gdouble &z, Matrix const &trans) {
+void convert_coord(gdouble &x, gdouble &y, gdouble &z, Geom::Matrix const &trans) {
Point p = Point(x, y);
p *= trans;
- x = p[X];
- y = p[Y];
+ x = p[Geom::X];
+ y = p[Geom::Y];
z *= trans[0];
}
index 4baa9cc86cfa15764cf3d6df357ce2d1b59ebe37..dbbc7c9a4eff947f5e7063ce1c6c348010a7f629 100644 (file)
--- a/src/display/nr-3dutils.h
+++ b/src/display/nr-3dutils.h
/*
* 3D utils. Definition of gdouble vectors of dimension 3 and of some basic
* functions.
+ * This looks redundant, why not just use Geom::Point for this?
*
* Authors:
* Jean-Rene Reinhard <jr@komite.net>
*/
#include <gdk/gdktypes.h>
+#include <2geom/forward.h>
struct NRPixBlock;
namespace NR {
-struct Matrix;
-
#define X_3D 0
#define Y_3D 1
#define Z_3D 2
* \param z a reference to a z coordinate
* \param z a reference to a transformation matrix
*/
-void convert_coord(gdouble &x, gdouble &y, gdouble &z, Matrix const &trans);
+void convert_coord(gdouble &x, gdouble &y, gdouble &z, Geom::Matrix const &trans);
} /* namespace NR */
index 7692cbf15e492715dbcf3b7728ba0e7860d29c0c..d73a0ecbf69aa9202a46ee1fbd59b85d13bdf5b4 100644 (file)
if (style->filter.set && style->getFilter()) {
if (!group->filter) {
int primitives = sp_filter_primitive_count(SP_FILTER(style->getFilter()));
- group->filter = new NR::Filter(primitives);
+ group->filter = new Inkscape::Filters::Filter(primitives);
}
sp_filter_build_renderer(SP_FILTER(style->getFilter()), group->filter);
} else {
index 147513f6bd00dfd68d4ce225c40d57eefb04bf56..da2f5ce7eb4564e24095249ede96473a64880ba0 100644 (file)
if (style->filter.set && style->getFilter()) {
if (!image->filter) {
int primitives = sp_filter_primitive_count(SP_FILTER(style->getFilter()));
- image->filter = new NR::Filter(primitives);
+ image->filter = new Inkscape::Filters::Filter(primitives);
}
sp_filter_build_renderer(SP_FILTER(style->getFilter()), image->filter);
} else {
index 22c15daef4858b80aa9b88690e42b3067608bb9c..17a223b31afe796d17fc0ede73b3969963f1991d 100644 (file)
/* Mask item */
NRArenaItem *mask;
/* Filter to be applied after rendering this object, NULL if none */
- NR::Filter *filter;
+ Inkscape::Filters::Filter *filter;
/* Rendered buffer */
unsigned char *px;
index 906d9166c9d63edc85cc89807215893c5240d67d..aafdc37d69a34cd879b813dcd02cadee06f0da4a 100644 (file)
if (style->filter.set && style->getFilter()) {
if (!shape->filter) {
int primitives = sp_filter_primitive_count(SP_FILTER(style->getFilter()));
- shape->filter = new NR::Filter(primitives);
+ shape->filter = new Inkscape::Filters::Filter(primitives);
}
sp_filter_build_renderer(SP_FILTER(style->getFilter()), shape->filter);
} else {
index 2544d8bfb08fe2972801ced5cad731075451fabb..2a066b5635ce10a7ea5b8bf75984083481dd1418 100644 (file)
#include "libnr/nr-blit.h"
#include "libnr/nr-pixops.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
/*
* From http://www.w3.org/TR/SVG11/filters.html#feBlend
}
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 3e3bf71b2e24d7252a974dcf47fdcd5ef74bf0d9..ffdd6211879bad49b501fdfce2c5432c059d0a54 100644 (file)
#include "display/nr-filter-slot.h"
#include "display/nr-filter-units.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
enum FilterBlendMode {
BLEND_NORMAL,
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
index f619e268529d1fbc5352aec06b6903006be7fa95..e5dc3fb2056959cc2c6ec7de7027c91085495a6f 100644 (file)
#include "libnr/nr-blit.h"
#include <math.h>
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterColorMatrix::FilterColorMatrix()
{
values = v;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 85d2ab75890ef56e1d92efaa9e0bbb909d1ebc3d..1c331a5b0ee46b4bea48fcd133f00a4e93550198 100644 (file)
#include "display/nr-filter-units.h"
#include<vector>
-namespace NR {
+namespace Inkscape {
+namespace Filters {
enum FilterColorMatrixType {
COLORMATRIX_MATRIX,
FilterColorMatrixType type;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_COLOR_MATRIX_H__ */
/*
diff --git a/src/display/nr-filter-component-transfer.cpp b/src/display/nr-filter-component-transfer.cpp
index caf053bcf38026c75b7491bd2b6b472c52544c0b..74d66fbe4a406373bcfc73ad43f19b93021dcd75 100644 (file)
#include "libnr/nr-pixops.h"
#include <math.h>
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterComponentTransfer::FilterComponentTransfer()
{
@@ -157,7 +158,8 @@ void FilterComponentTransfer::area_enlarge(NRRectL &/*area*/, Geom::Matrix const
{
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
diff --git a/src/display/nr-filter-component-transfer.h b/src/display/nr-filter-component-transfer.h
index 3a7c015cb0bd5b60418a49bd26b6dfafbf60d7ed..3d8be272e058fa44e3c20744962aea957ff61882 100644 (file)
#include "display/nr-filter-units.h"
#include <vector>
-namespace NR {
+namespace Inkscape {
+namespace Filters {
enum FilterComponentTransferType {
COMPONENTTRANSFER_TYPE_IDENTITY,
double offset[4];
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_COMPONENT_TRANSFER_H__ */
/*
index 568c093b9881e9fea27a8f270e337d90a76881a6..34a2d2e63672c3372e34332c0906f8da6e136214 100644 (file)
inline void
composite_arithmetic(unsigned char *r, unsigned char const *a, unsigned char const *b)
{
- r[0] = NR_NORMALIZE_31(NR::clamp3(arith_k1 * a[0] * b[0]
+ using Inkscape::Filters::clamp3;
+ r[0] = NR_NORMALIZE_31(clamp3(arith_k1 * a[0] * b[0]
+ arith_k2 * a[0] + arith_k3 * b[0] + arith_k4));
- r[1] = NR_NORMALIZE_31(NR::clamp3(arith_k1 * a[1] * b[1]
+ r[1] = NR_NORMALIZE_31(clamp3(arith_k1 * a[1] * b[1]
+ arith_k2 * a[1] + arith_k3 * b[1] + arith_k4));
- r[2] = NR_NORMALIZE_31(NR::clamp3(arith_k1 * a[2] * b[2]
+ r[2] = NR_NORMALIZE_31(clamp3(arith_k1 * a[2] * b[2]
+ arith_k2 * a[2] + arith_k3 * b[2] + arith_k4));
- r[3] = NR_NORMALIZE_31(NR::clamp3(arith_k1 * a[3] * b[3]
+ r[3] = NR_NORMALIZE_31(clamp3(arith_k1 * a[3] * b[3]
+ arith_k2 * a[3] + arith_k3 * b[3] + arith_k4));
}
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterComposite::FilterComposite() :
op(COMPOSITE_DEFAULT), k1(0), k2(0), k3(0), k4(0),
- _input2(NR::NR_FILTER_SLOT_NOT_SET)
+ _input2(Inkscape::Filters::NR_FILTER_SLOT_NOT_SET)
{}
FilterPrimitive * FilterComposite::create() {
@@ -216,7 +218,8 @@ void FilterComposite::set_arithmetic(double k1, double k2, double k3, double k4)
this->k4 = k4;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index d467213f088396fe01a46ca7bcab035fd8f7c3fc..b2466653111a8bd86e2d646c9e32d6c55f90602c 100644 (file)
#include "display/nr-filter-slot.h"
#include "display/nr-filter-units.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterComposite : public FilterPrimitive {
public:
int _input2;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_COMPOSITE_H__ */
/*
index e29283cf1b7fe4a1efd117772966c1ccd515cda1..3fca952da14c22de01349f506ba4bf07a2b4fa3a 100644 (file)
#include "display/nr-filter-utils.h"
#include <vector>
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterConvolveMatrix::FilterConvolveMatrix()
{}
return TRAIT_PARALLER;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 8414b60c195639611f54d002a73b56d3f2fb84ff..d7a04a7669a704c24f6b9442fea7367e5ed58571 100644 (file)
#include "libnr/nr-rect-l.h"
#include <vector>
-namespace NR {
+namespace Inkscape {
+namespace Filters {
enum FilterConvolveMatrixEdgeMode {
CONVOLVEMATRIX_EDGEMODE_DUPLICATE,
bool preserveAlpha;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_CONVOLVE_MATRIX_H__ */
/*
index 77879cd8903bc545012712ce4e58598d5fa9f88f..9ae231d395bede628ad813b19c9a3ba58410bc4c 100644 (file)
#include "libnr/nr-rect-l.h"
#include "color.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterDiffuseLighting::FilterDiffuseLighting()
{
#define COMPUTE_INTER(inter, N, L, kd) \
do {\
- (inter) = (kd) * scalar_product((N), (L)); \
+ (inter) = (kd) * NR::scalar_product((N), (L)); \
if ((inter) < 0) (inter) = 0; \
}while(0)
int dx = 1; //TODO setup
int dy = 1; //TODO setup
//surface scale
- Matrix trans = units.get_matrix_primitiveunits2pb();
+ Geom::Matrix trans = units.get_matrix_primitiveunits2pb();
gdouble ss = surfaceScale * trans[0];
gdouble kd = diffuseConstant; //diffuse lighting constant
- Fvector L, N, LC;
+ NR::Fvector L, N, LC;
gdouble inter;
nr_pixblock_setup_fast(out, in->mode,
dl->light_components(LC);
//finish the work
for (i = 0, j = 0; i < w*h; i++) {
- compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
+ NR::compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
COMPUTE_INTER(inter, N, L, kd);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]);
// pixblock coordinates
//finish the work
for (i = 0, j = 0; i < w*h; i++) {
- compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
+ NR::compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
pl->light_vector(L,
i % w + x0,
i / w + y0,
// pixblock coordinates
//finish the work
for (i = 0, j = 0; i < w*h; i++) {
- compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
+ NR::compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
sl->light_vector(L,
i % w + x0,
i / w + y0,
return TRAIT_PARALLER;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 36ed8835b64211b6870fea19e0b5955c31e82118..a1c6964cb8bf2afc5447b4f986b8e1efcde417ae 100644 (file)
#include "filters/spotlight.h"
#include "color.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterDiffuseLighting : public FilterPrimitive {
public:
private:
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_DIFFUSELIGHTING_H__ */
/*
diff --git a/src/display/nr-filter-displacement-map.cpp b/src/display/nr-filter-displacement-map.cpp
index 928745f31238a964515bcf18645a68e84fb860d0..39e921a38d289cf0f3f5c5a9b3b77f93b4edf0e4 100644 (file)
#include "libnr/nr-blit.h"
#include "libnr/nr-pixops.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterDisplacementMap::FilterDisplacementMap()
{}
return TRAIT_PARALLER;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index f30c5a8a92f323b4fc9e1aa3d973895440c4360f..2a7b0f19518dedfc87b92ccddd200161a6df48a1 100644 (file)
#include "display/nr-filter-units.h"
#include "libnr/nr-rect-l.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterDisplacementMap : public FilterPrimitive {
public:
int out_x0, out_y0, out_w, out_h;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_DISPLACEMENT_MAP_H__ */
/*
index 8e9b510398db0e42bb294886a1552bfd4d7e3e69..026cbce169b01b8376aa428b24c397da17992e52 100644 (file)
#include "display/nr-filter-flood.h"
#include "display/nr-filter-utils.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterFlood::FilterFlood()
{}
{
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index cd9269913527f3eac43e654849a289a13c33afcd..9e6a53abb55dbf6e9364089d1bfb235413358f1e 100644 (file)
#include "display/nr-filter-slot.h"
#include "display/nr-filter-units.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterFlood : public FilterPrimitive {
public:
guint32 color;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_FLOOD_H__ */
/*
index 4e4c3ee632d0b5e1348a2a2e7f8e4ba3cc75ff6b..5d071be8c0aafdb62ba5b6091dc69365f8b735e5 100644 (file)
return round_cast<Tt>(v);
}
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterGaussian::FilterGaussian()
{
}
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 1242a0961a18526d663118d72514c1f4c811fef3..763e42de22239d9c87002e4f32d2db5529f60912 100644 (file)
BLUR_QUALITY_WORST = -2
};
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterGaussian : public FilterPrimitive {
public:
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
index 72c05c797a6bdb9402f488b1dacd5263508f3c08..0b71e28c81dbb9317c78d623b3d8375f93a4bcc7 100644 (file)
#include "libnr/nr-blit.h"
#include "libnr/nr-pixblock.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
NRPixBlock *filter_get_alpha(NRPixBlock *src)
{
return dst;
}
-} // namespace NR
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index cfbca0bc158b4ebb36de3ef8b399a2dfc09bff25..fca64577651c1d71664b9c0e256da66a74c6937e 100644 (file)
#include "libnr/nr-pixblock.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
NRPixBlock *filter_get_alpha(NRPixBlock *src);
-}
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_GETALPHA_H__ */
/*
index da8fe0ac42298a8c706b824bb0c193fd726869e7..986b6502d460fe1a72dae6be956333367d857f74 100644 (file)
#include "display/nr-filter-units.h"
#include "libnr/nr-rect-l.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterImage::FilterImage()
{
}
pb = new NRPixBlock;
free_pb_on_exit = true;
-
- Matrix identity(1.0, 0.0,
- 0.0, 1.0,
- 0.0, 0.0);
- Geom::OptRect area = SVGElem->getBounds(identity);
+
+ Geom::OptRect area = SVGElem->getBounds(Geom::identity());
NRRectL rect;
rect.x0=area->min()[Geom::X];
// Get the object bounding box. Image is placed with respect to box.
// Array values: 0: width; 3: height; 4: -x; 5: -y.
- Matrix object_bbox = units.get_matrix_user2filterunits().inverse();
+ Geom::Matrix object_bbox = units.get_matrix_user2filterunits().inverse();
// feImage is suppose to use the same parameters as a normal SVG image.
// If a width or height is set to zero, the image is not suppose to be displayed.
int coordx,coordy;
unsigned char *out_data = NR_PIXBLOCK_PX(out);
- Matrix unit_trans = units.get_matrix_primitiveunits2pb().inverse();
+ Geom::Matrix unit_trans = units.get_matrix_primitiveunits2pb().inverse();
for (x=x0; x < x1; x++){
for (y=y0; y < y1; y++){
//TODO: use interpolation
return TRAIT_PARALLER;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 42e7f089aca77d25fc84117595b969d002f109a7..f7f0fe59062379822bd9f0fbc7a2a3df09b15448 100644 (file)
#include <gtkmm.h>
#include "sp-item.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterImage : public FilterPrimitive {
public:
float feImageX,feImageY,feImageWidth,feImageHeight;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_IMAGE_H__ */
/*
index 38088422343494a343b4bd7f4a969e865060d21a..b913e2cd7193509cb4c50ef95a7e3fd4d2f4bc7e 100644 (file)
r[3] = a[3] + NR_NORMALIZE_21(b[3] * (255 - a[3]));
}
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterMerge::FilterMerge() :
_input_image(1, NR_FILTER_SLOT_NOT_SET)
}
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 14c16a27a007fcc93c7c23b897c31a746e85e191..b7737e34717df11441ba40ead1f59ffd477b17f0 100644 (file)
#include "display/nr-filter-slot.h"
#include "display/nr-filter-units.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterMerge : public FilterPrimitive {
public:
std::vector<int> _input_image;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_MERGE_H__ */
/*
index b1c79044296a71459142fe82c2d8623452433d47..fb51099d5d4396816a408657cfeea6ed6524b829 100644 (file)
#include "display/nr-filter-units.h"
#include "libnr/nr-blit.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterMorphology::FilterMorphology()
{
return TRAIT_PARALLER;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index b598a4208a6bc708f77c8f411fad71860df107ac..1d3e16be3ec4727ecf0f009a1ec00925c5ac75a4 100644 (file)
#include "display/nr-filter-slot.h"
#include "display/nr-filter-units.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
enum FilterMorphologyOperator {
MORPHOLOGY_OPERATOR_ERODE,
double yradius;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_MORPHOLOGY_H__ */
/*
index ecfa40fa290e41c8b638395e197b9765c3fdf360..fd4f55053d031b448f16aa612cf9ca20379c7167 100644 (file)
#include "libnr/nr-pixblock.h"
#include "libnr/nr-rect-l.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
+
+using Geom::X;
+using Geom::Y;
FilterOffset::FilterOffset() :
dx(0), dy(0)
NRPixBlock *out = new NRPixBlock;
- Matrix trans = units.get_matrix_primitiveunits2pb();
- Point offset(dx, dy);
+ Geom::Matrix trans = units.get_matrix_primitiveunits2pb();
+ Geom::Point offset(dx, dy);
offset *= trans;
offset[X] -= trans[4];
offset[Y] -= trans[5];
void FilterOffset::area_enlarge(NRRectL &area, Geom::Matrix const &trans)
{
- Point offset(dx, dy);
+ Geom::Point offset(dx, dy);
offset *= trans;
offset[X] -= trans[4];
offset[Y] -= trans[5];
}
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 166fba247bac1aa86903f9f0b61d1f4752c6d620..b00ad25fe3ceb360529251ac8391d03ba8d55c79 100644 (file)
#include "display/nr-filter-units.h"
#include "libnr/nr-rect-l.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterOffset : public FilterPrimitive {
public:
double dx, dy;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_OFFSET_H__ */
/*
index 8d7c3166278b535d31dc35ccdc697aba729d2cfc..b2db7067ad0243bf96d764eebe68ed7ee9d5c78d 100644 (file)
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-namespace NR {
+namespace Inkscape {
+namespace Filters {
/**
* Mixes the two input images using the function given as template.
}
}
-} // namespace NR
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif // __NR_FILTER_PIXOPS_H_
/*
index eb4583b6e7f79e9b1db7a4ed5cb1d206ade26864..b70ae57fe9764da53478b7448b655f6978648783 100644 (file)
#include "libnr/nr-pixblock.h"
#include "svg/svg-length.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterPrimitive::FilterPrimitive()
{
return TRAIT_ANYTHING;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 6d0f5433b13244bad4918812c3bc45acbf0be7a0..74b41211bb3acddf13829c3f03d7d1a3365b855f 100644 (file)
#include "libnr/nr-rect-l.h"
#include "svg/svg-length.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
/*
* Different filter effects need different types of inputs. This is what
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
index 384baa2c5c0ec4af68a0b7d1e24a1e6e578b7ffe..bdb993ed9b603013ee12ebfe24d214923283366c 100644 (file)
#include "display/nr-filter-units.h"
#include "libnr/nr-pixblock.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterSkeleton::FilterSkeleton()
{}
return 0;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index c2e595f9c65e25b80c03eb6c887e48cf46c07632..dc69c95ed06550e1b4cb9b14537085c5fcedcee7 100644 (file)
#include "display/nr-filter-slot.h"
#include "display/nr-filter-units.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterSkeleton : public FilterPrimitive {
public:
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_SKELETON_H__ */
/*
index 5d470df15f4f762befb6a5fb91915e602dded042..dc4de5bd33203449d60edb0cd1c8518b81908ce3 100644 (file)
return (int)round(a);
}
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterSlot::FilterSlot(int slots, NRArenaItem const *item)
: _last_out(-1),
void FilterSlot::get_final(int slot_nr, NRPixBlock *result) {
NRPixBlock *final_usr = get(slot_nr);
- Matrix trans = units.get_matrix_pb2display();
+ Geom::Matrix trans = units.get_matrix_pb2display();
int size = (result->area.x1 - result->area.x0)
* (result->area.y1 - result->area.y0)
if (fabs(trans[1]) > 1e-6 || fabs(trans[2]) > 1e-6) {
if (filterquality == FILTER_QUALITY_BEST) {
- transform_bicubic(result, final_usr, trans);
+ NR::transform_bicubic(result, final_usr, trans);
} else {
- transform_nearest(result, final_usr, trans);
+ NR::transform_nearest(result, final_usr, trans);
}
} else if (fabs(trans[0] - 1) > 1e-6 || fabs(trans[3] - 1) > 1e-6) {
- scale_bicubic(result, final_usr);
+ NR::scale_bicubic(result, final_usr);
} else {
nr_blit_pixblock_pixblock(result, final_usr);
}
? _get_index(slot_nr)
: _get_index(NR_FILTER_UNNAMED_SLOT));
assert(index >= 0);
- // Unnamed slot is only for NR::FilterSlot internal use.
+ // Unnamed slot is only for Inkscape::Filters::FilterSlot internal use.
assert(slot_nr != NR_FILTER_UNNAMED_SLOT);
assert(slot_nr == NR_FILTER_SLOT_NOT_SET ||_slot_number[index] == slot_nr);
if (slot_nr == NR_FILTER_SOURCEGRAPHIC || slot_nr == NR_FILTER_BACKGROUNDIMAGE) {
- Matrix trans = units.get_matrix_display2pb();
+ Geom::Matrix trans = units.get_matrix_display2pb();
if (fabs(trans[1]) > 1e-6 || fabs(trans[2]) > 1e-6) {
NRPixBlock *trans_pb = new NRPixBlock;
int x0 = pb->area.x0;
* images are exported in horizontal stripes. One stripe
* is not too high, but can get thousands of pixels wide.
* Rotate this 45 degrees -> _huge_ image */
- g_warning("Memory allocation failed in NR::FilterSlot::set (transform)");
+ g_warning("Memory allocation failed in Inkscape::Filters::FilterSlot::set (transform)");
return;
}
if (filterquality == FILTER_QUALITY_BEST) {
- transform_bicubic(trans_pb, pb, trans);
+ NR::transform_bicubic(trans_pb, pb, trans);
} else {
- transform_nearest(trans_pb, pb, trans);
+ NR::transform_nearest(trans_pb, pb, trans);
}
nr_pixblock_release(pb);
delete pb;
nr_pixblock_setup_fast(trans_pb, pb->mode,
min_x, min_y, max_x, max_y, true);
if (trans_pb->size != NR_PIXBLOCK_SIZE_TINY && trans_pb->data.px == NULL) {
- g_warning("Memory allocation failed in NR::FilterSlot::set (scaling)");
+ g_warning("Memory allocation failed in Inkscape::Filters::FilterSlot::set (scaling)");
return;
}
- scale_bicubic(trans_pb, pb);
+ NR::scale_bicubic(trans_pb, pb);
nr_pixblock_release(pb);
delete pb;
pb = trans_pb;
filterquality = q;
}
-}
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index b566be10e7ee28d8e03fd6023c6a1ea670a22b3b..bddb42dc3528ecf2bcaad29b530362d2e546175e 100644 (file)
struct NRArenaItem;
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterSlot {
public:
int _get_index(int slot);
};
-}
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif // __NR_FILTER_SLOT_H__
/*
diff --git a/src/display/nr-filter-specularlighting.cpp b/src/display/nr-filter-specularlighting.cpp
index c6c81700cf1977eb8356df4f8d01999c4ff0baaf..526f49ec8ba3633cdd8016dce42973632d8b79d7 100644 (file)
#include "libnr/nr-rect-l.h"
#include "color.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterSpecularLighting::FilterSpecularLighting()
{
//to get the expected formula
#define COMPUTE_INTER(inter, H, N, ks, speculaExponent) \
do {\
- gdouble scal = scalar_product((N), (H)); \
+ gdouble scal = NR::scalar_product((N), (H)); \
if (scal <= 0)\
(inter) = 0;\
else\
@@ -79,10 +80,10 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
int dx = 1; //TODO setup
int dy = 1; //TODO setup
//surface scale
- Matrix trans = units.get_matrix_primitiveunits2pb();
+ Geom::Matrix trans = units.get_matrix_primitiveunits2pb();
gdouble ss = surfaceScale * trans[0];
gdouble ks = specularConstant; //diffuse lighting constant
- Fvector L, N, LC, H;
+ NR::Fvector L, N, LC, H;
gdouble inter;
nr_pixblock_setup_fast(out, NR_PIXBLOCK_MODE_R8G8B8A8N,
@@ -98,10 +99,10 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
DistantLight *dl = new DistantLight(light.distant, lighting_color);
dl->light_vector(L);
dl->light_components(LC);
- normalized_sum(H, L, EYE_VECTOR);
+ NR::normalized_sum(H, L, NR::EYE_VECTOR);
//finish the work
for (i = 0, j = 0; i < w*h; i++) {
- compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
+ NR::compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
COMPUTE_INTER(inter, N, H, ks, specularExponent);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]);
@@ -124,12 +125,12 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
// pixblock coordinates
//finish the work
for (i = 0, j = 0; i < w*h; i++) {
- compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
+ NR::compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
pl->light_vector(L,
i % w + x0,
i / w + y0,
ss * (double) data_i[4*i+3]/ 255);
- normalized_sum(H, L, EYE_VECTOR);
+ NR::normalized_sum(H, L, NR::EYE_VECTOR);
COMPUTE_INTER(inter, N, H, ks, specularExponent);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]);
@@ -151,13 +152,13 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
// pixblock coordinates
//finish the work
for (i = 0, j = 0; i < w*h; i++) {
- compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
+ NR::compute_surface_normal(N, ss, in, i / w, i % w, dx, dy);
sl->light_vector(L,
i % w + x0,
i / w + y0,
ss * (double) data_i[4*i+3]/ 255);
sl->light_components(LC, L);
- normalized_sum(H, L, EYE_VECTOR);
+ NR::normalized_sum(H, L, NR::EYE_VECTOR);
COMPUTE_INTER(inter, N, H, ks, specularExponent);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]);
return TRAIT_PARALLER;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 38f2dfc2266da84b2402a63773ab8940bf07fcef..e141f8f1ff9d165dbf781a171a244791cea517fa 100644 (file)
#include "filters/spotlight.h"
#include "color.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterSpecularLighting : public FilterPrimitive {
public:
private:
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_SPECULARLIGHTING_H__ */
/*
index 7fa8ac06ca267f08dba510d04192a8b27efffdff..53399eba29467cbef52c39350a73ae76ee7133bc 100644 (file)
#include "display/nr-filter-tile.h"
#include "display/nr-filter-units.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
FilterTile::FilterTile()
{
return TRAIT_PARALLER;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index ecdae91f4c2abf01a9ba1e26c2809bd3a7dd26c7..ea826dfd7326ffdb3cf259e77a01b4b4cf4f2552 100644 (file)
#include "display/nr-filter-units.h"
#include "libnr/nr-rect-l.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterTile : public FilterPrimitive {
public:
virtual FilterTraits get_input_traits();
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_TILE_H__ */
/*
index 1a3a8d1f119a07a0ff2356df5b2aa8853c4ca003..1336e5f79075f6655d2e41a0682b2ef9a11b5c7b 100644 (file)
#include "libnr/nr-blit.h"
#include <math.h>
-namespace NR {
+namespace Inkscape {
+namespace Filters{
FilterTurbulence::FilterTurbulence()
: XbaseFrequency(0),
numOctaves(1),
seed(0),
updated(false),
- updated_area(IPoint(), IPoint()),
+ updated_area(NR::IPoint(), NR::IPoint()),
pix(NULL),
fTileWidth(10), //guessed
fTileHeight(10), //guessed
updated=u;
}
-void FilterTurbulence::render_area(NRPixBlock *pix, IRect &full_area, FilterUnits const &units) {
- const int bbox_x0 = full_area.min()[X];
- const int bbox_y0 = full_area.min()[Y];
- const int bbox_x1 = full_area.max()[X];
- const int bbox_y1 = full_area.max()[Y];
+void FilterTurbulence::render_area(NRPixBlock *pix, NR::IRect &full_area, FilterUnits const &units) {
+ const int bbox_x0 = full_area.min()[NR::X];
+ const int bbox_y0 = full_area.min()[NR::Y];
+ const int bbox_x1 = full_area.max()[NR::X];
+ const int bbox_y1 = full_area.max()[NR::Y];
- Matrix unit_trans = units.get_matrix_primitiveunits2pb().inverse();
+ Geom::Matrix unit_trans = units.get_matrix_primitiveunits2pb().inverse();
double point[2];
@@ -123,11 +124,11 @@ void FilterTurbulence::render_area(NRPixBlock *pix, IRect &full_area, FilterUnit
pix->empty = FALSE;
}
-void FilterTurbulence::update_pixbuffer(IRect &area, FilterUnits const &units) {
- int bbox_x0 = area.min()[X];
- int bbox_y0 = area.min()[Y];
- int bbox_x1 = area.max()[X];
- int bbox_y1 = area.max()[Y];
+void FilterTurbulence::update_pixbuffer(NR::IRect &area, FilterUnits const &units) {
+ int bbox_x0 = area.min()[NR::X];
+ int bbox_y0 = area.min()[NR::Y];
+ int bbox_x1 = area.max()[NR::X];
+ int bbox_y1 = area.max()[NR::Y];
TurbulenceInit((long)seed);
@@ -162,7 +163,7 @@ void FilterTurbulence::update_pixbuffer(IRect &area, FilterUnits const &units) {
}
int FilterTurbulence::render(FilterSlot &slot, FilterUnits const &units) {
- IRect area = units.get_pixblock_filterarea_paraller();
+ NR::IRect area = units.get_pixblock_filterarea_paraller();
// TODO: could be faster - updated_area only has to be same size as area
if (!updated || updated_area != area) update_pixbuffer(area, units);
return TRAIT_PARALLER;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index d0f345360a41363b12a147898b2d03fa4a971b2b..b12e6395a1122878554feaa775cb92ec790689c3 100644 (file)
#include "display/nr-filter-units.h"
#include "libnr/nr-rect-l.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
enum FilterTurbulenceType {
TURBULENCE_FRACTALNOISE,
virtual ~FilterTurbulence();
virtual int render(FilterSlot &slot, FilterUnits const &units);
- void update_pixbuffer(IRect &area, FilterUnits const &units);
- void render_area(NRPixBlock *pix, IRect &full_area, FilterUnits const &units);
+ void update_pixbuffer(NR::IRect &area, FilterUnits const &units);
+ void render_area(NRPixBlock *pix, NR::IRect &full_area, FilterUnits const &units);
void set_baseFrequency(int axis, double freq);
void set_numOctaves(int num);
bool stitchTiles;
FilterTurbulenceType type;
bool updated;
- IRect updated_area;
+ NR::IRect updated_area;
NRPixBlock *pix;
unsigned char *pix_data;
double fTileY;
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_TURBULENCE_H__ */
/*
index a54bfa6700d31bf184db0f2da7d5cecfae412e4e..595606d4942e3ebc14d15da4bf13390120b2c10c 100644 (file)
#ifndef __NR_FILTER_TYPES_H__
#define __NR_FILTER_TYPES_H__
-namespace NR {
+namespace Inkscape {
+namespace Filters {
enum FilterPrimitiveType {
NR_FILTER_BLEND,
NR_FILTER_STROKEPAINT = -7,
NR_FILTER_UNNAMED_SLOT = -8
};
-/* Unnamed slot is for NR::FilterSlot internal use. Passing it as
- * parameter to NR::FilterSlot accessors may have unforeseen consequences. */
+/* Unnamed slot is for Inkscape::Filters::FilterSlot internal use. Passing it as
+ * parameter to Inkscape::Filters::FilterSlot accessors may have unforeseen consequences. */
enum FilterQuality {
FILTER_QUALITY_BEST = 2,
FILTER_QUALITY_WORST = -2
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif // __NR_FILTER_TYPES_H__
/*
index eafe1423f9ad0efe5ce16ff704616f04dc9c40b2..6a7de1fedfa0adbef32194323bb225213811f61e 100644 (file)
#include "sp-filter-units.h"
#include <2geom/transforms.h>
-namespace NR {
+using Geom::X;
+using Geom::Y;
+
+namespace Inkscape {
+namespace Filters {
FilterUnits::FilterUnits() :
filterUnits(SP_FILTER_UNITS_OBJECTBOUNDINGBOX),
} else if (units == SP_FILTER_UNITS_USERSPACEONUSE) {
return get_matrix_user2pb();
} else {
- g_warning("Error in NR::FilterUnits::get_matrix_units2pb: unrecognized unit type (%d)", units);
+ g_warning("Error in Inkscape::Filters::FilterUnits::get_matrix_units2pb: unrecognized unit type (%d)", units);
return Geom::Matrix();
}
}
if (item_bbox && units == SP_FILTER_UNITS_OBJECTBOUNDINGBOX) {
/* No need to worry about rotations: bounding box coordinates
* always have base vectors paraller with userspace coordinates */
- Point min(item_bbox->min());
- Point max(item_bbox->max());
+ Geom::Point min(item_bbox->min());
+ Geom::Point max(item_bbox->max());
double scale_x = 1.0 / (max[X] - min[X]);
double scale_y = 1.0 / (max[Y] - min[Y]);
//return Geom::Translate(min) * Geom::Scale(scale_x,scale_y); ?
} else if (units == SP_FILTER_UNITS_USERSPACEONUSE) {
return Geom::identity();
} else {
- g_warning("Error in NR::FilterUnits::get_matrix_user2units: unrecognized unit type (%d)", units);
+ g_warning("Error in Inkscape::Filters::FilterUnits::get_matrix_user2units: unrecognized unit type (%d)", units);
return Geom::Matrix();
}
}
return get_matrix_user2units(primitiveUnits);
}
-IRect FilterUnits::get_pixblock_filterarea_paraller() const {
+NR::IRect FilterUnits::get_pixblock_filterarea_paraller() const {
g_assert(filter_area);
int min_x = INT_MAX, min_y = INT_MAX, max_x = INT_MIN, max_y = INT_MIN;
if (p[Y] < min_y) min_y = (int)std::floor(p[Y]);
if (p[Y] > max_y) max_y = (int)std::ceil(p[Y]);
}
- IRect ret(IPoint(min_x, min_y), IPoint(max_x, max_y));
+ NR::IRect ret(NR::IPoint(min_x, min_y), NR::IPoint(max_x, max_y));
return ret;
}
return *this;
}
-} // namespace NR
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
index d11df621f441b3604c419403265734347e800e30..d8489b42e437f7087d8259610e12080e79b9ec85 100644 (file)
#include <2geom/matrix.h>
#include <2geom/rect.h>
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterUnits {
public:
* NOTE: use only in filters, that define TRAIT_PARALLER in
* get_input_traits. The filter effects area may not be representable
* by simple rectangle otherwise. */
- IRect get_pixblock_filterarea_paraller() const;
+ NR::IRect get_pixblock_filterarea_paraller() const;
FilterUnits& operator=(FilterUnits const &other);
};
-} // namespace NR
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_UNITS_H__ */
index ddd41298c364f636dd493640afbecfa364e9aceb..e9e422094fc1ca1d17e25d4e6096e62f43cd41d9 100644 (file)
#include "nr-filter-utils.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
int clamp(int const val) {
if (val < 0) return 0;
return val;
}
-} //namespace NR
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index 91c295e94e7a052897e9f49a8315d86ef415569b..ccdaec1a8ed4ad1ac18d91fbe69f2105006afa3e 100644 (file)
#include "round.h"
/* Shouldn't these be inlined? */
-namespace NR {
+namespace Inkscape {
+namespace Filters {
/**
* Clamps an integer value to a value between 0 and 255. Needed by filters where
*/
int clamp_alpha(int const val, int const alpha);
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_UTILS_H__ */
/*
index a6c5df036cef32a6d1c68134ad1e446c5231c44e..30f8ae7e9d1219692f49b070e64fb2aa2232bc69 100644 (file)
using Inkscape::round;
#endif
-namespace NR {
+namespace Inkscape {
+namespace Filters {
+
+using Geom::X;
+using Geom::Y;
static Geom::OptRect get_item_bbox(NRArenaItem const *item) {
Geom::Rect item_bbox;
nr_pixblock_setup_fast(in, pb->mode, pb->area.x0, pb->area.y0,
pb->area.x1, pb->area.y1, true);
if (in->size != NR_PIXBLOCK_SIZE_TINY && in->data.px == NULL) {
- g_warning("NR::Filter::render: failed to reserve temporary buffer");
+ g_warning("Inkscape::Filters::Filter::render: failed to reserve temporary buffer");
return 0;
}
nr_blit_pixblock_pixblock(in, pb);
in = slot.get(NR_FILTER_SOURCEGRAPHIC);
if (in->area.x1 - in->area.x0 <= 0 || in->area.y1 - in->area.y0 <= 0) {
if (in->area.x1 - in->area.x0 < 0 || in->area.y1 - in->area.y0 < 0) {
- g_warning("NR::Filter::render: negative area! (%d, %d) (%d, %d)",
+ g_warning("Inkscape::Filters::Filter::render: negative area! (%d, %d) (%d, %d)",
in->area.x0, in->area.y0, in->area.x1, in->area.y1);
}
return 0;
Geom::Rect enlarged = filter_effect_area(tmp_bbox);
- bbox.x0 = (ICoord)enlarged.min()[X];
- bbox.y0 = (ICoord)enlarged.min()[Y];
- bbox.x1 = (ICoord)enlarged.max()[X];
- bbox.y1 = (ICoord)enlarged.max()[Y];
+ bbox.x0 = (NR::ICoord)enlarged.min()[X];
+ bbox.y0 = (NR::ICoord)enlarged.min()[Y];
+ bbox.x1 = (NR::ICoord)enlarged.max()[X];
+ bbox.y1 = (NR::ICoord)enlarged.max()[Y];
}
Geom::Rect Filter::filter_effect_area(Geom::Rect const &bbox)
minp[Y] = _region_y.computed;
maxp[Y] = minp[Y] + _region_height.computed;
} else {
- g_warning("Error in NR::Filter::bbox_enlarge: unrecognized value of _filter_units");
+ g_warning("Error in Inkscape::Filters::Filter::bbox_enlarge: unrecognized value of _filter_units");
}
Geom::Rect area(minp, maxp);
return area;
/* Constructor table holds pointers to static methods returning filter
* primitives. This table is indexed with FilterPrimitiveType, so that
* for example method in _constructor[NR_FILTER_GAUSSIANBLUR]
- * returns a filter object of type NR::FilterGaussian.
+ * returns a filter object of type Inkscape::Filters::FilterGaussian.
*/
typedef FilterPrimitive*(*FilterConstructor)();
static FilterConstructor _constructor[NR_FILTER_ENDPRIMITIVETYPE];
return resolution;
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
index b00cbf7d71001398f52f1233d58cd1cb7146623c..318e1030f088579933fcb6020b048dff113f76f1 100644 (file)
--- a/src/display/nr-filter.h
+++ b/src/display/nr-filter.h
struct NRArenaItem;
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class Filter : public Inkscape::GC::Managed<> {
public:
};
-} /* namespace NR */
-
-
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif /* __NR_FILTER_H__ */
index 87865467c4e1daa58ef33be686b11f7a5133c22d..79b4a3a5edc4fb4e15ea9469c4b4aa2d89dcd2f1 100644 (file)
#ifndef __NR_LIGHT_TYPES_H__
#define __NR_LIGHT_TYPES_H__
-namespace NR {
+namespace Inkscape {
+namespace Filters {
enum LightType{
NO_LIGHT = 0,
SPOT_LIGHT
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif // __NR_LIGHT_TYPES_H__
/*
index 72ed684b0a093340e828576dd442b3427ab58b65..a3373aadb7aec1a99627f0c38071a1f9a5eddbb1 100644 (file)
--- a/src/display/nr-light.cpp
+++ b/src/display/nr-light.cpp
#include "filters/pointlight.h"
#include "filters/spotlight.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
DistantLight::DistantLight(SPFeDistantLight *light, guint32 lighting_color) {
color = lighting_color;
DistantLight::~DistantLight() {}
-void DistantLight::light_vector(Fvector &v) {
+void DistantLight::light_vector(NR::Fvector &v) {
v[X_3D] = std::cos(azimuth)*std::cos(elevation);
v[Y_3D] = std::sin(azimuth)*std::cos(elevation);
v[Z_3D] = std::sin(elevation);
}
-void DistantLight::light_components(Fvector &lc) {
+void DistantLight::light_components(NR::Fvector &lc) {
lc[LIGHT_RED] = NR_RGBA32_R(color);
lc[LIGHT_GREEN] = NR_RGBA32_G(color);
lc[LIGHT_BLUE] = NR_RGBA32_B(color);
}
-PointLight::PointLight(SPFePointLight *light, guint32 lighting_color, const Matrix &trans) {
+PointLight::PointLight(SPFePointLight *light, guint32 lighting_color, const Geom::Matrix &trans) {
color = lighting_color;
l_x = light->x;
l_y = light->y;
l_z = light->z;
- convert_coord(l_x, l_y, l_z, trans);
+ NR::convert_coord(l_x, l_y, l_z, trans);
}
PointLight::~PointLight() {}
-void PointLight::light_vector(Fvector &v, gdouble x, gdouble y, gdouble z) {
+void PointLight::light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z) {
v[X_3D] = l_x - x;
v[Y_3D] = l_y - y;
v[Z_3D] = l_z - z;
- normalize_vector(v);
+ NR::normalize_vector(v);
}
-void PointLight::light_components(Fvector &lc) {
+void PointLight::light_components(NR::Fvector &lc) {
lc[LIGHT_RED] = NR_RGBA32_R(color);
lc[LIGHT_GREEN] = NR_RGBA32_G(color);
lc[LIGHT_BLUE] = NR_RGBA32_B(color);
}
-SpotLight::SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Matrix &trans) {
+SpotLight::SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Geom::Matrix &trans) {
gdouble p_x, p_y, p_z;
color = lighting_color;
l_x = light->x;
p_z = light->pointsAtZ;
cos_lca = std::cos(M_PI / 180 * light->limitingConeAngle);
speExp = light->specularExponent;
- convert_coord(l_x, l_y, l_z, trans);
- convert_coord(p_x, p_y, p_z, trans);
+ NR::convert_coord(l_x, l_y, l_z, trans);
+ NR::convert_coord(p_x, p_y, p_z, trans);
S[X_3D] = p_x - l_x;
S[Y_3D] = p_y - l_y;
S[Z_3D] = p_z - l_z;
- normalize_vector(S);
+ NR::normalize_vector(S);
}
SpotLight::~SpotLight() {}
-void SpotLight::light_vector(Fvector &v, gdouble x, gdouble y, gdouble z) {
+void SpotLight::light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z) {
v[X_3D] = l_x - x;
v[Y_3D] = l_y - y;
v[Z_3D] = l_z - z;
- normalize_vector(v);
+ NR::normalize_vector(v);
}
-void SpotLight::light_components(Fvector &lc, const Fvector &L) {
- gdouble spmod = (-1) * scalar_product(L, S);
+void SpotLight::light_components(NR::Fvector &lc, const NR::Fvector &L) {
+ gdouble spmod = (-1) * NR::scalar_product(L, S);
if (spmod <= cos_lca)
spmod = 0;
else
lc[LIGHT_BLUE] = spmod * NR_RGBA32_B(color);
}
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
/*
Local Variables:
diff --git a/src/display/nr-light.h b/src/display/nr-light.h
index 6c73a0a683cf52a726b38894e811f133a4a426f7..e1870f176243be7289b4dedb0eb38d1bb5124f76 100644 (file)
--- a/src/display/nr-light.h
+++ b/src/display/nr-light.h
#include <gdk/gdktypes.h>
#include "display/nr-3dutils.h"
#include "display/nr-light-types.h"
+#include <2geom/forward.h>
struct SPFeDistantLight;
struct SPFePointLight;
struct SPFeSpotLight;
-namespace NR {
-
-struct Matrix;
+namespace Inkscape {
+namespace Filters {
enum LightComponent {
LIGHT_RED = 0,
*
* \param v a Fvector referece where we store the result
*/
- void light_vector(Fvector &v);
+ void light_vector(NR::Fvector &v);
/**
* Computes the light components of the distant light
*
* \param lc a Fvector referece where we store the result, X=R, Y=G, Z=B
*/
- void light_components(Fvector &lc);
+ void light_components(NR::Fvector &lc);
private:
guint32 color;
* employed in the sp light object) and current coordinate (those
* employed in the rendering)
*/
- PointLight(SPFePointLight *light, guint32 lighting_color, const Matrix &trans);
+ PointLight(SPFePointLight *light, guint32 lighting_color, const Geom::Matrix &trans);
virtual ~PointLight();
/**
* Computes the light vector of the distant light at point (x,y,z).
* \param y y coordinate of the current point
* \param z z coordinate of the current point
*/
- void light_vector(Fvector &v, gdouble x, gdouble y, gdouble z);
+ void light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z);
/**
* Computes the light components of the distant light
*
* \param lc a Fvector referece where we store the result, X=R, Y=G, Z=B
*/
- void light_components(Fvector &lc);
+ void light_components(NR::Fvector &lc);
private:
guint32 color;
* employed in the sp light object) and current coordinate (those
* employed in the rendering)
*/
- SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Matrix &trans);
+ SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Geom::Matrix &trans);
virtual ~SpotLight();
/**
* \param y y coordinate of the current point
* \param z z coordinate of the current point
*/
- void light_vector(Fvector &v, gdouble x, gdouble y, gdouble z);
+ void light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z);
/**
* Computes the light components of the distant light at the current
* \param lc a Fvector referece where we store the result, X=R, Y=G, Z=B
* \param L the light vector of the current point
*/
- void light_components(Fvector &lc, const Fvector &L);
+ void light_components(NR::Fvector &lc, const NR::Fvector &L);
private:
guint32 color;
gdouble l_z;
gdouble cos_lca; //cos of the limiting cone angle
gdouble speExp; //specular exponent;
- Fvector S; //unit vector from light position in the direction
+ NR::Fvector S; //unit vector from light position in the direction
//the spot point at
};
-} /* namespace NR */
+} /* namespace Filters */
+} /* namespace Inkscape */
#endif // __NR_LIGHT_H__
/*
index 39c82daf6ed9ba5808f70514afd1b85b4c6efacc..511104c43a04c98e05306febca8cca6890245e7e 100644 (file)
_check_index(to, to_y * to->rs + to_x * 4, __LINE__);
+ using Inkscape::Filters::clamp;
+ using Inkscape::Filters::clamp_alpha;
if (to->mode == NR_PIXBLOCK_MODE_R8G8B8A8P) {
/* Clamp the colour channels to range from 0 to result.a to
* make sure, we don't exceed 100% per colour channel with
_check_index(to, to_y * to->rs + to_x, __LINE__);
- NR_PIXBLOCK_PX(to)[to_y * to->rs + to_x] = clamp(result);
+ NR_PIXBLOCK_PX(to)[to_y * to->rs + to_x] = Inkscape::Filters::clamp(result);
}
}
}
index daf27582a8bd63e76c05abca153513c5e6d3c1d1..d0ba898063fe0be69cdb2055987c7c80dfe8f3f4 100644 (file)
@@ -249,6 +249,8 @@ void transform_bicubic(NRPixBlock *to, NRPixBlock *from, Geom::Matrix const &tra
result.a = samplex(line[0].a, line[1].a, line[2].a, line[3].a,
from_x);
+ using Inkscape::Filters::clamp;
+ using Inkscape::Filters::clamp_alpha;
_check_index(to, to_y * to->rs + to_x * 4, __LINE__);
if (to->mode == NR_PIXBLOCK_MODE_R8G8B8A8P) {
/* Make sure, none of the RGB channels exceeds 100% intensity
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
index 5a3015aef60ba07ace31c00030ecb870752459cf..78ddbb6bd6c50efb310cf6cf074acde59b9990f9 100644 (file)
}
static gchar *svgConvertRGBToText(double r, double g, double b) {
+ using Inkscape::Filters::clamp;
static gchar tmp[1023] = {0};
snprintf(tmp, 1023,
"#%02x%02x%02x",
- NR::clamp(SP_COLOR_F_TO_U(r)),
- NR::clamp(SP_COLOR_F_TO_U(g)),
- NR::clamp(SP_COLOR_F_TO_U(b)));
+ clamp(SP_COLOR_F_TO_U(r)),
+ clamp(SP_COLOR_F_TO_U(g)),
+ clamp(SP_COLOR_F_TO_U(b)));
return (gchar *)&tmp;
}
index f6dc8d01b647122da2d6c0210acce42b00a9a383..363663ac3c8c34c946916077a4f73f8bd8cfc9f2 100644 (file)
--- a/src/filter-chemistry.cpp
+++ b/src/filter-chemistry.cpp
}
SPFilterPrimitive *
-filter_add_primitive(SPFilter *filter, const NR::FilterPrimitiveType type)
+filter_add_primitive(SPFilter *filter, const Inkscape::Filters::FilterPrimitiveType type)
{
Inkscape::XML::Document *xml_doc = sp_document_repr_doc(filter->document);
// set default values
switch(type) {
- case NR::NR_FILTER_BLEND:
+ case Inkscape::Filters::NR_FILTER_BLEND:
repr->setAttribute("blend", "normal");
break;
- case NR::NR_FILTER_COLORMATRIX:
+ case Inkscape::Filters::NR_FILTER_COLORMATRIX:
break;
- case NR::NR_FILTER_COMPONENTTRANSFER:
+ case Inkscape::Filters::NR_FILTER_COMPONENTTRANSFER:
break;
- case NR::NR_FILTER_COMPOSITE:
+ case Inkscape::Filters::NR_FILTER_COMPOSITE:
break;
- case NR::NR_FILTER_CONVOLVEMATRIX:
+ case Inkscape::Filters::NR_FILTER_CONVOLVEMATRIX:
repr->setAttribute("order", "3 3");
repr->setAttribute("kernelMatrix", "0 0 0 0 0 0 0 0 0");
break;
- case NR::NR_FILTER_DIFFUSELIGHTING:
+ case Inkscape::Filters::NR_FILTER_DIFFUSELIGHTING:
break;
- case NR::NR_FILTER_DISPLACEMENTMAP:
+ case Inkscape::Filters::NR_FILTER_DISPLACEMENTMAP:
break;
- case NR::NR_FILTER_FLOOD:
+ case Inkscape::Filters::NR_FILTER_FLOOD:
break;
- case NR::NR_FILTER_GAUSSIANBLUR:
+ case Inkscape::Filters::NR_FILTER_GAUSSIANBLUR:
repr->setAttribute("stdDeviation", "1");
break;
- case NR::NR_FILTER_IMAGE:
+ case Inkscape::Filters::NR_FILTER_IMAGE:
break;
- case NR::NR_FILTER_MERGE:
+ case Inkscape::Filters::NR_FILTER_MERGE:
break;
- case NR::NR_FILTER_MORPHOLOGY:
+ case Inkscape::Filters::NR_FILTER_MORPHOLOGY:
break;
- case NR::NR_FILTER_OFFSET:
+ case Inkscape::Filters::NR_FILTER_OFFSET:
repr->setAttribute("dx", "0");
repr->setAttribute("dy", "0");
break;
- case NR::NR_FILTER_SPECULARLIGHTING:
+ case Inkscape::Filters::NR_FILTER_SPECULARLIGHTING:
break;
- case NR::NR_FILTER_TILE:
+ case Inkscape::Filters::NR_FILTER_TILE:
break;
- case NR::NR_FILTER_TURBULENCE:
+ case Inkscape::Filters::NR_FILTER_TURBULENCE:
break;
default:
break;
diff --git a/src/filter-chemistry.h b/src/filter-chemistry.h
index 219f79c8cc30a29977ac1b0605e91c192cdd23a4..1b18ec11ab706ead1f166202438eae5cc4771483 100644 (file)
--- a/src/filter-chemistry.h
+++ b/src/filter-chemistry.h
#include "forward.h"
#include "sp-filter.h"
-SPFilterPrimitive *filter_add_primitive(SPFilter *filter, NR::FilterPrimitiveType);
+SPFilterPrimitive *filter_add_primitive(SPFilter *filter, Inkscape::Filters::FilterPrimitiveType);
SPFilter *new_filter (SPDocument *document);
SPFilter *new_filter_gaussian_blur (SPDocument *document, gdouble stdDeviation, double expansion, double expansionX, double expansionY, double width, double height);
SPFilter *new_filter_simple_from_item (SPDocument *document, SPItem *item, const char *mode, gdouble stdDeviation);
diff --git a/src/filter-enums.cpp b/src/filter-enums.cpp
index 45a1c4c720ec93e6b58e072eebe6c5eb5fcce44c..0e41405c6050b0ad92546e507e13c09aee20a8bb 100644 (file)
--- a/src/filter-enums.cpp
+++ b/src/filter-enums.cpp
using Inkscape::Util::EnumData;
using Inkscape::Util::EnumDataConverter;
-const EnumData<NR::FilterPrimitiveType> FPData[NR::NR_FILTER_ENDPRIMITIVETYPE] = {
- {NR::NR_FILTER_BLEND, _("Blend"), "svg:feBlend"},
- {NR::NR_FILTER_COLORMATRIX, _("Color Matrix"), "svg:feColorMatrix"},
- {NR::NR_FILTER_COMPONENTTRANSFER, _("Component Transfer"), "svg:feComponentTransfer"},
- {NR::NR_FILTER_COMPOSITE, _("Composite"), "svg:feComposite"},
- {NR::NR_FILTER_CONVOLVEMATRIX, _("Convolve Matrix"), "svg:feConvolveMatrix"},
- {NR::NR_FILTER_DIFFUSELIGHTING, _("Diffuse Lighting"), "svg:feDiffuseLighting"},
- {NR::NR_FILTER_DISPLACEMENTMAP, _("Displacement Map"), "svg:feDisplacementMap"},
- {NR::NR_FILTER_FLOOD, _("Flood"), "svg:feFlood"},
- {NR::NR_FILTER_GAUSSIANBLUR, _("Gaussian Blur"), "svg:feGaussianBlur"},
- {NR::NR_FILTER_IMAGE, _("Image"), "svg:feImage"},
- {NR::NR_FILTER_MERGE, _("Merge"), "svg:feMerge"},
- {NR::NR_FILTER_MORPHOLOGY, _("Morphology"), "svg:feMorphology"},
- {NR::NR_FILTER_OFFSET, _("Offset"), "svg:feOffset"},
- {NR::NR_FILTER_SPECULARLIGHTING, _("Specular Lighting"), "svg:feSpecularLighting"},
- {NR::NR_FILTER_TILE, _("Tile"), "svg:feTile"},
- {NR::NR_FILTER_TURBULENCE, _("Turbulence"), "svg:feTurbulence"}
+const EnumData<Inkscape::Filters::FilterPrimitiveType> FPData[Inkscape::Filters::NR_FILTER_ENDPRIMITIVETYPE] = {
+ {Inkscape::Filters::NR_FILTER_BLEND, _("Blend"), "svg:feBlend"},
+ {Inkscape::Filters::NR_FILTER_COLORMATRIX, _("Color Matrix"), "svg:feColorMatrix"},
+ {Inkscape::Filters::NR_FILTER_COMPONENTTRANSFER, _("Component Transfer"), "svg:feComponentTransfer"},
+ {Inkscape::Filters::NR_FILTER_COMPOSITE, _("Composite"), "svg:feComposite"},
+ {Inkscape::Filters::NR_FILTER_CONVOLVEMATRIX, _("Convolve Matrix"), "svg:feConvolveMatrix"},
+ {Inkscape::Filters::NR_FILTER_DIFFUSELIGHTING, _("Diffuse Lighting"), "svg:feDiffuseLighting"},
+ {Inkscape::Filters::NR_FILTER_DISPLACEMENTMAP, _("Displacement Map"), "svg:feDisplacementMap"},
+ {Inkscape::Filters::NR_FILTER_FLOOD, _("Flood"), "svg:feFlood"},
+ {Inkscape::Filters::NR_FILTER_GAUSSIANBLUR, _("Gaussian Blur"), "svg:feGaussianBlur"},
+ {Inkscape::Filters::NR_FILTER_IMAGE, _("Image"), "svg:feImage"},
+ {Inkscape::Filters::NR_FILTER_MERGE, _("Merge"), "svg:feMerge"},
+ {Inkscape::Filters::NR_FILTER_MORPHOLOGY, _("Morphology"), "svg:feMorphology"},
+ {Inkscape::Filters::NR_FILTER_OFFSET, _("Offset"), "svg:feOffset"},
+ {Inkscape::Filters::NR_FILTER_SPECULARLIGHTING, _("Specular Lighting"), "svg:feSpecularLighting"},
+ {Inkscape::Filters::NR_FILTER_TILE, _("Tile"), "svg:feTile"},
+ {Inkscape::Filters::NR_FILTER_TURBULENCE, _("Turbulence"), "svg:feTurbulence"}
};
-const EnumDataConverter<NR::FilterPrimitiveType> FPConverter(FPData, NR::NR_FILTER_ENDPRIMITIVETYPE);
+const EnumDataConverter<Inkscape::Filters::FilterPrimitiveType> FPConverter(FPData, Inkscape::Filters::NR_FILTER_ENDPRIMITIVETYPE);
const EnumData<FilterPrimitiveInput> FPInputData[FPINPUT_END] = {
{FPINPUT_SOURCEGRAPHIC, _("Source Graphic"), "SourceGraphic"},
const EnumDataConverter<FilterPrimitiveInput> FPInputConverter(FPInputData, FPINPUT_END);
// feBlend
-const EnumData<NR::FilterBlendMode> BlendModeData[NR::BLEND_ENDMODE] = {
+const EnumData<Inkscape::Filters::FilterBlendMode> BlendModeData[Inkscape::Filters::BLEND_ENDMODE] = {
//TRANSLATORS: This is a context string, only put the word "Normal" in your translation
- {NR::BLEND_NORMAL, Q_("filterBlendMode|Normal"), "normal"},
- {NR::BLEND_MULTIPLY, _("Multiply"), "multiply"},
- {NR::BLEND_SCREEN, _("Screen"), "screen"},
- {NR::BLEND_DARKEN, _("Darken"), "darken"},
- {NR::BLEND_LIGHTEN, _("Lighten"), "lighten"}
+ {Inkscape::Filters::BLEND_NORMAL, Q_("filterBlendMode|Normal"), "normal"},
+ {Inkscape::Filters::BLEND_MULTIPLY, _("Multiply"), "multiply"},
+ {Inkscape::Filters::BLEND_SCREEN, _("Screen"), "screen"},
+ {Inkscape::Filters::BLEND_DARKEN, _("Darken"), "darken"},
+ {Inkscape::Filters::BLEND_LIGHTEN, _("Lighten"), "lighten"}
};
-const EnumDataConverter<NR::FilterBlendMode> BlendModeConverter(BlendModeData, NR::BLEND_ENDMODE);
+const EnumDataConverter<Inkscape::Filters::FilterBlendMode> BlendModeConverter(BlendModeData, Inkscape::Filters::BLEND_ENDMODE);
-const EnumData<NR::FilterColorMatrixType> ColorMatrixTypeData[NR::COLORMATRIX_ENDTYPE] = {
- {NR::COLORMATRIX_MATRIX, _("Matrix"), "matrix"},
- {NR::COLORMATRIX_SATURATE, _("Saturate"), "saturate"},
- {NR::COLORMATRIX_HUEROTATE, _("Hue Rotate"), "hueRotate"},
- {NR::COLORMATRIX_LUMINANCETOALPHA, _("Luminance to Alpha"), "luminanceToAlpha"}
+const EnumData<Inkscape::Filters::FilterColorMatrixType> ColorMatrixTypeData[Inkscape::Filters::COLORMATRIX_ENDTYPE] = {
+ {Inkscape::Filters::COLORMATRIX_MATRIX, _("Matrix"), "matrix"},
+ {Inkscape::Filters::COLORMATRIX_SATURATE, _("Saturate"), "saturate"},
+ {Inkscape::Filters::COLORMATRIX_HUEROTATE, _("Hue Rotate"), "hueRotate"},
+ {Inkscape::Filters::COLORMATRIX_LUMINANCETOALPHA, _("Luminance to Alpha"), "luminanceToAlpha"}
};
-const EnumDataConverter<NR::FilterColorMatrixType> ColorMatrixTypeConverter(ColorMatrixTypeData, NR::COLORMATRIX_ENDTYPE);
+const EnumDataConverter<Inkscape::Filters::FilterColorMatrixType> ColorMatrixTypeConverter(ColorMatrixTypeData, Inkscape::Filters::COLORMATRIX_ENDTYPE);
// feComposite
const EnumData<FeCompositeOperator> CompositeOperatorData[COMPOSITE_ENDOPERATOR] = {
@@ -79,22 +79,22 @@ const EnumData<FeCompositeOperator> CompositeOperatorData[COMPOSITE_ENDOPERATOR]
const EnumDataConverter<FeCompositeOperator> CompositeOperatorConverter(CompositeOperatorData, COMPOSITE_ENDOPERATOR);
// feComponentTransfer
-const EnumData<NR::FilterComponentTransferType> ComponentTransferTypeData[NR::COMPONENTTRANSFER_TYPE_ERROR] = {
- {NR::COMPONENTTRANSFER_TYPE_IDENTITY, _("Identity"), "identity"},
- {NR::COMPONENTTRANSFER_TYPE_TABLE, _("Table"), "table"},
- {NR::COMPONENTTRANSFER_TYPE_DISCRETE, _("Discrete"), "discrete"},
- {NR::COMPONENTTRANSFER_TYPE_LINEAR, _("Linear"), "linear"},
- {NR::COMPONENTTRANSFER_TYPE_GAMMA, _("Gamma"), "gamma"},
+const EnumData<Inkscape::Filters::FilterComponentTransferType> ComponentTransferTypeData[Inkscape::Filters::COMPONENTTRANSFER_TYPE_ERROR] = {
+ {Inkscape::Filters::COMPONENTTRANSFER_TYPE_IDENTITY, _("Identity"), "identity"},
+ {Inkscape::Filters::COMPONENTTRANSFER_TYPE_TABLE, _("Table"), "table"},
+ {Inkscape::Filters::COMPONENTTRANSFER_TYPE_DISCRETE, _("Discrete"), "discrete"},
+ {Inkscape::Filters::COMPONENTTRANSFER_TYPE_LINEAR, _("Linear"), "linear"},
+ {Inkscape::Filters::COMPONENTTRANSFER_TYPE_GAMMA, _("Gamma"), "gamma"},
};
-const EnumDataConverter<NR::FilterComponentTransferType> ComponentTransferTypeConverter(ComponentTransferTypeData, NR::COMPONENTTRANSFER_TYPE_ERROR);
+const EnumDataConverter<Inkscape::Filters::FilterComponentTransferType> ComponentTransferTypeConverter(ComponentTransferTypeData, Inkscape::Filters::COMPONENTTRANSFER_TYPE_ERROR);
// feConvolveMatrix
-const EnumData<NR::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeData[NR::CONVOLVEMATRIX_EDGEMODE_ENDTYPE] = {
- {NR::CONVOLVEMATRIX_EDGEMODE_DUPLICATE, _("Duplicate"), "duplicate"},
- {NR::CONVOLVEMATRIX_EDGEMODE_WRAP, _("Wrap"), "wrap"},
- {NR::CONVOLVEMATRIX_EDGEMODE_NONE, _("None"), "none"}
+const EnumData<Inkscape::Filters::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeData[Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_ENDTYPE] = {
+ {Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_DUPLICATE, _("Duplicate"), "duplicate"},
+ {Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_WRAP, _("Wrap"), "wrap"},
+ {Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_NONE, _("None"), "none"}
};
-const EnumDataConverter<NR::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeConverter(ConvolveMatrixEdgeModeData, NR::CONVOLVEMATRIX_EDGEMODE_ENDTYPE);
+const EnumDataConverter<Inkscape::Filters::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeConverter(ConvolveMatrixEdgeModeData, Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_ENDTYPE);
// feDisplacementMap
const EnumData<FilterDisplacementMapChannelSelector> DisplacementMapChannelData[DISPLACEMENTMAP_CHANNEL_ENDTYPE] = {
@@ -106,18 +106,18 @@ const EnumData<FilterDisplacementMapChannelSelector> DisplacementMapChannelData[
const EnumDataConverter<FilterDisplacementMapChannelSelector> DisplacementMapChannelConverter(DisplacementMapChannelData, DISPLACEMENTMAP_CHANNEL_ENDTYPE);
// feMorphology
-const EnumData<NR::FilterMorphologyOperator> MorphologyOperatorData[NR::MORPHOLOGY_OPERATOR_END] = {
- {NR::MORPHOLOGY_OPERATOR_ERODE, _("Erode"), "erode"},
- {NR::MORPHOLOGY_OPERATOR_DILATE, _("Dilate"), "dilate"}
+const EnumData<Inkscape::Filters::FilterMorphologyOperator> MorphologyOperatorData[Inkscape::Filters::MORPHOLOGY_OPERATOR_END] = {
+ {Inkscape::Filters::MORPHOLOGY_OPERATOR_ERODE, _("Erode"), "erode"},
+ {Inkscape::Filters::MORPHOLOGY_OPERATOR_DILATE, _("Dilate"), "dilate"}
};
-const EnumDataConverter<NR::FilterMorphologyOperator> MorphologyOperatorConverter(MorphologyOperatorData, NR::MORPHOLOGY_OPERATOR_END);
+const EnumDataConverter<Inkscape::Filters::FilterMorphologyOperator> MorphologyOperatorConverter(MorphologyOperatorData, Inkscape::Filters::MORPHOLOGY_OPERATOR_END);
// feTurbulence
-const EnumData<NR::FilterTurbulenceType> TurbulenceTypeData[NR::TURBULENCE_ENDTYPE] = {
- {NR::TURBULENCE_FRACTALNOISE, _("Fractal Noise"), "fractalNoise"},
- {NR::TURBULENCE_TURBULENCE, _("Turbulence"), "turbulence"}
+const EnumData<Inkscape::Filters::FilterTurbulenceType> TurbulenceTypeData[Inkscape::Filters::TURBULENCE_ENDTYPE] = {
+ {Inkscape::Filters::TURBULENCE_FRACTALNOISE, _("Fractal Noise"), "fractalNoise"},
+ {Inkscape::Filters::TURBULENCE_TURBULENCE, _("Turbulence"), "turbulence"}
};
-const EnumDataConverter<NR::FilterTurbulenceType> TurbulenceTypeConverter(TurbulenceTypeData, NR::TURBULENCE_ENDTYPE);
+const EnumDataConverter<Inkscape::Filters::FilterTurbulenceType> TurbulenceTypeConverter(TurbulenceTypeData, Inkscape::Filters::TURBULENCE_ENDTYPE);
// Light source
const EnumData<LightSource> LightSourceData[LIGHT_ENDSOURCE] = {
diff --git a/src/filter-enums.h b/src/filter-enums.h
index 815d439c18eabf59fbdb2b09a66a2ee71df268c9..6367a51022d4088cd045657a0ae49f2b807b7d54 100644 (file)
--- a/src/filter-enums.h
+++ b/src/filter-enums.h
#include "util/enums.h"
// Filter primitives
-extern const Inkscape::Util::EnumData<NR::FilterPrimitiveType> FPData[NR::NR_FILTER_ENDPRIMITIVETYPE];
-extern const Inkscape::Util::EnumDataConverter<NR::FilterPrimitiveType> FPConverter;
+extern const Inkscape::Util::EnumData<Inkscape::Filters::FilterPrimitiveType> FPData[Inkscape::Filters::NR_FILTER_ENDPRIMITIVETYPE];
+extern const Inkscape::Util::EnumDataConverter<Inkscape::Filters::FilterPrimitiveType> FPConverter;
enum FilterPrimitiveInput {
FPINPUT_SOURCEGRAPHIC,
@@ -41,29 +41,29 @@ extern const Inkscape::Util::EnumData<FilterPrimitiveInput> FPInputData[FPINPUT_
extern const Inkscape::Util::EnumDataConverter<FilterPrimitiveInput> FPInputConverter;
// Blend mode
-extern const Inkscape::Util::EnumData<NR::FilterBlendMode> BlendModeData[NR::BLEND_ENDMODE];
-extern const Inkscape::Util::EnumDataConverter<NR::FilterBlendMode> BlendModeConverter;
+extern const Inkscape::Util::EnumData<Inkscape::Filters::FilterBlendMode> BlendModeData[Inkscape::Filters::BLEND_ENDMODE];
+extern const Inkscape::Util::EnumDataConverter<Inkscape::Filters::FilterBlendMode> BlendModeConverter;
// ColorMatrix type
-extern const Inkscape::Util::EnumData<NR::FilterColorMatrixType> ColorMatrixTypeData[NR::COLORMATRIX_ENDTYPE];
-extern const Inkscape::Util::EnumDataConverter<NR::FilterColorMatrixType> ColorMatrixTypeConverter;
+extern const Inkscape::Util::EnumData<Inkscape::Filters::FilterColorMatrixType> ColorMatrixTypeData[Inkscape::Filters::COLORMATRIX_ENDTYPE];
+extern const Inkscape::Util::EnumDataConverter<Inkscape::Filters::FilterColorMatrixType> ColorMatrixTypeConverter;
// ComponentTransfer type
-extern const Inkscape::Util::EnumData<NR::FilterComponentTransferType> ComponentTransferTypeData[NR::COMPONENTTRANSFER_TYPE_ERROR];
-extern const Inkscape::Util::EnumDataConverter<NR::FilterComponentTransferType> ComponentTransferTypeConverter;
+extern const Inkscape::Util::EnumData<Inkscape::Filters::FilterComponentTransferType> ComponentTransferTypeData[Inkscape::Filters::COMPONENTTRANSFER_TYPE_ERROR];
+extern const Inkscape::Util::EnumDataConverter<Inkscape::Filters::FilterComponentTransferType> ComponentTransferTypeConverter;
// Composite operator
extern const Inkscape::Util::EnumData<FeCompositeOperator> CompositeOperatorData[COMPOSITE_ENDOPERATOR];
extern const Inkscape::Util::EnumDataConverter<FeCompositeOperator> CompositeOperatorConverter;
// ConvolveMatrix edgeMode
-extern const Inkscape::Util::EnumData<NR::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeData[NR::CONVOLVEMATRIX_EDGEMODE_ENDTYPE];
-extern const Inkscape::Util::EnumDataConverter<NR::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeConverter;
+extern const Inkscape::Util::EnumData<Inkscape::Filters::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeData[Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_ENDTYPE];
+extern const Inkscape::Util::EnumDataConverter<Inkscape::Filters::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeConverter;
// DisplacementMap channel
extern const Inkscape::Util::EnumData<FilterDisplacementMapChannelSelector> DisplacementMapChannelData[4];
extern const Inkscape::Util::EnumDataConverter<FilterDisplacementMapChannelSelector> DisplacementMapChannelConverter;
// Morphology operator
-extern const Inkscape::Util::EnumData<NR::FilterMorphologyOperator> MorphologyOperatorData[NR::MORPHOLOGY_OPERATOR_END];
-extern const Inkscape::Util::EnumDataConverter<NR::FilterMorphologyOperator> MorphologyOperatorConverter;
+extern const Inkscape::Util::EnumData<Inkscape::Filters::FilterMorphologyOperator> MorphologyOperatorData[Inkscape::Filters::MORPHOLOGY_OPERATOR_END];
+extern const Inkscape::Util::EnumDataConverter<Inkscape::Filters::FilterMorphologyOperator> MorphologyOperatorConverter;
// Turbulence type
-extern const Inkscape::Util::EnumData<NR::FilterTurbulenceType> TurbulenceTypeData[NR::TURBULENCE_ENDTYPE];
-extern const Inkscape::Util::EnumDataConverter<NR::FilterTurbulenceType> TurbulenceTypeConverter;
+extern const Inkscape::Util::EnumData<Inkscape::Filters::FilterTurbulenceType> TurbulenceTypeData[Inkscape::Filters::TURBULENCE_ENDTYPE];
+extern const Inkscape::Util::EnumDataConverter<Inkscape::Filters::FilterTurbulenceType> TurbulenceTypeConverter;
// Lighting
enum LightSource {
LIGHT_DISTANT,
diff --git a/src/filters/blend.cpp b/src/filters/blend.cpp
index 8c2d7978e6c4baa055571b7484218fb94f776957..709130adaa4f2665f7fdc23ccab6023741a588f9 100644 (file)
--- a/src/filters/blend.cpp
+++ b/src/filters/blend.cpp
static void sp_feBlend_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feBlend_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feBlend_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feBlend_build_renderer(SPFilterPrimitive *sp_prim, NR::Filter *filter);
+static void sp_feBlend_build_renderer(SPFilterPrimitive *sp_prim, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feBlend_parent_class;
static void
sp_feBlend_init(SPFeBlend *feBlend)
{
- feBlend->in2 = NR::NR_FILTER_SLOT_NOT_SET;
+ feBlend->in2 = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
/**
((SPObjectClass *) feBlend_parent_class)->release(object);
}
-static NR::FilterBlendMode sp_feBlend_readmode(gchar const *value)
+static Inkscape::Filters::FilterBlendMode sp_feBlend_readmode(gchar const *value)
{
- if (!value) return NR::BLEND_NORMAL;
+ if (!value) return Inkscape::Filters::BLEND_NORMAL;
switch (value[0]) {
case 'n':
if (strncmp(value, "normal", 6) == 0)
- return NR::BLEND_NORMAL;
+ return Inkscape::Filters::BLEND_NORMAL;
break;
case 'm':
if (strncmp(value, "multiply", 8) == 0)
- return NR::BLEND_MULTIPLY;
+ return Inkscape::Filters::BLEND_MULTIPLY;
break;
case 's':
if (strncmp(value, "screen", 6) == 0)
- return NR::BLEND_SCREEN;
+ return Inkscape::Filters::BLEND_SCREEN;
break;
case 'd':
if (strncmp(value, "darken", 6) == 0)
- return NR::BLEND_DARKEN;
+ return Inkscape::Filters::BLEND_DARKEN;
break;
case 'l':
if (strncmp(value, "lighten", 7) == 0)
- return NR::BLEND_LIGHTEN;
+ return Inkscape::Filters::BLEND_LIGHTEN;
break;
default:
// do nothing by default
break;
}
- return NR::BLEND_NORMAL;
+ return Inkscape::Filters::BLEND_NORMAL;
}
/**
SPFeBlend *feBlend = SP_FEBLEND(object);
(void)feBlend;
- NR::FilterBlendMode mode;
+ Inkscape::Filters::FilterBlendMode mode;
int input;
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
@@ -220,15 +220,15 @@ sp_feBlend_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::
return repr;
}
-static void sp_feBlend_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feBlend_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeBlend *sp_blend = SP_FEBLEND(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_BLEND);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterBlend *nr_blend = dynamic_cast<NR::FilterBlend*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_BLEND);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterBlend *nr_blend = dynamic_cast<Inkscape::Filters::FilterBlend*>(nr_primitive);
g_assert(nr_blend != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
diff --git a/src/filters/blend.h b/src/filters/blend.h
index bcb95c3c2b24d5d4bfa4ea56c59c05f981e68e8e..9f3cab47595d2ab23de41a638332d5c3a4d792c1 100644 (file)
--- a/src/filters/blend.h
+++ b/src/filters/blend.h
struct SPFeBlend : public SPFilterPrimitive {
/** BLEND ATTRIBUTES HERE */
- NR::FilterBlendMode blend_mode;
+ Inkscape::Filters::FilterBlendMode blend_mode;
int in2;
};
index 29c2458e8ff7b76dc4009f05d3c126773e31135f..a6096bdb641009bfa4a7c526f24b72b7e3a1a5ec 100644 (file)
static void sp_feColorMatrix_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feColorMatrix_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feColorMatrix_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feColorMatrix_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feColorMatrix_parent_class;
((SPObjectClass *) feColorMatrix_parent_class)->release(object);
}
-static NR::FilterColorMatrixType sp_feColorMatrix_read_type(gchar const *value){
- if (!value) return NR::COLORMATRIX_MATRIX; //matrix is default
+static Inkscape::Filters::FilterColorMatrixType sp_feColorMatrix_read_type(gchar const *value){
+ if (!value) return Inkscape::Filters::COLORMATRIX_MATRIX; //matrix is default
switch(value[0]){
case 'm':
- if (strcmp(value, "matrix") == 0) return NR::COLORMATRIX_MATRIX;
+ if (strcmp(value, "matrix") == 0) return Inkscape::Filters::COLORMATRIX_MATRIX;
break;
case 's':
- if (strcmp(value, "saturate") == 0) return NR::COLORMATRIX_SATURATE;
+ if (strcmp(value, "saturate") == 0) return Inkscape::Filters::COLORMATRIX_SATURATE;
break;
case 'h':
- if (strcmp(value, "hueRotate") == 0) return NR::COLORMATRIX_HUEROTATE;
+ if (strcmp(value, "hueRotate") == 0) return Inkscape::Filters::COLORMATRIX_HUEROTATE;
break;
case 'l':
- if (strcmp(value, "luminanceToAlpha") == 0) return NR::COLORMATRIX_LUMINANCETOALPHA;
+ if (strcmp(value, "luminanceToAlpha") == 0) return Inkscape::Filters::COLORMATRIX_LUMINANCETOALPHA;
break;
}
- return NR::COLORMATRIX_MATRIX; //matrix is default
+ return Inkscape::Filters::COLORMATRIX_MATRIX; //matrix is default
}
/**
SPFeColorMatrix *feColorMatrix = SP_FECOLORMATRIX(object);
(void)feColorMatrix;
- NR::FilterColorMatrixType read_type;
+ Inkscape::Filters::FilterColorMatrixType read_type;
/*DEAL WITH SETTING ATTRIBUTES HERE*/
switch(key) {
case SP_ATTR_TYPE:
@@ -205,15 +205,15 @@ sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape:
return repr;
}
-static void sp_feColorMatrix_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feColorMatrix_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeColorMatrix *sp_colormatrix = SP_FECOLORMATRIX(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_COLORMATRIX);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterColorMatrix *nr_colormatrix = dynamic_cast<NR::FilterColorMatrix*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_COLORMATRIX);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterColorMatrix *nr_colormatrix = dynamic_cast<Inkscape::Filters::FilterColorMatrix*>(nr_primitive);
g_assert(nr_colormatrix != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
index 4b9eda1a7a5ed6f975092e0d9b94b60c1c63556a..69be969281e7cc8200aa1a97cb685ca6d4cf23af 100644 (file)
struct SPFeColorMatrix : public SPFilterPrimitive {
/** COLORMATRIX ATTRIBUTES HERE */
- NR::FilterColorMatrixType type;
+ Inkscape::Filters::FilterColorMatrixType type;
gdouble value;
std::vector<gdouble> values;
};
diff --git a/src/filters/componenttransfer-funcnode.cpp b/src/filters/componenttransfer-funcnode.cpp
index 72a4e874431d4cc48fe68ca838d31e80e802ed86..a83dda1bbcd85e44ad58a3f0d50da58469b3a9de 100644 (file)
static void
sp_fefuncnode_init(SPFeFuncNode *fefuncnode)
{
- fefuncnode->type = NR::COMPONENTTRANSFER_TYPE_IDENTITY;
+ fefuncnode->type = Inkscape::Filters::COMPONENTTRANSFER_TYPE_IDENTITY;
//fefuncnode->tableValues = NULL;
fefuncnode->slope = 1;
fefuncnode->intercept = 0;
//TODO: release resources here
}
-static NR::FilterComponentTransferType sp_feComponenttransfer_read_type(gchar const *value){
- if (!value) return NR::COMPONENTTRANSFER_TYPE_ERROR; //type attribute is REQUIRED.
+static Inkscape::Filters::FilterComponentTransferType sp_feComponenttransfer_read_type(gchar const *value){
+ if (!value) return Inkscape::Filters::COMPONENTTRANSFER_TYPE_ERROR; //type attribute is REQUIRED.
switch(value[0]){
case 'i':
- if (strncmp(value, "identity", 8) == 0) return NR::COMPONENTTRANSFER_TYPE_IDENTITY;
+ if (strncmp(value, "identity", 8) == 0) return Inkscape::Filters::COMPONENTTRANSFER_TYPE_IDENTITY;
break;
case 't':
- if (strncmp(value, "table", 5) == 0) return NR::COMPONENTTRANSFER_TYPE_TABLE;
+ if (strncmp(value, "table", 5) == 0) return Inkscape::Filters::COMPONENTTRANSFER_TYPE_TABLE;
break;
case 'd':
- if (strncmp(value, "discrete", 8) == 0) return NR::COMPONENTTRANSFER_TYPE_DISCRETE;
+ if (strncmp(value, "discrete", 8) == 0) return Inkscape::Filters::COMPONENTTRANSFER_TYPE_DISCRETE;
break;
case 'l':
- if (strncmp(value, "linear", 6) == 0) return NR::COMPONENTTRANSFER_TYPE_LINEAR;
+ if (strncmp(value, "linear", 6) == 0) return Inkscape::Filters::COMPONENTTRANSFER_TYPE_LINEAR;
break;
case 'g':
- if (strncmp(value, "gamma", 5) == 0) return NR::COMPONENTTRANSFER_TYPE_GAMMA;
+ if (strncmp(value, "gamma", 5) == 0) return Inkscape::Filters::COMPONENTTRANSFER_TYPE_GAMMA;
break;
}
- return NR::COMPONENTTRANSFER_TYPE_ERROR; //type attribute is REQUIRED.
+ return Inkscape::Filters::COMPONENTTRANSFER_TYPE_ERROR; //type attribute is REQUIRED.
}
/**
sp_fefuncnode_set(SPObject *object, unsigned int key, gchar const *value)
{
SPFeFuncNode *feFuncNode = SP_FEFUNCNODE(object);
- NR::FilterComponentTransferType type;
+ Inkscape::Filters::FilterComponentTransferType type;
double read_num;
switch(key) {
case SP_ATTR_TYPE:
index 2f0b2fc28353ceb479a4f4fa422145300a6042ed..4db6ab785dcfc8c7c4ddb546fbba230d0f116b93 100644 (file)
class SPFeFuncNodeClass;
struct SPFeFuncNode : public SPObject {
- NR::FilterComponentTransferType type;
+ Inkscape::Filters::FilterComponentTransferType type;
std::vector<double> tableValues;
double slope;
double intercept;
index 603e1f4e57297f54392ed8c92d30b7e26d90937a..162b67703380e523f7ff023e12ce634dc3bba7c9 100644 (file)
static void sp_feComponentTransfer_release(SPObject *object);
static void sp_feComponentTransfer_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feComponentTransfer_update(SPObject *object, SPCtx *ctx, guint flags);
-static void sp_feComponentTransfer_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feComponentTransfer_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static void sp_feComponentTransfer_remove_child(SPObject *object, Inkscape::XML::Node *child);
static void sp_feComponentTransfer_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
static Inkscape::XML::Node *sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
@@ -130,7 +130,7 @@ static void sp_feComponentTransfer_children_modified(SPFeComponentTransfer *sp_c
// Set any types not explicitly set to the identity transform
for(int i=0;i<4;i++) {
if (!set[i]) {
- sp_componenttransfer->renderer->type[i] = NR::COMPONENTTRANSFER_TYPE_IDENTITY;
+ sp_componenttransfer->renderer->type[i] = Inkscape::Filters::COMPONENTTRANSFER_TYPE_IDENTITY;
}
}
}
@@ -238,15 +238,15 @@ sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Document *doc, Ink
return repr;
}
-static void sp_feComponentTransfer_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feComponentTransfer_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeComponentTransfer *sp_componenttransfer = SP_FECOMPONENTTRANSFER(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_COMPONENTTRANSFER);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterComponentTransfer *nr_componenttransfer = dynamic_cast<NR::FilterComponentTransfer*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_COMPONENTTRANSFER);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterComponentTransfer *nr_componenttransfer = dynamic_cast<Inkscape::Filters::FilterComponentTransfer*>(nr_primitive);
g_assert(nr_componenttransfer != NULL);
sp_componenttransfer->renderer = nr_componenttransfer;
index 515825d6530c6ddffc59e685bc213cd6d910b364..8281d9aea7342d7dc113b5250d3563aadabf760f 100644 (file)
struct SPFeComponentTransfer : public SPFilterPrimitive {
/** COMPONENTTRANSFER ATTRIBUTES HERE */
- NR::FilterComponentTransfer *renderer;
+ Inkscape::Filters::FilterComponentTransfer *renderer;
};
struct SPFeComponentTransferClass {
index 61658ba9e635bc8377f649d7645dd45f8acd88f6..707c74854bf877a0a04b9fc7d727889ef72ad725 100644 (file)
static void sp_feComposite_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feComposite_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feComposite_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feComposite_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feComposite_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feComposite_parent_class;
feComposite->k2 = 0;
feComposite->k3 = 0;
feComposite->k4 = 0;
- feComposite->in2 = NR::NR_FILTER_SLOT_NOT_SET;
+ feComposite->in2 = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
/**
@@ -249,15 +249,15 @@ sp_feComposite_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::X
return repr;
}
-static void sp_feComposite_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feComposite_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeComposite *sp_composite = SP_FECOMPOSITE(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_COMPOSITE);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterComposite *nr_composite = dynamic_cast<NR::FilterComposite*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_COMPOSITE);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterComposite *nr_composite = dynamic_cast<Inkscape::Filters::FilterComposite*>(nr_primitive);
g_assert(nr_composite != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
index a930bc4e75dc5cae0199543d26d3248d7b0b6039..41028fb201773097cd04ac525b8b5a966c049f71 100644 (file)
static void sp_feConvolveMatrix_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feConvolveMatrix_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feConvolveMatrix_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feConvolveMatrix_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feConvolveMatrix_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feConvolveMatrix_parent_class;
feConvolveMatrix->order.set("3 3");
feConvolveMatrix->targetX = 1;
feConvolveMatrix->targetY = 1;
- feConvolveMatrix->edgeMode = NR::CONVOLVEMATRIX_EDGEMODE_DUPLICATE;
+ feConvolveMatrix->edgeMode = Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_DUPLICATE;
feConvolveMatrix->preserveAlpha = false;
//some helper variables:
((SPObjectClass *) feConvolveMatrix_parent_class)->release(object);
}
-static NR::FilterConvolveMatrixEdgeMode sp_feConvolveMatrix_read_edgeMode(gchar const *value){
- if (!value) return NR::CONVOLVEMATRIX_EDGEMODE_DUPLICATE; //duplicate is default
+static Inkscape::Filters::FilterConvolveMatrixEdgeMode sp_feConvolveMatrix_read_edgeMode(gchar const *value){
+ if (!value) return Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_DUPLICATE; //duplicate is default
switch(value[0]){
case 'd':
- if (strncmp(value, "duplicate", 9) == 0) return NR::CONVOLVEMATRIX_EDGEMODE_DUPLICATE;
+ if (strncmp(value, "duplicate", 9) == 0) return Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_DUPLICATE;
break;
case 'w':
- if (strncmp(value, "wrap", 4) == 0) return NR::CONVOLVEMATRIX_EDGEMODE_WRAP;
+ if (strncmp(value, "wrap", 4) == 0) return Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_WRAP;
break;
case 'n':
- if (strncmp(value, "none", 4) == 0) return NR::CONVOLVEMATRIX_EDGEMODE_NONE;
+ if (strncmp(value, "none", 4) == 0) return Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_NONE;
break;
}
- return NR::CONVOLVEMATRIX_EDGEMODE_DUPLICATE; //duplicate is default
+ return Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_DUPLICATE; //duplicate is default
}
/**
double read_num;
int read_int;
bool read_bool;
- NR::FilterConvolveMatrixEdgeMode read_mode;
+ Inkscape::Filters::FilterConvolveMatrixEdgeMode read_mode;
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
@@ -303,15 +303,15 @@ sp_feConvolveMatrix_write(SPObject *object, Inkscape::XML::Document *doc, Inksca
return repr;
}
-static void sp_feConvolveMatrix_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feConvolveMatrix_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeConvolveMatrix *sp_convolve = SP_FECONVOLVEMATRIX(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_CONVOLVEMATRIX);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterConvolveMatrix *nr_convolve = dynamic_cast<NR::FilterConvolveMatrix*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_CONVOLVEMATRIX);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterConvolveMatrix *nr_convolve = dynamic_cast<Inkscape::Filters::FilterConvolveMatrix*>(nr_primitive);
g_assert(nr_convolve != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
index 991f63988a7fde505b0100f40a2c22cce3b2c8cd..beb5fad756dd414382773ac9033d8bb40878935e 100644 (file)
std::vector<gdouble> kernelMatrix;
double divisor, bias;
int targetX, targetY;
- NR::FilterConvolveMatrixEdgeMode edgeMode;
+ Inkscape::Filters::FilterConvolveMatrixEdgeMode edgeMode;
NumberOptNumber kernelUnitLength;
bool preserveAlpha;
//some helper variables:
index a4935bf728cd3817683cf399b1e339d837d483c0..9c68006edbe6febb904f9abcb84c52a2529d6649 100644 (file)
static void sp_feDiffuseLighting_remove_child(SPObject *object, Inkscape::XML::Node *child);
static void sp_feDiffuseLighting_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
static Inkscape::XML::Node *sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feDiffuseLighting_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feDiffuseLighting_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static void sp_feDiffuseLighting_children_modified(SPFeDiffuseLighting *sp_diffuselighting);
static SPFilterPrimitiveClass *feDiffuseLighting_parent_class;
@@ -321,31 +321,31 @@ sp_feDiffuseLighting_order_changed (SPObject *object, Inkscape::XML::Node *child
static void sp_feDiffuseLighting_children_modified(SPFeDiffuseLighting *sp_diffuselighting)
{
if (sp_diffuselighting->renderer) {
- sp_diffuselighting->renderer->light_type = NR::NO_LIGHT;
+ sp_diffuselighting->renderer->light_type = Inkscape::Filters::NO_LIGHT;
if (SP_IS_FEDISTANTLIGHT(sp_diffuselighting->children)) {
- sp_diffuselighting->renderer->light_type = NR::DISTANT_LIGHT;
+ sp_diffuselighting->renderer->light_type = Inkscape::Filters::DISTANT_LIGHT;
sp_diffuselighting->renderer->light.distant = SP_FEDISTANTLIGHT(sp_diffuselighting->children);
}
if (SP_IS_FEPOINTLIGHT(sp_diffuselighting->children)) {
- sp_diffuselighting->renderer->light_type = NR::POINT_LIGHT;
+ sp_diffuselighting->renderer->light_type = Inkscape::Filters::POINT_LIGHT;
sp_diffuselighting->renderer->light.point = SP_FEPOINTLIGHT(sp_diffuselighting->children);
}
if (SP_IS_FESPOTLIGHT(sp_diffuselighting->children)) {
- sp_diffuselighting->renderer->light_type = NR::SPOT_LIGHT;
+ sp_diffuselighting->renderer->light_type = Inkscape::Filters::SPOT_LIGHT;
sp_diffuselighting->renderer->light.spot = SP_FESPOTLIGHT(sp_diffuselighting->children);
}
}
}
-static void sp_feDiffuseLighting_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feDiffuseLighting_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeDiffuseLighting *sp_diffuselighting = SP_FEDIFFUSELIGHTING(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_DIFFUSELIGHTING);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterDiffuseLighting *nr_diffuselighting = dynamic_cast<NR::FilterDiffuseLighting*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_DIFFUSELIGHTING);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterDiffuseLighting *nr_diffuselighting = dynamic_cast<Inkscape::Filters::FilterDiffuseLighting*>(nr_primitive);
g_assert(nr_diffuselighting != NULL);
sp_diffuselighting->renderer = nr_diffuselighting;
@@ -355,17 +355,17 @@ static void sp_feDiffuseLighting_build_renderer(SPFilterPrimitive *primitive, NR
nr_diffuselighting->surfaceScale = sp_diffuselighting->surfaceScale;
nr_diffuselighting->lighting_color = sp_diffuselighting->lighting_color;
//We assume there is at most one child
- nr_diffuselighting->light_type = NR::NO_LIGHT;
+ nr_diffuselighting->light_type = Inkscape::Filters::NO_LIGHT;
if (SP_IS_FEDISTANTLIGHT(primitive->children)) {
- nr_diffuselighting->light_type = NR::DISTANT_LIGHT;
+ nr_diffuselighting->light_type = Inkscape::Filters::DISTANT_LIGHT;
nr_diffuselighting->light.distant = SP_FEDISTANTLIGHT(primitive->children);
}
if (SP_IS_FEPOINTLIGHT(primitive->children)) {
- nr_diffuselighting->light_type = NR::POINT_LIGHT;
+ nr_diffuselighting->light_type = Inkscape::Filters::POINT_LIGHT;
nr_diffuselighting->light.point = SP_FEPOINTLIGHT(primitive->children);
}
if (SP_IS_FESPOTLIGHT(primitive->children)) {
- nr_diffuselighting->light_type = NR::SPOT_LIGHT;
+ nr_diffuselighting->light_type = Inkscape::Filters::SPOT_LIGHT;
nr_diffuselighting->light.spot = SP_FESPOTLIGHT(primitive->children);
}
index 8e909f9ae624a26b620d0d4bbb1a97ba63668cfd..3c6c0ae73f5dd1c89106e46cce189f484925607c 100644 (file)
#include "sp-filter.h"
#include "diffuselighting-fns.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterDiffuseLighting;
}
+}
/* FeDiffuseLighting base class */
class SPFeDiffuseLightingClass;
guint32 lighting_color;
guint lighting_color_set : 1;
/** pointer to the associated renderer */
- NR::FilterDiffuseLighting *renderer;
+ Inkscape::Filters::FilterDiffuseLighting *renderer;
};
struct SPFeDiffuseLightingClass {
index 405922b46a706bf99e48cffa1cc4ce761d6223db..7d4100b0ebd7a32121c12a0b99dd991ee6fcbff8 100644 (file)
static void sp_feDisplacementMap_release(SPObject *object);
static void sp_feDisplacementMap_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feDisplacementMap_update(SPObject *object, SPCtx *ctx, guint flags);
-static void sp_feDisplacementMap_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feDisplacementMap_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static Inkscape::XML::Node *sp_feDisplacementMap_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPFilterPrimitiveClass *feDisplacementMap_parent_class;
feDisplacementMap->scale=0;
feDisplacementMap->xChannelSelector = DISPLACEMENTMAP_CHANNEL_ALPHA;
feDisplacementMap->yChannelSelector = DISPLACEMENTMAP_CHANNEL_ALPHA;
- feDisplacementMap->in2 = NR::NR_FILTER_SLOT_NOT_SET;
+ feDisplacementMap->in2 = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
/**
@@ -227,15 +227,15 @@ sp_feDisplacementMap_write(SPObject *object, Inkscape::XML::Document *doc, Inksc
return repr;
}
-static void sp_feDisplacementMap_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feDisplacementMap_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeDisplacementMap *sp_displacement_map = SP_FEDISPLACEMENTMAP(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_DISPLACEMENTMAP);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterDisplacementMap *nr_displacement_map = dynamic_cast<NR::FilterDisplacementMap*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_DISPLACEMENTMAP);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterDisplacementMap *nr_displacement_map = dynamic_cast<Inkscape::Filters::FilterDisplacementMap*>(nr_primitive);
g_assert(nr_displacement_map != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
diff --git a/src/filters/flood.cpp b/src/filters/flood.cpp
index 31aa9559a4ba7f79416237aee01831ed8f9804e9..003d174c1fe8b6c48ffe8b11df9275c330451762 100644 (file)
--- a/src/filters/flood.cpp
+++ b/src/filters/flood.cpp
static void sp_feFlood_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feFlood_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feFlood_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feFlood_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feFlood_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feFlood_parent_class;
@@ -196,16 +196,16 @@ sp_feFlood_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::
return repr;
}
-static void sp_feFlood_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feFlood_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeFlood *sp_flood = SP_FEFLOOD(primitive);
(void)sp_flood;
- int primitive_n = filter->add_primitive(NR::NR_FILTER_FLOOD);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterFlood *nr_flood = dynamic_cast<NR::FilterFlood*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_FLOOD);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterFlood *nr_flood = dynamic_cast<Inkscape::Filters::FilterFlood*>(nr_primitive);
g_assert(nr_flood != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
diff --git a/src/filters/image.cpp b/src/filters/image.cpp
index d132d361c5ca64922b8881866232c104f3a9bcfb..f4764577a9f6ee9a066177bc24f33b0610e4cecb 100644 (file)
--- a/src/filters/image.cpp
+++ b/src/filters/image.cpp
static void sp_feImage_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feImage_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feImage_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feImage_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feImage_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feImage_parent_class;
@@ -232,15 +232,15 @@ sp_feImage_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::
return repr;
}
-static void sp_feImage_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feImage_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeImage *sp_image = SP_FEIMAGE(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_IMAGE);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterImage *nr_image = dynamic_cast<NR::FilterImage*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_IMAGE);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterImage *nr_image = dynamic_cast<Inkscape::Filters::FilterImage*>(nr_primitive);
g_assert(nr_image != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
diff --git a/src/filters/merge.cpp b/src/filters/merge.cpp
index 079d1b19cef85213f1cdb8d0f16e9350e132adb6..a1f17889dcdf9e6f48246dbc6905cf464956ae4f 100644 (file)
--- a/src/filters/merge.cpp
+++ b/src/filters/merge.cpp
static void sp_feMerge_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feMerge_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feMerge_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feMerge_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feMerge_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feMerge_parent_class;
@@ -164,16 +164,16 @@ sp_feMerge_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::
return repr;
}
-static void sp_feMerge_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feMerge_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeMerge *sp_merge = SP_FEMERGE(primitive);
(void)sp_merge;
- int primitive_n = filter->add_primitive(NR::NR_FILTER_MERGE);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterMerge *nr_merge = dynamic_cast<NR::FilterMerge*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_MERGE);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterMerge *nr_merge = dynamic_cast<Inkscape::Filters::FilterMerge*>(nr_primitive);
g_assert(nr_merge != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
index 1f056a25f70beee57816f4e435c2ced026012d60..8a4e0dd0ac179691fbb754e3cfeae9ab056cd514 100644 (file)
static void
sp_feMergeNode_init(SPFeMergeNode *feMergeNode)
{
- feMergeNode->input = NR::NR_FILTER_SLOT_NOT_SET;
+ feMergeNode->input = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
/**
index 9276160913c791fdf4aeeb33d6977fc67005894d..679221626efd6f1317fef4d1ec470f995d5c3e87 100644 (file)
static void sp_feMorphology_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feMorphology_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feMorphology_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feMorphology_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feMorphology_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feMorphology_parent_class;
((SPObjectClass *) feMorphology_parent_class)->release(object);
}
-static NR::FilterMorphologyOperator sp_feMorphology_read_operator(gchar const *value){
- if (!value) return NR::MORPHOLOGY_OPERATOR_ERODE; //erode is default
+static Inkscape::Filters::FilterMorphologyOperator sp_feMorphology_read_operator(gchar const *value){
+ if (!value) return Inkscape::Filters::MORPHOLOGY_OPERATOR_ERODE; //erode is default
switch(value[0]){
case 'e':
- if (strncmp(value, "erode", 5) == 0) return NR::MORPHOLOGY_OPERATOR_ERODE;
+ if (strncmp(value, "erode", 5) == 0) return Inkscape::Filters::MORPHOLOGY_OPERATOR_ERODE;
break;
case 'd':
- if (strncmp(value, "dilate", 6) == 0) return NR::MORPHOLOGY_OPERATOR_DILATE;
+ if (strncmp(value, "dilate", 6) == 0) return Inkscape::Filters::MORPHOLOGY_OPERATOR_DILATE;
break;
}
- return NR::MORPHOLOGY_OPERATOR_ERODE; //erode is default
+ return Inkscape::Filters::MORPHOLOGY_OPERATOR_ERODE; //erode is default
}
/**
SPFeMorphology *feMorphology = SP_FEMORPHOLOGY(object);
(void)feMorphology;
- NR::FilterMorphologyOperator read_operator;
+ Inkscape::Filters::FilterMorphologyOperator read_operator;
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
case SP_ATTR_OPERATOR:
@@ -199,15 +199,15 @@ sp_feMorphology_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::
return repr;
}
-static void sp_feMorphology_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feMorphology_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeMorphology *sp_morphology = SP_FEMORPHOLOGY(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_MORPHOLOGY);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterMorphology *nr_morphology = dynamic_cast<NR::FilterMorphology*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_MORPHOLOGY);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterMorphology *nr_morphology = dynamic_cast<Inkscape::Filters::FilterMorphology*>(nr_primitive);
g_assert(nr_morphology != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
index 8e807d73a7be80a69458d0bc4aeac0b9e63f0d3b..20abf8a8d4a860efd9a01ae8e9606a8546b3a1d4 100644 (file)
--- a/src/filters/morphology.h
+++ b/src/filters/morphology.h
struct SPFeMorphology : public SPFilterPrimitive {
/** MORPHOLOGY ATTRIBUTES HERE */
- NR::FilterMorphologyOperator Operator;
+ Inkscape::Filters::FilterMorphologyOperator Operator;
NumberOptNumber radius;
};
diff --git a/src/filters/offset.cpp b/src/filters/offset.cpp
index 08486361295a930b6f6246b38ffe9e7de527eae9..2c01549d3aca287bf5a644c3df7ffb7ffdbfdb72 100644 (file)
--- a/src/filters/offset.cpp
+++ b/src/filters/offset.cpp
static void sp_feOffset_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feOffset_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feOffset_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feOffset_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feOffset_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feOffset_parent_class;
@@ -184,15 +184,15 @@ sp_feOffset_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML:
return repr;
}
-static void sp_feOffset_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feOffset_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeOffset *sp_offset = SP_FEOFFSET(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_OFFSET);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterOffset *nr_offset = dynamic_cast<NR::FilterOffset*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_OFFSET);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterOffset *nr_offset = dynamic_cast<Inkscape::Filters::FilterOffset*>(nr_primitive);
g_assert(nr_offset != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
index baf9bb7c20cd8acfc8ab5e1f30dc4679450d3f0d..4c73033e604ccb05d8ea104ac7755742f5b8cb6a 100644 (file)
static void sp_feSpecularLighting_remove_child(SPObject *object, Inkscape::XML::Node *child);
static void sp_feSpecularLighting_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
static Inkscape::XML::Node *sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feSpecularLighting_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feSpecularLighting_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static void sp_feSpecularLighting_children_modified(SPFeSpecularLighting *sp_specularlighting);
static SPFilterPrimitiveClass *feSpecularLighting_parent_class;
@@ -343,31 +343,31 @@ sp_feSpecularLighting_order_changed (SPObject *object, Inkscape::XML::Node *chil
static void sp_feSpecularLighting_children_modified(SPFeSpecularLighting *sp_specularlighting)
{
if (sp_specularlighting->renderer) {
- sp_specularlighting->renderer->light_type = NR::NO_LIGHT;
+ sp_specularlighting->renderer->light_type = Inkscape::Filters::NO_LIGHT;
if (SP_IS_FEDISTANTLIGHT(sp_specularlighting->children)) {
- sp_specularlighting->renderer->light_type = NR::DISTANT_LIGHT;
+ sp_specularlighting->renderer->light_type = Inkscape::Filters::DISTANT_LIGHT;
sp_specularlighting->renderer->light.distant = SP_FEDISTANTLIGHT(sp_specularlighting->children);
}
if (SP_IS_FEPOINTLIGHT(sp_specularlighting->children)) {
- sp_specularlighting->renderer->light_type = NR::POINT_LIGHT;
+ sp_specularlighting->renderer->light_type = Inkscape::Filters::POINT_LIGHT;
sp_specularlighting->renderer->light.point = SP_FEPOINTLIGHT(sp_specularlighting->children);
}
if (SP_IS_FESPOTLIGHT(sp_specularlighting->children)) {
- sp_specularlighting->renderer->light_type = NR::SPOT_LIGHT;
+ sp_specularlighting->renderer->light_type = Inkscape::Filters::SPOT_LIGHT;
sp_specularlighting->renderer->light.spot = SP_FESPOTLIGHT(sp_specularlighting->children);
}
}
}
-static void sp_feSpecularLighting_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feSpecularLighting_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeSpecularLighting *sp_specularlighting = SP_FESPECULARLIGHTING(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_SPECULARLIGHTING);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterSpecularLighting *nr_specularlighting = dynamic_cast<NR::FilterSpecularLighting*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_SPECULARLIGHTING);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterSpecularLighting *nr_specularlighting = dynamic_cast<Inkscape::Filters::FilterSpecularLighting*>(nr_primitive);
g_assert(nr_specularlighting != NULL);
sp_specularlighting->renderer = nr_specularlighting;
@@ -378,17 +378,17 @@ static void sp_feSpecularLighting_build_renderer(SPFilterPrimitive *primitive, N
nr_specularlighting->surfaceScale = sp_specularlighting->surfaceScale;
nr_specularlighting->lighting_color = sp_specularlighting->lighting_color;
//We assume there is at most one child
- nr_specularlighting->light_type = NR::NO_LIGHT;
+ nr_specularlighting->light_type = Inkscape::Filters::NO_LIGHT;
if (SP_IS_FEDISTANTLIGHT(primitive->children)) {
- nr_specularlighting->light_type = NR::DISTANT_LIGHT;
+ nr_specularlighting->light_type = Inkscape::Filters::DISTANT_LIGHT;
nr_specularlighting->light.distant = SP_FEDISTANTLIGHT(primitive->children);
}
if (SP_IS_FEPOINTLIGHT(primitive->children)) {
- nr_specularlighting->light_type = NR::POINT_LIGHT;
+ nr_specularlighting->light_type = Inkscape::Filters::POINT_LIGHT;
nr_specularlighting->light.point = SP_FEPOINTLIGHT(primitive->children);
}
if (SP_IS_FESPOTLIGHT(primitive->children)) {
- nr_specularlighting->light_type = NR::SPOT_LIGHT;
+ nr_specularlighting->light_type = Inkscape::Filters::SPOT_LIGHT;
nr_specularlighting->light.spot = SP_FESPOTLIGHT(primitive->children);
}
index c2a55df512366b900ad564bb4d8362637b53c70e..cdca5f99f388bfff1f6b41b395c7e6670ce26544 100644 (file)
#include "sp-filter.h"
#include "specularlighting-fns.h"
-namespace NR {
+namespace Inkscape {
+namespace Filters {
class FilterSpecularLighting;
}
+}
/* FeSpecularLighting base class */
class SPFeSpecularLightingClass;
guint32 lighting_color;
guint lighting_color_set : 1;
- NR::FilterSpecularLighting *renderer;
+ Inkscape::Filters::FilterSpecularLighting *renderer;
};
struct SPFeSpecularLightingClass {
diff --git a/src/filters/tile.cpp b/src/filters/tile.cpp
index ab4f9a27aa8a9c9c9f7f3ae8237f3c980ea9d89a..cf72cb0527d63a1d3cac6dcf4a5ad39528e9be27 100644 (file)
--- a/src/filters/tile.cpp
+++ b/src/filters/tile.cpp
static void sp_feTile_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feTile_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feTile_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feTile_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feTile_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feTile_parent_class;
@@ -164,16 +164,16 @@ sp_feTile_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::N
return repr;
}
-static void sp_feTile_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feTile_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeTile *sp_tile = SP_FETILE(primitive);
(void)sp_tile;
- int primitive_n = filter->add_primitive(NR::NR_FILTER_TILE);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterTile *nr_tile = dynamic_cast<NR::FilterTile*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_TILE);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterTile *nr_tile = dynamic_cast<Inkscape::Filters::FilterTile*>(nr_primitive);
g_assert(nr_tile != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
index 1d7a1c8405ed3623fe2eff6c30f36abfaa695486..7c185f2af40b7603bdc7548ecc50d0dadf01a7e0 100644 (file)
static void sp_feTurbulence_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feTurbulence_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_feTurbulence_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_feTurbulence_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_feTurbulence_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *feTurbulence_parent_class;
return false; // 'noStitch' is default
}
-static NR::FilterTurbulenceType sp_feTurbulence_read_type(gchar const *value){
- if (!value) return NR::TURBULENCE_TURBULENCE; // 'turbulence' is default
+static Inkscape::Filters::FilterTurbulenceType sp_feTurbulence_read_type(gchar const *value){
+ if (!value) return Inkscape::Filters::TURBULENCE_TURBULENCE; // 'turbulence' is default
switch(value[0]){
case 'f':
- if (strncmp(value, "fractalNoise", 12) == 0) return NR::TURBULENCE_FRACTALNOISE;
+ if (strncmp(value, "fractalNoise", 12) == 0) return Inkscape::Filters::TURBULENCE_FRACTALNOISE;
break;
case 't':
- if (strncmp(value, "turbulence", 10) == 0) return NR::TURBULENCE_TURBULENCE;
+ if (strncmp(value, "turbulence", 10) == 0) return Inkscape::Filters::TURBULENCE_TURBULENCE;
break;
}
- return NR::TURBULENCE_TURBULENCE; // 'turbulence' is default
+ return Inkscape::Filters::TURBULENCE_TURBULENCE; // 'turbulence' is default
}
/**
int read_int;
double read_num;
bool read_bool;
- NR::FilterTurbulenceType read_type;
+ Inkscape::Filters::FilterTurbulenceType read_type;
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
@@ -249,15 +249,15 @@ sp_feTurbulence_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::
return repr;
}
-static void sp_feTurbulence_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_feTurbulence_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
g_assert(primitive != NULL);
g_assert(filter != NULL);
SPFeTurbulence *sp_turbulence = SP_FETURBULENCE(primitive);
- int primitive_n = filter->add_primitive(NR::NR_FILTER_TURBULENCE);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
- NR::FilterTurbulence *nr_turbulence = dynamic_cast<NR::FilterTurbulence*>(nr_primitive);
+ int primitive_n = filter->add_primitive(Inkscape::Filters::NR_FILTER_TURBULENCE);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(primitive_n);
+ Inkscape::Filters::FilterTurbulence *nr_turbulence = dynamic_cast<Inkscape::Filters::FilterTurbulence*>(nr_primitive);
g_assert(nr_turbulence != NULL);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
index 3601a7cdc8bddbbad7d7d161c15ac9b8424c8450..5edf678a74292ca9aa81bc09778563a4fdfcda7c 100644 (file)
--- a/src/filters/turbulence.h
+++ b/src/filters/turbulence.h
int numOctaves;
double seed;
bool stitchTiles;
- NR::FilterTurbulenceType type;
+ Inkscape::Filters::FilterTurbulenceType type;
SVGLength x, y, height, width;
bool updated;
};
index ccde93889d0c0a4b85a302d67c7bb668c58994bf..9bfaff4aa6751dfc7ca94d56cd7a84f41400fb5d 100644 (file)
static void
sp_filter_primitive_init(SPFilterPrimitive *filter_primitive)
{
- filter_primitive->image_in = NR::NR_FILTER_SLOT_NOT_SET;
- filter_primitive->image_out = NR::NR_FILTER_SLOT_NOT_SET;
+ filter_primitive->image_in = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
+ filter_primitive->image_out = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
/**
if (value) {
image_nr = sp_filter_primitive_read_in(filter_primitive, value);
} else {
- image_nr = NR::NR_FILTER_SLOT_NOT_SET;
+ image_nr = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
if (image_nr != filter_primitive->image_in) {
filter_primitive->image_in = image_nr;
if (value) {
image_nr = sp_filter_primitive_read_result(filter_primitive, value);
} else {
- image_nr = NR::NR_FILTER_SLOT_NOT_SET;
+ image_nr = Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
if (image_nr != filter_primitive->image_out) {
filter_primitive->image_out = image_nr;
@@ -200,26 +200,26 @@ sp_filter_primitive_write(SPObject *object, Inkscape::XML::Document *doc, Inksca
int sp_filter_primitive_read_in(SPFilterPrimitive *prim, gchar const *name)
{
- if (!name) return NR::NR_FILTER_SLOT_NOT_SET;
+ if (!name) return Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
// TODO: are these case sensitive or not? (assumed yes)
switch (name[0]) {
case 'S':
if (strcmp(name, "SourceGraphic") == 0)
- return NR::NR_FILTER_SOURCEGRAPHIC;
+ return Inkscape::Filters::NR_FILTER_SOURCEGRAPHIC;
if (strcmp(name, "SourceAlpha") == 0)
- return NR::NR_FILTER_SOURCEALPHA;
+ return Inkscape::Filters::NR_FILTER_SOURCEALPHA;
if (strcmp(name, "StrokePaint") == 0)
- return NR::NR_FILTER_STROKEPAINT;
+ return Inkscape::Filters::NR_FILTER_STROKEPAINT;
break;
case 'B':
if (strcmp(name, "BackgroundImage") == 0)
- return NR::NR_FILTER_BACKGROUNDIMAGE;
+ return Inkscape::Filters::NR_FILTER_BACKGROUNDIMAGE;
if (strcmp(name, "BackgroundAlpha") == 0)
- return NR::NR_FILTER_BACKGROUNDALPHA;
+ return Inkscape::Filters::NR_FILTER_BACKGROUNDALPHA;
break;
case 'F':
if (strcmp(name, "FillPaint") == 0)
- return NR::NR_FILTER_FILLPAINT;
+ return Inkscape::Filters::NR_FILTER_FILLPAINT;
break;
}
int ret = sp_filter_get_image_name(parent, name);
if (ret >= 0) return ret;
- return NR::NR_FILTER_SLOT_NOT_SET;
+ return Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
int sp_filter_primitive_read_result(SPFilterPrimitive *prim, gchar const *name)
@@ -239,11 +239,11 @@ int sp_filter_primitive_read_result(SPFilterPrimitive *prim, gchar const *name)
ret = sp_filter_set_image_name(parent, name);
if (ret >= 0) return ret;
- return NR::NR_FILTER_SLOT_NOT_SET;
+ return Inkscape::Filters::NR_FILTER_SLOT_NOT_SET;
}
/* Common initialization for filter primitives */
-void sp_filter_primitive_renderer_common(SPFilterPrimitive *sp_prim, NR::FilterPrimitive *nr_prim)
+void sp_filter_primitive_renderer_common(SPFilterPrimitive *sp_prim, Inkscape::Filters::FilterPrimitive *nr_prim)
{
g_assert(sp_prim != NULL);
g_assert(nr_prim != NULL);
index 6f6558c5ccbe65a5b5de1f4e79d852a5d2ca314a..889c40e40b4ea08774811f05d17de4c60b5b0540 100644 (file)
struct SPFilterPrimitiveClass {
SPObjectClass sp_object_class;
- void (* build_renderer)(SPFilterPrimitive*, NR::Filter*);
+ void (* build_renderer)(SPFilterPrimitive*, Inkscape::Filters::Filter*);
};
GType sp_filter_primitive_get_type (void);
/* Common initialization for filter primitives */
-void sp_filter_primitive_renderer_common(SPFilterPrimitive *sp_prim, NR::FilterPrimitive *nr_prim);
+void sp_filter_primitive_renderer_common(SPFilterPrimitive *sp_prim, Inkscape::Filters::FilterPrimitive *nr_prim);
int sp_filter_primitive_read_in(SPFilterPrimitive *prim, gchar const *name);
int sp_filter_primitive_read_result(SPFilterPrimitive *prim, gchar const *name);
diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp
index e075087d3af3d6bd84899348e6181678e8ea90aa..2a971ccc673745aac90c9edbc6bc3d282a2504a3 100644 (file)
--- a/src/sp-filter.cpp
+++ b/src/sp-filter.cpp
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
-void sp_filter_build_renderer(SPFilter *sp_filter, NR::Filter *nr_filter)
+void sp_filter_build_renderer(SPFilter *sp_filter, Inkscape::Filters::Filter *nr_filter)
{
g_assert(sp_filter != NULL);
g_assert(nr_filter != NULL);
diff --git a/src/sp-filter.h b/src/sp-filter.h
index d0a449c47591671e2b5457d8b59969c6485acf18..c1af5f768728385b5e8e9756cfe32094482aea73 100644 (file)
--- a/src/sp-filter.h
+++ b/src/sp-filter.h
SPFilterReference *href;
sigc::connection modified_connection;
- NR::Filter *_renderer;
+ Inkscape::Filters::Filter *_renderer;
std::map<gchar *, int, ltstr>* _image_name;
int _image_number_next;
};
/*
- * Initializes the given NR::Filter object as a renderer for this
+ * Initializes the given Inkscape::Filters::Filter object as a renderer for this
* SPFilter object.
*/
-void sp_filter_build_renderer(SPFilter *sp_filter, NR::Filter *nr_filter);
+void sp_filter_build_renderer(SPFilter *sp_filter, Inkscape::Filters::Filter *nr_filter);
/*
* Returns the number of filter primitives in this SPFilter object.
index 94efc5727d447e0709390e31e8dcb7cfb1b906ea..77efe9c01f5f5d4e7c2048fa879af023262f6d43 100644 (file)
--- a/src/sp-gaussian-blur.cpp
+++ b/src/sp-gaussian-blur.cpp
static void sp_gaussianBlur_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_gaussianBlur_update(SPObject *object, SPCtx *ctx, guint flags);
static Inkscape::XML::Node *sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_gaussianBlur_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
+static void sp_gaussianBlur_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter);
static SPFilterPrimitiveClass *gaussianBlur_parent_class;
@@ -186,12 +186,12 @@ void sp_gaussianBlur_setDeviation(SPGaussianBlur *blur, float num, float optnum
blur->stdDeviation.setOptNumber(optnum);
}
-static void sp_gaussianBlur_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter) {
+static void sp_gaussianBlur_build_renderer(SPFilterPrimitive *primitive, Inkscape::Filters::Filter *filter) {
SPGaussianBlur *sp_blur = SP_GAUSSIANBLUR(primitive);
- int handle = filter->add_primitive(NR::NR_FILTER_GAUSSIANBLUR);
- NR::FilterPrimitive *nr_primitive = filter->get_primitive(handle);
- NR::FilterGaussian *nr_blur = dynamic_cast<NR::FilterGaussian*>(nr_primitive);
+ int handle = filter->add_primitive(Inkscape::Filters::NR_FILTER_GAUSSIANBLUR);
+ Inkscape::Filters::FilterPrimitive *nr_primitive = filter->get_primitive(handle);
+ Inkscape::Filters::FilterGaussian *nr_blur = dynamic_cast<Inkscape::Filters::FilterGaussian*>(nr_primitive);
sp_filter_primitive_renderer_common(primitive, nr_primitive);
index 7f92f5f01ee3d1881794277b4b008a3c55123be6..7a4684d836fbddb4082a84fbea89f49a3f434728 100644 (file)
#include "io/sys.h"
#include <iostream>
-using namespace NR;
+using namespace Inkscape::Filters;
namespace Inkscape {
namespace UI {
_infobox_desc.hide();
}
switch(_add_primitive_type.get_active_data()->id){
- case(NR::NR_FILTER_BLEND):
+ case(NR_FILTER_BLEND):
_infobox_icon.set(g_strdup_printf("%s/feBlend-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feBlend</b> filter primitive provides 4 image blending modes: screen, multiply, darken and lighten."));
break;
- case(NR::NR_FILTER_COLORMATRIX):
+ case(NR_FILTER_COLORMATRIX):
_infobox_icon.set(g_strdup_printf("%s/feColorMatrix-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feColorMatrix</b> filter primitive applies a matrix transformation to colour of each rendered pixel. This allows for effects like turning object to grayscale, modifying colour saturation and changing colour hue."));
break;
- case(NR::NR_FILTER_COMPONENTTRANSFER):
+ case(NR_FILTER_COMPONENTTRANSFER):
_infobox_icon.set(g_strdup_printf("%s/feComponentTransfer-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feComponentTransfer</b> filter primitive manipulates the input's color components (red, green, blue, and alpha) according to particular transfer functions, allowing operations like brightness and contrast adjustment, color balance, and thresholding."));
break;
- case(NR::NR_FILTER_COMPOSITE):
+ case(NR_FILTER_COMPOSITE):
_infobox_icon.set(g_strdup_printf("%s/feComposite-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feComposite</b> filter primitive composites two images using one of the Porter-Duff blending modes or the aritmetic mode described in SVG standard. Porter-Duff blending modes are essentially logical operations between the corresponding pixel values of the images."));
break;
- case(NR::NR_FILTER_CONVOLVEMATRIX):
+ case(NR_FILTER_CONVOLVEMATRIX):
_infobox_icon.set(g_strdup_printf("%s/feConvolveMatrix-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feConvolveMatrix</b> lets you specify a Convolution to be applied on the image. Common effects created using convolution matrices are blur, sharpening, embossing and edge detection. Note that while gaussian blur can be created using this filter primitive, the special gaussian blur primitive is faster and resolution-independent."));
break;
- case(NR::NR_FILTER_DIFFUSELIGHTING):
+ case(NR_FILTER_DIFFUSELIGHTING):
_infobox_icon.set(g_strdup_printf("%s/feDiffuseLighting-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feDiffuseLighting</b> and feSpecularLighting filter primitives create \"embossed\" shadings. The input's alpha channel is used to provide depth information: higher opacity areas are raised toward the viewer and lower opacity areas recede away from the viewer."));
break;
- case(NR::NR_FILTER_DISPLACEMENTMAP):
+ case(NR_FILTER_DISPLACEMENTMAP):
_infobox_icon.set(g_strdup_printf("%s/feDisplacementMap-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feDisplacementMap</b> filter primitive displaces the pixels in the first input using the second input as a displacement map, that shows from how far the pixel should come from. Classical examples are whirl and pinch effects."));
break;
- case(NR::NR_FILTER_FLOOD):
+ case(NR_FILTER_FLOOD):
_infobox_icon.set(g_strdup_printf("%s/feFlood-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feFlood</b> filter primitive fills the region with a given color and opacity. It is usually used as an input to other filters to apply color to a graphic."));
break;
- case(NR::NR_FILTER_GAUSSIANBLUR):
+ case(NR_FILTER_GAUSSIANBLUR):
_infobox_icon.set(g_strdup_printf("%s/feGaussianBlur-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feGaussianBlur</b> filter primitive uniformly blurs its input. It is commonly used together with feOffset to create a drop shadow effect."));
break;
- case(NR::NR_FILTER_IMAGE):
+ case(NR_FILTER_IMAGE):
_infobox_icon.set(g_strdup_printf("%s/feImage-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feImage</b> filter primitive fills the region with an external image or another part of the document."));
break;
- case(NR::NR_FILTER_MERGE):
+ case(NR_FILTER_MERGE):
_infobox_icon.set(g_strdup_printf("%s/feMerge-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feMerge</b> filter primitive composites several temporary images inside the filter primitive to a single image. It uses normal alpha compositing for this. This is equivalent to using several feBlend primitives in 'normal' mode or several feComposite primitives in 'over' mode."));
break;
- case(NR::NR_FILTER_MORPHOLOGY):
+ case(NR_FILTER_MORPHOLOGY):
_infobox_icon.set(g_strdup_printf("%s/feMorphology-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feMorphology</b> filter primitive provides erode and dilate effects. For single-colour objects erode makes the object thinner and dilate makes it thicker."));
break;
- case(NR::NR_FILTER_OFFSET):
+ case(NR_FILTER_OFFSET):
_infobox_icon.set(g_strdup_printf("%s/feOffset-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feOffset</b> filter primitive offsets the image by an user-defined amount. For example, this is useful for drop shadows, where the shadow is in a slightly different position than the actual object."));
break;
- case(NR::NR_FILTER_SPECULARLIGHTING):
+ case(NR_FILTER_SPECULARLIGHTING):
_infobox_icon.set(g_strdup_printf("%s/feSpecularLighting-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The feDiffuseLighting and <b>feSpecularLighting</b> filter primitives create \"embossed\" shadings. The input's alpha channel is used to provide depth information: higher opacity areas are raised toward the viewer and lower opacity areas recede away from the viewer."));
break;
- case(NR::NR_FILTER_TILE):
+ case(NR_FILTER_TILE):
_infobox_icon.set(g_strdup_printf("%s/feTile-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feTile</b> filter primitive tiles a region with its input graphic"));
break;
- case(NR::NR_FILTER_TURBULENCE):
+ case(NR_FILTER_TURBULENCE):
_infobox_icon.set(g_strdup_printf("%s/feTurbulence-icon.png", INKSCAPE_PIXMAPDIR));
_infobox_desc.set_markup(_("The <b>feTurbulence</b> filter primitive renders Perlin noise. This kind of noise is useful in simulating several nature phenomena like clouds, fire and smoke and in generating complex textures like marble or granite."));
break;
index 99b411441c028fe5c59b574506c4b11b42c8854a..3fb9a46fb89568d19c140269cd5ae6a3a8b0f2c8 100644 (file)
}
Gtk::TreeModelColumn<SPFilterPrimitive*> primitive;
- Gtk::TreeModelColumn<NR::FilterPrimitiveType> type_id;
+ Gtk::TreeModelColumn<Inkscape::Filters::FilterPrimitiveType> type_id;
Gtk::TreeModelColumn<Glib::ustring> type;
Gtk::TreeModelColumn<Glib::ustring> id;
};
// View/add primitives
Gtk::VBox _primitive_box;
- UI::Widget::ComboBoxEnum<NR::FilterPrimitiveType> _add_primitive_type;
+ UI::Widget::ComboBoxEnum<Inkscape::Filters::FilterPrimitiveType> _add_primitive_type;
Gtk::Button _add_primitive;
// Bottom pane (filter effect primitive settings)
index f2611c377a4790de059595475f5f5db5a7629db0..b086dd3e6352b84d52a26cd8d61d2d680394a527 100644 (file)
/* filter quality */
_filter_quality_best.init ( _("Best quality (slowest)"), "/options/filterquality/value",
- NR::FILTER_QUALITY_BEST, false, 0);
+ Inkscape::Filters::FILTER_QUALITY_BEST, false, 0);
_filter_quality_better.init ( _("Better quality (slower)"), "/options/filterquality/value",
- NR::FILTER_QUALITY_BETTER, false, &_filter_quality_best);
+ Inkscape::Filters::FILTER_QUALITY_BETTER, false, &_filter_quality_best);
_filter_quality_normal.init ( _("Average quality"), "/options/filterquality/value",
- NR::FILTER_QUALITY_NORMAL, true, &_filter_quality_best);
+ Inkscape::Filters::FILTER_QUALITY_NORMAL, true, &_filter_quality_best);
_filter_quality_worse.init ( _("Lower quality (faster)"), "/options/filterquality/value",
- NR::FILTER_QUALITY_WORSE, false, &_filter_quality_best);
+ Inkscape::Filters::FILTER_QUALITY_WORSE, false, &_filter_quality_best);
_filter_quality_worst.init ( _("Lowest quality (fastest)"), "/options/filterquality/value",
- NR::FILTER_QUALITY_WORST, false, &_filter_quality_best);
+ Inkscape::Filters::FILTER_QUALITY_WORST, false, &_filter_quality_best);
_page_filters.add_group_header( _("Filter effects quality for display:"));
_page_filters.add_line( true, "", _filter_quality_best, "",
index 80418abd883673403bfaf32cc1cfbf6b3d9b26ca..5b5b7011831842448db9adc22b240c0a0330615c 100644 (file)
if (_blend.get_active_row_number() == 5) {
return "filter";
} else {
- const Util::EnumData<NR::FilterBlendMode> *d = _blend.get_active_data();
+ const Util::EnumData<Inkscape::Filters::FilterBlendMode> *d = _blend.get_active_data();
if (d)
return _blend.get_active_data()->key;
else
index 141ec6bc062bf516c00465f60ba0972719c2afd2..e4e6796f4b3c96227d1fb526364bed147e14aa3c 100644 (file)
Gtk::HBox _hb_blend;
Gtk::VBox _vb_blur;
Gtk::Label _lb_blend, _lb_blur;
- ComboBoxEnum<NR::FilterBlendMode> _blend;
+ ComboBoxEnum<Inkscape::Filters::FilterBlendMode> _blend;
SpinSlider _blur;
sigc::signal<void> _signal_blend_blur_changed;