Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/source/render_texture.c
| Context not available. | |||||
| #include "DNA_image_types.h" | #include "DNA_image_types.h" | ||||
| #include "DNA_node_types.h" | #include "DNA_node_types.h" | ||||
| #include "IMB_imbuf_types.h" | #include "DNA_imbuf_types.h" | ||||
| #include "IMB_colormanagement.h" | #include "IMB_colormanagement.h" | ||||
| #include "BKE_image.h" | #include "BKE_image.h" | ||||
| Context not available. | |||||
| rgbnor = multitex(tex, texvec, dxt, dyt, osatex, texres, thread, which_output, pool, skip_load_image); | rgbnor = multitex(tex, texvec, dxt, dyt, osatex, texres, thread, which_output, pool, skip_load_image); | ||||
| if (mtex->mapto & (MAP_COL+MAP_COLSPEC+MAP_COLMIR)) { | if (mtex->mapto & (MAP_COL+MAP_COLSPEC+MAP_COLMIR)) { | ||||
| ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool); | ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool, IMA_IBUF_IMA); | ||||
| /* don't linearize float buffers, assumed to be linear */ | /* don't linearize float buffers, assumed to be linear */ | ||||
| if (ibuf && !(ibuf->rect_float) && scene_color_manage) | if (ibuf && !(ibuf->rect_float) && scene_color_manage) | ||||
| Context not available. | |||||
| rgbnor = multitex(tex, texvec_l, dxt_l, dyt_l, osatex, texres, thread, which_output, pool, skip_load_image); | rgbnor = multitex(tex, texvec_l, dxt_l, dyt_l, osatex, texres, thread, which_output, pool, skip_load_image); | ||||
| { | { | ||||
| ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool); | ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool, IMA_IBUF_IMA); | ||||
| /* don't linearize float buffers, assumed to be linear */ | /* don't linearize float buffers, assumed to be linear */ | ||||
| if (ibuf && !(ibuf->rect_float) && scene_color_manage) | if (ibuf && !(ibuf->rect_float) && scene_color_manage) | ||||
| Context not available. | |||||
| if (!shi->osatex && (tex->type == TEX_IMAGE) && tex->ima) { | if (!shi->osatex && (tex->type == TEX_IMAGE) && tex->ima) { | ||||
| /* in case we have no proper derivatives, fall back to | /* in case we have no proper derivatives, fall back to | ||||
| * computing du/dv it based on image size */ | * computing du/dv it based on image size */ | ||||
| ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool); | ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool, IMA_IBUF_IMA); | ||||
| if (ibuf) { | if (ibuf) { | ||||
| du = 1.f/(float)ibuf->x; | du = 1.f/(float)ibuf->x; | ||||
| dv = 1.f/(float)ibuf->y; | dv = 1.f/(float)ibuf->y; | ||||
| Context not available. | |||||
| /* resolve image dimensions */ | /* resolve image dimensions */ | ||||
| if (found_deriv_map || (mtex->texflag&MTEX_BUMP_TEXTURESPACE)!=0) { | if (found_deriv_map || (mtex->texflag&MTEX_BUMP_TEXTURESPACE)!=0) { | ||||
| ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool); | ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool, IMA_IBUF_IMA); | ||||
| if (ibuf) { | if (ibuf) { | ||||
| dimx = ibuf->x; | dimx = ibuf->x; | ||||
| dimy = ibuf->y; | dimy = ibuf->y; | ||||
| Context not available. | |||||
| /* inverse gamma correction */ | /* inverse gamma correction */ | ||||
| if (tex->type==TEX_IMAGE) { | if (tex->type==TEX_IMAGE) { | ||||
| Image *ima = tex->ima; | Image *ima = tex->ima; | ||||
| ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, re->pool); | ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, re->pool, IMA_IBUF_IMA); | ||||
| /* don't linearize float buffers, assumed to be linear */ | /* don't linearize float buffers, assumed to be linear */ | ||||
| if (ibuf && !(ibuf->rect_float) && R.scene_color_manage) | if (ibuf && !(ibuf->rect_float) && R.scene_color_manage) | ||||
| Context not available. | |||||
| /* inverse gamma correction */ | /* inverse gamma correction */ | ||||
| if (mtex->tex->type==TEX_IMAGE) { | if (mtex->tex->type==TEX_IMAGE) { | ||||
| Image *ima = mtex->tex->ima; | Image *ima = mtex->tex->ima; | ||||
| ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &mtex->tex->iuser, har->pool); | ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &mtex->tex->iuser, har->pool, IMA_IBUF_IMA); | ||||
| /* don't linearize float buffers, assumed to be linear */ | /* don't linearize float buffers, assumed to be linear */ | ||||
| if (ibuf && !(ibuf->rect_float) && R.scene_color_manage) | if (ibuf && !(ibuf->rect_float) && R.scene_color_manage) | ||||
| Context not available. | |||||
| /* inverse gamma correction */ | /* inverse gamma correction */ | ||||
| if (tex->type==TEX_IMAGE) { | if (tex->type==TEX_IMAGE) { | ||||
| Image *ima = tex->ima; | Image *ima = tex->ima; | ||||
| ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, R.pool); | ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, R.pool, IMA_IBUF_IMA); | ||||
| /* don't linearize float buffers, assumed to be linear */ | /* don't linearize float buffers, assumed to be linear */ | ||||
| if (ibuf && !(ibuf->rect_float) && R.scene_color_manage) | if (ibuf && !(ibuf->rect_float) && R.scene_color_manage) | ||||
| Context not available. | |||||
| /* inverse gamma correction */ | /* inverse gamma correction */ | ||||
| if (tex->type==TEX_IMAGE) { | if (tex->type==TEX_IMAGE) { | ||||
| Image *ima = tex->ima; | Image *ima = tex->ima; | ||||
| ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, R.pool); | ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, R.pool, IMA_IBUF_IMA); | ||||
| /* don't linearize float buffers, assumed to be linear */ | /* don't linearize float buffers, assumed to be linear */ | ||||
| if (ibuf && !(ibuf->rect_float) && R.scene_color_manage) | if (ibuf && !(ibuf->rect_float) && R.scene_color_manage) | ||||
| Context not available. | |||||