2011-02-17 21:48:12 +01:00
|
|
|
/*
|
2008-04-17 00:40:48 +02:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 13:37:38 +02: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
|
2008-04-17 00:40:48 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 13:37:38 +02: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 14:34:04 +01:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 13:37:38 +02:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
2008-04-17 00:40:48 +02:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 13:37:38 +02:00
|
|
|
*/
|
|
|
|
|
2011-02-17 21:48:12 +01:00
|
|
|
/** \file DNA_image_types.h
|
|
|
|
* \ingroup DNA
|
|
|
|
*/
|
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#ifndef __DNA_IMAGE_TYPES_H__
|
|
|
|
#define __DNA_IMAGE_TYPES_H__
|
2011-12-30 08:25:49 +01:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
#include "DNA_ID.h"
|
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
|
|
|
#include "DNA_color_types.h" /* for color management */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
|
|
|
struct PackedFile;
|
2009-01-04 15:14:06 +01:00
|
|
|
struct Scene;
|
2002-10-12 13:37:38 +02:00
|
|
|
struct anim;
|
|
|
|
struct ImBuf;
|
2006-12-20 18:57:56 +01:00
|
|
|
struct RenderResult;
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 22:51:28 +02:00
|
|
|
struct GPUTexture;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2006-06-05 13:07:15 +02:00
|
|
|
|
2006-12-20 18:57:56 +01:00
|
|
|
/* ImageUser is in Texture, in Nodes, Background Image, Image Window, .... */
|
|
|
|
/* should be used in conjunction with an ID * to Image. */
|
|
|
|
typedef struct ImageUser {
|
2010-11-21 04:45:35 +01:00
|
|
|
struct Scene *scene; /* to retrieve render result */
|
|
|
|
|
2006-12-20 18:57:56 +01:00
|
|
|
int framenr; /* movies, sequences: current to display */
|
|
|
|
int frames; /* total amount of frames to use */
|
|
|
|
int offset, sfra; /* offset within movie, start frame in global time */
|
2010-11-21 04:45:35 +01:00
|
|
|
char fie_ima, cycl; /* fields/image in movie, cyclic flag */
|
|
|
|
char ok, pad;
|
|
|
|
|
2006-12-20 18:57:56 +01:00
|
|
|
short multi_index, layer, pass; /* listbase indices, for menu browsing or retrieve buffer */
|
2010-11-10 01:51:34 +01:00
|
|
|
|
2010-11-21 04:45:35 +01:00
|
|
|
short flag;
|
|
|
|
|
|
|
|
int pad2;
|
|
|
|
|
2006-12-20 18:57:56 +01:00
|
|
|
} ImageUser;
|
|
|
|
|
|
|
|
/* iuser->flag */
|
|
|
|
#define IMA_ANIM_ALWAYS 1
|
|
|
|
#define IMA_ANIM_REFRESHED 2
|
2008-02-26 12:38:32 +01:00
|
|
|
/* #define IMA_DO_PREMUL 4 */
|
2012-06-04 12:41:18 +02:00
|
|
|
#define IMA_NEED_FRAME_RECALC 8
|
2006-12-20 18:57:56 +01:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct Image {
|
|
|
|
ID id;
|
|
|
|
|
2012-01-21 15:54:53 +01:00
|
|
|
char name[1024]; /* file path, 1024 = FILE_MAX */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 22:51:28 +02:00
|
|
|
ListBase ibufs; /* not written in file */
|
|
|
|
struct GPUTexture *gputexture; /* not written in file */
|
2006-12-20 18:57:56 +01:00
|
|
|
|
|
|
|
/* sources from: */
|
2002-10-12 13:37:38 +02:00
|
|
|
struct anim *anim;
|
2006-12-20 18:57:56 +01:00
|
|
|
struct RenderResult *rr;
|
2010-03-27 16:35:34 +01:00
|
|
|
|
|
|
|
struct RenderResult *renders[8]; /* IMA_MAX_RENDER_SLOT */
|
|
|
|
short render_slot, last_render_slot;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
|
|
|
short ok, flag;
|
2010-03-27 16:35:34 +01:00
|
|
|
short source, type;
|
2006-05-06 17:26:53 +02:00
|
|
|
int lastframe;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2003-04-27 13:55:33 +02:00
|
|
|
/* texture page */
|
2002-10-12 13:37:38 +02:00
|
|
|
short tpageflag, totbind;
|
|
|
|
short xrep, yrep;
|
|
|
|
short twsta, twend;
|
2006-12-20 18:57:56 +01:00
|
|
|
unsigned int bindcode; /* only for current image... */
|
2003-04-27 13:55:33 +02:00
|
|
|
unsigned int *repbind; /* for repeat of parts of images */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2012-05-03 23:35:04 +02:00
|
|
|
struct PackedFile *packedfile;
|
|
|
|
struct PreviewImage *preview;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2010-03-27 16:35:34 +01:00
|
|
|
/* game engine tile animation */
|
2002-10-12 13:37:38 +02:00
|
|
|
float lastupdate;
|
2005-11-20 21:19:48 +01:00
|
|
|
int lastused;
|
2002-10-12 13:37:38 +02:00
|
|
|
short animspeed;
|
2013-02-26 22:58:06 +01:00
|
|
|
short pad2;
|
2006-12-20 18:57:56 +01:00
|
|
|
|
2010-03-27 16:35:34 +01:00
|
|
|
/* for generated images */
|
2013-02-26 22:58:06 +01:00
|
|
|
int gen_x, gen_y;
|
2011-07-21 02:41:00 +02:00
|
|
|
char gen_type, gen_flag;
|
2013-08-12 09:47:44 +02:00
|
|
|
short gen_depth;
|
2006-12-20 18:57:56 +01:00
|
|
|
|
2007-09-21 00:38:04 +02:00
|
|
|
/* display aspect - for UV editing images resized for faster openGL display */
|
|
|
|
float aspx, aspy;
|
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
|
|
|
|
|
|
|
/* color management */
|
|
|
|
ColorManagedColorspaceSettings colorspace_settings;
|
2012-12-31 14:52:13 +01:00
|
|
|
char alpha_mode;
|
|
|
|
|
|
|
|
char pad[7];
|
2002-10-12 13:37:38 +02:00
|
|
|
} Image;
|
|
|
|
|
|
|
|
|
|
|
|
/* **************** IMAGE ********************* */
|
|
|
|
|
2010-07-30 08:09:23 +02:00
|
|
|
/* Image.flag */
|
2011-12-30 15:17:11 +01:00
|
|
|
#define IMA_FIELDS 1
|
|
|
|
#define IMA_STD_FIELD 2
|
2012-12-31 14:52:13 +01:00
|
|
|
#define IMA_DO_PREMUL 4 /* deprecated, should not be used */
|
2011-12-30 15:17:11 +01:00
|
|
|
#define IMA_REFLECT 16
|
|
|
|
#define IMA_NOCOLLECT 32
|
2013-05-28 03:15:59 +02:00
|
|
|
// #define IMA_DONE_TAG 64 // UNUSED
|
2011-12-30 15:17:11 +01:00
|
|
|
#define IMA_OLD_PREMUL 128
|
2012-12-31 14:52:13 +01:00
|
|
|
/*#define IMA_CM_PREDIVIDE 256*/ /* deprecated, should not be used */
|
2012-01-20 08:43:46 +01:00
|
|
|
#define IMA_USED_FOR_RENDER 512
|
2012-07-03 16:04:39 +02:00
|
|
|
#define IMA_USER_FRAME_IN_RANGE 1024 /* for image user, but these flags are mixed */
|
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
|
|
|
#define IMA_VIEW_AS_RENDER 2048
|
2012-12-31 14:52:13 +01:00
|
|
|
#define IMA_IGNORE_ALPHA 4096
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2010-07-30 08:09:23 +02:00
|
|
|
/* Image.tpageflag */
|
2006-11-27 00:14:52 +01:00
|
|
|
#define IMA_TILES 1
|
|
|
|
#define IMA_TWINANIM 2
|
|
|
|
#define IMA_COLCYCLE 4 /* Depreciated */
|
|
|
|
#define IMA_MIPMAP_COMPLETE 8 /* all mipmap levels in OpenGL texture set? */
|
2010-02-13 14:09:30 +01:00
|
|
|
#define IMA_CLAMP_U 16
|
|
|
|
#define IMA_CLAMP_V 32
|
|
|
|
#define IMA_TPAGE_REFRESH 64
|
2012-10-25 17:25:28 +02:00
|
|
|
#define IMA_GLBIND_IS_DATA 128 /* opengl image texture bound as non-color data */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2006-12-20 18:57:56 +01:00
|
|
|
/* ima->type and ima->source moved to BKE_image.h, for API */
|
|
|
|
|
2010-03-27 16:35:34 +01:00
|
|
|
/* render */
|
|
|
|
#define IMA_MAX_RENDER_TEXT 512
|
|
|
|
#define IMA_MAX_RENDER_SLOT 8
|
2009-07-10 18:55:49 +02:00
|
|
|
|
2011-07-21 02:41:00 +02:00
|
|
|
/* gen_flag */
|
|
|
|
#define IMA_GEN_FLOAT 1
|
|
|
|
|
2012-12-31 14:52:13 +01:00
|
|
|
/* alpha_mode */
|
|
|
|
enum {
|
|
|
|
IMA_ALPHA_STRAIGHT = 0,
|
|
|
|
IMA_ALPHA_PREMUL = 1,
|
|
|
|
};
|
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
#endif
|