Code cleanup: remove unused function
This commit is contained in:
@@ -221,8 +221,5 @@ void glaDrawImBuf_glsl(struct ImBuf *ibuf, float x, float y, int zoomfilter,
|
||||
/* Draw imbuf on a screen, preferably using GLSL display transform */
|
||||
void glaDrawImBuf_glsl_ctx(const struct bContext *C, struct ImBuf *ibuf, float x, float y, int zoomfilter);
|
||||
|
||||
/* Transform buffer from role to scene linear space using GLSL OCIO conversion */
|
||||
int glaBufferTransformFromRole_glsl(float *buffer, int width, int height, int role);
|
||||
|
||||
#endif /* __BIF_GLUTIL_H__ */
|
||||
|
||||
|
@@ -1160,57 +1160,3 @@ void glaDrawImBuf_glsl_ctx(const bContext *C, ImBuf *ibuf, float x, float y, int
|
||||
|
||||
glaDrawImBuf_glsl(ibuf, x, y, zoomfilter, view_settings, display_settings);
|
||||
}
|
||||
|
||||
/* Transform buffer from role to scene linear space using GLSL OCIO conversion
|
||||
*
|
||||
* See IMB_colormanagement_setup_transform_from_role_glsl description for
|
||||
* some more details
|
||||
*
|
||||
* NOTE: this only works for RGBA buffers!
|
||||
*/
|
||||
int glaBufferTransformFromRole_glsl(float *buffer, int width, int height, int role)
|
||||
{
|
||||
GPUOffScreen *ofs;
|
||||
char err_out[256];
|
||||
rcti display_rect;
|
||||
|
||||
ofs = GPU_offscreen_create(width, height, err_out);
|
||||
|
||||
if (!ofs)
|
||||
return FALSE;
|
||||
|
||||
GPU_offscreen_bind(ofs);
|
||||
|
||||
if (!IMB_colormanagement_setup_transform_from_role_glsl(role, true)) {
|
||||
GPU_offscreen_unbind(ofs);
|
||||
GPU_offscreen_free(ofs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BLI_rcti_init(&display_rect, 0, width, 0, height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
|
||||
glaDefine2DArea(&display_rect);
|
||||
|
||||
glaDrawPixelsTex(0, 0, width, height, GL_RGBA, GL_FLOAT,
|
||||
GL_NEAREST, buffer);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
|
||||
GPU_offscreen_read_pixels(ofs, GL_FLOAT, buffer);
|
||||
|
||||
IMB_colormanagement_finish_glsl_transform();
|
||||
|
||||
/* unbind */
|
||||
GPU_offscreen_unbind(ofs);
|
||||
GPU_offscreen_free(ofs);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user