Skip to content
Browse files

Fixed coordinate transformation bug.

  • Loading branch information...
1 parent cbcd5b2 commit 87b646ac5c4755714b6a85c858f120698dda550f @schani committed Aug 16, 2009
Showing with 30 additions and 33 deletions.
  1. +27 −6 TODO
  2. +1 −13 backends/cc.c
  3. +2 −14 backends/llvm.cpp
View
33 TODO
@@ -7,7 +7,7 @@
*** TODO why does syntax highlighting not work completely in WinGimp? :bug:
** General
-*** DONE What's userval_t->type for? :simplify:
+*** DONE What's =userval_t->type= for? :simplify:
CLOSED: [2009-08-15 Sat 23:09]
Not needed anymore.
@@ -22,6 +22,24 @@
CLOSED: [2009-08-15 Sat 22:16]
** Compiler
+*** DONE We still have some bugs in the coordinate transformations :bug:
+ CLOSED: [2009-08-16 Sun 23:17]
+ This does not work as expected if the aspect ratios of in1 and in2
+ are different:
+
+ #+BEGIN_SRC mathmap
+ filter bla_ident (image in)
+ in(xy)
+ end
+
+ filter bla (image in, image in2)
+ bla_ident(in2,xy)
+ end
+ #+END_SRC
+
+ It turns out the problem here is that closures get their pixel
+ size from their first image, which is wrong. It should always be
+ the same for all closures, namely the canvas size.
*** DONE Profile the compilation of Gaussian Blur->Spin Zoom->Droste :performance:
CLOSED: [2009-08-16 Sun 00:24]
Most of the time is spent in GCC compiling the C code. Without
@@ -38,6 +56,9 @@ So does Gaussian Blur->Random Blur->Droste
* 1.3.x
** GIMP Plug-In
+*** TODO We have a one-pixel offset between fast and slow preview again :bug:
+ Just try ident filter and turn fast preview on and off.
+*** TODO MathMap crashes if a drawable is selected that was already closed in GIMP :bug:
*** TODO speed up rendering of GIMP drawables by processing tile for tile :performance:
*** TODO make preview input drawables to be floatmaps :simplify:
*** TODO UI via GtkBuilder/Glade :simplify:
@@ -121,7 +142,7 @@ course =lazy= would only be used for expensive operations.
requires pools in the folders
*** TODO make internals typed
*** TODO don't produce functions for filters which have been optimized away :performance:
-*** TODO short circuit execution for && etc in compiler :feature:performance:
+*** TODO short circuit execution for =&&= etc in compiler :feature:performance:
** LLVM
*** TODO implement mathfuncs :performance:simplify:
@@ -597,11 +618,11 @@ manual: WH,W,H statt wh,w,h
koordinatensystem erklaeren
-> (i) Die M�glichkeit, bei 'user_slider(name,minimum,maximum)' als 'maximum'
-> und 'minimum' Ausdr�cke anzugeben, die von den Variablen 'X(nil:1)' und
-> 'Y(nil:1)' abh�ngen.
+> (i) Die Moeglichkeit, bei 'user_slider(name,minimum,maximum)' als 'maximum'
+> und 'minimum' Ausdruecke anzugeben, die von den Variablen 'X(nil:1)' und
+> 'Y(nil:1)' abhaengen.
>
-> (ii) Einen voreingestellten Wert f�r 'userslider' festzulegen (mit der
+> (ii) Einen voreingestellten Wert fuer 'userslider' festzulegen (mit der
> gleichen Methode wie unter (i)).
View
14 backends/cc.c
@@ -160,7 +160,6 @@ output_make_mathmap_filter_closure (FILE *out, const char *var_name,
{
int num_args = compiler_num_filter_args(filter) - 3;
int i;
- gboolean have_size;
userval_info_t *info;
g_assert(filter->kind == FILTER_MATHMAP);
@@ -177,28 +176,17 @@ output_make_mathmap_filter_closure (FILE *out, const char *var_name,
var_name, filter->name,
var_name, filter->name);
- have_size = FALSE;
for (i = 0, info = filter->userval_infos;
info != 0;
++i, info = info->next)
{
fprintf(out, "CLOSURE_IMAGE_ARGS(%s)[%d].v.%s = ", var_name, i, userval_element_name(info));
output_primary(out, &args[i]);
fprintf(out, "; ");
- if (info->type == USERVAL_IMAGE && !have_size)
- {
- fprintf(out,
- "%s->pixel_width = IMAGE_PIXEL_WIDTH(CLOSURE_IMAGE_ARGS(%s)[%d].v.image);"
- "%s->pixel_height = IMAGE_PIXEL_HEIGHT(CLOSURE_IMAGE_ARGS(%s)[%d].v.image);\n",
- var_name, var_name, i,
- var_name, var_name, i);
- have_size = TRUE;
- }
}
g_assert(i == num_args);
- if (!have_size)
- fprintf(out, "image->pixel_width = __canvasPixelW; image->pixel_height = __canvasPixelH;\n");
+ fprintf(out, "image->pixel_width = __canvasPixelW; image->pixel_height = __canvasPixelH;\n");
}
static void
View
16 backends/llvm.cpp
@@ -553,7 +553,6 @@ code_emitter::emit_closure (filter_t *closure_filter, primary_t *args)
{
int num_args = compiler_num_filter_args(closure_filter) - 3;
Value *closure = NULL, *uservals;
- bool have_size;
userval_info_t *info;
int i;
@@ -580,7 +579,6 @@ code_emitter::emit_closure (filter_t *closure_filter, primary_t *args)
pools_arg,
make_int_const(compiler_num_filter_args(closure_filter) - 3));
- have_size = FALSE;
for (i = 0, info = closure_filter->userval_infos;
info != 0;
++i, info = info->next)
@@ -593,23 +591,13 @@ code_emitter::emit_closure (filter_t *closure_filter, primary_t *args)
arg = promote(arg, TYPE_FLOAT);
builder->CreateCall3(module->getFunction(string(set_func_name)), uservals, make_int_const(i), arg);
-
- if (closure_filter->kind == FILTER_MATHMAP
- && info->type == USERVAL_IMAGE
- && !have_size)
- {
- builder->CreateCall2(module->getFunction(string("set_closure_size_from_image")), closure, arg);
- have_size = true;
- }
}
g_assert(i == num_args);
if (closure_filter->kind == FILTER_MATHMAP)
{
- if (!have_size)
- builder->CreateCall3(module->getFunction(string("set_closure_pixel_size")),
- closure, lookup_internal("__canvasPixelW"), lookup_internal("__canvasPixelH"));
-
+ builder->CreateCall3(module->getFunction(string("set_closure_pixel_size")),
+ closure, lookup_internal("__canvasPixelW"), lookup_internal("__canvasPixelH"));
return closure;
}
else

0 comments on commit 87b646a

Please sign in to comment.
Something went wrong with that request. Please try again.