static ImBuf *prepare_write_imbuf(ImFileType *type, ImBuf *ibuf) { ImBuf *write_ibuf = ibuf; if (type->flag & IM_FTYPE_FLOAT) { /* pass */ } else { if (ibuf->rect == NULL && ibuf->rect_float) { ibuf->rect_colorspace = colormanage_colorspace_get_roled(COLOR_ROLE_DEFAULT_BYTE); IMB_rect_from_float(ibuf); } } return write_ibuf; }
ImBuf *IMB_prepare_write_ImBuf(const bool isfloat, ImBuf *ibuf) { ImBuf *write_ibuf = ibuf; if (isfloat) { /* pass */ } else { if (ibuf->rect == NULL && ibuf->rect_float) { ibuf->rect_colorspace = colormanage_colorspace_get_roled(COLOR_ROLE_DEFAULT_BYTE); IMB_rect_from_float(ibuf); } } return write_ibuf; }