Blender  V2.59
BKE_colortools.h
Go to the documentation of this file.
00001 /*
00002  * $Id: BKE_colortools.h 36715 2011-05-16 13:34:42Z blendix $ 
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version. 
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2006 Blender Foundation.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL/BL DUAL LICENSE BLOCK *****
00028  */
00029 #ifndef BKE_COLORTOOLS_H
00030 #define BKE_COLORTOOLS_H
00031 
00036 struct CurveMapping;
00037 struct CurveMap;
00038 struct Scopes;
00039 struct ImBuf;
00040 struct rctf;
00041 
00042 #if defined _WIN32
00043 #   define DO_INLINE __inline
00044 #elif defined (__sgi)
00045 #   define DO_INLINE
00046 #elif defined (__sun) || defined (__sun__)
00047 #   define DO_INLINE
00048 #else
00049 #   define DO_INLINE static inline
00050 #endif
00051 
00052 void                            floatbuf_to_srgb_byte(float *rectf, unsigned char *rectc, int x1, int x2, int y1, int y2, int w);
00053 void                            floatbuf_to_byte(float *rectf, unsigned char *rectc, int x1, int x2, int y1, int y2, int w);
00054 
00055 struct CurveMapping     *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
00056 void                            curvemapping_free(struct CurveMapping *cumap);
00057 struct CurveMapping     *curvemapping_copy(struct CurveMapping *cumap);
00058 void                            curvemapping_set_black_white(struct CurveMapping *cumap, float *black, float *white);
00059 
00060 #define CURVEMAP_SLOPE_NEGATIVE 0
00061 #define CURVEMAP_SLOPE_POSITIVE 1
00062 void                            curvemap_reset(struct CurveMap *cuma, struct rctf *clipr, int preset, int slope);
00063 void                            curvemap_remove(struct CurveMap *cuma, int flag);
00064 void                            curvemap_insert(struct CurveMap *cuma, float x, float y);
00065 void                            curvemap_sethandle(struct CurveMap *cuma, int type);
00066 
00067 void                            curvemapping_changed(struct CurveMapping *cumap, int rem_doubles);
00068                                         
00069                                         /* single curve, no table check */
00070 float                           curvemap_evaluateF(struct CurveMap *cuma, float value);
00071                                         /* single curve, with table check */
00072 float                           curvemapping_evaluateF(struct CurveMapping *cumap, int cur, float value);
00073 void                            curvemapping_evaluate3F(struct CurveMapping *cumap, float *vecout, const float *vecin);
00074 void                            curvemapping_evaluateRGBF(struct CurveMapping *cumap, float *vecout, const float *vecin);
00075 void                            curvemapping_evaluate_premulRGBF(struct CurveMapping *cumap, float *vecout, const float *vecin);
00076 void                            curvemapping_do_ibuf(struct CurveMapping *cumap, struct ImBuf *ibuf);
00077 void                            curvemapping_premultiply(struct CurveMapping *cumap, int restore);
00078 int                                     curvemapping_RGBA_does_something(struct CurveMapping *cumap);
00079 void                            curvemapping_initialize(struct CurveMapping *cumap);
00080 void                            curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
00081 
00082 void                            scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management);
00083 void                            scopes_free(struct Scopes *scopes);
00084 void                            scopes_new(struct Scopes *scopes);
00085 
00086 #endif
00087