Blender
V3.3
|
#include <math.h>
#include <stdlib.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
Go to the source code of this file.
Classes | |
struct | ScanlineGlobalData |
Functions | |
void | IMB_convert_rgba_to_abgr (struct ImBuf *ibuf) |
static void | pixel_from_buffer (const struct ImBuf *ibuf, unsigned char **outI, float **outF, int x, int y) |
Bi-Cubic Interpolation | |
void | bicubic_interpolation_color (const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v) |
void | bicubic_interpolation (const ImBuf *in, ImBuf *out, float u, float v, int xout, int yout) |
Bi-Linear Interpolation | |
void | bilinear_interpolation_color_fl (const struct ImBuf *in, unsigned char UNUSED(outI[4]), float outF[4], float u, float v) |
void | bilinear_interpolation_color_char (const struct ImBuf *in, unsigned char outI[4], float UNUSED(outF[4]), float u, float v) |
void | bilinear_interpolation_color (const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v) |
void | bilinear_interpolation_color_wrap (const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v) |
void | bilinear_interpolation (const ImBuf *in, ImBuf *out, float u, float v, int xout, int yout) |
Nearest Interpolation | |
void | nearest_interpolation_color_char (const struct ImBuf *in, unsigned char outI[4], float UNUSED(outF[4]), float u, float v) |
void | nearest_interpolation_color_fl (const struct ImBuf *in, unsigned char UNUSED(outI[4]), float outF[4], float u, float v) |
void | nearest_interpolation_color (const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v) |
void | nearest_interpolation_color_wrap (const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v) |
void | nearest_interpolation (const ImBuf *in, ImBuf *out, float u, float v, int xout, int yout) |
Alpha-under | |
void | IMB_alpha_under_color_float (float *rect_float, int x, int y, float backcol[3]) |
void | IMB_alpha_under_color_byte (unsigned char *rect, int x, int y, const float backcol[3]) |
Sample Pixel | |
void | IMB_sampleImageAtLocation (ImBuf *ibuf, float x, float y, bool make_linear_rgb, float color[4]) |
Threaded Image Processing | |
typedef struct ScanlineGlobalData | ScanlineGlobalData |
static void | processor_apply_func (TaskPool *__restrict pool, void *taskdata) |
void | IMB_processor_apply_threaded (int buffer_lines, int handle_size, void *init_customdata, void(init_handle)(void *handle, int start_line, int tot_line, void *customdata), void *(do_thread)(void *)) |
static void | processor_apply_parallel (void *__restrict userdata, const int scanline, const TaskParallelTLS *__restrict UNUSED(tls)) |
void | IMB_processor_apply_threaded_scanlines (int total_scanlines, ScanlineThreadFunc do_thread, void *custom_data) |
This file was moved here from the src/
directory. It is meant to deal with endianness. It resided in a general blending lib. The other functions were only used during rendering. This single function remained. It should probably move to imbuf/intern/util.c
, but we'll keep it here for the time being.
Definition in file imageprocess.c.
typedef struct ScanlineGlobalData ScanlineGlobalData |
Definition at line 91 of file imageprocess.c.
References bicubic_interpolation_color(), NULL, usdtokens::out(), pixel_from_buffer(), ImBuf::rect, ImBuf::rect_float, and v.
void bicubic_interpolation_color | ( | const struct ImBuf * | in, |
unsigned char | outI[4], | ||
float | outF[4], | ||
float | u, | ||
float | v | ||
) |
Definition at line 80 of file imageprocess.c.
References BLI_bicubic_interpolation_char(), BLI_bicubic_interpolation_fl(), ImBuf::rect, ImBuf::rect_float, v, ImBuf::x, and ImBuf::y.
Referenced by bicubic_interpolation(), do_projectpaint_thread(), blender::compositor::MovieClipBaseOperation::execute_pixel_sampled(), blender::compositor::MultilayerColorOperation::execute_pixel_sampled(), and blender::compositor::sample_image_at_location().
Definition at line 214 of file imageprocess.c.
References bilinear_interpolation_color(), NULL, usdtokens::out(), pixel_from_buffer(), ImBuf::rect, ImBuf::rect_float, and v.
void bilinear_interpolation_color | ( | const struct ImBuf * | in, |
unsigned char | outI[4], | ||
float | outF[4], | ||
float | u, | ||
float | v | ||
) |
Definition at line 128 of file imageprocess.c.
References BLI_bilinear_interpolation_char(), BLI_bilinear_interpolation_fl(), ImBuf::rect, ImBuf::rect_float, v, ImBuf::x, and ImBuf::y.
Referenced by bilinear_interpolation(), blender::compositor::MovieClipBaseOperation::execute_pixel_sampled(), blender::compositor::MultilayerColorOperation::execute_pixel_sampled(), and blender::compositor::sample_image_at_location().
void bilinear_interpolation_color_char | ( | const struct ImBuf * | in, |
unsigned char | outI[4], | ||
float | UNUSEDoutF[4], | ||
float | u, | ||
float | v | ||
) |
Definition at line 120 of file imageprocess.c.
References BLI_assert, BLI_bilinear_interpolation_char(), ImBuf::rect, v, ImBuf::x, and ImBuf::y.
void bilinear_interpolation_color_fl | ( | const struct ImBuf * | in, |
unsigned char | UNUSEDoutI[4], | ||
float | outF[4], | ||
float | u, | ||
float | v | ||
) |
Definition at line 112 of file imageprocess.c.
References BLI_assert, BLI_bilinear_interpolation_fl(), ImBuf::rect_float, v, ImBuf::x, and ImBuf::y.
void bilinear_interpolation_color_wrap | ( | const struct ImBuf * | in, |
unsigned char | outI[4], | ||
float | outF[4], | ||
float | u, | ||
float | v | ||
) |
Note about wrapping, the u/v still needs to be within the image bounds, just the interpolation is wrapped. This the same as bilinear_interpolation_color except it wraps rather than using empty and emptyI.
Definition at line 142 of file imageprocess.c.
References Freestyle::a, usdtokens::b(), ceil(), clamp_v4(), blender::math::floor(), floorf, ImBuf::rect, ImBuf::rect_float, v, ImBuf::x, x2, ImBuf::y, and y1.
Referenced by paint_sample_color(), project_face_pixel(), and project_paint_PickColor().
Definition at line 449 of file imageprocess.c.
References Freestyle::a, mul(), x, and y.
Referenced by IMB_colormanagement_imbuf_for_write().
Definition at line 435 of file imageprocess.c.
References Freestyle::a, madd_v3_v3fl(), mul(), x, and y.
Referenced by IMB_colormanagement_imbuf_for_write().
Change the ordering of the color bytes pointed to by rect from rgba to abgr. size * 4 color bytes are reordered.
Only this one is used liberally here, and in imbuf.
Definition at line 26 of file imageprocess.c.
References if(), ImBuf::rect, ImBuf::rect_float, size(), ImBuf::x, and ImBuf::y.
Referenced by IMB_anim_absolute(), imb_loadiris(), imb_loadtarga(), imb_read_tiff_pixels(), and imb_saveiris().
void IMB_processor_apply_threaded | ( | int | buffer_lines, |
int | handle_size, | ||
void * | init_customdata, | ||
void(init_handle)(void *handle, int start_line, int tot_line, void *customdata) | , | ||
void * | do_thread)(void * | ||
) |
Threaded processors.
Definition at line 355 of file imageprocess.c.
References BLI_task_pool_create(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), handles, MEM_callocN, MEM_freeN, NULL, processor_apply_func(), task_pool, and TASK_PRIORITY_HIGH.
Referenced by display_buffer_apply_threaded(), do_gaussian_blur_effect(), IMB_scaleImBuf_threaded(), modifier_apply_threaded(), modifier_color_balance_apply(), processor_transform_apply_threaded(), and seq_render_effect_execute_threaded().
void IMB_processor_apply_threaded_scanlines | ( | int | total_scanlines, |
ScanlineThreadFunc | do_thread, | ||
void * | custom_data | ||
) |
Definition at line 415 of file imageprocess.c.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), data, and processor_apply_parallel().
Referenced by BKE_image_buf_fill_checker(), BKE_image_buf_fill_checker_color(), BKE_image_buf_fill_color(), IMB_buffer_float_from_float_threaded(), imb_partial_display_buffer_update_ex(), IMB_rectblend_threaded(), and blender::imbuf::transform::transform_threaded().
void IMB_sampleImageAtLocation | ( | struct ImBuf * | ibuf, |
float | x, | ||
float | y, | ||
bool | make_linear_rgb, | ||
float | color[4] | ||
) |
Sample pixel of image using NEAREST method.
Definition at line 484 of file imageprocess.c.
References color, IMB_colormanagement_colorspace_to_scene_linear_v4(), nearest_interpolation_color(), NULL, ImBuf::rect_colorspace, ImBuf::rect_float, rgba_uchar_to_float(), x, and y.
Referenced by BKE_gpencil_from_image(), and palette_extract_img_exec().
Definition at line 328 of file imageprocess.c.
References nearest_interpolation_color(), NULL, usdtokens::out(), pixel_from_buffer(), ImBuf::rect, ImBuf::rect_float, and v.
void nearest_interpolation_color | ( | const struct ImBuf * | in, |
unsigned char | outI[4], | ||
float | outF[4], | ||
float | u, | ||
float | v | ||
) |
Definition at line 278 of file imageprocess.c.
References nearest_interpolation_color_char(), nearest_interpolation_color_fl(), and v.
Referenced by blender::compositor::MovieClipBaseOperation::execute_pixel_sampled(), blender::compositor::MultilayerColorOperation::execute_pixel_sampled(), IMB_sampleImageAtLocation(), nearest_interpolation(), blender::compositor::sample_image_at_location(), and studiolight_matcap_preview().
void nearest_interpolation_color_char | ( | const struct ImBuf * | in, |
unsigned char | outI[4], | ||
float | UNUSEDoutF[4], | ||
float | u, | ||
float | v | ||
) |
Definition at line 235 of file imageprocess.c.
References BLI_assert, offset, ImBuf::rect, v, ImBuf::x, ImBuf::y, and y1.
Referenced by nearest_interpolation_color().
void nearest_interpolation_color_fl | ( | const struct ImBuf * | in, |
unsigned char | UNUSEDoutI[4], | ||
float | outF[4], | ||
float | u, | ||
float | v | ||
) |
Definition at line 258 of file imageprocess.c.
References BLI_assert, copy_v4_v4(), offset, ImBuf::rect_float, v, ImBuf::x, ImBuf::y, y1, and zero_v4().
Referenced by nearest_interpolation_color().
void nearest_interpolation_color_wrap | ( | const struct ImBuf * | in, |
unsigned char | outI[4], | ||
float | outF[4], | ||
float | u, | ||
float | v | ||
) |
Definition at line 289 of file imageprocess.c.
References blender::math::floor(), ImBuf::rect, ImBuf::rect_float, v, x, ImBuf::x, y, and ImBuf::y.
Referenced by paint_sample_color(), and studiolight_calculate_radiance().
|
static |
Definition at line 61 of file imageprocess.c.
References offset, ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, and y.
Referenced by bicubic_interpolation(), bilinear_interpolation(), and nearest_interpolation().
Definition at line 349 of file imageprocess.c.
References BLI_task_pool_user_data(), blender::compositor::pool, and void.
Referenced by IMB_processor_apply_threaded().
|
static |
Definition at line 407 of file imageprocess.c.
References data.
Referenced by IMB_processor_apply_threaded_scanlines().