Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2009-07-17 06:43:15 +0400
committerMatt Ebb <matt@mke3.net>2009-07-17 06:43:15 +0400
commit1ef729358517248888073be71ba5d3b6e3d723ee (patch)
treedfa33f083ac1afd500e76dcf4bc581394637d0dd /source/blender/blenlib
parent70f6255433fcb1f5551199ef7a285a9ab80a3318 (diff)
Colour Management
- 1st stage: Linear Workflow This implements automatic linear workflow in Blender's renderer. With the new Colour Management option on in the Render buttons, all inputs to the renderer and compositor are converted to linear colour space before rendering, and gamma corrected afterwards. In essence, this makes all manual gamma correction with nodes, etc unnecessary, since it's done automatically through the pipeline. It's all explained much better in the notes/doc here, so please have a look: http://wiki.blender.org/index.php/Dev:Source/Blender/Architecture/Colour_Management And an example of the sort of difference it makes: http://mke3.net/blender/devel/rendering/b25_colormanagement_test01.jpg This also enables Colour Management in the default B.blend, and changes the default lamp falloff to inverse square, which is more correct, and much easier to use now it's all gamma corrected properly. Next step is to look into profiles/soft proofing for the compositor. Thanks to brecht for reviewing and fixing some oversights!
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_arithb.h1
-rw-r--r--source/blender/blenlib/intern/arithb.c27
2 files changed, 2 insertions, 26 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h
index 787579250ed..a4f49779ca1 100644
--- a/source/blender/blenlib/BLI_arithb.h
+++ b/source/blender/blenlib/BLI_arithb.h
@@ -339,7 +339,6 @@ void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr);
void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv);
void xyz_to_rgb(float x, float y, float z, float *r, float *g, float *b, int colorspace);
int constrain_rgb(float *r, float *g, float *b);
-void gamma_correct_rgb(float *r, float *g, float *b);
unsigned int hsv_to_cpack(float h, float s, float v);
unsigned int rgb_to_cpack(float r, float g, float b);
void cpack_to_rgb(unsigned int col, float *r, float *g, float *b);
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index f111e94a141..03be10dd0b1 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -3542,33 +3542,10 @@ int constrain_rgb(float *r, float *g, float *b)
if (w > 0) {
*r += w; *g += w; *b += w;
- return 1; /* Colour modified to fit RGB gamut */
+ return 1; /* Color modified to fit RGB gamut */
}
- return 0; /* Colour within RGB gamut */
-}
-
-/*Transform linear RGB values to nonlinear RGB values. Rec.
- 709 is ITU-R Recommendation BT. 709 (1990) ``Basic
- Parameter Values for the HDTV Standard for the Studio and
- for International Programme Exchange'', formerly CCIR Rec.
- 709.*/
-static void gamma_correct(float *c)
-{
- /* Rec. 709 gamma correction. */
- float cc = 0.018f;
-
- if (*c < cc)
- *c *= ((1.099f * (float)pow(cc, 0.45)) - 0.099f) / cc;
- else
- *c = (1.099f * (float)pow(*c, 0.45)) - 0.099f;
-}
-
-void gamma_correct_rgb(float *r, float *g, float *b)
-{
- gamma_correct(r);
- gamma_correct(g);
- gamma_correct(b);
+ return 0; /* Color within RGB gamut */
}