diff options
author | Søren Sandmann Pedersen <sandmann@redhat.com> | 2008-10-06 19:34:20 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2008-10-06 19:34:20 -0400 |
commit | abbc0178bae8152a1ebec04683d6b2036271d165 (patch) | |
tree | 9d31aaa8ca396d0d77e023e2ce4998df3ea37834 | |
parent | 0e663ca0f24a1c9938d7d502434214c2d3374d2a (diff) |
More unimplemented filters
-rw-r--r-- | downscaling.c | 27 | ||||
-rw-r--r-- | downscaling.ui | 42 |
2 files changed, 66 insertions, 3 deletions
diff --git a/downscaling.c b/downscaling.c index d0dd3b9..2dbfb43 100644 --- a/downscaling.c +++ b/downscaling.c @@ -256,7 +256,7 @@ create_gaussian_kernel (int r, int *n_params) double v = (1 / (2 * G_PI * sigma * sigma)) * exp (-(j * j + i * i) / (2 * sigma * sigma)); - g_assert (idx < n_params); + g_assert (idx < *n_params); params[idx] = _cairo_fixed_16_16_from_double (v); @@ -303,11 +303,32 @@ set_nearest (pixman_image_t *image, int w, int h) pixman_image_set_filter (image, PIXMAN_FILTER_NEAREST, NULL, 0); } +static void +set_lanczos (pixman_image_t *image, int w, int h) +{ + g_error ("Lanczos filter is not implemented yet"); +} + +static void +set_box (pixman_image_t *image, int w, int h) +{ + g_error ("Box filter is not implemented yet"); +} + +static void +set_pixbuf (pixman_image_t *image, int w, int h) +{ + g_error ("Pixbuf filter is not implemented yet"); +} + static const filter_t filters[] = { { "nearest", set_nearest }, { "bilinear", set_bilinear }, - { "gaussian", set_gaussian /* FIXME */ }, + { "gaussian", set_gaussian }, + { "lanczos", set_lanczos }, + { "box", set_box }, + { "pixbuf", set_pixbuf }, { NULL }, }; @@ -444,7 +465,7 @@ main (int argc, char **argv) G_CALLBACK (gtk_widget_queue_draw), da); } - gtk_window_set_default_size (GTK_WINDOW (window), info.width, info.height); + gtk_widget_set_size_request (da, info.width, info.height); #if 0 g_print ("width %d, height %d, pixels: %p, stride: %d, format: %d\n", diff --git a/downscaling.ui b/downscaling.ui index 397d6a1..84aaeb0 100644 --- a/downscaling.ui +++ b/downscaling.ui @@ -92,6 +92,48 @@ const char *uidef = " <property name=\"position\">4</property>" \ " </packing>" \ " </child>" \ +" <child>" \ +" <object class=\"GtkRadioButton\" id=\"lanczos\">" \ +" <property name=\"visible\">True</property>" \ +" <property name=\"can_focus\">True</property>" \ +" <property name=\"label\" translatable=\"yes\">Lanczos</property>" \ +" <property name=\"active\">True</property>" \ +" <property name=\"draw_indicator\">True</property>" \ +" <property name=\"group\">nearest</property>" \ +" </object>" \ +" <packing>" \ +" <property name=\"expand\">False</property>" \ +" <property name=\"position\">5</property>" \ +" </packing>" \ +" </child>" \ +" <child>" \ +" <object class=\"GtkRadioButton\" id=\"pixbuf\">" \ +" <property name=\"visible\">True</property>" \ +" <property name=\"can_focus\">True</property>" \ +" <property name=\"label\" translatable=\"yes\">Similar to GdkPixbuf</property>" \ +" <property name=\"active\">True</property>" \ +" <property name=\"draw_indicator\">True</property>" \ +" <property name=\"group\">nearest</property>" \ +" </object>" \ +" <packing>" \ +" <property name=\"expand\">False</property>" \ +" <property name=\"position\">6</property>" \ +" </packing>" \ +" </child>" \ +" <child>" \ +" <object class=\"GtkRadioButton\" id=\"box\">" \ +" <property name=\"visible\">True</property>" \ +" <property name=\"can_focus\">True</property>" \ +" <property name=\"label\" translatable=\"yes\">Box Filter</property>" \ +" <property name=\"active\">True</property>" \ +" <property name=\"draw_indicator\">True</property>" \ +" <property name=\"group\">nearest</property>" \ +" </object>" \ +" <packing>" \ +" <property name=\"expand\">False</property>" \ +" <property name=\"position\">7</property>" \ +" </packing>" \ +" </child>" \ " </object>" \ " <packing>" \ " <property name=\"expand\">False</property>" \ |