[gegl/samplers] Added GEGL_SAMPLER_MIPMAP_LEVELS



commit fcd1cd57672abc92a516620412d0a4ecf606888b
Author: Adam Turcotte <aturcotte src gnome org>
Date:   Mon Jun 27 17:24:56 2011 -0400

    Added GEGL_SAMPLER_MIPMAP_LEVELS

 gegl/buffer/gegl-sampler.c |    2 +-
 gegl/buffer/gegl-sampler.h |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index 6d522a5..4409e63 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -113,7 +113,7 @@ gegl_sampler_init (GeglSampler *self)
 {
   int i;
   self->buffer = NULL;
-  for (i=0; i<3; ++i) {
+  for (i=0; i<GEGL_SAMPLER_MIPMAP_LEVELS; ++i) {
     GeglRectangle context_rect = {0,0,1,1};
     GeglRectangle sampler_rectangle = {0,0,0,0};
     self->sampler_buffer[i] = NULL;
diff --git a/gegl/buffer/gegl-sampler.h b/gegl/buffer/gegl-sampler.h
index 8f90727..8b2b69c 100644
--- a/gegl/buffer/gegl-sampler.h
+++ b/gegl/buffer/gegl-sampler.h
@@ -31,6 +31,7 @@ G_BEGIN_DECLS
 #define GEGL_IS_SAMPLER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_SAMPLER))
 #define GEGL_IS_SAMPLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_SAMPLER))
 #define GEGL_SAMPLER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_SAMPLER, GeglSamplerClass))
+#define GEGL_SAMPLER_MIPMAP_LEVELS   3
 
 typedef struct _GeglSamplerClass GeglSamplerClass;
 typedef struct _GeglSampler    GeglSampler;
@@ -44,9 +45,9 @@ struct _GeglSampler
   Babl          *format;
   Babl          *interpolate_format;
   Babl          *fish;
-  GeglRectangle  context_rect[3];
-  gpointer       sampler_buffer[3];
-  GeglRectangle  sampler_rectangle[3];
+  GeglRectangle  context_rect[GEGL_SAMPLER_MIPMAP_LEVELS];
+  gpointer       sampler_buffer[GEGL_SAMPLER_MIPMAP_LEVELS];
+  GeglRectangle  sampler_rectangle[GEGL_SAMPLER_MIPMAP_LEVELS];
   GeglMatrix2   *inverse_jacobian;
   gdouble        x; /* mirrors the currently requested */
   gdouble        y; /* coordinates in the instance     */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]