summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f1a7e9)
raw | patch | inline | side by side (parent: 6f1a7e9)
author | kiirala <kiirala@users.sourceforge.net> | |
Wed, 31 Oct 2007 13:56:54 +0000 (13:56 +0000) | ||
committer | kiirala <kiirala@users.sourceforge.net> | |
Wed, 31 Oct 2007 13:56:54 +0000 (13:56 +0000) |
37 files changed:
index b02b20cbf6d8eddcfbaa2e97bf400d40d1865128..fe21dc125ef2de8694300c22bfeb5dab752624a7 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
#include "display/nr-filter-types.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-pixblock.h"
#include "libnr/nr-matrix.h"
#include "libnr/nr-blit.h"
FilterBlend::~FilterBlend()
{}
-int FilterBlend::render(FilterSlot &slot, Matrix const &trans) {
+int FilterBlend::render(FilterSlot &slot, FilterUnits const & /*units*/) {
NRPixBlock *in1 = slot.get(_input);
NRPixBlock *in2 = slot.get(_input2);
NRPixBlock *original_in1 = in1;
index ffed2cd033e148177e9be1261e509b438d020bdb..28f92dad47201302e6f9faceb11d3ce15392f419 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
namespace NR {
static FilterPrimitive *create();
virtual ~FilterBlend();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void set_input(int slot);
virtual void set_input(int input, int slot);
index 3ed193984a02bbc1027670a833c6ef95b862f62b..e69e753e8a1bd1a58d0abfa21c4a1b21e016d103 100644 (file)
*/
#include "display/nr-filter-colormatrix.h"
+#include "display/nr-filter-units.h"
#include "display/nr-filter-utils.h"
-#include<math.h>
+#include <math.h>
namespace NR {
FilterColorMatrix::~FilterColorMatrix()
{}
-int FilterColorMatrix::render(FilterSlot &slot, Matrix const &trans) {
+int FilterColorMatrix::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = slot.get(_input);
NRPixBlock *out = new NRPixBlock;
index 32b57ce0c3b18a702fa88040fe92a66d1c46a652..d62cb5c193cd9546ebe239ab7895fda5ab6c0716 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include<vector>
namespace NR {
static FilterPrimitive *create();
virtual ~FilterColorMatrix();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void area_enlarge(NRRectL &area, Matrix const &trans);
virtual void set_type(FilterColorMatrixType type);
virtual void set_value(gdouble value);
diff --git a/src/display/nr-filter-component-transfer.cpp b/src/display/nr-filter-component-transfer.cpp
index 909dc7d90607cbb1a22da8bebb20d0aaa4993ff5..a190cecde593a2bd0dac140b364f6cda1fa792cd 100644 (file)
*/
#include "display/nr-filter-component-transfer.h"
+#include "display/nr-filter-units.h"
namespace NR {
FilterComponentTransfer::~FilterComponentTransfer()
{}
-int FilterComponentTransfer::render(FilterSlot &slot, Matrix const &trans) {
+int FilterComponentTransfer::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = slot.get(_input);
NRPixBlock *out = new NRPixBlock;
diff --git a/src/display/nr-filter-component-transfer.h b/src/display/nr-filter-component-transfer.h
index 9036a6644688aa01bcac37de5d74a644aa442748..30b793777abf271d41d36cd4670198ae6777bdec 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include <vector>
namespace NR {
static FilterPrimitive *create();
virtual ~FilterComponentTransfer();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void area_enlarge(NRRectL &area, Matrix const &trans);
void set_type(FilterComponentTransferType t);
index 29207b6b906707ec6170542c489192205360018d..de7dd7952eb2306f9014b100a393008d1a23af7d 100644 (file)
#include "display/nr-filter-composite.h"
#include "display/nr-filter-pixops.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "display/nr-filter-utils.h"
#include "libnr/nr-blit.h"
#include "libnr/nr-pixblock.h"
FilterComposite::~FilterComposite()
{}
-int FilterComposite::render(FilterSlot &slot, Matrix const &trans) {
+int FilterComposite::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in1 = slot.get(_input);
NRPixBlock *in2 = slot.get(_input2);
NRPixBlock *original_in1 = in1;
index a1bbbb1865ce895afbe97cddd5ffcbeb52a9c363..e41dd77dbfebfd69a06ce38c176be7da622d0022 100644 (file)
#include "sp-fecomposite.h"
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
namespace NR {
static FilterPrimitive *create();
virtual ~FilterComposite();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void set_input(int input);
virtual void set_input(int input, int slot);
index 13bc585c9cfd1801e78b135a422d755ce4b5bcc6..e40a201a08527955c60acb6b8b2c3a79740db207 100644 (file)
*/
#include "display/nr-filter-convolve-matrix.h"
+#include "display/nr-filter-units.h"
#include "display/nr-filter-utils.h"
#include <vector>
+
namespace NR {
FilterConvolveMatrix::FilterConvolveMatrix()
return true;
}
-int FilterConvolveMatrix::render(FilterSlot &slot, Matrix const &trans) {
+int FilterConvolveMatrix::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = slot.get(_input);
NRPixBlock *out = new NRPixBlock;
index ec47028e1ed325462ed9403b4a41d060c88aac5a..b13db2f983d3b9180b3c3d177dd87110619b6a24 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
#include "libnr/nr-rect-l.h"
#include <vector>
static FilterPrimitive *create();
virtual ~FilterConvolveMatrix();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void area_enlarge(NRRectL &area, Matrix const &trans);
virtual FilterTraits get_input_traits();
index 0fa0495e76ee3c02147c381448a15053f664bf75..9ff3922e8d1c2b049b8d10ab7da40e0c18e76872 100644 (file)
#include "display/nr-filter-diffuselighting.h"
#include "display/nr-filter-getalpha.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "display/nr-filter-utils.h"
#include "display/nr-light.h"
#include "libnr/nr-blit.h"
}while(0)
-int FilterDiffuseLighting::render(FilterSlot &slot, Matrix const &trans) {
+int FilterDiffuseLighting::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = filter_get_alpha(slot.get(_input));
NRPixBlock *out = new NRPixBlock;
int dx = 1; //TODO setup
int dy = 1; //TODO setup
//surface scale
- //TODO for the time being, assumes userSpaceOnUse
+ Matrix trans = units.get_matrix_primitiveunits2pb();
gdouble ss = surfaceScale * trans[0];
gdouble kd = diffuseConstant; //diffuse lighting constant
PointLight *pl = new PointLight(light.point, lighting_color, trans);
pl->light_components(LC);
//TODO we need a reference to the filter to determine primitiveUnits
- //slot._arena_item->filter seems to be ok on simple examples
- //for now assume userSpaceOnUse
//if objectBoundingBox is used, use a different matrix for light_vector
+ // UPDATE: trans is now correct matrix from primitiveUnits to
+ // 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);
{
SpotLight *sl = new SpotLight(light.spot, lighting_color, trans);
//TODO we need a reference to the filter to determine primitiveUnits
- //slot._arena_item->filter seems to be ok on simple examples
- //for now assume userSpaceOnUse
//if objectBoundingBox is used, use a different matrix for light_vector
+ // UPDATE: trans is now correct matrix from primitiveUnits to
+ // 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);
index 37da884ca47412aff33c6d8fad3e02a6e657eb7f..669d2c7e1876dd6c411404169b8a4dd19e3e8747 100644 (file)
#include "display/nr-light-types.h"
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
#include "sp-fedistantlight.h"
#include "sp-fepointlight.h"
FilterDiffuseLighting();
static FilterPrimitive *create();
virtual ~FilterDiffuseLighting();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual FilterTraits get_input_traits();
private:
diff --git a/src/display/nr-filter-displacement-map.cpp b/src/display/nr-filter-displacement-map.cpp
index f405109283e3feb80f1a7857330f55d6cad28702..184aa802d1661243d33b9373aaa8a2156e727025 100644 (file)
#include "display/nr-filter-displacement-map.h"
#include "display/nr-filter-types.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-pixops.h"
namespace NR {
FilterDisplacementMap::~FilterDisplacementMap()
{}
-int FilterDisplacementMap::render(FilterSlot &slot, Matrix const &trans) {
+int FilterDisplacementMap::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *texture = slot.get(_input);
NRPixBlock *map = slot.get(_input2);
index bf0565c22dd67e61e52210aec704c9daf5a5cca0..b89553697d88647b64c9afad2c918e550fd21b59 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
#include "libnr/nr-rect-l.h"
virtual void set_input(int input, int slot);
virtual void set_scale(double s);
virtual void set_channel_selector(int channel, int s);
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void area_enlarge(NRRectL &area, Matrix const &trans);
virtual FilterTraits get_input_traits();
index 5bd3466370c5dd78033ff508a928b26b43078188..fc03e564f8ce8483ac7c9d2d0166e4ab4945e592 100644 (file)
*/
#include "display/nr-filter-flood.h"
+#include "display/nr-filter-units.h"
+
namespace NR {
FilterFlood::FilterFlood()
FilterFlood::~FilterFlood()
{}
-int FilterFlood::render(FilterSlot &slot, Matrix const &trans) {
+int FilterFlood::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = slot.get(_input);
NRPixBlock *out = new NRPixBlock;
index 5487111642e3f989a0631c3b7258bee70adecc03..34cde5a7867d01bdd7313ca719b59e2941bdc9f5 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
namespace NR {
static FilterPrimitive *create();
virtual ~FilterFlood();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void area_enlarge(NRRectL &area, Matrix const &trans);
};
index fb94a654b68695a05afa2c073e609dc8bb031c02..fdab94f1d7c82ba284fe2cfceb141cf088743fdd 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-gaussian.h"
#include "display/nr-filter-types.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-pixblock.h"
#include "libnr/nr-matrix.h"
#include "util/fixed_point.h"
@@ -505,8 +506,9 @@ upsample(PT *const dst, int const dstr1, int const dstr2, unsigned int const dn1
}
}
-int FilterGaussian::render(FilterSlot &slot, Matrix const &trans)
+int FilterGaussian::render(FilterSlot &slot, FilterUnits const &units)
{
+ Matrix trans = units.get_matrix_primitiveunits2pb();
/* in holds the input pixblock */
NRPixBlock *in = slot.get(_input);
index 7b2a96ca583711cf5d77240585a3bcb03ba2c9f6..3ff3e3d22bf36a8945eff324a72207279539f7a3 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-pixblock.h"
#include "libnr/nr-matrix.h"
#include "libnr/nr-rect-l.h"
static FilterPrimitive *create();
virtual ~FilterGaussian();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void area_enlarge(NRRectL &area, Matrix const &m);
virtual FilterTraits get_input_traits();
index bd5e5296585b614c6c03dfff25e270b182fc8d81..b8abb0317f0eefead705016fd88437c3d39cf2b7 100644 (file)
#include "display/nr-arena-item.h"
#include "display/nr-filter.h"
#include "display/nr-filter-image.h"
+#include "display/nr-filter-units.h"
namespace NR {
FilterImage::~FilterImage()
{}
-int FilterImage::render(FilterSlot &slot, Matrix const &trans) {
+int FilterImage::render(FilterSlot &slot, FilterUnits const &units) {
int w,x,y;
NRPixBlock *in = slot.get(_input);
NRPixBlock *out = new NRPixBlock;
index 0e522139ca553ff1164e37a8dae17cc67a03f51c..9d4057826de38f04f17b8154233017e8300624ef 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include <gtkmm.h>
namespace NR {
static FilterPrimitive *create();
virtual ~FilterImage();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual FilterTraits get_input_traits();
void set_region(SVGLength x, SVGLength y, SVGLength width, SVGLength height);
private:
index 8650fee8ba3f62abe805b50dbf850d21caba6aac..1e95d7cf120a5cb4e9b86ea5773928ee5980217c 100644 (file)
#include "display/nr-filter-merge.h"
#include "display/nr-filter-pixops.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "display/nr-filter-utils.h"
#include "libnr/nr-blit.h"
#include "libnr/nr-pixblock.h"
FilterMerge::~FilterMerge()
{}
-int FilterMerge::render(FilterSlot &slot, Matrix const &trans) {
+int FilterMerge::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in[_input_image.size()];
NRPixBlock *original_in[_input_image.size()];
index a88819c502d341df9fb9174a249abe4a0d17e5fd..5fe6b33e32ddf9bc4417ccb8297f9e4b65c41dd2 100644 (file)
#include "sp-femerge.h"
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
namespace NR {
static FilterPrimitive *create();
virtual ~FilterMerge();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void set_input(int input);
virtual void set_input(int input, int slot);
index 6cc6dd7b8f713651ce5253b3190859a579bf5ac5..20dc95bfabfb4c0490e35bfc00ba6a9c01e1d9b1 100644 (file)
*/
#include "display/nr-filter-morphology.h"
+#include "display/nr-filter-units.h"
+
namespace NR {
FilterMorphology::FilterMorphology()
FilterMorphology::~FilterMorphology()
{}
-int FilterMorphology::render(FilterSlot &slot, Matrix const &trans) {
+int FilterMorphology::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = slot.get(_input);
NRPixBlock *out = new NRPixBlock;
index 7283b0cea8990a770c3166c0f5f4d0eafc41594a..a9435041ec237fa2b5a3c7454876c71671485298 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
namespace NR {
static FilterPrimitive *create();
virtual ~FilterMorphology();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void area_enlarge(NRRectL &area, Matrix const &trans);
virtual FilterTraits get_input_traits();
void set_operator(FilterMorphologyOperator &o);
index 4facd94364a8e3867375e8b70e5ace5bdc504efd..85df3351ff3d4e2312afcc78867cdf5aad5fd6aa 100644 (file)
#include "display/nr-filter-offset.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-blit.h"
#include "libnr/nr-matrix.h"
#include "libnr/nr-pixblock.h"
FilterOffset::~FilterOffset()
{}
-int FilterOffset::render(FilterSlot &slot, Matrix const &trans) {
+int FilterOffset::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = slot.get(_input);
NRPixBlock *out = new NRPixBlock;
return 1;
}
+ Matrix trans = units.get_matrix_primitiveunits2pb();
Point offset(dx, dy);
offset *= trans;
offset[X] -= trans[4];
index 7c39b0eccc6c3d5a284cb4af3f8fd03b5aa3c053..ffcdbd744435c4f9e46986da127067d2e9eb5baf 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
#include "libnr/nr-rect-l.h"
static FilterPrimitive *create();
virtual ~FilterOffset();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void area_enlarge(NRRectL &area, Matrix const &trans);
void set_dx(double amount);
index 14f5c00788503acb941b2f7b4123c44f46d7a03a..6e7e9e6abfd6a18f1a9c59a77452322fd5b21850 100644 (file)
// Nothing to do here
}
-/** Wrapper function for rendering with C-style matrices. */
-int FilterPrimitive::render(FilterSlot &slot, NRMatrix const *trans) {
- if(trans) {
- return this->render(slot, *trans);
- } else {
- Matrix tmp;
- tmp.set_identity();
- return this->render(slot, tmp);
- }
-}
-
void FilterPrimitive::area_enlarge(NRRectL &area, Matrix const &m)
{
// This doesn't need to do anything by default
index e1e5984e671de53c9a1417065162cfe76ec1f01f..fba4c634419484fc1b83c50a3c277161ce49e357 100644 (file)
* Author:
* Niko Kiirala <niko@kiirala.com>
*
- * Copyright (C) 2006 Niko Kiirala
+ * Copyright (C) 2006-2007 Niko Kiirala
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
FilterPrimitive();
virtual ~FilterPrimitive();
- int render(FilterSlot &slot, NRMatrix const *trans);
- virtual int render(FilterSlot &slot, Matrix const &trans) = 0;
+ virtual int render(FilterSlot &slot, FilterUnits const &units) = 0;
virtual void area_enlarge(NRRectL &area, Matrix const &m);
/**
index 68c38c4b22b5a0daac9c17fbf484ef71637129f3..70d7a251294a0936d1363df6101efdafa11655f8 100644 (file)
#include "display/nr-filter-skeleton.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-pixblock.h"
#include "libnr/nr-matrix.h"
FilterSkeleton::~FilterSkeleton()
{}
-int FilterSkeleton::render(FilterSlot &slot, Matrix const &trans) {
+int FilterSkeleton::render(FilterSlot &slot, FitlerUnits const &units) {
NRPixBlock *in = slot.get(_input);
NRPixBlock *out;
index edba5c2f16834240590b3c6c6abdc8fb1a3912c6..b0581593b6d00f84a225e3f73aa2578a9067aa48 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
namespace NR {
static FilterPrimitive *create();
virtual ~FilterSkeleton();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
private:
diff --git a/src/display/nr-filter-specularlighting.cpp b/src/display/nr-filter-specularlighting.cpp
index ca8bca6a8b3f3c8eb35ccdd0528150616f107675..7f24f3ec26055f0f46510d6680a30e3a06aaabba 100644 (file)
#include "display/nr-filter-specularlighting.h"
#include "display/nr-filter-getalpha.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "display/nr-filter-utils.h"
#include "display/nr-light.h"
#include "libnr/nr-blit.h"
(inter) = (ks) * std::pow(scal, (specularExponent));\
}while(0)
-int FilterSpecularLighting::render(FilterSlot &slot, Matrix const &trans) {
+int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = filter_get_alpha(slot.get(_input));
NRPixBlock *out = new NRPixBlock;
int dx = 1; //TODO setup
int dy = 1; //TODO setup
//surface scale
- //TODO for the time being, assumes userSpaceOnUse
+ Matrix trans = units.get_matrix_primitiveunits2pb();
gdouble ss = surfaceScale * trans[0];
gdouble ks = specularConstant; //diffuse lighting constant
Fvector L, N, LC, H;
PointLight *pl = new PointLight(light.point, lighting_color, trans);
pl->light_components(LC);
//TODO we need a reference to the filter to determine primitiveUnits
- //slot._arena_item->filter seems to be ok on simple examples
- //for now assume userSpaceOnUse
//if objectBoundingBox is used, use a different matrix for light_vector
+ // UPDATE: trans is now correct matrix from primitiveUnits to
+ // 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);
{
SpotLight *sl = new SpotLight(light.spot, lighting_color, trans);
//TODO we need a reference to the filter to determine primitiveUnits
- //slot._arena_item->filter seems to be ok on simple examples
- //for now assume userSpaceOnUse
//if objectBoundingBox is used, use a different matrix for light_vector
+ // UPDATE: trans is now correct matrix from primitiveUnits to
+ // 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);
index 578b7ad4ad56a067077f9ff55cc9a04f3c6fcfe7..6de682972f2153a3fa7ab4bd5dd267bee28da14a 100644 (file)
#include "display/nr-light-types.h"
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
#include "sp-fedistantlight.h"
#include "sp-fepointlight.h"
FilterSpecularLighting();
static FilterPrimitive *create();
virtual ~FilterSpecularLighting();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual FilterTraits get_input_traits();
private:
index 39e2bff33c458b95213dd42d60001633ff98ba21..01453da39447111376981bd7b615fe57d85a0297 100644 (file)
*/
#include "display/nr-filter-tile.h"
+#include "display/nr-filter-units.h"
+
namespace NR {
FilterTile::FilterTile()
FilterTile::~FilterTile()
{}
-int FilterTile::render(FilterSlot &slot, Matrix const &trans) {
+int FilterTile::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = slot.get(_input);
NRPixBlock *out = new NRPixBlock;
index 56c26bd6630c14688c9fa2c93d6b4bf12c86405a..45d280d3957679f15fccce100b72994cad146569 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
#include "libnr/nr-matrix.h"
#include "libnr/nr-rect-l.h"
static FilterPrimitive *create();
virtual ~FilterTile();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void area_enlarge(NRRectL &area, Matrix const &trans);
virtual FilterTraits get_input_traits();
};
index b3938418f62ebbef667bfdd33b9e4ef42363ac86..addbbb66380e0f9d81cc7aa2562b67cdb0eeaa4f 100644 (file)
#include "display/nr-arena-item.h"
#include "display/nr-filter.h"
#include "display/nr-filter-turbulence.h"
+#include "display/nr-filter-units.h"
#include "display/nr-filter-utils.h"
#include <math.h>
updated=true;
}
-int FilterTurbulence::render(FilterSlot &slot, Matrix const &trans) {
+int FilterTurbulence::render(FilterSlot &slot, FilterUnits const &units) {
//g_warning("render");
if (!updated) update_pixbuffer(slot);
index 03c2e22a5ad4971d0d6bace6805718cd8a7842b0..144e3ec4cda5a5f3aafb5fac76c5b2b3dd0caacb 100644 (file)
#include "display/nr-filter-primitive.h"
#include "display/nr-filter-slot.h"
+#include "display/nr-filter-units.h"
namespace NR {
static FilterPrimitive *create();
virtual ~FilterTurbulence();
- virtual int render(FilterSlot &slot, Matrix const &trans);
+ virtual int render(FilterSlot &slot, FilterUnits const &units);
virtual void update_pixbuffer(FilterSlot &slot);
virtual void set_baseFrequency(int axis, double freq);
index 770d9d0a97e7f1acfdf99af3bf3696f9468d1fde..84e8180bc80c2fcbf44e7f3f128c2194124b65e9 100644 (file)
}
in = NULL; // in is now handled by FilterSlot, we should not touch it
- // TODO: filters may need both filterUnits and primitiveUnits,
- // so we should pass FilterUnits to render method, not just one Matrix
- Matrix primitiveunits2pixblock = units.get_matrix_primitiveunits2pb();
for (int i = 0 ; i < _primitive_count ; i++) {
- _primitive[i]->render(slot, primitiveunits2pixblock);
+ _primitive[i]->render(slot, units);
}
slot.get_final(_output_slot, pb);