[Bf-blender-cvs] [e9a01c1d2f6] master: Cleanup: comments (long lines) in imbuf

Campbell Barton noreply at git.blender.org
Sun Apr 21 22:35:15 CEST 2019


Commit: e9a01c1d2f6edaf2902f82c73c98ff7d25627878
Author: Campbell Barton
Date:   Mon Apr 22 01:18:55 2019 +1000
Branches: master
https://developer.blender.org/rBe9a01c1d2f6edaf2902f82c73c98ff7d25627878

Cleanup: comments (long lines) in imbuf

===================================================================

M	source/blender/imbuf/IMB_colormanagement.h
M	source/blender/imbuf/IMB_imbuf.h
M	source/blender/imbuf/intern/allocimbuf.c
M	source/blender/imbuf/intern/anim_movie.c
M	source/blender/imbuf/intern/bmp.c
M	source/blender/imbuf/intern/cineon/logImageCore.h
M	source/blender/imbuf/intern/colormanagement.c
M	source/blender/imbuf/intern/dds/Color.h
M	source/blender/imbuf/intern/divers.c
M	source/blender/imbuf/intern/filter.c
M	source/blender/imbuf/intern/imageprocess.c
M	source/blender/imbuf/intern/jp2.c
M	source/blender/imbuf/intern/oiio/openimageio_api.cpp
M	source/blender/imbuf/intern/openexr/openexr_api.cpp
M	source/blender/imbuf/intern/radiance_hdr.c
M	source/blender/imbuf/intern/scaling.c
M	source/blender/imbuf/intern/thumbs.c
M	source/blender/imbuf/intern/thumbs_blend.c

===================================================================

