Blender V2.61 - r43446
|
Go to the source code of this file.
Defines | |
#define | BLI_XYZ_SMPTE 0 |
#define | BLI_XYZ_REC709_SRGB 1 |
#define | BLI_XYZ_CIE 2 |
#define | BLI_PR_NONE 0 |
#define | BLI_PR_SRGB 1 |
#define | BLI_PR_REC709 2 |
#define | BLI_YCC_ITU_BT601 0 |
#define | BLI_YCC_ITU_BT709 1 |
#define | BLI_YCC_JFIF_0_255 2 |
Functions | |
void | hsv_to_rgb (float h, float s, float v, float *r, float *g, float *b) |
void | hex_to_rgb (char *hexcol, float *r, float *g, float *b) |
void | yuv_to_rgb (float y, float u, float v, float *lr, float *lg, float *lb) |
void | ycc_to_rgb (float y, float cb, float cr, float *lr, float *lg, float *lb, int colorspace) |
void | xyz_to_rgb (float x, float y, float z, float *r, float *g, float *b, int colorspace) |
void | cpack_to_rgb (unsigned int col, float *r, float *g, float *b) |
void | rgb_to_yuv (float r, float g, float b, float *ly, float *lu, float *lv) |
void | rgb_to_ycc (float r, float g, float b, float *ly, float *lcb, float *lcr, int colorspace) |
void | rgb_to_hsv (float r, float g, float b, float *lh, float *ls, float *lv) |
void | rgb_to_hsv_compat (float r, float g, float b, float *lh, float *ls, float *lv) |
unsigned int | rgb_to_cpack (float r, float g, float b) |
unsigned int | hsv_to_cpack (float h, float s, float v) |
float | rgb_to_grayscale (const float rgb[3]) |
unsigned char | rgb_to_grayscale_byte (const unsigned char rgb[3]) |
float | rgb_to_luma (const float rgb[3]) |
unsigned char | rgb_to_luma_byte (const unsigned char rgb[3]) |
void | gamma_correct (float *c, float gamma) |
float | rec709_to_linearrgb (float c) |
float | linearrgb_to_rec709 (float c) |
float | srgb_to_linearrgb (float c) |
float | linearrgb_to_srgb (float c) |
MINLINE void | srgb_to_linearrgb_v3_v3 (float linear[3], const float srgb[3]) |
MINLINE void | linearrgb_to_srgb_v3_v3 (float srgb[3], const float linear[3]) |
MINLINE void | srgb_to_linearrgb_v4 (float linear[4], const float srgb[4]) |
MINLINE void | linearrgb_to_srgb_v4 (float srgb[4], const float linear[4]) |
MINLINE void | srgb_to_linearrgb_predivide_v4 (float linear[4], const float srgb[4]) |
MINLINE void | linearrgb_to_srgb_predivide_v4 (float srgb[4], const float linear[4]) |
void | BLI_init_srgb_conversion (void) |
int | constrain_rgb (float *r, float *g, float *b) |
void | minmax_rgb (short c[3]) |
void | rgb_float_set_hue_float_offset (float *rgb, float hue_offset) |
void | rgb_byte_set_hue_float_offset (unsigned char *rgb, float hue_offset) |
void | rgb_byte_to_float (const unsigned char in[3], float out[3]) |
void | rgb_float_to_byte (const float in[3], unsigned char out[3]) |
void | lift_gamma_gain_to_asc_cdl (float *lift, float *gamma, float *gain, float *offset, float *slope, float *power) |
Definition in file BLI_math_color.h.
#define BLI_PR_NONE 0 |
Definition at line 45 of file BLI_math_color.h.
Referenced by do_hex_rna_cb(), ui_block_func_COL(), ui_draw_but_COLORBAND(), ui_draw_but_HSV_v(), ui_draw_but_HSVCIRCLE(), ui_ndofedit_but_HSVCUBE(), ui_numedit_but_HSVCUBE(), ui_update_block_buts_rgb(), uiBlockPicker(), and widget_swatch().
#define BLI_PR_REC709 2 |
Definition at line 47 of file BLI_math_color.h.
#define BLI_PR_SRGB 1 |
Definition at line 46 of file BLI_math_color.h.
#define BLI_XYZ_CIE 2 |
Definition at line 42 of file BLI_math_color.h.
Referenced by add_lamp(), and xyz_to_rgb().
#define BLI_XYZ_REC709_SRGB 1 |
Definition at line 41 of file BLI_math_color.h.
Referenced by xyz_to_rgb().
#define BLI_XYZ_SMPTE 0 |
Definition at line 40 of file BLI_math_color.h.
Referenced by xyz_to_rgb().
#define BLI_YCC_ITU_BT601 0 |
Definition at line 50 of file BLI_math_color.h.
Referenced by do_comb_ycca_601(), do_normalized_rgba_to_ycca2(), do_normalized_ycca_to_rgba2(), do_rgba_to_ycca(), do_rgba_to_ycca_normalized(), do_sepycca_601(), do_ycca_to_rgba(), do_ycca_to_rgba_normalized(), node_composit_exec_combycca(), node_composit_exec_sepycca(), rgb_to_ycc(), scopes_update(), and ycc_to_rgb().
#define BLI_YCC_ITU_BT709 1 |
Definition at line 51 of file BLI_math_color.h.
Referenced by do_comb_ycca_709(), do_sepycca_709(), node_composit_exec_combycca(), node_composit_exec_sepycca(), rgb_to_ycc(), scopes_update(), and ycc_to_rgb().
#define BLI_YCC_JFIF_0_255 2 |
Definition at line 52 of file BLI_math_color.h.
Referenced by do_comb_ycca_jfif(), do_sepycca_jfif(), node_composit_exec_combycca(), node_composit_exec_sepycca(), rgb_to_ycc(), scopes_update(), and ycc_to_rgb().
void BLI_init_srgb_conversion | ( | void | ) |
Definition at line 547 of file math_color.c.
References BLI_color_from_srgb_table, BLI_color_to_srgb_table, hipart(), i, index_to_float(), linearrgb_to_srgb(), and srgb_to_linearrgb().
Referenced by IMB_buffer_byte_from_float(), and IMB_buffer_float_from_byte().
int constrain_rgb | ( | float * | r, |
float * | g, | ||
float * | b | ||
) |
Definition at line 416 of file math_color.c.
References g, and simple_enum_gen::w.
void cpack_to_rgb | ( | unsigned int | col, |
float * | r, | ||
float * | g, | ||
float * | b | ||
) |
Definition at line 327 of file math_color.c.
void gamma_correct | ( | float * | c, |
float | gamma | ||
) |
Definition at line 363 of file math_color.c.
References powf.
void hex_to_rgb | ( | char * | hexcol, |
float * | r, | ||
float * | g, | ||
float * | b | ||
) |
unsigned int hsv_to_cpack | ( | float | h, |
float | s, | ||
float | v | ||
) |
Definition at line 296 of file math_color.c.
References g, and hsv_to_rgb().
void hsv_to_rgb | ( | float | h, |
float | s, | ||
float | v, | ||
float * | r, | ||
float * | g, | ||
float * | b | ||
) |
Definition at line 39 of file math_color.c.
Referenced by BKE_image_buf_fill_checker(), checker_board_color_fill(), Color_channel_hsv_set(), Color_hsv_set(), do_comb_hsva(), do_hsv_rna_cb(), do_hsva_to_rgba(), do_hue_sat_fac(), do_huecorrect(), do_huecorrect_fac(), getcolor_fcurve_rainbow(), hsv_to_cpack(), input_preprocess(), ramp_blend(), rgb_float_set_hue_float_offset(), svm_mix_color(), svm_mix_hue(), svm_mix_sat(), svm_mix_val(), svm_node_hsv(), transformc(), ui_do_but_BLOCK(), ui_do_but_HSVCIRCLE(), ui_do_but_HSVCUBE(), ui_draw_but_HSVCIRCLE(), ui_draw_gradient(), ui_ndofedit_but_HSVCIRCLE(), ui_ndofedit_but_HSVCUBE(), ui_numedit_but_HSVCIRCLE(), ui_numedit_but_HSVCUBE(), ui_picker_small_wheel_cb(), ui_set_but_hsv(), and ui_set_but_val().
void lift_gamma_gain_to_asc_cdl | ( | float * | lift, |
float * | gamma, | ||
float * | gain, | ||
float * | offset, | ||
float * | slope, | ||
float * | power | ||
) |
Definition at line 459 of file math_color.c.
References FLT_MAX.
float linearrgb_to_rec709 | ( | float | c | ) |
Definition at line 376 of file math_color.c.
References powf.
float linearrgb_to_srgb | ( | float | c | ) |
Definition at line 392 of file math_color.c.
References powf.
Referenced by bake_shade(), BLI_init_srgb_conversion(), colorbalance_lgg(), imb_cocoaSaveImage(), linearrgb_to_srgb_predivide_v4(), linearrgb_to_srgb_ushort4_predivide(), linearrgb_to_srgb_v3_v3(), nodeAddToPreview(), srgb_to_linearrgb_uchar4_predivide(), ui_draw_but_HSV_v(), and ui_draw_but_HSVCIRCLE().
MINLINE void linearrgb_to_srgb_predivide_v4 | ( | float | srgb[4], |
const float | linear[4] | ||
) |
Definition at line 89 of file math_color_inline.c.
References linearrgb_to_srgb().
Referenced by IMB_buffer_byte_from_byte(), IMB_buffer_float_from_byte(), and IMB_buffer_float_from_float().
MINLINE void linearrgb_to_srgb_v3_v3 | ( | float | srgb[3], |
const float | linear[3] | ||
) |
Definition at line 46 of file math_color_inline.c.
References linearrgb_to_srgb().
Referenced by add_tface_color_layer(), BlenderWorldInfo::BlenderWorldInfo(), draw_tface__set_draw_legacy(), ED_image_draw_info(), ED_view3d_draw_offscreen(), gpu_material_to_fixed(), ibuftoimage(), image_new_exec(), image_sample_line_exec(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), imb_savetiff(), linearrgb_to_srgb_v4(), scopes_update(), ui_draw_but_COLORBAND(), ui_update_block_buts_rgb(), uiBlockPicker(), view3d_main_area_draw_objects(), and widget_swatch().
MINLINE void linearrgb_to_srgb_v4 | ( | float | srgb[4], |
const float | linear[4] | ||
) |
Definition at line 59 of file math_color_inline.c.
References linearrgb_to_srgb_v3_v3().
Referenced by IMB_buffer_byte_from_byte(), IMB_buffer_float_from_byte(), and IMB_buffer_float_from_float().
void minmax_rgb | ( | short | c[3] | ) |
float rec709_to_linearrgb | ( | float | c | ) |
Definition at line 368 of file math_color.c.
References powf.
void rgb_byte_set_hue_float_offset | ( | unsigned char * | rgb, |
float | hue_offset | ||
) |
Referenced by get_seq_color3ubv().
void rgb_byte_to_float | ( | const unsigned char | in[3], |
float | out[3] | ||
) |
Definition at line 340 of file math_color.c.
Referenced by acf_generic_channel_color(), input_preprocess(), and rgb_byte_set_hue_float_offset().
void rgb_float_set_hue_float_offset | ( | float * | rgb, |
float | hue_offset | ||
) |
Referenced by rgb_byte_set_hue_float_offset().
void rgb_float_to_byte | ( | const float | in[3], |
unsigned char | out[3] | ||
) |
Definition at line 347 of file math_color.c.
References g.
Referenced by draw_new_particle_system(), draw_object(), draw_pose_bones(), drawRBpivot(), get_seq_color3ubv(), input_preprocess(), and rgb_byte_set_hue_float_offset().
unsigned int rgb_to_cpack | ( | float | r, |
float | g, | ||
float | b | ||
) |
Definition at line 313 of file math_color.c.
float rgb_to_grayscale | ( | const float | rgb[3] | ) |
Definition at line 437 of file math_color.c.
Referenced by IMB_color_to_bw(), ramp_diffuse_result(), ramp_spec_result(), and shade_lamp_loop_only_shadow().
unsigned char rgb_to_grayscale_byte | ( | const unsigned char | rgb[3] | ) |
Definition at line 442 of file math_color.c.
Referenced by IMB_color_to_bw().
void rgb_to_hsv | ( | float | r, |
float | g, | ||
float | b, | ||
float * | lh, | ||
float * | ls, | ||
float * | lv | ||
) |
Definition at line 205 of file math_color.c.
References g.
Referenced by Color_channel_hsv_get(), Color_channel_hsv_set(), Color_hsv_get(), do_hue_sat_fac(), do_huecorrect(), do_huecorrect_fac(), do_rgba_to_hsva(), do_sephsva(), ED_image_draw_info(), input_preprocess(), node_composit_exec_sephsva(), ramp_blend(), rgb_float_set_hue_float_offset(), rgb_to_hsv_compat(), svm_mix_color(), svm_mix_hue(), svm_mix_sat(), svm_mix_val(), svm_node_hsv(), transformc(), ui_do_but_HSVCIRCLE(), ui_do_but_HSVCUBE(), ui_draw_but_HSV_v(), ui_get_but_val(), ui_set_but_val(), uiBlockPicker(), and weightvg_do_mask().
void rgb_to_hsv_compat | ( | float | r, |
float | g, | ||
float | b, | ||
float * | lh, | ||
float * | ls, | ||
float * | lv | ||
) |
Definition at line 249 of file math_color.c.
References rgb_to_hsv().
Referenced by ui_do_but_BLOCK(), ui_do_but_HSVCIRCLE(), ui_do_but_HSVCUBE(), ui_draw_but_HSVCIRCLE(), ui_draw_but_HSVCUBE(), ui_ndofedit_but_HSVCIRCLE(), ui_ndofedit_but_HSVCUBE(), ui_numedit_but_HSVCIRCLE(), ui_numedit_but_HSVCUBE(), ui_picker_small_wheel_cb(), and ui_update_block_buts_rgb().
float rgb_to_luma | ( | const float | rgb[3] | ) |
Definition at line 447 of file math_color.c.
Referenced by image_sample_line_exec(), make_waveform_view_from_ibuf_float(), and scopes_update().
unsigned char rgb_to_luma_byte | ( | const unsigned char | rgb[3] | ) |
Definition at line 452 of file math_color.c.
Referenced by image_sample_line_exec(), and make_waveform_view_from_ibuf_byte().
void rgb_to_ycc | ( | float | r, |
float | g, | ||
float | b, | ||
float * | ly, | ||
float * | lcb, | ||
float * | lcr, | ||
int | colorspace | ||
) |
Definition at line 119 of file math_color.c.
References assert, BLI_YCC_ITU_BT601, BLI_YCC_ITU_BT709, BLI_YCC_JFIF_0_255, and g.
Referenced by do_normalized_rgba_to_ycca2(), do_rgba_to_ycca(), do_rgba_to_ycca_normalized(), do_sepycca_601(), do_sepycca_709(), do_sepycca_jfif(), node_composit_exec_sepycca(), and scopes_update().
void rgb_to_yuv | ( | float | r, |
float | g, | ||
float | b, | ||
float * | ly, | ||
float * | lu, | ||
float * | lv | ||
) |
Definition at line 93 of file math_color.c.
Referenced by brightness_mean(), brightness_standard_deviation(), do_rgba_to_yuva(), do_sepyuva(), ED_image_draw_info(), fill_bins(), node_composit_exec_sepyuva(), save_sample_line(), and vectorscope_draw_target().
float srgb_to_linearrgb | ( | float | c | ) |
Definition at line 384 of file math_color.c.
References powf.
Referenced by BLI_init_srgb_conversion(), colorbalance_lgg(), imb_save_openexr_half(), srgb_to_linearrgb_predivide_v4(), srgb_to_linearrgb_v3_v3(), ui_ndofedit_but_HSVCUBE(), and ui_numedit_but_HSVCUBE().
MINLINE void srgb_to_linearrgb_predivide_v4 | ( | float | linear[4], |
const float | srgb[4] | ||
) |
Definition at line 70 of file math_color_inline.c.
References srgb_to_linearrgb().
Referenced by IMB_buffer_byte_from_byte(), IMB_buffer_byte_from_float(), and IMB_buffer_float_from_float().
MINLINE void srgb_to_linearrgb_v3_v3 | ( | float | linear[3], |
const float | srgb[3] | ||
) |
Definition at line 39 of file math_color_inline.c.
References srgb_to_linearrgb().
Referenced by brush_imbuf_new(), do_halo_tex(), do_hex_rna_cb(), do_lamp_tex(), do_material_tex(), do_projectpaint_draw_f(), do_sky_tex(), do_versions(), eyedropper_sample(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), multitex_nodes(), shade_input_set_shade_texco(), shade_input_set_strand_texco(), and srgb_to_linearrgb_v4().
MINLINE void srgb_to_linearrgb_v4 | ( | float | linear[4], |
const float | srgb[4] | ||
) |
Definition at line 53 of file math_color_inline.c.
References srgb_to_linearrgb_v3_v3().
Referenced by IMB_buffer_byte_from_byte(), IMB_buffer_byte_from_float(), and IMB_buffer_float_from_float().
void xyz_to_rgb | ( | float | x, |
float | y, | ||
float | z, | ||
float * | r, | ||
float * | g, | ||
float * | b, | ||
int | colorspace | ||
) |
Definition at line 271 of file math_color.c.
References BLI_XYZ_CIE, BLI_XYZ_REC709_SRGB, and BLI_XYZ_SMPTE.
Referenced by shadeSunView(), and sky_radiance().
void ycc_to_rgb | ( | float | y, |
float | cb, | ||
float | cr, | ||
float * | lr, | ||
float * | lg, | ||
float * | lb, | ||
int | colorspace | ||
) |
Definition at line 157 of file math_color.c.
References assert, BLI_YCC_ITU_BT601, BLI_YCC_ITU_BT709, BLI_YCC_JFIF_0_255, and g.
Referenced by do_comb_ycca_601(), do_comb_ycca_709(), do_comb_ycca_jfif(), do_normalized_ycca_to_rgba2(), do_ycca_to_rgba(), do_ycca_to_rgba_normalized(), and node_composit_exec_combycca().
void yuv_to_rgb | ( | float | y, |
float | u, | ||
float | v, | ||
float * | lr, | ||
float * | lg, | ||
float * | lb | ||
) |
Definition at line 105 of file math_color.c.
References g.
Referenced by do_comb_yuva(), and do_yuva_to_rgba().