diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-15 14:05:07 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-15 14:05:07 +0400 |
commit | a73dd3476e7d180d3320afc04d218ce22f2f3bfc (patch) | |
tree | a540f5657bc9e8692eb0d3417de71393bad6bece /source/blender/makesdna | |
parent | b93da9b01e163158a830872d29f8bd874f63d54d (diff) |
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!
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_color_types.h | 22 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_image_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_movieclip_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 11 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 13 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 8 |
6 files changed, 59 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h index 4ead26c04f3..32a0629c338 100644 --- a/source/blender/makesdna/DNA_color_types.h +++ b/source/blender/makesdna/DNA_color_types.h @@ -160,6 +160,26 @@ typedef struct Scopes { #define SCOPES_WAVEFRM_YCC_709 3 #define SCOPES_WAVEFRM_YCC_JPEG 4 +typedef struct ColorManagedViewSettings { + int flag, pad; + char view_transform[64]; /* view transform which is being applied when displaying buffer on the screen */ + float exposure; /* fstop exposure */ + float gamma; /* post-display gamma transform */ + struct CurveMapping *curve_mapping; /* pre-display RGB curves transform */ + void *pad2; +} ColorManagedViewSettings; + +typedef struct ColorManagedDisplaySettings { + char display_device[64]; +} ColorManagedDisplaySettings; + +typedef struct ColorManagedColorspaceSettings { + char name[64]; /* MAX_COLORSPACE_NAME */ +} ColorManagedColorspaceSettings; + +/* ColorManagedViewSettings->flag */ +enum { + COLORMANAGE_VIEW_USE_CURVES = (1 << 0) +}; #endif - diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index 4a4b21017db..38058dbb699 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -33,6 +33,7 @@ #define __DNA_IMAGE_TYPES_H__ #include "DNA_ID.h" +#include "DNA_color_types.h" /* for color management */ struct PackedFile; struct Scene; @@ -107,6 +108,9 @@ typedef struct Image { /* display aspect - for UV editing images resized for faster openGL display */ float aspx, aspy; + + /* color management */ + ColorManagedColorspaceSettings colorspace_settings; } Image; @@ -123,6 +127,7 @@ typedef struct Image { #define IMA_CM_PREDIVIDE 256 #define IMA_USED_FOR_RENDER 512 #define IMA_USER_FRAME_IN_RANGE 1024 /* for image user, but these flags are mixed */ +#define IMA_VIEW_AS_RENDER 2048 /* Image.tpageflag */ #define IMA_TILES 1 diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h index d8bba4a3bf5..cda51779528 100644 --- a/source/blender/makesdna/DNA_movieclip_types.h +++ b/source/blender/makesdna/DNA_movieclip_types.h @@ -37,6 +37,7 @@ #include "DNA_ID.h" #include "DNA_tracking_types.h" +#include "DNA_color_types.h" /* for color management */ struct anim; struct AnimData; @@ -94,6 +95,9 @@ typedef struct MovieClip { /* from a file. affects only a way how scene frame is mapping */ /* to a file name and not touches other data associated with */ /* a clip */ + + /* color management */ + ColorManagedColorspaceSettings colorspace_settings; } MovieClip; typedef struct MovieClipScopes { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 23a8cb098f4..e3a8863714a 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -41,6 +41,7 @@ extern "C" { #endif +#include "DNA_color_types.h" /* color management */ #include "DNA_vec_types.h" #include "DNA_listBase.h" #include "DNA_ID.h" @@ -273,6 +274,9 @@ typedef struct ImageFormatData { char pad[7]; + /* color management */ + ColorManagedViewSettings view_settings; + ColorManagedDisplaySettings display_settings; } ImageFormatData; @@ -1133,6 +1137,11 @@ typedef struct Scene { uint64_t customdata_mask; /* XXX. runtime flag for drawing, actually belongs in the window, only used by BKE_object_handle_update() */ uint64_t customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */ + + /* Color Management */ + ColorManagedViewSettings view_settings; + ColorManagedDisplaySettings display_settings; + ColorManagedColorspaceSettings sequencer_colorspace_settings; } Scene; @@ -1254,7 +1263,7 @@ typedef struct Scene { #define R_ALPHAKEY 2 /* color_mgt_flag */ -#define R_COLOR_MANAGEMENT (1 << 0) +#define R_COLOR_MANAGEMENT (1 << 0) /* deprecated, should only be used in versioning code only */ #define R_COLOR_MANAGEMENT_PREDIVIDE (1 << 1) /* subimtype, flag options for imtype */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index d094c1d6255..4d259fad246 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -275,6 +275,18 @@ typedef struct BrightContrastModifierData { float contrast; } BrightContrastModifierData; +/* ***************** Scopes ****************** */ + +typedef struct SequencerScopes { + struct ImBuf *reference_ibuf; + + struct ImBuf *zebra_ibuf; + struct ImBuf *waveform_ibuf; + struct ImBuf *sep_waveform_ibuf; + struct ImBuf *vector_ibuf; + struct ImBuf *histogram_ibuf; +} SequencerScopes; + #define MAXSEQ 32 #define SELECT 1 @@ -317,6 +329,7 @@ typedef struct BrightContrastModifierData { #define SEQ_USE_PROXY_CUSTOM_FILE (1 << 21) #define SEQ_USE_EFFECT_DEFAULT_FADE (1 << 22) +#define SEQ_USE_LINEAR_MODIFIERS (1 << 23) // flags for whether those properties are animated or not #define SEQ_AUDIO_VOLUME_ANIMATED (1 << 24) diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index b828247c816..6cc4541f19e 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -40,6 +40,7 @@ #include "DNA_outliner_types.h" /* for TreeStoreElem */ #include "DNA_image_types.h" /* ImageUser */ #include "DNA_movieclip_types.h" /* MovieClipUser */ +#include "DNA_sequence_types.h" /* SequencerScopes */ /* Hum ... Not really nice... but needed for spacebuts. */ #include "DNA_view2d_types.h" @@ -473,6 +474,8 @@ typedef struct SpaceSeq { int overlay_type; struct bGPdata *gpd; /* grease-pencil data */ + + struct SequencerScopes scopes; /* different scoped displayed in space */ } SpaceSeq; @@ -685,8 +688,9 @@ typedef struct SpaceImage { struct Image *image; struct ImageUser iuser; - struct CurveMapping *cumap; - + + struct CurveMapping *cumap DNA_DEPRECATED; /* was switched to scene's color management settings */ + struct Scopes scopes; /* histogram waveform and vectorscope */ struct Histogram sample_line_hist; /* sample line histogram */ |