Blender V2.61 - r43446
|
#include "BLI_blenlib.h"
#include "BLI_rand.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "IMB_allocimbuf.h"
#include "MEM_guardedalloc.h"
Go to the source code of this file.
Classes | |
struct | DitherContext |
Typedefs | |
typedef struct DitherContext | DitherContext |
Functions | |
void | IMB_de_interlace (ImBuf *ibuf) |
void | IMB_interlace (ImBuf *ibuf) |
DitherContext * | create_dither_context (int w, float factor) |
static void | clear_dither_context (DitherContext *di) |
static void | dither_finish_row (DitherContext *di) |
MINLINE unsigned char | dither_value (unsigned short v_in, DitherContext *di, int i) |
MINLINE void | byte_to_float_v4 (float f[4], const uchar b[4]) |
MINLINE void | float_to_byte_v4 (uchar b[4], const float f[4]) |
MINLINE void | ushort_to_byte_v4 (uchar b[4], const unsigned short us[4]) |
MINLINE void | ushort_to_byte_dither_v4 (uchar b[4], const unsigned short us[4], DitherContext *di) |
MINLINE void | float_to_byte_dither_v4 (uchar b[4], const float f[4], DitherContext *di) |
void | IMB_buffer_byte_from_float (uchar *rect_to, const float *rect_from, int channels_from, float dither, int profile_to, int profile_from, int predivide, int width, int height, int stride_to, int stride_from) |
void | IMB_buffer_float_from_byte (float *rect_to, const uchar *rect_from, int profile_to, int profile_from, int predivide, int width, int height, int stride_to, int stride_from) |
void | IMB_buffer_float_from_float (float *rect_to, const float *rect_from, int channels_from, int profile_to, int profile_from, int predivide, int width, int height, int stride_to, int stride_from) |
void | IMB_buffer_byte_from_byte (uchar *rect_to, const uchar *rect_from, int profile_to, int profile_from, int predivide, int width, int height, int stride_to, int stride_from) |
void | IMB_rect_from_float (ImBuf *ibuf) |
void | IMB_partial_rect_from_float (ImBuf *ibuf, float *buffer, int x, int y, int w, int h) |
void | IMB_float_from_rect (ImBuf *ibuf) |
void | IMB_float_from_rect_simple (ImBuf *ibuf) |
void | IMB_convert_profile (ImBuf *ibuf, int profile) |
float * | IMB_float_profile_ensure (ImBuf *ibuf, int profile, int *alloc) |
void | IMB_color_to_bw (ImBuf *ibuf) |
Definition in file divers.c.
typedef struct DitherContext DitherContext |
MINLINE void byte_to_float_v4 | ( | float | f[4], |
const uchar | b[4] | ||
) |
Definition at line 167 of file divers.c.
Referenced by IMB_buffer_byte_from_byte(), and IMB_buffer_float_from_byte().
static void clear_dither_context | ( | DitherContext * | di | ) | [static] |
Definition at line 127 of file divers.c.
References DitherContext::error_buf, and MEM_freeN().
Referenced by IMB_buffer_byte_from_float().
DitherContext* create_dither_context | ( | int | w, |
float | factor | ||
) |
Definition at line 111 of file divers.c.
References BLI_frand(), DitherContext::e, DitherContext::error_buf, DitherContext::f, i, MEM_callocN(), DitherContext::v, DitherContext::v0, and DitherContext::v1.
Referenced by IMB_buffer_byte_from_float().
static void dither_finish_row | ( | DitherContext * | di | ) | [static] |
Definition at line 133 of file divers.c.
References DitherContext::e, DitherContext::error_buf, i, DitherContext::v, DitherContext::v0, and DitherContext::v1.
Referenced by IMB_buffer_byte_from_float().
MINLINE unsigned char dither_value | ( | unsigned short | v_in, |
DitherContext * | di, | ||
int | i | ||
) |
Definition at line 143 of file divers.c.
References CLAMP(), DitherContext::e, DitherContext::f, i, USHORTTOUCHAR, DitherContext::v, DitherContext::v0, and DitherContext::v1.
Referenced by ushort_to_byte_dither_v4().
MINLINE void float_to_byte_dither_v4 | ( | uchar | b[4], |
const float | f[4], | ||
DitherContext * | di | ||
) |
Definition at line 196 of file divers.c.
References FTOUSHORT, and ushort_to_byte_dither_v4().
Referenced by IMB_buffer_byte_from_float().
MINLINE void float_to_byte_v4 | ( | uchar | b[4], |
const float | f[4] | ||
) |
Definition at line 175 of file divers.c.
References F4TOCHAR4.
Referenced by IMB_buffer_byte_from_byte(), and IMB_buffer_byte_from_float().
void IMB_buffer_byte_from_byte | ( | uchar * | rect_to, |
const uchar * | rect_from, | ||
int | profile_to, | ||
int | profile_from, | ||
int | predivide, | ||
int | width, | ||
int | height, | ||
int | stride_to, | ||
int | stride_from | ||
) |
Definition at line 481 of file divers.c.
References BLI_assert, byte_to_float_v4(), float_to_byte_v4(), IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, linearrgb_to_srgb_predivide_v4(), linearrgb_to_srgb_v4(), srgb_to_linearrgb_predivide_v4(), and srgb_to_linearrgb_v4().
Referenced by IMB_convert_profile().
void IMB_buffer_byte_from_float | ( | uchar * | rect_to, |
const float * | rect_from, | ||
int | channels_from, | ||
float | dither, | ||
int | profile_to, | ||
int | profile_from, | ||
int | predivide, | ||
int | width, | ||
int | height, | ||
int | stride_to, | ||
int | stride_from | ||
) |
Definition at line 203 of file divers.c.
References BLI_assert, BLI_init_srgb_conversion(), clear_dither_context(), create_dither_context(), dither_finish_row(), F3TOCHAR3, float_to_byte_dither_v4(), float_to_byte_v4(), FTOCHAR, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, linearrgb_to_srgb_ushort4(), linearrgb_to_srgb_ushort4_predivide(), linearrgb_to_srgb_v3_v3(), srgb_to_linearrgb_predivide_v4(), srgb_to_linearrgb_v3_v3(), srgb_to_linearrgb_v4(), ushort_to_byte_dither_v4(), and ushort_to_byte_v4().
Referenced by ed_preview_draw_rect(), generate_preview(), image_buffer_rect_update(), IMB_partial_rect_from_float(), IMB_rect_from_float(), and render_result_rect_get_pixels().
void IMB_buffer_float_from_byte | ( | float * | rect_to, |
const uchar * | rect_from, | ||
int | profile_to, | ||
int | profile_from, | ||
int | predivide, | ||
int | width, | ||
int | height, | ||
int | stride_to, | ||
int | stride_from | ||
) |
Definition at line 340 of file divers.c.
References BLI_assert, BLI_init_srgb_conversion(), byte_to_float_v4(), IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, linearrgb_to_srgb_predivide_v4(), linearrgb_to_srgb_v4(), srgb_to_linearrgb_uchar4(), and srgb_to_linearrgb_uchar4_predivide().
Referenced by IMB_float_from_rect(), IMB_float_from_rect_simple(), and IMB_float_profile_ensure().
void IMB_buffer_float_from_float | ( | float * | rect_to, |
const float * | rect_from, | ||
int | channels_from, | ||
int | profile_to, | ||
int | profile_from, | ||
int | predivide, | ||
int | width, | ||
int | height, | ||
int | stride_to, | ||
int | stride_from | ||
) |
Definition at line 395 of file divers.c.
References BLI_assert, copy_v3_v3(), IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, linearrgb_to_srgb_predivide_v4(), linearrgb_to_srgb_v3_v3(), linearrgb_to_srgb_v4(), srgb_to_linearrgb_predivide_v4(), srgb_to_linearrgb_v3_v3(), and srgb_to_linearrgb_v4().
Referenced by IMB_convert_profile(), IMB_float_profile_ensure(), IMB_partial_rect_from_float(), node_composit_get_float_buffer(), render_result_rect_from_ibuf(), and screen_opengl_render_apply().
void IMB_color_to_bw | ( | ImBuf * | ibuf | ) |
Definition at line 738 of file divers.c.
References i, ImBuf::rect, ImBuf::rect_float, rgb_to_grayscale(), rgb_to_grayscale_byte(), ImBuf::x, and ImBuf::y.
Referenced by render_result_rect_to_ibuf(), screen_opengl_render_anim_step(), and screen_opengl_render_apply().
void IMB_convert_profile | ( | ImBuf * | ibuf, |
int | profile | ||
) |
Definition at line 648 of file divers.c.
References BLI_assert, ELEM, ImBuf::flags, IB_cm_predivide, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, IMB_buffer_byte_from_byte(), IMB_buffer_float_from_float(), ImBuf::profile, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by seq_render_scene_strip_impl(), and seq_render_strip().
void IMB_de_interlace | ( | struct ImBuf * | ibuf | ) |
Definition at line 49 of file divers.c.
References ImBuf::flags, IB_fields, IB_rect, IMB_allocImBuf(), IMB_freeImBuf(), IMB_rectcpy(), NULL, ImBuf::rect, ImBuf::x, and ImBuf::y.
Referenced by de_interlace(), and IMB_loadiffname().
void IMB_float_from_rect | ( | ImBuf * | ibuf | ) |
Definition at line 610 of file divers.c.
References ImBuf::flags, IB_cm_predivide, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, imb_addrectfloatImBuf(), IMB_buffer_float_from_byte(), NULL, ImBuf::profile, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by colorfn(), curvemapping_do_ibuf(), envmap_split_ima(), imapaint_canvas_set(), IMB_float_profile_ensure(), load_frame_image_sequence(), node_composit_get_image(), node_composit_get_movieclip(), RE_layer_load_from_file(), and render_result_rect_to_ibuf().
void IMB_float_from_rect_simple | ( | ImBuf * | ibuf | ) |
Definition at line 636 of file divers.c.
References ImBuf::flags, IB_cm_predivide, IB_PROFILE_SRGB, imb_addrectfloatImBuf(), IMB_buffer_float_from_byte(), NULL, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by do_plugin_effect(), input_preprocess(), and prepare_effect_imbufs().
float* IMB_float_profile_ensure | ( | ImBuf * | ibuf, |
int | profile, | ||
int * | alloc | ||
) |
Definition at line 690 of file divers.c.
References ImBuf::flags, IB_cm_predivide, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, IMB_buffer_float_from_byte(), IMB_buffer_float_from_float(), IMB_float_from_rect(), MEM_mallocN(), NULL, ImBuf::profile, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by imb_save_dpx_cineon().
void IMB_interlace | ( | ImBuf * | ibuf | ) |
Definition at line 76 of file divers.c.
References ImBuf::flags, IB_fields, IB_rect, IMB_allocImBuf(), IMB_freeImBuf(), IMB_rectcpy(), NULL, ImBuf::rect, ImBuf::x, and ImBuf::y.
Referenced by interlace().
void IMB_partial_rect_from_float | ( | ImBuf * | ibuf, |
float * | buffer, | ||
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) |
Definition at line 571 of file divers.c.
References BLI_assert, ImBuf::channels, ImBuf::dither, ELEM, ImBuf::flags, IB_cm_predivide, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, IB_RECT_INVALID, imb_addrectImBuf(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), NULL, ImBuf::profile, ImBuf::rect, ImBuf::rect_float, ImBuf::userflags, and ImBuf::x.
Referenced by GPU_paint_update_image().
void IMB_rect_from_float | ( | ImBuf * | ibuf | ) |
Definition at line 540 of file divers.c.
References BLI_assert, ImBuf::channels, ImBuf::dither, ELEM, ImBuf::flags, IB_cm_predivide, IB_PROFILE_LINEAR_RGB, IB_PROFILE_NONE, IB_PROFILE_SRGB, IB_RECT_INVALID, imb_addrectImBuf(), IMB_buffer_byte_from_float(), NULL, ImBuf::profile, ImBuf::rect, ImBuf::rect_float, ImBuf::userflags, ImBuf::x, and ImBuf::y.
Referenced by BKE_movieclip_update_scopes(), curvemapping_do_ibuf(), do_plugin_effect(), draw_bgpic(), draw_empty_image(), draw_image_seq(), draw_movieclip_buffer(), draw_nodespace_back_pix(), ED_view3d_draw_offscreen_imbuf(), get_undistorted_ibuf(), GPU_paint_update_image(), GPU_verify_image(), icon_copy_rect(), image_invert_exec(), image_verify_buffer_float(), imapaint_canvas_set(), imb_jp2_decode(), imb_load_dpx_cineon(), imb_loadhdr(), imb_loadiris(), IMB_saveiff(), IMB_thumb_create(), prepare_effect_imbufs(), RE_bake_shade_all_selected(), and sample_apply().
MINLINE void ushort_to_byte_dither_v4 | ( | uchar | b[4], |
const unsigned short | us[4], | ||
DitherContext * | di | ||
) |
Definition at line 188 of file divers.c.
References dither_value().
Referenced by float_to_byte_dither_v4(), and IMB_buffer_byte_from_float().
MINLINE void ushort_to_byte_v4 | ( | uchar | b[4], |
const unsigned short | us[4] | ||
) |
Definition at line 180 of file divers.c.
References USHORTTOUCHAR.
Referenced by IMB_buffer_byte_from_float().