diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-05-07 19:18:04 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-05-07 19:18:04 +0400 |
commit | 008863daec1249d1f17bc69e1105e336db690d63 (patch) | |
tree | 78a4001857b26a287125a3f5fa31496052f6ebdd /source/blender/imbuf/intern/thumbs.c | |
parent | 1613829e8e821321da99cad4790b7e6a1d90cea8 (diff) |
Merge image related changes from the render branch. This includes the image
tile cache code in imbuf, but it is not hooked up to the render engine.
Imbuf module: some small refactoring and removing a lot of unused or old code
(about 6.5k lines).
* Added a ImFileType struct with callbacks to make adding an file format type,
or making changes to the API easier.
* Move imbuf init/exit code into IMB_init()/IMB_exit() functions.
* Increased mipmap levels from 10 to 20, you run into this limit already with
a 2k image.
* Removed hamx, amiga, anim5 format support.
* Removed colormap saving, only simple colormap code now for reading tga.
* Removed gen_dynlibtiff.py, editing this is almost as much work as just
editing the code directly.
* Functions removed that were only used for sequencer plugin API:
IMB_anim_nextpic, IMB_clever_double, IMB_antialias, IMB_gamwarp,
IMB_scalefieldImBuf, IMB_scalefastfieldImBuf, IMB_onethird, IMB_halflace,
IMB_dit0, IMB_dit2, IMB_cspace
* Write metadata info into OpenEXR images. Can be viewed with the command
line utility 'exrheader'
For the image tile cache code, see this page:
http://wiki.blender.org/index.php/Dev:2.5/Source/Imaging/ImageTileCache
Diffstat (limited to 'source/blender/imbuf/intern/thumbs.c')
-rw-r--r-- | source/blender/imbuf/intern/thumbs.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 5e0504155dc..45fbf49dbbd 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -37,7 +37,7 @@ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" #include "IMB_thumbs.h" -#include "IMB_imginfo.h" +#include "IMB_metadata.h" #include "md5.h" @@ -282,11 +282,11 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source) return NULL; } if (size == THB_FAIL) { - img = IMB_allocImBuf(0,0,32, IB_rect | IB_imginfo, 0); + img = IMB_allocImBuf(0,0,32, IB_rect | IB_metadata, 0); if (!img) return 0; } else { if (THB_SOURCE_IMAGE == source) { - img = IMB_loadiffname(path, IB_rect | IB_imginfo); + img = IMB_loadiffname(path, IB_rect | IB_metadata); if (img != NULL) { stat(path, &info); sprintf(mtime, "%ld", info.st_mtime); @@ -295,7 +295,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source) } } else if (THB_SOURCE_MOVIE == source) { struct anim * anim = NULL; - anim = IMB_open_anim(path, IB_rect | IB_imginfo); + anim = IMB_open_anim(path, IB_rect | IB_metadata); if (anim != NULL) { img = IMB_anim_absolute(anim, 0); if (img == NULL) { @@ -325,17 +325,17 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source) IMB_scaleImBuf(img, ex, ey); } sprintf(desc, "Thumbnail for %s", uri); - IMB_imginfo_change_field(img, "Description", desc); - IMB_imginfo_change_field(img, "Software", "Blender"); - IMB_imginfo_change_field(img, "Thumb::URI", uri); - IMB_imginfo_change_field(img, "Thumb::MTime", mtime); + IMB_metadata_change_field(img, "Description", desc); + IMB_metadata_change_field(img, "Software", "Blender"); + IMB_metadata_change_field(img, "Thumb::URI", uri); + IMB_metadata_change_field(img, "Thumb::MTime", mtime); if (THB_SOURCE_IMAGE == source) { - IMB_imginfo_change_field(img, "Thumb::Image::Width", cwidth); - IMB_imginfo_change_field(img, "Thumb::Image::Height", cheight); + IMB_metadata_change_field(img, "Thumb::Image::Width", cwidth); + IMB_metadata_change_field(img, "Thumb::Image::Height", cheight); } img->ftype = PNG; img->depth = 32; - if (IMB_saveiff(img, temp, IB_rect | IB_imginfo)) { + if (IMB_saveiff(img, temp, IB_rect | IB_metadata)) { #ifndef WIN32 chmod(temp, S_IRUSR | S_IWUSR); #endif @@ -358,7 +358,7 @@ ImBuf* IMB_thumb_read(const char* path, ThumbSize size) return NULL; } if (thumbpath_from_uri(uri, thumb, size)) { - img = IMB_loadiffname(thumb, IB_rect | IB_imginfo); + img = IMB_loadiffname(thumb, IB_rect | IB_metadata); } return img; @@ -409,10 +409,10 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source) if (strncmp(path, thumb, strlen(thumb)) == 0) { img = IMB_loadiffname(path, IB_rect); } else { - img = IMB_loadiffname(thumb, IB_rect | IB_imginfo); + img = IMB_loadiffname(thumb, IB_rect | IB_metadata); if (img) { char mtime[40]; - if (!IMB_imginfo_get_field(img, "Thumb::MTime", mtime, 40)) { + if (!IMB_metadata_get_field(img, "Thumb::MTime", mtime, 40)) { /* illegal thumb, forget it! */ IMB_freeImBuf(img); img = 0; |