summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 059bc86)
raw | patch | inline | side by side (parent: 059bc86)
author | kiirala <kiirala@users.sourceforge.net> | |
Fri, 4 Jan 2008 21:22:26 +0000 (21:22 +0000) | ||
committer | kiirala <kiirala@users.sourceforge.net> | |
Fri, 4 Jan 2008 21:22:26 +0000 (21:22 +0000) |
15 files changed:
index e5a3ca33f1d743199056320f87072be0bcab3a34..61f9970f1b2d0072d374283882cf78db62fe7fcf 100644 (file)
int FilterColorMatrix::render(FilterSlot &slot, FilterUnits const &/*units*/) {
NRPixBlock *in = slot.get(_input);
+ if (!in) {
+ g_warning("Missing source image for feColorMatrix (in=%d)", _input);
+ return 1;
+ }
+
NRPixBlock *out = new NRPixBlock;
nr_pixblock_setup_fast(out, in->mode,
diff --git a/src/display/nr-filter-component-transfer.cpp b/src/display/nr-filter-component-transfer.cpp
index 270e2296c2991fa153e0b85d39c9463d63ef99eb..9b20034022998ceabff5c74d13c0e8964b7c9c20 100644 (file)
int FilterComponentTransfer::render(FilterSlot &slot, FilterUnits const &/*units*/) {
NRPixBlock *in = slot.get(_input);
+ if (!in) {
+ g_warning("Missing source image for feComponentTransfer (in=%d)", _input);
+ return 1;
+ }
+
NRPixBlock *out = new NRPixBlock;
nr_pixblock_setup_fast(out, in->mode,
unsigned char *out_data = NR_PIXBLOCK_PX(out);
//IMPLEMENT ME!
+ g_warning("Renderer for feComponentTransfer is not implemented.");
(void)in_data;
(void)out_data;
index fe28c4b0b0f5299393887eb0a5127b334bf296c1..360ff6567efa5691d5ef50d22a2e6e3453bd716d 100644 (file)
int FilterConvolveMatrix::render(FilterSlot &slot, FilterUnits const &/*units*/) {
NRPixBlock *in = slot.get(_input);
+ if (!in) {
+ g_warning("Missing source image for feConvolveMatrix (in=%d)", _input);
+ return 1;
+ }
+
NRPixBlock *out = new NRPixBlock;
nr_pixblock_setup_fast(out, in->mode,
index 9ff3922e8d1c2b049b8d10ab7da40e0c18e76872..0fca4509547b918bd93ec117f37e1fdc435bc9f3 100644 (file)
int FilterDiffuseLighting::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = filter_get_alpha(slot.get(_input));
+ if (!in) {
+ g_warning("Missing source image for feDiffuseLighting (in=%d)", _input);
+ return 1;
+ }
+
NRPixBlock *out = new NRPixBlock;
int w = in->area.x1 - in->area.x0;
index 55576842bdc201d9821e2a9638ae0ca236d1adb2..7eade278957d171ed5e121d0b6f625e89747208b 100644 (file)
int FilterFlood::render(FilterSlot &slot, FilterUnits const &/*units*/) {
NRPixBlock *in = slot.get(_input);
+ if (!in) {
+ g_warning("Missing source image for feFlood (in=%d)", _input);
+ return 1;
+ }
+
NRPixBlock *out = new NRPixBlock;
nr_pixblock_setup_fast(out, in->mode,
index fdab94f1d7c82ba284fe2cfceb141cf088743fdd..a3fa37bd76ed7d9ae61ec70bb857dade288f43ca 100644 (file)
@@ -508,9 +508,14 @@ upsample(PT *const dst, int const dstr1, int const dstr2, unsigned int const dn1
int FilterGaussian::render(FilterSlot &slot, FilterUnits const &units)
{
- Matrix trans = units.get_matrix_primitiveunits2pb();
/* in holds the input pixblock */
NRPixBlock *in = slot.get(_input);
+ if (!in) {
+ g_warning("Missing source image for feGaussianBlur (in=%d)", _input);
+ return 1;
+ }
+
+ Matrix trans = units.get_matrix_primitiveunits2pb();
/* If to either direction, the standard deviation is zero or
* input image is not defined,
index 1aba770a37abe54df14bbb9e147a5ba40e23b963..72c05c797a6bdb9402f488b1dacd5263508f3c08 100644 (file)
nr_pixblock_setup_fast(dst, NR_PIXBLOCK_MODE_R8G8B8A8P,
src->area.x0, src->area.y0,
src->area.x1, src->area.y1, false);
+ if (!dst || (dst->size != NR_PIXBLOCK_SIZE_TINY && dst->data.px == NULL)) {
+ g_warning("Memory allocation failed in filter_get_alpha");
+ delete dst;
+ return NULL;
+ }
nr_blit_pixblock_pixblock(dst, src);
unsigned char *data = NR_PIXBLOCK_PX(dst);
index 2d32cc51abac4443f3e70e5aebb841982a5337e8..028744b5c4539c8ddc019ded69638bb0be9706f5 100644 (file)
}
int w,x,y;
NRPixBlock *in = slot.get(_input);
+ if (!in) {
+ g_warning("Missing source image for feImage (in=%d)", _input);
+ return 1;
+ }
+
NRPixBlock *out = new NRPixBlock;
int x0 = in->area.x0, y0 = in->area.y0;
index ed060b6495f15e4b4b1cb2003a363fb56e37a070..977d4fbf81aaa2cd5e1b50f03108acec95ea05e3 100644 (file)
NRPixBlock *out;
- // Bail out if either one of source images is missing
+ // Bail out if one of source images is missing
for (unsigned int i = 0 ; i < _input_image.size() ; i++) {
+ bool missing = false;
if (!in[i]) {
g_warning("Missing source image for feMerge (number=%d slot=%d)", i, _input_image[i]);
- return 1;
+ missing = true;
}
+ if (missing) return 1;
}
out = new NRPixBlock;
index abc529aadc8b746d1698192d467fd4bae15181de..4ef0b6ad3e5e25598c7165ebd70c63afb8de2b24 100644 (file)
int FilterMorphology::render(FilterSlot &slot, FilterUnits const &/*units*/) {
NRPixBlock *in = slot.get(_input);
+ if (!in) {
+ g_warning("Missing source image for feMorphology (in=%d)", _input);
+ return 1;
+ }
+
NRPixBlock *out = new NRPixBlock;
int x0=in->area.x0;
index 85df3351ff3d4e2312afcc78867cdf5aad5fd6aa..683c4f83d45fe859bf13c04a16dd19f9ea7f0c9f 100644 (file)
int FilterOffset::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = slot.get(_input);
- NRPixBlock *out = new NRPixBlock;
-
// Bail out if source image is missing
if (!in) {
g_warning("Missing source image for feOffset (in=%d)", _input);
return 1;
}
+ NRPixBlock *out = new NRPixBlock;
+
Matrix trans = units.get_matrix_primitiveunits2pb();
Point offset(dx, dy);
offset *= trans;
index 62a8717bb2c0e83bb4ad6b4a8ef0534bc0083765..432598b7cfe323c39f4356484a81f3aba0aa2873 100644 (file)
min_x, min_y,
max_x, max_y, true);
if (trans_pb->size != NR_PIXBLOCK_SIZE_TINY && trans_pb->data.px == NULL) {
- // memory allocation failed
+ /* TODO: this gets hit occasionally. Worst case scenario:
+ * 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)");
return;
}
transform_nearest(trans_pb, pb, trans);
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) {
- //memory allocation failed
+ g_warning("Memory allocation failed in NR::FilterSlot::set (scaling)");
return;
}
scale_bicubic(trans_pb, pb);
diff --git a/src/display/nr-filter-specularlighting.cpp b/src/display/nr-filter-specularlighting.cpp
index 3f459f164dbba5ecaef49062c2979fdcdcecb903..d579bf5f7da932d814eb7793f9d73f38135744a6 100644 (file)
int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) {
NRPixBlock *in = filter_get_alpha(slot.get(_input));
+ if (!in) {
+ g_warning("Missing source image for feSpecularLighting (in=%d)", _input);
+ return 1;
+ }
+
NRPixBlock *out = new NRPixBlock;
//Fvector *L = NULL; //vector to the light
index b058db2bc1e4eea82784f1bc3029a011b0836b64..565bc8c7eca316d6461d0f016831e04f3674c434 100644 (file)
int FilterTile::render(FilterSlot &slot, FilterUnits const &/*units*/) {
NRPixBlock *in = slot.get(_input);
+ if (!in) {
+ g_warning("Missing source image for feTile (in=%d)", _input);
+ return 1;
+ }
+
NRPixBlock *out = new NRPixBlock;
nr_pixblock_setup_fast(out, in->mode,
unsigned char *out_data = NR_PIXBLOCK_PX(out);
//IMPLEMENT ME!
+ g_warning("Renderer for feTile is not implemented.");
(void)in_data;
(void)out_data;
index 8d3bc290c32ab380d7d773b08606a1201ce29db0..74c229109ebbd6ae8793e6e3f8a6c1004eb766f2 100644 (file)
if (!pix){
pix = new NRPixBlock;
nr_pixblock_setup_fast(pix, NR_PIXBLOCK_MODE_R8G8B8A8N, bbox_x0, bbox_y0, bbox_x1, bbox_y1, true);
- pix_data = NR_PIXBLOCK_PX(pix);
}
else if (bbox_x0 != pix->area.x0 || bbox_y0 != pix->area.y0 ||
bbox_x1 != pix->area.x1 || bbox_y1 != pix->area.y1)
* width and height don't change */
nr_pixblock_release(pix);
nr_pixblock_setup_fast(pix, NR_PIXBLOCK_MODE_R8G8B8A8N, bbox_x0, bbox_y0, bbox_x1, bbox_y1, true);
- pix_data = NR_PIXBLOCK_PX(pix);
}
+ if (!pix || (pix->size != NR_PIXBLOCK_SIZE_TINY && pix->data.px == NULL)) {
+ /* TODO: Should render the visible area or something instead. */
+ g_warning("Unable to reserve image buffer for feTurbulence");
+ pix_data = NULL;
+ return;
+ }
+
+ pix_data = NR_PIXBLOCK_PX(pix);
+
TurbulenceInit((long)seed);
double point[2];
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(slot, area);
-
+ if (!pix_data) {
+ /* update_pixbuffer couldn't render the turbulence */
+ return 1;
+ }
NRPixBlock *in = slot.get(_input);
+ if (!in) {
+ g_warning("Missing source image for feTurbulence (in=%d)", _input);
+ return 1;
+ }
NRPixBlock *out = new NRPixBlock;
+
int x,y;
int x0 = in->area.x0, y0 = in->area.y0;
int x1 = in->area.x1, y1 = in->area.y1;