Blender
V3.3
|
#include <math.h>
#include "MEM_guardedalloc.h"
#include "BLI_math_base.h"
#include "BLI_utildefines.h"
#include "IMB_filter.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "imbuf.h"
Go to the source code of this file.
Functions | |
static void | filtrow (unsigned char *point, int x) |
static void | filtrowf (float *point, int x) |
static void | filtcolum (unsigned char *point, int y, int skip) |
static void | filtcolumf (float *point, int y, int skip) |
void | IMB_filtery (struct ImBuf *ibuf) |
void | imb_filterx (struct ImBuf *ibuf) |
static void | imb_filterN (ImBuf *out, ImBuf *in) |
void | IMB_filter (struct ImBuf *ibuf) |
void | IMB_mask_filter_extend (char *mask, int width, int height) |
void | IMB_mask_clear (ImBuf *ibuf, const char *mask, int val) |
static int | filter_make_index (const int x, const int y, const int w, const int h) |
static int | check_pixel_assigned (const void *buffer, const char *mask, const int index, const int depth, const bool is_float) |
void | IMB_filter_extend (struct ImBuf *ibuf, char *mask, int filter) |
void | IMB_remakemipmap (ImBuf *ibuf, int use_filter) |
void | IMB_makemipmap (ImBuf *ibuf, int use_filter) |
ImBuf * | IMB_getmipmap (ImBuf *ibuf, int level) |
void | IMB_premultiply_rect (unsigned int *rect, char planes, int w, int h) |
void | IMB_premultiply_rect_float (float *rect_float, int channels, int w, int h) |
void | IMB_premultiply_alpha (ImBuf *ibuf) |
void | IMB_unpremultiply_rect (unsigned int *rect, char planes, int w, int h) |
void | IMB_unpremultiply_rect_float (float *rect_float, int channels, int w, int h) |
void | IMB_unpremultiply_alpha (ImBuf *ibuf) |
|
static |
|
static |
|
static |
Definition at line 301 of file filter.c.
References imb_filterx(), and IMB_filtery().
If alpha is zero, it checks surrounding pixels and averages color. sets new alphas to 1.0 When a mask is given, the mask will be used instead of the alpha channel, where only pixels with a mask value of 0 will be written to, and only pixels with a mask value of 1 will be used for the average. The mask will be set to one for the pixels which were written.
Definition at line 406 of file filter.c.
References Freestyle::c, check_pixel_assigned(), filter(), filter_make_index(), FILTER_MASK_MARGIN, float(), height, mask(), MEM_dupallocN, MEM_freeN, NULL, r, ImBuf::rect, ImBuf::rect_float, sqrt(), width, x, ImBuf::x, y, and ImBuf::y.
Referenced by bake_ibuf_filter(), blender::render::texturemargin::generate_margin(), and RE_bake_margin().
Definition at line 184 of file filter.c.
References BLI_assert, ImBuf::channels, channels(), usdtokens::out(), ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_makemipmap(), and IMB_remakemipmap().
Definition at line 143 of file filter.c.
References filtrow(), filtrowf(), ImBuf::planes, point, ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_double_x(), and IMB_filter().
Definition at line 102 of file filter.c.
References filtcolum(), filtcolumf(), ImBuf::planes, point, ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_anim_absolute(), IMB_double_y(), IMB_filter(), and input_preprocess().
Definition at line 610 of file filter.c.
References CLAMP, ImBuf::mipmap, and ImBuf::miptot.
Referenced by IMB_tiles_to_rect().
Frees too (if there) and recreates new data.
Definition at line 573 of file filter.c.
References ImBuf::channels, ImBuf::flags, IMB_allocImBuf(), imb_filterN(), IMB_freeImBuf(), imb_freemipmapImBuf(), IMB_MIPMAP_LEVELS, IMB_onehalf(), ImBuf::miplevel, ImBuf::mipmap, ImBuf::miptot, ImBuf::planes, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by image_mipmap_test().
Definition at line 351 of file filter.c.
References col, mask(), ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, y, and ImBuf::y.
void IMB_mask_filter_extend | ( | char * | mask, |
int | width, | ||
int | height | ||
) |
Definition at line 307 of file filter.c.
References FILTER_MASK_MARGIN, height, mask(), MEM_dupallocN, MEM_freeN, width, x, and y.
Definition at line 662 of file filter.c.
References ImBuf::channels, IMB_premultiply_rect(), IMB_premultiply_rect_float(), NULL, ImBuf::planes, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by BKE_previewimg_ensure(), imb_handle_alpha(), UI_icon_alert_imbuf_get(), UI_icons_reload_internal_textures(), wm_block_create_about(), and wm_block_splash_image().
void IMB_premultiply_rect | ( | unsigned int * | rect, |
char | planes, | ||
int | w, | ||
int | h | ||
) |
Definition at line 644 of file filter.c.
References channels(), w(), x, and y.
Referenced by do_processor_transform_thread(), IMB_colormanagement_transform_from_byte_threaded(), IMB_float_from_rect_ex(), and IMB_premultiply_alpha().
Thread-safe version, only recreates existing maps.
Definition at line 537 of file filter.c.
References ImBuf::flags, IMB_allocImBuf(), imb_filterN(), IMB_freeImBuf(), IMB_MIPMAP_LEVELS, imb_onehalf_no_alloc(), ImBuf::miplevel, ImBuf::mipmap, ImBuf::miptot, ImBuf::planes, ImBuf::x, and ImBuf::y.
Referenced by image_mipmap_test().
Definition at line 724 of file filter.c.
References ImBuf::channels, IMB_unpremultiply_rect(), IMB_unpremultiply_rect_float(), NULL, ImBuf::planes, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by imb_handle_alpha().
void IMB_unpremultiply_rect | ( | unsigned int * | rect, |
char | planes, | ||
int | w, | ||
int | h | ||
) |
Definition at line 677 of file filter.c.
References float(), unit_float_to_uchar_clamp(), w(), x, and y.
Referenced by IMB_unpremultiply_alpha().
Definition at line 706 of file filter.c.
References channels(), w(), x, and y.
Referenced by IMB_rect_from_float(), and IMB_unpremultiply_alpha().