diff --git a/source/blender/imbuf/IMB_colormanagement.h b/source/blender/imbuf/IMB_colormanagement.h
index 5978066f4a8..620f8984d9f 100644
--- a/source/blender/imbuf/IMB_colormanagement.h
+++ b/source/blender/imbuf/IMB_colormanagement.h
@@ -318,7 +318,8 @@ bool IMB_colormanagement_setup_glsl_draw_from_space(
 bool IMB_colormanagement_setup_glsl_draw_ctx(const struct bContext *C,
                                              float dither,
                                              bool predivide);
-/* Same as setup_glsl_draw_from_space, but color management settings are guessing from a given context */
+/* Same as setup_glsl_draw_from_space,
+ * but color management settings are guessing from a given context. */
 bool IMB_colormanagement_setup_glsl_draw_from_space_ctx(const struct bContext *C,
                                                         struct ColorSpace *colorspace,
                                                         float dither,
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index 8445c0f8f3a..bdc1abf3132 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -472,7 +472,8 @@ bool IMB_isfloat(struct ImBuf *ibuf);
 /* create char buffer, color corrected if necessary, for ImBufs that lack one */
 void IMB_rect_from_float(struct ImBuf *ibuf);
 /* Create char buffer for part of the image, color corrected if necessary,
- * Changed part will be stored in buffer. This is expected to be used for texture painting updates */
+ * Changed part will be stored in buffer.
+ * This is expected to be used for texture painting updates */
 void IMB_partial_rect_from_float(
     struct ImBuf *ibuf, float *buffer, int x, int y, int w, int h, bool is_data);
 void IMB_float_from_rect(struct ImBuf *ibuf);
@@ -660,7 +661,8 @@ void IMB_rectfill_area(struct ImBuf *ibuf,
                        struct ColorManagedDisplay *display);
 void IMB_rectfill_alpha(struct ImBuf *ibuf, const float value);
 
-/* this should not be here, really, we needed it for operating on render data, IMB_rectfill_area calls it */
+/* This should not be here, really,
+ * we needed it for operating on render data, IMB_rectfill_area calls it. */
 void buf_rectfill_area(unsigned char *rect,
                        float *rectf,
                        int width,
diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index eaf3d58270a..ba92026f560 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -212,9 +212,8 @@ void IMB_freeImBuf(ImBuf *ibuf)
       colormanage_cache_free(ibuf);
 
       if (ibuf->dds_data.data != NULL) {
-        free(
-            ibuf->dds_data
-                .data); /* dds_data.data is allocated by DirectDrawSurface::readData(), so don't use MEM_freeN! */
+        /* dds_data.data is allocated by DirectDrawSurface::readData(), so don't use MEM_freeN! */
+        free(ibuf->dds_data.data);
       }
       MEM_freeN(ibuf);
     }
@@ -385,7 +384,8 @@ bool imb_addrectImBuf(ImBuf *ibuf)
   if (ibuf == NULL)
     return false;
 
-  /* don't call imb_freerectImBuf, it frees mipmaps, this call is used only too give float buffers display */
+  /* Don't call imb_freerectImBuf, it frees mipmaps,
+   * this call is used only too give float buffers display. */
   if (ibuf->rect && (ibuf->mall & IB_rect))
     MEM_freeN(ibuf->rect);
   ibuf->rect = NULL;
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 13813fb23b3..aa1d63394ff 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -413,7 +413,14 @@ static int startavi(struct anim *anim)
   anim->curposition = 0;
   anim->preseek = 0;
 
-  /*  printf("x:%d y:%d size:%d interl:%d dur:%d\n", anim->x, anim->y, anim->framesize, anim->interlacing, anim->duration);*/
+#  if 0
+  printf("x:%d y:%d size:%d interl:%d dur:%d\n",
+         anim->x,
+         anim->y,
+         anim->framesize,
+         anim->interlacing,
+         anim->duration);
+#  endif
 
   return 0;
 }
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index f5c12c916f0..b43b13ff282 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -33,8 +33,8 @@
 #include "IMB_colormanagement.h"
 #include "IMB_colormanagement_intern.h"
 
-/* some code copied from article on microsoft.com, copied
- * here for enhanced BMP support in the future
+/* Some code copied from article on microsoft.com,
+ * copied here for enhanced BMP support in the future:
  * http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0197/mfcp1/mfcp1.htm&nav=/msj/0197/newnav.htm
  */
 
diff --git a/source/blender/imbuf/intern/cineon/logImageCore.h b/source/blender/imbuf/intern/cineon/logImageCore.h
index e01c2e0f117..3f09effa839 100644
--- a/source/blender/imbuf/intern/cineon/logImageCore.h
+++ b/source/blender/imbuf/intern/cineon/logImageCore.h
@@ -43,7 +43,8 @@ extern "C" {
  * Image structure
  */
 
-/* There are some differences between DPX and Cineon so we need to know from what type of file the datas come from */
+/* There are some differences between DPX and Cineon
+ * so we need to know from what type of file the datas come from. */
 enum format {
   format_DPX,
   format_Cineon,
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 1370ea40137..46c08afe201 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -332,8 +332,8 @@ static ImBuf *colormanage_cache_get_ibuf(ImBuf *ibuf,
   struct MovieCache *moviecache = colormanage_moviecache_get(ibuf);
 
   if (!moviecache) {
-    /* if there's no moviecache it means no color management was applied on given image buffer before */
-
+    /* If there's no moviecache it means no color management was applied
+     * on given image buffer before. */
     return NULL;
   }
 
@@ -425,7 +425,8 @@ static void colormanage_cache_put(ImBuf *ibuf,
   cache_ibuf->mall |= IB_rect;
   cache_ibuf->flags |= IB_rect;
 
-  /* store data which is needed to check whether cached buffer could be used for color managed display settings */
+  /* Store data which is needed to check whether cached buffer
+   * could be used for color managed display settings. */
   cache_data = MEM_callocN(sizeof(ColormanageCacheData), "color manage cache imbuf data");
   cache_data->look = view_settings->look;
   cache_data->exposure = view_settings->exposure;
@@ -1798,7 +1799,8 @@ static void processor_transform_apply_threaded(unsigned char *byte_buffer,
 
 /*********************** Color space transformation functions *************************/
 
-/* convert the whole buffer from specified by name color space to another - internal implementation */
+/* Convert the whole buffer from specified by name color space to another -
+ * internal implementation. */
 static void colormanagement_transform_ex(unsigned char *byte_buffer,
                                          float *float_buffer,
                                          int width,
@@ -2249,8 +2251,9 @@ ImBuf *IMB_colormanagement_imbuf_for_write(ImBuf *ibuf,
       colormanaged_ibuf = IMB_dupImBuf(ibuf);
     }
     else {
-      /* render pipeline is constructing image buffer itself, but it's re-using byte and float buffers from render result
-       * make copy of this buffers here sine this buffers would be transformed to other color space here
+      /* Render pipeline is constructing image buffer itself,
+       * but it's re-using byte and float buffers from render result make copy of this buffers
+       * here sine this buffers would be transformed to other color space here.
        */
 
       if (ibuf->rect && (ibuf->mall & IB_rect) == 0) {
@@ -3843,7 +3846,10 @@ bool IMB_colormanagement_setup_glsl_draw(const ColorManagedViewSettings *view_se
       view_settings, display_settings, NULL, dither, predivide);
 }
 
-/* Same as setup_glsl_draw_from_space, but color management settings are guessing from a given context */
+/**
+ * Same as setup_glsl_draw_from_space,
+ * but color management settings are guessing from a given context.
+ */
 bool IMB_colormanagement_setup_glsl_draw_from_space_ctx(const bContext *C,
                                                         struct ColorSpace *from_colorspace,
                                                         float dither,
diff --git a/source/blender/imbuf/intern/dds/Color.h b/source/blender/imbuf/intern/dds/Color.h
index 16432ffa715..36e2615759b 100644
--- a/source/blender/imbuf/intern/dds/Color.h
+++ b/source/blender/imbuf/intern/dds/Color.h
@@ -47,9 +47,20 @@ class Color32 {
   {
     setRGBA(R, G, B, A);
   }
-  //Color32(unsigned char c[4]) { setRGBA(c[0], c[1], c[2], c[3]); }
-  //Color32(float R, float G, float B) { setRGBA(uint(R*255), uint(G*255), uint(B*255), 0xFF); }
-  //Color32(float R, float G, float B, float A) { setRGBA(uint(R*255), uint(G*255), uint(B*255), uint(A*255)); }
+#if 0
+  Color32(unsigned char c[4])
+  {
+    setRGBA(c[0], c[1], c[2], c[3]);
+  }
+  Color32(float R, float G, float B)
+  {
+    setRGBA(uint(R * 255), uint(G * 255), uint(B * 255), 0xFF);
+  }
+  Color32(float R, float G, float B, float A)
+  {
+    setRGBA(uint(R * 255), uint(G * 255), uint(B * 255), uint(A * 255));
+  }
+#endif
   Color32(unsigned int U) : u(U)
   {
   }
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index fb8dcffe9d4..535d2e95122 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -801,7 +801,10 @@ static void partial_rect_from_float_thread_do(void *data_v, int start_scanline,
                                 data->is_data);
 }
 
-/* converts from linear float to sRGB byte for part of the texture, buffer will hold the changed part */
+/**
+ * Converts from linear float to sRGB byte for part of the texture,
+ * buffer will hold the changed part.
+ */
 void IMB_partial_rect_from_float(
     ImBuf *ibuf, float *buffer, int x, int y, int w, int h, bool is_data)
 {
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list