diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/customdata_file.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 39 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/ocean.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeavi.c | 2 |
5 files changed, 31 insertions, 26 deletions
diff --git a/source/blender/blenkernel/intern/customdata_file.c b/source/blender/blenkernel/intern/customdata_file.c index c72eea50e40..97972cca30c 100644 --- a/source/blender/blenkernel/intern/customdata_file.c +++ b/source/blender/blenkernel/intern/customdata_file.c @@ -276,7 +276,7 @@ static int cdf_write_header(CDataFile *cdf) return 1; } -int cdf_read_open(CDataFile *cdf, const char *filename) +bool cdf_read_open(CDataFile *cdf, const char *filename) { FILE *f; @@ -299,7 +299,7 @@ int cdf_read_open(CDataFile *cdf, const char *filename) return 1; } -int cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay) +bool cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay) { size_t offset; int a; @@ -316,7 +316,7 @@ int cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay) return (fseek(cdf->readf, offset, SEEK_SET) == 0); } -int cdf_read_data(CDataFile *cdf, unsigned int size, void *data) +bool cdf_read_data(CDataFile *cdf, unsigned int size, void *data) { /* read data */ if (!fread(data, size, 1, cdf->readf)) @@ -338,7 +338,7 @@ void cdf_read_close(CDataFile *cdf) } } -int cdf_write_open(CDataFile *cdf, const char *filename) +bool cdf_write_open(CDataFile *cdf, const char *filename) { CDataFileHeader *header; CDataFileImageHeader *image; @@ -380,12 +380,12 @@ int cdf_write_open(CDataFile *cdf, const char *filename) return 1; } -int cdf_write_layer(CDataFile *UNUSED(cdf), CDataFileLayer *UNUSED(blay)) +bool cdf_write_layer(CDataFile *UNUSED(cdf), CDataFileLayer *UNUSED(blay)) { return 1; } -int cdf_write_data(CDataFile *cdf, unsigned int size, void *data) +bool cdf_write_data(CDataFile *cdf, unsigned int size, void *data) { /* write data */ if (!fwrite(data, size, 1, cdf->writef)) diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index e3fa4733e6c..3541b3fba3f 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -2705,7 +2705,7 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam if (format == R_IMF_IMTYPE_OPENEXR) format = R_IMF_IMTYPE_PNG; #endif BLI_strncpy(output_file, filename, sizeof(output_file)); - BKE_add_image_extension_from_type(output_file, format); + BKE_image_path_ensure_ext_from_imtype(output_file, format); /* Validate output file path */ BLI_path_abs(output_file, G.main->name); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 870c077ff78..27165042cb2 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1011,7 +1011,7 @@ void BKE_image_all_free_anim_ibufs(int cfra) /* *********** READ AND WRITE ************** */ -int BKE_imtype_to_ftype(const char imtype) +int BKE_image_imtype_to_ftype(const char imtype) { if (imtype == R_IMF_IMTYPE_TARGA) return TGA; @@ -1051,7 +1051,7 @@ int BKE_imtype_to_ftype(const char imtype) return JPG | 90; } -char BKE_ftype_to_imtype(const int ftype) +char BKE_image_ftype_to_imtype(const int ftype) { if (ftype == 0) return R_IMF_IMTYPE_TARGA; @@ -1258,7 +1258,7 @@ char BKE_imtype_from_arg(const char *imtype_arg) else return R_IMF_IMTYPE_INVALID; } -static bool do_add_image_extension(char *string, const char imtype, const ImageFormatData *im_format) +static bool image_path_ensure_ext(char *string, const char imtype, const ImageFormatData *im_format) { const char *extension = NULL; const char *extension_test; @@ -1368,14 +1368,14 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF } } -int BKE_add_image_extension(char *string, const ImageFormatData *im_format) +bool BKE_image_path_ensure_ext_from_imformat(char *string, const ImageFormatData *im_format) { - return do_add_image_extension(string, im_format->imtype, im_format); + return image_path_ensure_ext(string, im_format->imtype, im_format); } -int BKE_add_image_extension_from_type(char *string, const char imtype) +bool BKE_image_path_ensure_ext_from_imtype(char *string, const char imtype) { - return do_add_image_extension(string, imtype, NULL); + return image_path_ensure_ext(string, imtype, NULL); } void BKE_imformat_defaults(ImageFormatData *im_format) @@ -1651,7 +1651,9 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d } } -void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rectf, int width, int height, int channels) +void BKE_image_stamp_buf( + Scene *scene, Object *camera, + unsigned char *rect, float *rectf, int width, int height, int channels) { struct StampData stamp_data; float w, h, pad; @@ -2076,8 +2078,9 @@ int BKE_imbuf_write_stamp(Scene *scene, struct Object *camera, ImBuf *ibuf, cons } -static void do_makepicstring(char *string, const char *base, const char *relbase, int frame, const char imtype, - const ImageFormatData *im_format, const short use_ext, const short use_frames) +static void image_path_makepicstring( + char *string, const char *base, const char *relbase, int frame, const char imtype, + const ImageFormatData *im_format, const short use_ext, const short use_frames) { if (string == NULL) return; BLI_strncpy(string, base, FILE_MAX - 10); /* weak assumption */ @@ -2087,19 +2090,21 @@ static void do_makepicstring(char *string, const char *base, const char *relbase BLI_path_frame(string, frame, 4); if (use_ext) - do_add_image_extension(string, imtype, im_format); + image_path_ensure_ext(string, imtype, im_format); } -void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, - const ImageFormatData *im_format, const bool use_ext, const bool use_frames) +void BKE_image_path_from_imformat( + char *string, const char *base, const char *relbase, int frame, + const ImageFormatData *im_format, const bool use_ext, const bool use_frames) { - do_makepicstring(string, base, relbase, frame, im_format->imtype, im_format, use_ext, use_frames); + image_path_makepicstring(string, base, relbase, frame, im_format->imtype, im_format, use_ext, use_frames); } -void BKE_makepicstring_from_type(char *string, const char *base, const char *relbase, int frame, - const char imtype, const bool use_ext, const bool use_frames) +void BKE_image_path_from_imtype( + char *string, const char *base, const char *relbase, int frame, + const char imtype, const bool use_ext, const bool use_frames) { - do_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames); + image_path_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames); } /* used by sequencer too */ diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index 373ad34e7bd..12e82d3a34f 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -1002,7 +1002,7 @@ static void cache_filename(char *string, const char *path, const char *relbase, BLI_join_dirfile(cachepath, sizeof(cachepath), path, fname); - BKE_makepicstring_from_type(string, cachepath, relbase, frame, R_IMF_IMTYPE_OPENEXR, true, true); + BKE_image_path_from_imtype(string, cachepath, relbase, frame, R_IMF_IMTYPE_OPENEXR, true, true); } /* silly functions but useful to inline when the args do a lot of indirections */ diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 8a6a0438b84..85eac1f21ed 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -253,7 +253,7 @@ static void end_avi(void) } #endif /* WITH_AVI */ -/* similar to BKE_makepicstring() */ +/* similar to BKE_image_path_from_imformat() */ void BKE_movie_filepath_get(char *string, RenderData *rd) { bMovieHandle *mh = BKE_movie_handle_get(rd->im_format.imtype); |