2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2009-01-28 21:43:43 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2009-01-28 21:43:43 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-01-28 21:43:43 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup editors
|
2011-02-21 07:25:24 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __ED_IMAGE_H__
|
|
|
|
|
#define __ED_IMAGE_H__
|
2009-01-28 21:43:43 +00:00
|
|
|
|
2019-01-28 21:08:24 +11:00
|
|
|
struct ARegion;
|
|
|
|
|
struct ImBuf;
|
2009-02-21 19:17:31 +00:00
|
|
|
struct Image;
|
|
|
|
|
struct ImageUser;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
struct Scene;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct SpaceImage;
|
|
|
|
|
struct ToolSettings;
|
2017-11-22 10:52:39 -02:00
|
|
|
struct ViewLayer;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bContext;
|
|
|
|
|
struct wmWindowManager;
|
2009-01-28 21:43:43 +00:00
|
|
|
|
2012-07-25 10:15:24 +00:00
|
|
|
/* image_edit.c, exported for transform */
|
2009-01-28 21:43:43 +00:00
|
|
|
struct Image *ED_space_image(struct SpaceImage *sima);
|
2019-03-11 12:44:14 +01:00
|
|
|
void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, struct Object *obedit, struct Image *ima, bool automatic);
|
|
|
|
|
void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima);
|
2012-07-25 10:39:54 +00:00
|
|
|
struct Mask *ED_space_image_get_mask(struct SpaceImage *sima);
|
|
|
|
|
void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask);
|
2009-02-09 20:58:31 +00:00
|
|
|
|
2017-04-20 22:41:26 +02:00
|
|
|
bool ED_space_image_color_sample(struct SpaceImage *sima, struct ARegion *ar, int mval[2], float r_col[3]);
|
2015-05-08 07:25:39 +10:00
|
|
|
struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock);
|
2012-11-15 15:59:58 +00:00
|
|
|
void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock);
|
2014-01-28 03:52:21 +11:00
|
|
|
bool ED_space_image_has_buffer(struct SpaceImage *sima);
|
2009-09-30 18:18:32 +00:00
|
|
|
|
2012-07-25 16:30:53 +00:00
|
|
|
void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height);
|
2012-07-26 11:47:47 +00:00
|
|
|
void ED_space_image_get_size_fl(struct SpaceImage *sima, float size[2]);
|
2012-07-25 16:30:53 +00:00
|
|
|
void ED_space_image_get_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
|
|
|
|
|
void ED_space_image_get_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy);
|
|
|
|
|
void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
|
2009-01-28 21:43:43 +00:00
|
|
|
|
2015-01-12 14:21:23 +01:00
|
|
|
void ED_space_image_scopes_update(const struct bContext *C, struct SpaceImage *sima, struct ImBuf *ibuf, bool use_view_settings);
|
|
|
|
|
|
2018-06-11 11:05:37 +02:00
|
|
|
void ED_space_image_paint_update(struct Main *bmain, struct wmWindowManager *wm, struct Scene *scene);
|
|
|
|
|
void ED_space_image_uv_sculpt_update(struct Main *bmain, struct wmWindowManager *wm, struct Scene *scene);
|
2010-10-20 00:42:19 +00:00
|
|
|
|
2012-09-13 05:29:38 +00:00
|
|
|
void ED_image_get_uv_aspect(struct Image *ima, struct ImageUser *iuser, float *aspx, float *aspy);
|
2012-07-27 15:15:55 +00:00
|
|
|
void ED_image_mouse_pos(struct SpaceImage *sima, struct ARegion *ar, const int mval[2], float co[2]);
|
2012-07-26 09:54:52 +00:00
|
|
|
void ED_image_point_pos(struct SpaceImage *sima, struct ARegion *ar, float x, float y, float *xr, float *yr);
|
|
|
|
|
void ED_image_point_pos__reverse(struct SpaceImage *sima, struct ARegion *ar, const float co[2], float r_co[2]);
|
2015-11-16 07:13:40 +11:00
|
|
|
bool ED_image_slot_cycle(struct Image *image, int direction);
|
2009-02-09 20:58:31 +00:00
|
|
|
|
2014-01-28 03:52:21 +11:00
|
|
|
bool ED_space_image_show_render(struct SpaceImage *sima);
|
|
|
|
|
bool ED_space_image_show_paint(struct SpaceImage *sima);
|
|
|
|
|
bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit);
|
2009-02-09 20:58:31 +00:00
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
bool ED_space_image_paint_curve(const struct bContext *C);
|
|
|
|
|
|
2018-04-05 18:20:27 +02:00
|
|
|
bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct ViewLayer *view_layer);
|
2018-07-02 11:47:00 +02:00
|
|
|
bool ED_space_image_maskedit_poll(struct bContext *C);
|
|
|
|
|
bool ED_space_image_maskedit_mask_poll(struct bContext *C);
|
2012-07-25 10:39:54 +00:00
|
|
|
|
2014-03-31 23:39:08 +11:00
|
|
|
void ED_image_draw_info(struct Scene *scene, struct ARegion *ar, bool color_manage, bool use_default_view, int channels, int x, int y,
|
2013-03-18 11:34:05 +00:00
|
|
|
const unsigned char cp[4], const float fp[4], const float linearcol[4], int *zp, float *zpf);
|
2012-01-12 05:46:45 +00:00
|
|
|
|
2014-12-09 20:33:19 +05:00
|
|
|
bool ED_space_image_show_cache(struct SpaceImage *sima);
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __ED_IMAGE_H__ */
|