Merging r50248 through r50264 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Aug 2012 12:49:10 +0000 (12:49 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Aug 2012 12:49:10 +0000 (12:49 +0000)
1  2 
source/blender/blenkernel/BKE_image.h
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/image.c
source/blender/editors/space_image/image_ops.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_nodetree.c

index b1ca348be86fb0b774f8c214866bf9e3b134d2f8,10f10cb1d138eac1c0ebcaf33f34b5927549136b..6e0dec33453f604b9ba83ab971e1d5575434fd41
@@@ -64,7 -64,6 +64,7 @@@ int     BKE_imtype_is_movie(const char 
  int     BKE_imtype_supports_zbuf(const char imtype);
  int     BKE_imtype_supports_compress(const char imtype);
  int     BKE_imtype_supports_quality(const char imtype);
 +int     BKE_imtype_supports_float(const char imtype);
  char    BKE_imtype_valid_channels(const char imtype);
  char    BKE_imtype_valid_depths(const char imtype);
  
@@@ -107,6 -106,12 +107,12 @@@ struct RenderResult
  #define IMA_TYPE_R_RESULT   4
  #define IMA_TYPE_COMPOSITE  5
  
+ enum {
+       IMA_GENTYPE_BLANK = 0,
+       IMA_GENTYPE_GRID = 1,
+       IMA_GENTYPE_GRID_COLOR = 2
+ };
  /* ima->ok */
  #define IMA_OK              1
  #define IMA_OK_LOADED       2
index 5138d68cf790e75e1c646d48f49c1a9e3a724ce7,d65c81b4f9befabe21a60cc883722b888a8a5ae2..252add2c4233bbee3db482ec9c96045b9cc3e32b
@@@ -49,7 -49,6 +49,7 @@@
  #include "BKE_fcurve.h"
  
  
 +#include "IMB_colormanagement.h"
  #include "IMB_imbuf.h"
  #include "IMB_imbuf_types.h"
  
@@@ -106,9 -105,18 +106,18 @@@ void curvemapping_free_data(CurveMappin
        int a;
  
        for (a = 0; a < CM_TOT; a++) {
-               if (cumap->cm[a].curve) MEM_freeN(cumap->cm[a].curve);
-               if (cumap->cm[a].table) MEM_freeN(cumap->cm[a].table);
-               if (cumap->cm[a].premultable) MEM_freeN(cumap->cm[a].premultable);
+               if (cumap->cm[a].curve) {
+                       MEM_freeN(cumap->cm[a].curve);
+                       cumap->cm[a].curve = NULL;
+               }
+               if (cumap->cm[a].table) {
+                       MEM_freeN(cumap->cm[a].table);
+                       cumap->cm[a].table = NULL;
+               }
+               if (cumap->cm[a].premultable) {
+                       MEM_freeN(cumap->cm[a].premultable);
+                       cumap->cm[a].premultable = NULL;
+               }
        }
  }
  
@@@ -1249,48 -1257,3 +1258,48 @@@ void scopes_new(Scopes *scopes
        scopes->waveform_3 = NULL;
        scopes->vecscope = NULL;
  }
 +
 +void BKE_color_managed_display_settings_init(ColorManagedDisplaySettings *settings)
 +{
 +      const char *display_name = IMB_colormanagement_display_get_default_name();
 +
 +      BLI_strncpy(settings->display_device, display_name, sizeof(settings->display_device));
 +}
 +
 +void BKE_color_managed_display_settings_copy(ColorManagedDisplaySettings *new_settings,
 +                                             const ColorManagedDisplaySettings *settings)
 +{
 +      BLI_strncpy(new_settings->display_device, settings->display_device, sizeof(new_settings->display_device));
 +}
 +
 +void BKE_color_managed_view_settings_init(ColorManagedViewSettings *settings)
 +{
 +      /* OCIO_TODO: use default view transform here when OCIO is completely integrated
 +      *             and proper versioning stuff is added.
 +      *             for now use NONE to be compatible with all current files
 +      */
 +      BLI_strncpy(settings->view_transform, "NONE", sizeof(settings->view_transform));
 +
 +      settings->gamma = 1.0f;
 +      settings->exposure = 0.0f;
 +}
 +
 +void BKE_color_managed_view_settings_copy(ColorManagedViewSettings *new_settings,
 +                                          const ColorManagedViewSettings *settings)
 +{
 +      BLI_strncpy(new_settings->view_transform, settings->view_transform, sizeof(new_settings->view_transform));
 +
 +      new_settings->exposure = settings->exposure;
 +      new_settings->gamma = settings->gamma;
 +}
 +
 +void BKE_color_managed_colorspace_settings_init(ColorManagedColorspaceSettings *colorspace_settings)
 +{
 +      BLI_strncpy(colorspace_settings->name, "NONE", sizeof(colorspace_settings->name));
 +}
 +
 +void BKE_color_managed_colorspace_settings_copy(ColorManagedColorspaceSettings *colorspace_settings,
 +                                                const ColorManagedColorspaceSettings *settings)
 +{
 +      BLI_strncpy(colorspace_settings->name, settings->name, sizeof(colorspace_settings->name));
 +}
index af1fc1bf8cf3b593130b1c8963752e1649d06128,6201473f317d12989c878d928259aed040de5485..d74a7f6e374781822350147076fa7d75ee0ca6a7
@@@ -47,7 -47,6 +47,7 @@@
  
  #include "MEM_guardedalloc.h"
  
 +#include "IMB_colormanagement.h"
  #include "IMB_imbuf_types.h"
  #include "IMB_imbuf.h"
  
@@@ -71,7 -70,6 +71,7 @@@
  #include "BLI_bpath.h"
  
  #include "BKE_bmfont.h"
 +#include "BKE_colortools.h"
  #include "BKE_global.h"
  #include "BKE_icons.h"
  #include "BKE_image.h"
@@@ -246,8 -244,6 +246,8 @@@ static Image *image_alloc(const char *n
  
                ima->source = source;
                ima->type = type;
 +
 +              BKE_color_managed_colorspace_settings_init(&ima->colorspace_settings);
        }
        return ima;
  }
@@@ -330,8 -326,6 +330,8 @@@ Image *BKE_image_copy(Image *ima
        nima->aspx = ima->aspx;
        nima->aspy = ima->aspy;
  
 +      BKE_color_managed_colorspace_settings_copy(&nima->colorspace_settings, &ima->colorspace_settings);
 +
        return nima;
  }
  
@@@ -601,7 -595,7 +601,7 @@@ Image *BKE_image_load_exists(const cha
        return BKE_image_load(filepath);
  }
  
- static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4])
+ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, float color[4])
  {
        ImBuf *ibuf;
        unsigned char *rect = NULL;
        BLI_strncpy(ibuf->name, name, sizeof(ibuf->name));
        ibuf->userflags |= IB_BITMAPDIRTY;
  
-       switch (uvtestgrid) {
-               case 1:
+       switch (gen_type) {
+               case IMA_GENTYPE_GRID:
                        BKE_image_buf_fill_checker(rect, rect_float, width, height);
                        break;
-               case 2:
+               case IMA_GENTYPE_GRID_COLOR:
                        BKE_image_buf_fill_checker_color(rect, rect_float, width, height);
                        break;
                default:
  }
  
  /* adds new image block, creates ImBuf and initializes color */
- Image *BKE_image_add_generated(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4])
+ Image *BKE_image_add_generated(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, float color[4])
  {
        /* on save, type is changed to FILE in editsima.c */
        Image *ima = image_alloc(name, IMA_SRC_GENERATED, IMA_TYPE_UV_TEST);
                /* BLI_strncpy(ima->name, name, FILE_MAX); */ /* don't do this, this writes in ain invalid filepath! */
                ima->gen_x = width;
                ima->gen_y = height;
-               ima->gen_type = uvtestgrid;
+               ima->gen_type = gen_type;
                ima->gen_flag |= (floatbuf ? IMA_GEN_FLOAT : 0);
  
-               ibuf = add_ibuf_size(width, height, ima->name, depth, floatbuf, uvtestgrid, color);
+               ibuf = add_ibuf_size(width, height, ima->name, depth, floatbuf, gen_type, color);
                image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
  
                ima->ok = IMA_OK_LOADED;
@@@ -1016,20 -1010,6 +1016,20 @@@ int BKE_imtype_supports_quality(const c
        return 0;
  }
  
 +int BKE_imtype_supports_float(const char imtype)
 +{
 +      switch (imtype) {
 +              case R_IMF_IMTYPE_CINEON:
 +              case R_IMF_IMTYPE_DPX:
 +              case R_IMF_IMTYPE_RADHDR:
 +              case R_IMF_IMTYPE_OPENEXR:
 +              case R_IMF_IMTYPE_MULTILAYER:
 +              case R_IMF_IMTYPE_JP2:
 +                      return TRUE;
 +      }
 +      return 0;
 +}
 +
  char BKE_imtype_valid_channels(const char imtype)
  {
        char chan_flag = IMA_CHAN_FLAG_RGB; /* assume all support rgb */
@@@ -2213,9 -2193,6 +2213,9 @@@ static void image_create_multilayer(Ima
  /* common stuff to do with images after loading */
  static void image_initialize_after_load(Image *ima, ImBuf *ibuf)
  {
 +      /* make float buffer stored in ImBuf scene linear space */
 +      IMB_colormanagement_imbuf_make_scene_linear(ibuf, &ima->colorspace_settings);
 +
        /* preview is NULL when it has never been used as an icon before */
        if (G.background == 0 && ima->preview == NULL)
                BKE_icon_changed(BKE_icon_getid(&ima->id));
@@@ -2583,23 -2560,13 +2583,23 @@@ static ImBuf *image_get_render_result(I
                image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
        }
  
 +      /* invalidate color managed buffers if render result changed */
 +      BLI_lock_thread(LOCK_COLORMANAGE);
 +      if (ibuf->x != rres.rectx || ibuf->y != rres.recty || ibuf->rect_float != rectf) {
 +              IMB_display_buffer_invalidate(ibuf);
 +      }
 +
        ibuf->x = rres.rectx;
        ibuf->y = rres.recty;
  
        /* free rect buffer if float buffer changes, so it can be recreated with
         * the updated result, and also in case we got byte buffer from sequencer,
         * so we don't keep reference to freed buffer */
 -      if (ibuf->rect_float != rectf || rect || !rectf)
 +      
 +      /* todo: this fix breaks save buffers render progress 
 +         if (ibuf->rect_float != rectf || rect || !rectf) */
 +
 +      if (ibuf->rect_float != rectf || rect)
                imb_freerectImBuf(ibuf);
  
        if (rect)
                ibuf->flags &= ~IB_zbuffloat;
        }
  
 +      BLI_unlock_thread(LOCK_COLORMANAGE);
 +
        /* since its possible to access the buffer from the image directly, set the profile [#25073] */
        ibuf->profile = (iuser->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) ? IB_PROFILE_LINEAR_RGB : IB_PROFILE_NONE;
        ibuf->dither = dither;
index 0b5216a98932b998d287707082aaa3dabfc06bd9,3eeae1f16de1c45d2ee3d2f7ce1999acec385a66..43e4db16b7d6c4c1fd2e3145f418bdd877ea5623
@@@ -55,7 -55,6 +55,7 @@@
  #include "BKE_report.h"
  #include "BKE_screen.h"
  
 +#include "IMB_colormanagement.h"
  #include "IMB_imbuf.h"
  #include "IMB_imbuf_types.h"
  
@@@ -1052,7 -1051,7 +1052,7 @@@ static int image_replace_invoke(bContex
                return image_replace_exec(C, op);
  
        if (!RNA_struct_property_is_set(op->ptr, "relative_path"))
-               RNA_boolean_set(op->ptr, "relative_path", (strncmp(sima->image->name, "//", 2)) == 0);
+               RNA_boolean_set(op->ptr, "relative_path", BLI_path_is_rel(sima->image->name));
  
        image_filesel(C, op, sima->image->name);
  
@@@ -1169,10 -1168,6 +1169,10 @@@ static int save_image_options_init(Save
                        }
                        BLI_path_abs(simopts->filepath, G.main->name);
                }
 +
 +              /* color management */
 +              BKE_color_managed_display_settings_copy(&simopts->im_format.display_settings, &scene->display_settings);
 +              BKE_color_managed_view_settings_copy(&simopts->im_format.view_settings, &scene->view_settings);
        }
  
        ED_space_image_release_buffer(sima, lock);
@@@ -1201,38 -1196,6 +1201,38 @@@ static void save_image_options_to_op(Sa
        RNA_string_set(op->ptr, "filepath", simopts->filepath);
  }
  
 +static ImBuf *save_image_colormanaged_imbuf_acquire(ImBuf *ibuf, SaveImageOptions *simopts, void **cache_handle)
 +{
 +      ImageFormatData *imf = &simopts->im_format;
 +      ImBuf *colormanaged_ibuf;
 +      int do_colormanagement;
 +
 +      *cache_handle = NULL;
 +      do_colormanagement = !BKE_imtype_supports_float(imf->imtype);
 +
 +      if (do_colormanagement) {
 +              unsigned char *display_buffer =
 +                      IMB_display_buffer_acquire(ibuf, &imf->view_settings, &imf->display_settings, cache_handle);
 +
 +              if (*cache_handle) {
 +                      colormanaged_ibuf = IMB_allocImBuf(ibuf->x, ibuf->y, ibuf->planes, 0);
 +                      colormanaged_ibuf->rect = (unsigned int *) display_buffer;
 +              }
 +              else {
 +                      /* no cache handle means color management didn't run transformation
 +                       * or performed transformation to image's byte buffer which doesn't
 +                       * require allocating new image buffer
 +                       */
 +                      colormanaged_ibuf = ibuf;
 +              }
 +      }
 +      else {
 +              colormanaged_ibuf = ibuf;
 +      }
 +
 +      return colormanaged_ibuf;
 +}
 +
  /* assumes name is FILE_MAX */
  /* ima->name and ibuf->name should end up the same */
  static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveImageOptions *simopts, int do_newpath)
        ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
  
        if (ibuf) {
 +              void *cache_handle;
 +              ImBuf *colormanaged_ibuf;
                const char *relbase = ID_BLEND_PATH(CTX_data_main(C), &ima->id);
                const short relative = (RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path"));
                const short save_copy = (RNA_struct_find_property(op->ptr, "copy") && RNA_boolean_get(op->ptr, "copy"));
                                ibuf->planes = BKE_imbuf_alpha_test(ibuf) ? 32 : 24;
                        }
                }
 -              
 +
 +              colormanaged_ibuf = save_image_colormanaged_imbuf_acquire(ibuf, simopts, &cache_handle);
 +
                if (simopts->im_format.imtype == R_IMF_IMTYPE_MULTILAYER) {
                        Scene *scene = CTX_data_scene(C);
                        RenderResult *rr = BKE_image_acquire_renderresult(scene, ima);
                        BKE_image_release_renderresult(scene, ima);
                }
                else {
 -                      if (BKE_imbuf_write_as(ibuf, simopts->filepath, &simopts->im_format, save_copy)) {
 +                      if (BKE_imbuf_write_as(colormanaged_ibuf, simopts->filepath, &simopts->im_format, save_copy)) {
                                ok = TRUE;
                        }
                }
                WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, sima->image);
  
                WM_cursor_wait(0);
 +
 +              if (cache_handle) {
 +                      colormanaged_ibuf->rect = NULL;
 +                      IMB_freeImBuf(colormanaged_ibuf);
 +
 +                      IMB_display_buffer_release(cache_handle);
 +              }
        }
  
        ED_space_image_release_buffer(sima, lock);
@@@ -1437,7 -1389,7 +1437,7 @@@ static void image_save_as_draw(bContex
  
        /* image template */
        RNA_pointer_create(NULL, &RNA_ImageFormatSettings, imf, &ptr);
 -      uiTemplateImageSettings(layout, &ptr);
 +      uiTemplateImageSettings(layout, &ptr, TRUE);
  
        /* main draw call */
        RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
@@@ -1634,7 -1586,7 +1634,7 @@@ static int image_new_exec(bContext *C, 
        PropertyRNA *prop;
        char name[MAX_ID_NAME - 2];
        float color[4];
-       int width, height, floatbuf, uvtestgrid, alpha;
+       int width, height, floatbuf, gen_type, alpha;
  
        /* retrieve state */
        sima = CTX_wm_space_image(C);
        width = RNA_int_get(op->ptr, "width");
        height = RNA_int_get(op->ptr, "height");
        floatbuf = RNA_boolean_get(op->ptr, "float");
-       uvtestgrid = RNA_boolean_get(op->ptr, "uv_test_grid");
+       gen_type = RNA_enum_get(op->ptr, "generated_type");
        RNA_float_get_array(op->ptr, "color", color);
        alpha = RNA_boolean_get(op->ptr, "alpha");
        
        if (!alpha)
                color[3] = 1.0f;
  
-       ima = BKE_image_add_generated(width, height, name, alpha ? 32 : 24, floatbuf, uvtestgrid, color);
+       ima = BKE_image_add_generated(width, height, name, alpha ? 32 : 24, floatbuf, gen_type, color);
  
        if (!ima)
                return OPERATOR_CANCELLED;
@@@ -1712,7 -1664,8 +1712,8 @@@ void IMAGE_OT_new(wmOperatorType *ot
        prop = RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color", 0.0f, 1.0f);
        RNA_def_property_float_array_default(prop, default_color);
        RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel");
-       RNA_def_boolean(ot->srna, "uv_test_grid", 0, "UV Test Grid", "Fill the image with a grid for UV map testing");
+       RNA_def_enum(ot->srna, "generated_type", image_generated_type_items, IMA_GENTYPE_BLANK,
+                    "Generated Type", "Fill the image with a grid for UV map testing");
        RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth");
  }
  
@@@ -1987,14 -1940,12 +1988,14 @@@ typedef struct ImageSampleInfo 
        int draw;
  } ImageSampleInfo;
  
 -static void image_sample_draw(const bContext *UNUSED(C), ARegion *ar, void *arg_info)
 +static void image_sample_draw(const bContext *C, ARegion *ar, void *arg_info)
  {
        ImageSampleInfo *info = arg_info;
        if (info->draw) {
 +              Scene *scene = CTX_data_scene(C);
 +
                /* no color management needed for images (color_manage=0) */
 -              ED_image_draw_info(ar, 0, info->channels, info->x, info->y, info->colp, info->colfp, info->zp, info->zfp);
 +              ED_image_draw_info(scene, ar, 0, info->channels, info->x, info->y, info->colp, info->colfp, info->zp, info->zfp);
        }
  }
  
index ed933181a7bbdfc64a9e0ee1d2553b3f0dc8d4c3,62a0688861300cbb995b46a5b7431ac297c876dd..0c3814f72d610087ef1387afe7f5a9baa2cecb5c
  #include "WM_types.h"
  #include "WM_api.h"
  
+ EnumPropertyItem image_generated_type_items[] = {
+       {IMA_GENTYPE_BLANK, "BLANK", 0, "Blank", "Generate a blank image"},
+       {IMA_GENTYPE_GRID, "UV_GRID", 0, "UV Grid", "Generated grid to test UV mappings"},
+       {IMA_GENTYPE_GRID_COLOR, "COLOR_GRID", 0, "Color Grid", "Generated improved UV grid to test UV mappings"},
+       {0, NULL, 0, NULL, NULL}
+ };
  static EnumPropertyItem image_source_items[] = {
        {IMA_SRC_FILE, "FILE", 0, "Single Image", "Single image file"},
        {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"},
@@@ -436,12 -443,6 +443,6 @@@ static void rna_def_image(BlenderRNA *b
                {IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""},
                {0, NULL, 0, NULL, NULL}
        };
-       static const EnumPropertyItem prop_generated_type_items[] = {
-               {0, "BLANK", 0, "Blank", "Generate a blank image"},
-               {1, "UV_GRID", 0, "UV Grid", "Generated grid to test UV mappings"},
-               {2, "COLOR_GRID", 0, "Color Grid", "Generated improved UV grid to test UV mappings"},
-               {0, NULL, 0, NULL, NULL}
-       };
        static const EnumPropertyItem prop_mapping_items[] = {
                {0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"},
                {IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"},
        /* generated image (image_generated_change_cb) */
        prop = RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "gen_type");
-       RNA_def_property_enum_items(prop, prop_generated_type_items);
+       RNA_def_property_enum_items(prop, image_generated_type_items);
        RNA_def_property_ui_text(prop, "Generated Type", "Generated image type");
        RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update");
  
        RNA_def_property_dynamic_array_funcs(prop, "rna_Image_pixels_get_length");
        RNA_def_property_float_funcs(prop, "rna_Image_pixels_get", "rna_Image_pixels_set", NULL);
  
 +      prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_pointer_sdna(prop, NULL, "colorspace_settings");
 +      RNA_def_property_struct_type(prop, "ColorManagedColorspaceSettings");
 +      RNA_def_property_ui_text(prop, "Colorspace Settings", "Input color space settings");
 +
        RNA_api_image(srna);
  }
  
index b66a5e4567a3ed2c82d7b9e6e5ba670f9b4b9056,2f763a6ed0e4c4c429e12dae9819430e7c244c7d..55dda3fc3150b2a2f59e594b76d77477c1152689
@@@ -133,6 -133,14 +133,14 @@@ EnumPropertyItem node_filter_items[] = 
        {0, NULL, 0, NULL, NULL}
  };
  
+ EnumPropertyItem node_sampler_type_items[] = {
+       {0, "NEAREST",   0, "Nearest",   ""},
+       {1, "BILINEAR",   0, "Bilinear",   ""},
+       {2, "BICUBIC", 0, "Bicubic", ""},
+       {0, NULL, 0, NULL, NULL}
+ };
  EnumPropertyItem prop_noise_basis_items[] = {
        {SHD_NOISE_PERLIN, "PERLIN", 0, "Perlin", ""},
        {SHD_NOISE_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", ""},
@@@ -1518,15 -1526,6 +1526,15 @@@ static void def_sh_tex_image(StructRNA 
                {0, NULL, 0, NULL, NULL}
        };
  
 +      static const EnumPropertyItem prop_projection_items[] = {
 +              {SHD_PROJ_FLAT, "FLAT", 0, "Flat",
 +                              "Image is projected flat using the X and Y coordinates of the texture vector"},
 +              {SHD_PROJ_BOX,  "BOX", 0, "Box",
 +                              "Image is projected using different components for each side of the object space bounding box"},
 +              {0, NULL, 0, NULL, NULL}
 +      };
 +
 +
        PropertyRNA *prop;
  
        prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
        RNA_def_property_ui_text(prop, "Color Space", "Image file color space");
        RNA_def_property_update(prop, 0, "rna_Node_update");
  
 +      prop = RNA_def_property(srna, "projection", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_items(prop, prop_projection_items);
 +      RNA_def_property_ui_text(prop, "Projection", "Method to project 2D image on object with a 3D texture vector");
 +      RNA_def_property_update(prop, 0, "rna_Node_update");
 +
 +      prop = RNA_def_property(srna, "projection_blend", PROP_FLOAT, PROP_FACTOR);
 +      RNA_def_property_ui_text(prop, "Projection Blend", "For box projection, amount of blend to use between sides");
 +      RNA_def_property_update(prop, 0, "rna_Node_update");
 +
        prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
        RNA_def_property_pointer_sdna(prop, NULL, "iuser");
@@@ -1598,43 -1588,6 +1606,43 @@@ static void def_sh_tex_checker(StructRN
        def_sh_tex(srna);
  }
  
 +static void def_sh_tex_brick(StructRNA *srna)
 +{
 +      PropertyRNA *prop;
 +      
 +      RNA_def_struct_sdna_from(srna, "NodeTexBrick", "storage");
 +      def_sh_tex(srna);
 +      
 +      prop = RNA_def_property(srna, "offset_frequency", PROP_INT, PROP_NONE);
 +      RNA_def_property_int_sdna(prop, NULL, "offset_freq");
 +      RNA_def_property_int_default(prop, 2);
 +      RNA_def_property_range(prop, 1, 99);
 +      RNA_def_property_ui_text(prop, "Offset Frequency", "");
 +      RNA_def_property_update(prop, 0, "rna_Node_update");
 +      
 +      prop = RNA_def_property(srna, "squash_frequency", PROP_INT, PROP_NONE);
 +      RNA_def_property_int_sdna(prop, NULL, "squash_freq");
 +      RNA_def_property_int_default(prop, 2);
 +      RNA_def_property_range(prop, 1, 99);
 +      RNA_def_property_ui_text(prop, "Squash Frequency", "");
 +      RNA_def_property_update(prop, 0, "rna_Node_update");
 +      
 +      prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "offset");
 +      RNA_def_property_float_default(prop, 0.5f);
 +      RNA_def_property_range(prop, 0.0f, 1.0f);
 +      RNA_def_property_ui_text(prop, "Offset Amount", "");
 +      RNA_def_property_update(prop, 0, "rna_Node_update");
 +      
 +      prop = RNA_def_property(srna, "squash", PROP_FLOAT, PROP_NONE);
 +      RNA_def_property_float_sdna(prop, NULL, "squash");
 +      RNA_def_property_float_default(prop, 1.0f);
 +      RNA_def_property_range(prop, 0.0f, 99.0f);
 +      RNA_def_property_ui_text(prop, "Squash Amount", "");
 +      RNA_def_property_update(prop, 0, "rna_Node_update");
 +      
 +}
 +
  static void def_sh_tex_magic(StructRNA *srna)
  {
        PropertyRNA *prop;
@@@ -2216,7 -2169,7 +2224,7 @@@ static void def_cmp_despeckle(StructRN
        prop = RNA_def_property(srna, "threshold_neighbour", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "custom4");
        RNA_def_property_range(prop, 0.0, 1.0f);
-       RNA_def_property_ui_text(prop, "Neighbour", "Threshold for the number of neighbour pixels that must match");
+       RNA_def_property_ui_text(prop, "Neighbor", "Threshold for the number of neighbor pixels that must match");
        RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
  }
  
@@@ -2268,16 -2221,9 +2276,9 @@@ static void def_cmp_rotate(StructRNA *s
  {
        PropertyRNA *prop;
        
-       static EnumPropertyItem rotate_items[] = {
-               {0, "NEAREST",   0, "Nearest",   ""},
-               {1, "BILINEAR",   0, "Bilinear",   ""},
-               {2, "BICUBIC", 0, "Bicubic", ""},
-               {0, NULL, 0, NULL, NULL}
-       };
-       
        prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "custom1");
-       RNA_def_property_enum_items(prop, rotate_items);
+       RNA_def_property_enum_items(prop, node_sampler_type_items);
        RNA_def_property_ui_text(prop, "Filter", "Method to use to filter rotation");
        RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
  }
@@@ -3205,13 -3151,6 +3206,6 @@@ static void def_cmp_stabilize2d(StructR
  {
        PropertyRNA *prop;
  
-       static EnumPropertyItem filter_type_items[] = {
-               {0, "NEAREST",   0, "Nearest",   ""},
-               {1, "BILINEAR",   0, "Bilinear",   ""},
-               {2, "BICUBIC", 0, "Bicubic", ""},
-               {0, NULL, 0, NULL, NULL}
-       };
        prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "id");
        RNA_def_property_struct_type(prop, "MovieClip");
  
        prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "custom1");
-       RNA_def_property_enum_items(prop, filter_type_items);
+       RNA_def_property_enum_items(prop, node_sampler_type_items);
        RNA_def_property_ui_text(prop, "Filter", "Method to use to filter stabilization");
        RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
  }
@@@ -3319,16 -3258,9 +3313,9 @@@ static void dev_cmd_transform(StructRN
  {
        PropertyRNA *prop;
  
-       static EnumPropertyItem filter_type_items[] = {
-               {0, "NEAREST",   0, "Nearest",   ""},
-               {1, "BILINEAR",   0, "Bilinear",   ""},
-               {2, "BICUBIC", 0, "Bicubic", ""},
-               {0, NULL, 0, NULL, NULL}
-       };
        prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "custom1");
-       RNA_def_property_enum_items(prop, filter_type_items);
+       RNA_def_property_enum_items(prop, node_sampler_type_items);
        RNA_def_property_ui_text(prop, "Filter", "Method to use to filter transform");
        RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
  }