Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/image.c
| Show First 20 Lines • Show All 332 Lines • ▼ Show 20 Lines | |||||
| void BKE_image_free(Image *ima) | void BKE_image_free(Image *ima) | ||||
| { | { | ||||
| int a; | int a; | ||||
| BKE_image_free_buffers(ima); | BKE_image_free_buffers(ima); | ||||
| image_free_packedfiles(ima); | image_free_packedfiles(ima); | ||||
| BKE_icon_delete(&ima->id); | BKE_icon_id_delete(&ima->id); | ||||
| ima->id.icon_id = 0; | ima->id.icon_id = 0; | ||||
| BKE_previewimg_free(&ima->preview); | BKE_previewimg_free(&ima->preview); | ||||
| for (a = 0; a < IMA_MAX_RENDER_SLOT; a++) { | for (a = 0; a < IMA_MAX_RENDER_SLOT; a++) { | ||||
| if (ima->renders[a]) { | if (ima->renders[a]) { | ||||
| RE_FreeRenderResult(ima->renders[a]); | RE_FreeRenderResult(ima->renders[a]); | ||||
| ima->renders[a] = NULL; | ima->renders[a] = NULL; | ||||
| ▲ Show 20 Lines • Show All 2,646 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| #endif /* WITH_OPENEXR */ | #endif /* WITH_OPENEXR */ | ||||
| /* common stuff to do with images after loading */ | /* common stuff to do with images after loading */ | ||||
| static void image_initialize_after_load(Image *ima, ImBuf *ibuf) | static void image_initialize_after_load(Image *ima, ImBuf *ibuf) | ||||
| { | { | ||||
| /* preview is NULL when it has never been used as an icon before */ | /* preview is NULL when it has never been used as an icon before */ | ||||
| if (G.background == 0 && ima->preview == NULL) | if (G.background == 0 && ima->preview == NULL) | ||||
| BKE_icon_changed(BKE_icon_getid(&ima->id)); | BKE_icon_changed(BKE_icon_id_ensure(&ima->id)); | ||||
| /* fields */ | /* fields */ | ||||
| if (ima->flag & IMA_FIELDS) { | if (ima->flag & IMA_FIELDS) { | ||||
| if (ima->flag & IMA_STD_FIELD) de_interlace_st(ibuf); | if (ima->flag & IMA_STD_FIELD) de_interlace_st(ibuf); | ||||
| else de_interlace_ng(ibuf); | else de_interlace_ng(ibuf); | ||||
| } | } | ||||
| /* timer */ | /* timer */ | ||||
| BKE_image_tag_time(ima); | BKE_image_tag_time(ima); | ||||
| ▲ Show 20 Lines • Show All 1,586 Lines • Show Last 20 Lines | |||||