diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-22 03:56:32 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-22 03:56:32 +0400 |
commit | da25b50ccb6a2a2c7d91ec588fe5c1b0e150ae4e (patch) | |
tree | 8abc36b362e479a6ba6aca8a8de417fd1c9d4d47 /source/blender/blenkernel/intern | |
parent | 30fd1ab523393216a66a7debb7e42ec39e40a242 (diff) |
image save operator now shares settings and UI with render & image out node.
details:
- setting format options from python isnt possible anymore since this isnt exposed via op->properties, python should use image.save() function instead.
- image save UI now hides 'Relative' option when copy is selected since it has no effect.
- default image depth is set to 8 or more if the image has no float buffer, otherwise its set to 32 or less.
other fixes:
- image new was adding an image with a filepath set to "untitled", if this file happened to exist in the current directory a save on the generated image would overwrite it, now initialize to empty path.
- BKE_ftype_to_imtype was returning an invalid value if ftype==0.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 26 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeavi.c | 2 |
2 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index c99396e6939..0d84385fad0 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -556,13 +556,13 @@ Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *n if (ima) { ImBuf *ibuf; - BLI_strncpy(ima->name, name, FILE_MAX); + /* BLI_strncpy(ima->name, name, FILE_MAX); */ /* dont do this, this writes in ain invalid filepath! */ ima->gen_x= width; ima->gen_y= height; ima->gen_type= uvtestgrid; ima->gen_flag |= (floatbuf ? IMA_GEN_FLOAT : 0); - ibuf= add_ibuf_size(width, height, name, depth, floatbuf, uvtestgrid, color); + ibuf= add_ibuf_size(width, height, ima->name, depth, floatbuf, uvtestgrid, color); image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); ima->ok= IMA_OK_LOADED; @@ -800,7 +800,7 @@ void BKE_image_all_free_anim_ibufs(int cfra) /* *********** READ AND WRITE ************** */ -int BKE_imtype_to_ftype(int imtype) +int BKE_imtype_to_ftype(const char imtype) { if(imtype==R_TARGA) return TGA; @@ -840,10 +840,10 @@ int BKE_imtype_to_ftype(int imtype) return JPG|90; } -int BKE_ftype_to_imtype(int ftype) +char BKE_ftype_to_imtype(const int ftype) { if(ftype==0) - return TGA; + return R_TARGA; else if(ftype == IMAGIC) return R_IRIS; #ifdef WITH_HDR @@ -883,7 +883,7 @@ int BKE_ftype_to_imtype(int ftype) } -int BKE_imtype_is_movie(int imtype) +int BKE_imtype_is_movie(const char imtype) { switch(imtype) { case R_AVIRAW: @@ -900,7 +900,7 @@ int BKE_imtype_is_movie(int imtype) return 0; } -int BKE_imtype_is_alpha_ok(int imtype) +int BKE_imtype_is_alpha_ok(const char imtype) { switch(imtype) { case R_TARGA: @@ -918,7 +918,7 @@ int BKE_imtype_is_alpha_ok(int imtype) return 0; } -int BKE_imtype_is_zbuf_ok(int imtype) +int BKE_imtype_is_zbuf_ok(const char imtype) { switch(imtype) { case R_IRIZ: @@ -928,7 +928,7 @@ int BKE_imtype_is_zbuf_ok(int imtype) return 0; } -int BKE_imtype_is_compression_ok(int imtype) +int BKE_imtype_is_compression_ok(const char imtype) { switch(imtype) { case R_PNG: @@ -937,7 +937,7 @@ int BKE_imtype_is_compression_ok(int imtype) return 0; } -int BKE_imtype_is_quality_ok(int imtype) +int BKE_imtype_is_quality_ok(const char imtype) { switch(imtype) { case R_JPEG90: @@ -947,7 +947,7 @@ int BKE_imtype_is_quality_ok(int imtype) return 0; } -int BKE_imtype_is_depth_ok(int imtype) +char BKE_imtype_is_depth_ok(const char imtype) { switch (imtype) { case R_RADHDR: @@ -970,7 +970,7 @@ int BKE_imtype_is_depth_ok(int imtype) } } -int BKE_add_image_extension(char *string, int imtype) +int BKE_add_image_extension(char *string, const char imtype) { const char *extension= NULL; @@ -1557,7 +1557,7 @@ int BKE_write_ibuf_stamp(Scene *scene, struct Object *camera, ImBuf *ibuf, const } -void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, int imtype, const short use_ext, const short use_frames) +void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames) { if (string==NULL) return; BLI_strncpy(string, base, FILE_MAX - 10); /* weak assumption */ diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index e7e375928e1..c70d2bdf3de 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -67,7 +67,7 @@ static void filepath_avi(char *string, RenderData *rd); #include "BKE_writeframeserver.h" -bMovieHandle *BKE_get_movie_handle(int imtype) +bMovieHandle *BKE_get_movie_handle(const char imtype) { static bMovieHandle mh; |