Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_playanim.c
| Show First 20 Lines • Show All 387 Lines • ▼ Show 20 Lines | |||||
| static void build_pict_list_ex( | static void build_pict_list_ex( | ||||
| PlayState *ps, const char *first, int totframes, int fstep, int fontid) | PlayState *ps, const char *first, int totframes, int fstep, int fontid) | ||||
| { | { | ||||
| if (IMB_isanim(first)) { | if (IMB_isanim(first)) { | ||||
| /* OCIO_TODO: support different input color space */ | /* OCIO_TODO: support different input color space */ | ||||
| struct anim *anim = IMB_open_anim(first, IB_rect, 0, NULL); | struct anim *anim = IMB_open_anim(first, IB_rect, 0, NULL); | ||||
| if (anim) { | if (anim) { | ||||
| int pic; | int pic; | ||||
| struct ImBuf *ibuf = IMB_anim_absolute(anim, 0, IMB_TC_NONE, IMB_PROXY_NONE); | struct ImBuf *ibuf = IMB_anim_absolute( | ||||
| anim, 0, IMB_TC_NONE, IMB_PROXY_NONE, IMB_DOWNSCALE_NONE); | |||||
| if (ibuf) { | if (ibuf) { | ||||
| playanim_toscreen(ps, NULL, ibuf, fontid, fstep); | playanim_toscreen(ps, NULL, ibuf, fontid, fstep); | ||||
| IMB_freeImBuf(ibuf); | IMB_freeImBuf(ibuf); | ||||
| } | } | ||||
| for (pic = 0; pic < IMB_anim_get_duration(anim, IMB_TC_NONE); pic++) { | for (pic = 0; pic < IMB_anim_get_duration(anim, IMB_TC_NONE); pic++) { | ||||
| PlayAnimPict *picture = (PlayAnimPict *)MEM_callocN(sizeof(PlayAnimPict), "Pict"); | PlayAnimPict *picture = (PlayAnimPict *)MEM_callocN(sizeof(PlayAnimPict), "Pict"); | ||||
| picture->anim = anim; | picture->anim = anim; | ||||
| ▲ Show 20 Lines • Show All 837 Lines • ▼ Show 20 Lines | else { | ||||
| exit(1); | exit(1); | ||||
| } | } | ||||
| if (IMB_isanim(filepath)) { | if (IMB_isanim(filepath)) { | ||||
| /* OCIO_TODO: support different input color spaces */ | /* OCIO_TODO: support different input color spaces */ | ||||
| struct anim *anim; | struct anim *anim; | ||||
| anim = IMB_open_anim(filepath, IB_rect, 0, NULL); | anim = IMB_open_anim(filepath, IB_rect, 0, NULL); | ||||
| if (anim) { | if (anim) { | ||||
| ibuf = IMB_anim_absolute(anim, 0, IMB_TC_NONE, IMB_PROXY_NONE); | ibuf = IMB_anim_absolute(anim, 0, IMB_TC_NONE, IMB_PROXY_NONE, IMB_DOWNSCALE_NONE); | ||||
| IMB_close_anim(anim); | IMB_close_anim(anim); | ||||
| anim = NULL; | anim = NULL; | ||||
| } | } | ||||
| } | } | ||||
| else if (!IMB_ispic(filepath)) { | else if (!IMB_ispic(filepath)) { | ||||
| printf("%s: '%s' not an image file\n", __func__, filepath); | printf("%s: '%s' not an image file\n", __func__, filepath); | ||||
| exit(1); | exit(1); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | #ifndef USE_IMB_CACHE | ||||
| if (ibuf != NULL && ibuf->ftype == IMB_FTYPE_NONE) { | if (ibuf != NULL && ibuf->ftype == IMB_FTYPE_NONE) { | ||||
| IMB_freeImBuf(ibuf); | IMB_freeImBuf(ibuf); | ||||
| } | } | ||||
| #endif | #endif | ||||
| if (ps.picture->ibuf) { | if (ps.picture->ibuf) { | ||||
| ibuf = ps.picture->ibuf; | ibuf = ps.picture->ibuf; | ||||
| } | } | ||||
| else if (ps.picture->anim) { | else if (ps.picture->anim) { | ||||
| ibuf = IMB_anim_absolute(ps.picture->anim, ps.picture->frame, IMB_TC_NONE, IMB_PROXY_NONE); | ibuf = IMB_anim_absolute( | ||||
| ps.picture->anim, ps.picture->frame, IMB_TC_NONE, IMB_PROXY_NONE, IMB_DOWNSCALE_NONE); | |||||
| } | } | ||||
| else if (ps.picture->mem) { | else if (ps.picture->mem) { | ||||
| /* use correct colorspace here */ | /* use correct colorspace here */ | ||||
| ibuf = IMB_ibImageFromMemory( | ibuf = IMB_ibImageFromMemory( | ||||
| ps.picture->mem, ps.picture->size, ps.picture->IB_flags, NULL, ps.picture->name); | ps.picture->mem, ps.picture->size, ps.picture->IB_flags, NULL, ps.picture->name); | ||||
| } | } | ||||
| else { | else { | ||||
| /* use correct colorspace here */ | /* use correct colorspace here */ | ||||
| ▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines | |||||