diff --git a/src/display/nr-filter-specularlighting.cpp b/src/display/nr-filter-specularlighting.cpp
index d579bf5f7da932d814eb7793f9d73f38135744a6..3a14eb78f8af798a300b4f498bb91a9e927a8be4 100644 (file)
}while(0)
int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
- NRPixBlock *in = filter_get_alpha(slot.get(_input));
+ NRPixBlock *in = slot.get(_input);
if (!in) {
g_warning("Missing source image for feSpecularLighting (in=%d)", _input);
return 1;
Fvector L, N, LC, H;
gdouble inter;
- nr_pixblock_setup_fast(out, in->mode,
+ nr_pixblock_setup_fast(out, NR_PIXBLOCK_MODE_R8G8B8A8N,
in->area.x0, in->area.y0, in->area.x1, in->area.y1,
true);
unsigned char *data_i = NR_PIXBLOCK_PX (in);
@@ -108,7 +108,8 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_GREEN]);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_BLUE]);
- data_o[j++] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]);
+ data_o[j] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]);
+ ++j;
}
out->empty = FALSE;
delete dl;
@@ -135,7 +136,8 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_GREEN]);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_BLUE]);
- data_o[j++] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]);
+ data_o[j] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]);
+ ++j;
}
out->empty = FALSE;
delete pl;
@@ -162,7 +164,8 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_GREEN]);
data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_BLUE]);
- data_o[j++] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]);
+ data_o[j] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]);
+ ++j;
}
out->empty = FALSE;
delete sl;
@@ -180,8 +183,8 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
//finishing
slot.set(_output, out);
- nr_pixblock_release(in);
- delete in;
+ //nr_pixblock_release(in);
+ //delete in;
return 0;
}