2023-08-15 16:20:26 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2006 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2012-02-17 19:59:41 +01:00
|
|
|
#pragma once
|
Orange:
- New UI element: the "Curve Button".
For mapping ranges (like 0 - 1) to another range, the curve button can be
used for proportional falloff, bone influences, painting density, etc.
Most evident use is of course to map RGB color with curves.
To be able to use it, you have to allocate a CurveMapping struct and pass
this on to the button. The CurveMapping API is in the new C file
blenkernel/intern/colortools.c
It's as simple as calling:
curvemap= curvemapping_add(3, 0, 0, 1, 1)
Which will create 3 curves, and sets a default 0-1 range. The current code
only supports up to 4 curves maximum per mapping struct.
The CurveMap button in Blender than handles allmost all editing.
Evaluating a single channel:
float newvalue= curvemapping_evaluateF(curvemap, 0, oldval);
Where the second argument is the channel index, here 0-1-2 are possible.
Or mapping a vector:
curvemapping_evaluate3F(curvemap, newvec, oldvec);
Optimized versions for byte or short mapping is possible too, not done yet.
In butspace.c I've added a template wrapper for buttons around the curve, to
reveil settings or show tools; check this screenie:
http://www.blender.org/bf/curves.jpg
- Buttons R, G, B: select channel
- icons + and -: zoom in, out
- icon 'wrench': menu with tools, like clear curve, set handle type
- icon 'clipping': menu with clip values, and to dis/enable clipping
- icon 'x': delete selection
In the curve button itself, only LMB clicks are handled (like all UI elements
in Blender).
- click on point: select
- shift+click on point: swap select
- click on point + drag: select point (if not selected) and move it
- click outside point + drag: translate view
- CTRL+click: add new point
- hold SHIFT while dragging to snap to grid
(Yes I know... either one of these can be Blender compliant, not both!)
- if you drag a point exactly on top of another, it merges them
Other fixes:
- Icons now draw using "Safe RasterPos", so they align with pixel boundary.
the old code made ints from the raster pos coordinate, which doesn't work
well for zoom in/out situations
- bug in Node editing: buttons could not get freed, causing in memory error
prints at end of a Blender session. That one was a very simple, but nasty
error causing me all evening last night to find!
(Hint; check diff of editnode.c, where uiDoButtons is called)
Last note: this adds 3 new files in our tree, I did scons, but not MSVC!
2006-01-08 12:41:06 +01:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup bke
|
2011-02-18 14:05:18 +01:00
|
|
|
*/
|
|
|
|
|
2020-09-30 03:51:13 +02:00
|
|
|
struct BlendDataReader;
|
|
|
|
struct BlendWriter;
|
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 12:05:07 +02:00
|
|
|
struct ColorManagedColorspaceSettings;
|
|
|
|
struct ColorManagedDisplaySettings;
|
|
|
|
struct ColorManagedViewSettings;
|
Orange:
- New UI element: the "Curve Button".
For mapping ranges (like 0 - 1) to another range, the curve button can be
used for proportional falloff, bone influences, painting density, etc.
Most evident use is of course to map RGB color with curves.
To be able to use it, you have to allocate a CurveMapping struct and pass
this on to the button. The CurveMapping API is in the new C file
blenkernel/intern/colortools.c
It's as simple as calling:
curvemap= curvemapping_add(3, 0, 0, 1, 1)
Which will create 3 curves, and sets a default 0-1 range. The current code
only supports up to 4 curves maximum per mapping struct.
The CurveMap button in Blender than handles allmost all editing.
Evaluating a single channel:
float newvalue= curvemapping_evaluateF(curvemap, 0, oldval);
Where the second argument is the channel index, here 0-1-2 are possible.
Or mapping a vector:
curvemapping_evaluate3F(curvemap, newvec, oldvec);
Optimized versions for byte or short mapping is possible too, not done yet.
In butspace.c I've added a template wrapper for buttons around the curve, to
reveil settings or show tools; check this screenie:
http://www.blender.org/bf/curves.jpg
- Buttons R, G, B: select channel
- icons + and -: zoom in, out
- icon 'wrench': menu with tools, like clear curve, set handle type
- icon 'clipping': menu with clip values, and to dis/enable clipping
- icon 'x': delete selection
In the curve button itself, only LMB clicks are handled (like all UI elements
in Blender).
- click on point: select
- shift+click on point: swap select
- click on point + drag: select point (if not selected) and move it
- click outside point + drag: translate view
- CTRL+click: add new point
- hold SHIFT while dragging to snap to grid
(Yes I know... either one of these can be Blender compliant, not both!)
- if you drag a point exactly on top of another, it merges them
Other fixes:
- Icons now draw using "Safe RasterPos", so they align with pixel boundary.
the old code made ints from the raster pos coordinate, which doesn't work
well for zoom in/out situations
- bug in Node editing: buttons could not get freed, causing in memory error
prints at end of a Blender session. That one was a very simple, but nasty
error causing me all evening last night to find!
(Hint; check diff of editnode.c, where uiDoButtons is called)
Last note: this adds 3 new files in our tree, I did scons, but not MSVC!
2006-01-08 12:41:06 +01:00
|
|
|
struct CurveMap;
|
2012-05-15 20:34:00 +02:00
|
|
|
struct CurveMapPoint;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct CurveMapping;
|
2012-06-14 00:38:31 +02:00
|
|
|
struct Histogram;
|
2006-12-20 18:57:56 +01:00
|
|
|
struct ImBuf;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct Scopes;
|
Orange:
- New UI element: the "Curve Button".
For mapping ranges (like 0 - 1) to another range, the curve button can be
used for proportional falloff, bone influences, painting density, etc.
Most evident use is of course to map RGB color with curves.
To be able to use it, you have to allocate a CurveMapping struct and pass
this on to the button. The CurveMapping API is in the new C file
blenkernel/intern/colortools.c
It's as simple as calling:
curvemap= curvemapping_add(3, 0, 0, 1, 1)
Which will create 3 curves, and sets a default 0-1 range. The current code
only supports up to 4 curves maximum per mapping struct.
The CurveMap button in Blender than handles allmost all editing.
Evaluating a single channel:
float newvalue= curvemapping_evaluateF(curvemap, 0, oldval);
Where the second argument is the channel index, here 0-1-2 are possible.
Or mapping a vector:
curvemapping_evaluate3F(curvemap, newvec, oldvec);
Optimized versions for byte or short mapping is possible too, not done yet.
In butspace.c I've added a template wrapper for buttons around the curve, to
reveil settings or show tools; check this screenie:
http://www.blender.org/bf/curves.jpg
- Buttons R, G, B: select channel
- icons + and -: zoom in, out
- icon 'wrench': menu with tools, like clear curve, set handle type
- icon 'clipping': menu with clip values, and to dis/enable clipping
- icon 'x': delete selection
In the curve button itself, only LMB clicks are handled (like all UI elements
in Blender).
- click on point: select
- shift+click on point: swap select
- click on point + drag: select point (if not selected) and move it
- click outside point + drag: translate view
- CTRL+click: add new point
- hold SHIFT while dragging to snap to grid
(Yes I know... either one of these can be Blender compliant, not both!)
- if you drag a point exactly on top of another, it merges them
Other fixes:
- Icons now draw using "Safe RasterPos", so they align with pixel boundary.
the old code made ints from the raster pos coordinate, which doesn't work
well for zoom in/out situations
- bug in Node editing: buttons could not get freed, causing in memory error
prints at end of a Blender session. That one was a very simple, but nasty
error causing me all evening last night to find!
(Hint; check diff of editnode.c, where uiDoButtons is called)
Last note: this adds 3 new files in our tree, I did scons, but not MSVC!
2006-01-08 12:41:06 +01:00
|
|
|
struct rctf;
|
2009-07-17 04:43:15 +02:00
|
|
|
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_set_defaults(CurveMapping *cumap,
|
2023-08-30 22:36:36 +02:00
|
|
|
int tot,
|
|
|
|
float minx,
|
|
|
|
float miny,
|
|
|
|
float maxx,
|
|
|
|
float maxy,
|
|
|
|
short default_handle_type);
|
2024-01-04 21:07:48 +01:00
|
|
|
CurveMapping *BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
|
|
|
|
void BKE_curvemapping_free_data(CurveMapping *cumap);
|
|
|
|
void BKE_curvemapping_free(CurveMapping *cumap);
|
|
|
|
void BKE_curvemapping_copy_data(CurveMapping *target, const CurveMapping *cumap);
|
|
|
|
CurveMapping *BKE_curvemapping_copy(const CurveMapping *cumap);
|
2019-08-06 19:21:55 +02:00
|
|
|
void BKE_curvemapping_set_black_white_ex(const float black[3],
|
|
|
|
const float white[3],
|
|
|
|
float r_bwmul[3]);
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_set_black_white(CurveMapping *cumap,
|
2019-08-06 19:21:55 +02:00
|
|
|
const float black[3],
|
|
|
|
const float white[3]);
|
Orange:
- New UI element: the "Curve Button".
For mapping ranges (like 0 - 1) to another range, the curve button can be
used for proportional falloff, bone influences, painting density, etc.
Most evident use is of course to map RGB color with curves.
To be able to use it, you have to allocate a CurveMapping struct and pass
this on to the button. The CurveMapping API is in the new C file
blenkernel/intern/colortools.c
It's as simple as calling:
curvemap= curvemapping_add(3, 0, 0, 1, 1)
Which will create 3 curves, and sets a default 0-1 range. The current code
only supports up to 4 curves maximum per mapping struct.
The CurveMap button in Blender than handles allmost all editing.
Evaluating a single channel:
float newvalue= curvemapping_evaluateF(curvemap, 0, oldval);
Where the second argument is the channel index, here 0-1-2 are possible.
Or mapping a vector:
curvemapping_evaluate3F(curvemap, newvec, oldvec);
Optimized versions for byte or short mapping is possible too, not done yet.
In butspace.c I've added a template wrapper for buttons around the curve, to
reveil settings or show tools; check this screenie:
http://www.blender.org/bf/curves.jpg
- Buttons R, G, B: select channel
- icons + and -: zoom in, out
- icon 'wrench': menu with tools, like clear curve, set handle type
- icon 'clipping': menu with clip values, and to dis/enable clipping
- icon 'x': delete selection
In the curve button itself, only LMB clicks are handled (like all UI elements
in Blender).
- click on point: select
- shift+click on point: swap select
- click on point + drag: select point (if not selected) and move it
- click outside point + drag: translate view
- CTRL+click: add new point
- hold SHIFT while dragging to snap to grid
(Yes I know... either one of these can be Blender compliant, not both!)
- if you drag a point exactly on top of another, it merges them
Other fixes:
- Icons now draw using "Safe RasterPos", so they align with pixel boundary.
the old code made ints from the raster pos coordinate, which doesn't work
well for zoom in/out situations
- bug in Node editing: buttons could not get freed, causing in memory error
prints at end of a Blender session. That one was a very simple, but nasty
error causing me all evening last night to find!
(Hint; check diff of editnode.c, where uiDoButtons is called)
Last note: this adds 3 new files in our tree, I did scons, but not MSVC!
2006-01-08 12:41:06 +01:00
|
|
|
|
2015-10-25 12:14:19 +01:00
|
|
|
enum {
|
|
|
|
CURVEMAP_SLOPE_NEGATIVE = 0,
|
|
|
|
CURVEMAP_SLOPE_POSITIVE = 1,
|
2015-10-27 15:00:51 +01:00
|
|
|
CURVEMAP_SLOPE_POS_NEG = 2,
|
2015-10-25 12:14:19 +01:00
|
|
|
};
|
|
|
|
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Reset the view for current curve.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_reset_view(CurveMapping *cumap);
|
|
|
|
void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Removes with flag set.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemap_remove(CurveMap *cuma, short flag);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Remove specified point.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
bool BKE_curvemap_remove_point(CurveMap *cuma, CurveMapPoint *cmp);
|
|
|
|
CurveMapPoint *BKE_curvemap_insert(CurveMap *cuma, float x, float y);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* \param type: #eBezTriple_Handle
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemap_handle_set(CurveMap *cuma, int type);
|
Orange:
- New UI element: the "Curve Button".
For mapping ranges (like 0 - 1) to another range, the curve button can be
used for proportional falloff, bone influences, painting density, etc.
Most evident use is of course to map RGB color with curves.
To be able to use it, you have to allocate a CurveMapping struct and pass
this on to the button. The CurveMapping API is in the new C file
blenkernel/intern/colortools.c
It's as simple as calling:
curvemap= curvemapping_add(3, 0, 0, 1, 1)
Which will create 3 curves, and sets a default 0-1 range. The current code
only supports up to 4 curves maximum per mapping struct.
The CurveMap button in Blender than handles allmost all editing.
Evaluating a single channel:
float newvalue= curvemapping_evaluateF(curvemap, 0, oldval);
Where the second argument is the channel index, here 0-1-2 are possible.
Or mapping a vector:
curvemapping_evaluate3F(curvemap, newvec, oldvec);
Optimized versions for byte or short mapping is possible too, not done yet.
In butspace.c I've added a template wrapper for buttons around the curve, to
reveil settings or show tools; check this screenie:
http://www.blender.org/bf/curves.jpg
- Buttons R, G, B: select channel
- icons + and -: zoom in, out
- icon 'wrench': menu with tools, like clear curve, set handle type
- icon 'clipping': menu with clip values, and to dis/enable clipping
- icon 'x': delete selection
In the curve button itself, only LMB clicks are handled (like all UI elements
in Blender).
- click on point: select
- shift+click on point: swap select
- click on point + drag: select point (if not selected) and move it
- click outside point + drag: translate view
- CTRL+click: add new point
- hold SHIFT while dragging to snap to grid
(Yes I know... either one of these can be Blender compliant, not both!)
- if you drag a point exactly on top of another, it merges them
Other fixes:
- Icons now draw using "Safe RasterPos", so they align with pixel boundary.
the old code made ints from the raster pos coordinate, which doesn't work
well for zoom in/out situations
- bug in Node editing: buttons could not get freed, causing in memory error
prints at end of a Blender session. That one was a very simple, but nasty
error causing me all evening last night to find!
(Hint; check diff of editnode.c, where uiDoButtons is called)
Last note: this adds 3 new files in our tree, I did scons, but not MSVC!
2006-01-08 12:41:06 +01:00
|
|
|
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* \note only does current curvemap!.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_changed(CurveMapping *cumap, bool rem_doubles);
|
|
|
|
void BKE_curvemapping_changed_all(CurveMapping *cumap);
|
2006-02-14 18:32:49 +01:00
|
|
|
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Call before _all_ evaluation functions.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_init(CurveMapping *cumap);
|
2012-08-21 16:43:51 +02:00
|
|
|
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Keep these `const CurveMap` - to help with thread safety.
|
|
|
|
* \note Single curve, no table check.
|
|
|
|
* \note Table should be verified.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
float BKE_curvemap_evaluateF(const CurveMapping *cumap, const CurveMap *cuma, float value);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Single curve, with table check.
|
|
|
|
* Works with curve 'cur'.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
float BKE_curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Vector case.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_evaluate3F(const CurveMapping *cumap, float vecout[3], const float vecin[3]);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* RGB case, no black/white points, no pre-multiply.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_evaluateRGBF(const CurveMapping *cumap,
|
2019-08-06 19:21:55 +02:00
|
|
|
float vecout[3],
|
|
|
|
const float vecin[3]);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Byte version of #BKE_curvemapping_evaluateRGBF.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_evaluate_premulRGB(const CurveMapping *cumap,
|
2019-08-06 19:21:55 +02:00
|
|
|
unsigned char vecout_byte[3],
|
|
|
|
const unsigned char vecin_byte[3]);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Same as #BKE_curvemapping_evaluate_premulRGBF
|
|
|
|
* but black/bwmul are passed as args for the compositor
|
|
|
|
* where they can change per pixel.
|
|
|
|
*
|
|
|
|
* Use in conjunction with #BKE_curvemapping_set_black_white_ex
|
|
|
|
*
|
|
|
|
* \param black: Use instead of cumap->black
|
|
|
|
* \param bwmul: Use instead of cumap->bwmul
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_evaluate_premulRGBF_ex(const CurveMapping *cumap,
|
2019-08-06 19:21:55 +02:00
|
|
|
float vecout[3],
|
|
|
|
const float vecin[3],
|
|
|
|
const float black[3],
|
|
|
|
const float bwmul[3]);
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* RGB with black/white points and pre-multiply. tables are checked.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_evaluate_premulRGBF(const CurveMapping *cumap,
|
2019-08-06 19:21:55 +02:00
|
|
|
float vecout[3],
|
|
|
|
const float vecin[3]);
|
2024-01-04 21:07:48 +01:00
|
|
|
bool BKE_curvemapping_RGBA_does_something(const CurveMapping *cumap);
|
|
|
|
void BKE_curvemapping_table_F(const CurveMapping *cumap, float **array, int *size);
|
|
|
|
void BKE_curvemapping_table_RGBA(const CurveMapping *cumap, float **array, int *size);
|
2012-08-21 16:43:51 +02:00
|
|
|
|
2022-05-06 13:33:23 +02:00
|
|
|
/** Get the minimum x value of each curve map table. */
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_get_range_minimums(const CurveMapping *curve_mapping, float minimums[4]);
|
2022-05-06 13:33:23 +02:00
|
|
|
|
2023-03-09 00:39:49 +01:00
|
|
|
/**
|
|
|
|
* Get the reciprocal of the difference between the maximum and the minimum x value of each curve
|
2022-05-06 13:33:23 +02:00
|
|
|
* map table. Evaluation parameters can be multiplied by this value to be normalized. If the
|
2023-03-09 00:39:49 +01:00
|
|
|
* difference is zero, 1^8 is returned.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_compute_range_dividers(const CurveMapping *curve_mapping, float dividers[4]);
|
2022-05-06 13:33:23 +02:00
|
|
|
|
2023-03-09 00:39:49 +01:00
|
|
|
/**
|
|
|
|
* Compute the slopes at the start and end points of each curve map. The slopes are multiplied by
|
2022-05-06 13:33:23 +02:00
|
|
|
* the range of the curve map to compensate for parameter normalization. If the slope is vertical,
|
2023-03-09 00:39:49 +01:00
|
|
|
* 1^8 is returned.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_compute_slopes(const CurveMapping *curve_mapping,
|
2022-05-06 13:33:23 +02:00
|
|
|
float start_slopes[4],
|
|
|
|
float end_slopes[4]);
|
|
|
|
|
2023-03-09 00:39:49 +01:00
|
|
|
/**
|
|
|
|
* Check if the curve map at the index is identity, that is, does nothing.
|
|
|
|
* A curve map is said to be identity if:
|
2022-05-06 13:33:23 +02:00
|
|
|
* - The curve mapping uses extrapolation.
|
|
|
|
* - Its range is 1.
|
|
|
|
* - The slope at its start point is 1.
|
|
|
|
* - The slope at its end point is 1.
|
|
|
|
* - The number of points is 2.
|
|
|
|
* - The start point is at (0, 0).
|
|
|
|
* - The end point is at (1, 1).
|
|
|
|
* Note that this could return false even if the curve map is identity, this happens in the case
|
|
|
|
* when more than 2 points exist in the curve map but all points are collinear. */
|
2024-01-04 21:07:48 +01:00
|
|
|
bool BKE_curvemapping_is_map_identity(const CurveMapping *curve_mapping, int index);
|
2022-05-06 13:33:23 +02:00
|
|
|
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Call when you do images etc, needs restore too. also verifies tables.
|
|
|
|
* non-const (these modify the curve).
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_premultiply(CurveMapping *cumap, bool restore);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_blend_write(BlendWriter *writer, const CurveMapping *cumap);
|
|
|
|
void BKE_curvemapping_curves_blend_write(BlendWriter *writer, const CurveMapping *cumap);
|
Compositor: Make Hue Correct node wrap
Compositor: Make Hue Correct node wrap
This patch makes the Hue Correct node as well as the Hue Correct VSE
modifiers to wrap, such that no discontinuities occur for the red hue.
Since it now wraps, the default curve preset now exempts the last point
of the curve.
A new CUMA_USE_WRAPPING flag was added to specify wrapping for curve
maps. The implementation works by adding two virtual points before and
after the terminal points in the curve map, such that their handles
match, and would then produce a continues curve.
This is a breaking change, since existing curves were also adjusted
using versioning. However, the change will not be significant, since in
most realistic cases, the terminal points will be close to each other,
and even with wrapping, the connection will be very sharp, almost
matching the old behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/117114
2024-03-21 15:35:02 +01:00
|
|
|
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* \note `cumap` itself has been read already.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_curvemapping_blend_read(BlendDataReader *reader, CurveMapping *cumap);
|
2020-06-16 16:59:52 +02:00
|
|
|
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_histogram_update_sample_line(Histogram *hist,
|
|
|
|
ImBuf *ibuf,
|
|
|
|
const ColorManagedViewSettings *view_settings,
|
|
|
|
const ColorManagedDisplaySettings *display_settings);
|
|
|
|
void BKE_scopes_update(Scopes *scopes,
|
|
|
|
ImBuf *ibuf,
|
|
|
|
const ColorManagedViewSettings *view_settings,
|
|
|
|
const ColorManagedDisplaySettings *display_settings);
|
|
|
|
void BKE_scopes_free(Scopes *scopes);
|
|
|
|
void BKE_scopes_new(Scopes *scopes);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_color_managed_display_settings_init(ColorManagedDisplaySettings *settings);
|
|
|
|
void BKE_color_managed_display_settings_copy(ColorManagedDisplaySettings *new_settings,
|
|
|
|
const ColorManagedDisplaySettings *settings);
|
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 12:05:07 +02:00
|
|
|
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Initialize view settings to be best suitable for render type of viewing.
|
2019-02-01 20:30:10 +01:00
|
|
|
* This will use default view transform from the OCIO configuration if none
|
2021-12-07 07:19:15 +01:00
|
|
|
* is specified.
|
|
|
|
*/
|
2018-12-06 11:56:23 +01:00
|
|
|
void BKE_color_managed_view_settings_init_render(
|
2024-01-04 21:07:48 +01:00
|
|
|
ColorManagedViewSettings *settings,
|
|
|
|
const ColorManagedDisplaySettings *display_settings,
|
2019-02-01 20:30:10 +01:00
|
|
|
const char *view_transform);
|
2018-12-06 11:56:23 +01:00
|
|
|
|
2021-12-07 07:19:15 +01:00
|
|
|
/**
|
|
|
|
* Initialize view settings which are best suitable for viewing non-render images.
|
|
|
|
* For example,s movie clips while tracking.
|
|
|
|
*/
|
2018-12-06 12:21:37 +01:00
|
|
|
void BKE_color_managed_view_settings_init_default(
|
2024-01-04 21:07:48 +01:00
|
|
|
ColorManagedViewSettings *settings, const ColorManagedDisplaySettings *display_settings);
|
2018-12-06 12:21:37 +01:00
|
|
|
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_color_managed_view_settings_copy(ColorManagedViewSettings *new_settings,
|
|
|
|
const ColorManagedViewSettings *settings);
|
|
|
|
void BKE_color_managed_view_settings_free(ColorManagedViewSettings *settings);
|
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 12:05:07 +02:00
|
|
|
|
2024-01-04 21:07:48 +01:00
|
|
|
void BKE_color_managed_view_settings_blend_write(BlendWriter *writer,
|
|
|
|
ColorManagedViewSettings *settings);
|
|
|
|
void BKE_color_managed_view_settings_blend_read_data(BlendDataReader *reader,
|
|
|
|
ColorManagedViewSettings *settings);
|
2020-11-06 14:05:09 +01:00
|
|
|
|
2018-12-05 12:06:48 +01:00
|
|
|
void BKE_color_managed_colorspace_settings_init(
|
2024-01-04 21:07:48 +01:00
|
|
|
ColorManagedColorspaceSettings *colorspace_settings);
|
2018-12-05 12:06:48 +01:00
|
|
|
void BKE_color_managed_colorspace_settings_copy(
|
2024-01-04 21:07:48 +01:00
|
|
|
ColorManagedColorspaceSettings *colorspace_settings,
|
|
|
|
const ColorManagedColorspaceSettings *settings);
|
|
|
|
bool BKE_color_managed_colorspace_settings_equals(const ColorManagedColorspaceSettings *settings1,
|
|
|
|
const ColorManagedColorspaceSettings *settings2);
|