Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Mein <mein@cs.umn.edu>2003-12-04 21:18:05 +0300
committerKent Mein <mein@cs.umn.edu>2003-12-04 21:18:05 +0300
commit24624501a473c13f6a6d9c4676cbdd33b4a88e73 (patch)
tree6b0c79b38b21da22fac3e0a6f141b970e610b473 /source/blender/imbuf/intern/writeimage.c
parent43369f076f3be5000f56079f31767ffc3e730d2b (diff)
This looks like a lot but its a few small changes.
Summary: standardized imageformat functions(make function names similar, and parameters in same order where relavant), small code cleanups, and added a description of how to add an image format to blender. Kent Specifics: merged png_decode.c and png_encode.c to png.c and cleaned function calls. fixed some spacing in IMB_imbuf_types.h casting cleanups: intern/amiga.c intern/ham.c intern/iris.c Modified switch statements to have a default type to insure values are set: intern/antialias.c Initalization of some vars and make types similar. intern/bitplanes.c cleaned function calls, and changed if else to if's with return: intern/jpeg.c added {}'s in multidemensional arrays. intern/matrix.h Made a little cleaner to read, and matched above changes. intern/readimage.c intern/writeimage.c
Diffstat (limited to 'source/blender/imbuf/intern/writeimage.c')
-rw-r--r--source/blender/imbuf/intern/writeimage.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c
index 49d827fcce5..3bd0e8bafc6 100644
--- a/source/blender/imbuf/intern/writeimage.c
+++ b/source/blender/imbuf/intern/writeimage.c
@@ -48,6 +48,7 @@
#include "IMB_ham.h"
#include "IMB_hamx.h"
#include "IMB_amiga.h"
+#include "IMB_png.h"
#include "IMB_iff.h"
#include "IMB_bitplanes.h"
@@ -66,10 +67,11 @@ short IMB_saveiff(struct ImBuf *ibuf,char *naam,int flags)
if (ibuf==0) return (FALSE);
ibuf->flags = flags;
+ /* Put formats that take a filename here */
if (IS_jpg(ibuf)) {
- if (imb_save_jpeg(naam, ibuf, flags)) return (0);
- else return (TRUE);
+ return imb_savejpeg(ibuf, naam, flags);
}
+
file = open(naam, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666);
if (file < 0) return (FALSE);
@@ -79,15 +81,16 @@ short IMB_saveiff(struct ImBuf *ibuf,char *naam,int flags)
}
}
+ /* Put formats that take a filehandle here */
if (IS_png(ibuf)) {
- ok = IMB_png_encode(ibuf,file,flags);
+ ok = imb_savepng(ibuf,file,flags);
if (ok) {
close (file);
return (ok);
}
}
- if (IS_tga(ibuf) || IS_png(ibuf)) {
+ if (IS_tga(ibuf)) {
ok = imb_savetarga(ibuf,file,flags);
if (ok) {
close (file);