[Bf-blender-cvs] [af4c389f995] master: Cleanup: imbuf callback naming

Campbell Barton noreply at git.blender.org
Mon Nov 9 07:06:12 CET 2020


Commit: af4c389f9955c5975058733858017da68792f509
Author: Campbell Barton
Date:   Mon Nov 9 17:03:28 2020 +1100
Branches: master
https://developer.blender.org/rBaf4c389f9955c5975058733858017da68792f509

Cleanup: imbuf callback naming

Use `is_a` & `is_a_filepath` in callback names.

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

M	source/blender/imbuf/intern/IMB_filetype.h
M	source/blender/imbuf/intern/cineon/cineon_dpx.c
M	source/blender/imbuf/intern/filetype.c
M	source/blender/imbuf/intern/oiio/openimageio_api.cpp
M	source/blender/imbuf/intern/oiio/openimageio_api.h

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

diff --git a/source/blender/imbuf/intern/IMB_filetype.h b/source/blender/imbuf/intern/IMB_filetype.h
index 93a3a98c3d1..53d9a1a2919 100644
--- a/source/blender/imbuf/intern/IMB_filetype.h
+++ b/source/blender/imbuf/intern/IMB_filetype.h
@@ -119,7 +119,7 @@ struct ImBuf *imb_bmp_decode(const unsigned char *mem,
 int imb_savebmp(struct ImBuf *ibuf, const char *filepath, int flags);
 
 /* cineon */
-int imb_is_cineon(const unsigned char *buf);
+int imb_is_a_cineon(const unsigned char *buf);
 int imb_save_cineon(struct ImBuf *buf, const char *filepath, int flags);
 struct ImBuf *imb_load_cineon(const unsigned char *mem,
                               size_t size,
@@ -127,7 +127,7 @@ struct ImBuf *imb_load_cineon(const unsigned char *mem,
                               char colorspace[IM_MAX_SPACE]);
 
 /* dpx */
-int imb_is_dpx(const unsigned char *buf);
+int imb_is_a_dpx(const unsigned char *buf);
 int imb_save_dpx(struct ImBuf *buf, const char *filepath, int flags);
 struct ImBuf *imb_load_dpx(const unsigned char *mem,
                            size_t size,
diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c
index eeccadf56c1..98082a97e0f 100644
--- a/source/blender/imbuf/intern/cineon/cineon_dpx.c
+++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c
@@ -188,7 +188,7 @@ int imb_save_cineon(struct ImBuf *buf, const char *filepath, int flags)
   return imb_save_dpx_cineon(buf, filepath, 1, flags);
 }
 
-int imb_is_cineon(const unsigned char *buf)
+int imb_is_a_cineon(const unsigned char *buf)
 {
   return logImageIsCineon(buf);
 }
@@ -198,7 +198,7 @@ ImBuf *imb_load_cineon(const unsigned char *mem,
                        int flags,
                        char colorspace[IM_MAX_SPACE])
 {
-  if (imb_is_cineon(mem)) {
+  if (imb_is_a_cineon(mem)) {
     return imb_load_dpx_cineon(mem, size, 1, flags, colorspace);
   }
   return NULL;
@@ -209,7 +209,7 @@ int imb_save_dpx(struct ImBuf *buf, const char *filepath, int flags)
   return imb_save_dpx_cineon(buf, filepath, 0, flags);
 }
 
-int imb_is_dpx(const unsigned char *buf)
+int imb_is_a_dpx(const unsigned char *buf)
 {
   return logImageIsDpx(buf);
 }
@@ -219,7 +219,7 @@ ImBuf *imb_load_dpx(const unsigned char *mem,
                     int flags,
                     char colorspace[IM_MAX_SPACE])
 {
-  if (imb_is_dpx(mem)) {
+  if (imb_is_a_dpx(mem)) {
     return imb_load_dpx_cineon(mem, size, 0, flags, colorspace);
   }
   return NULL;
diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c
index 5aa588da36d..667027ebfeb 100644
--- a/source/blender/imbuf/intern/filetype.c
+++ b/source/blender/imbuf/intern/filetype.c
@@ -114,7 +114,7 @@ const ImFileType IMB_FILE_TYPES[] = {
 #ifdef WITH_CINEON
     {NULL,
      NULL,
-     imb_is_dpx,
+     imb_is_a_dpx,
      NULL,
      imb_ftype_default,
      imb_load_dpx,
@@ -126,7 +126,7 @@ const ImFileType IMB_FILE_TYPES[] = {
      COLOR_ROLE_DEFAULT_FLOAT},
     {NULL,
      NULL,
-     imb_is_cineon,
+     imb_is_a_cineon,
      NULL,
      imb_ftype_default,
      imb_load_cineon,
@@ -211,7 +211,7 @@ const ImFileType IMB_FILE_TYPES[] = {
     {NULL,
      NULL,
      NULL,
-     imb_is_a_photoshop,
+     imb_is_a_filepath_photoshop,
      imb_ftype_default,
      NULL,
      imb_load_photoshop,
diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
index d62258fbd2f..9d8c5d50a89 100644
--- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp
+++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
@@ -163,7 +163,7 @@ static ImBuf *imb_oiio_load_image_float(
 
 extern "C" {
 
-int imb_is_a_photoshop(const char *filename)
+int imb_is_a_filepath_photoshop(const char *filename)
 {
   const char *photoshop_extension[] = {
       ".psd",
@@ -198,7 +198,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac
   const bool is_colorspace_manually_set = (colorspace[0] != '\0');
 
   /* load image from file through OIIO */
-  if (imb_is_a_photoshop(filename) == 0) {
+  if (imb_is_a_filepath_photoshop(filename) == 0) {
     return nullptr;
   }
 
diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.h b/source/blender/imbuf/intern/oiio/openimageio_api.h
index 3f5f234099c..135e3521f71 100644
--- a/source/blender/imbuf/intern/oiio/openimageio_api.h
+++ b/source/blender/imbuf/intern/oiio/openimageio_api.h
@@ -31,7 +31,7 @@ extern "C" {
 
 struct ImBuf;
 
-int imb_is_a_photoshop(const char *name);
+int imb_is_a_filepath_photoshop(const char *name);
 
 int imb_save_photoshop(struct ImBuf *ibuf, const char *name, int flags);



More information about the Bf-blender-cvs mailing list