Blender V4.5
filter.cc File Reference
#include <cmath>
#include "MEM_guardedalloc.h"
#include "BLI_math_base.h"
#include "BLI_utildefines.h"
#include "IMB_filter.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"

Go to the source code of this file.

Functions

static void filtcolum (uchar *point, int y, int skip)
static void filtcolumf (float *point, int y, int skip)
void IMB_filtery (ImBuf *ibuf)
static void imb_filterN (ImBuf *out, ImBuf *in)
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 (ImBuf *ibuf, char *mask, int filter)
void IMB_remakemipmap (ImBuf *ibuf, int use_filter)
void IMB_makemipmap (ImBuf *ibuf, int use_filter)
ImBufIMB_getmipmap (ImBuf *ibuf, int level)
void IMB_premultiply_rect (uint8_t *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 (uint8_t *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)

Function Documentation

◆ check_pixel_assigned()

int check_pixel_assigned ( const void * buffer,
const char * mask,
const int index,
const int depth,
const bool is_float )
static

Definition at line 296 of file filter.cc.

References check_pixel_assigned(), and mask().

Referenced by check_pixel_assigned(), and IMB_filter_extend().

◆ filtcolum()

void filtcolum ( uchar * point,
int y,
int skip )
static

Definition at line 20 of file filter.cc.

References filtcolum(), and y.

Referenced by filtcolum(), and IMB_filtery().

◆ filtcolumf()

void filtcolumf ( float * point,
int y,
int skip )
static

Definition at line 43 of file filter.cc.

References filtcolumf(), and y.

Referenced by filtcolumf(), and IMB_filtery().

◆ filter_make_index()

int filter_make_index ( const int x,
const int y,
const int w,
const int h )
static

Definition at line 287 of file filter.cc.

References filter_make_index(), w(), x, and y.

Referenced by filter_make_index(), and IMB_filter_extend().

◆ IMB_filter_extend()

void IMB_filter_extend ( ImBuf * ibuf,
char * mask,
int filter )

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 317 of file filter.cc.

References ImBuf::byte_buffer, check_pixel_assigned(), ImBufByteBuffer::data, ImBufFloatBuffer::data, filter, filter_make_index(), FILTER_MASK_MARGIN, ImBuf::float_buffer, i, IMB_filter_extend(), mask(), MEM_dupallocN(), MEM_freeN(), nullptr, sqrt, ImBuf::x, x, ImBuf::y, and y.

Referenced by bake_ibuf_filter(), blender::render::texturemargin::generate_margin(), IMB_filter_extend(), and RE_bake_margin().

◆ imb_filterN()

void imb_filterN ( ImBuf * out,
ImBuf * in )
static

Definition at line 100 of file filter.cc.

References BLI_assert, imb_filterN(), in, out, x, and y.

Referenced by imb_filterN(), IMB_makemipmap(), and IMB_remakemipmap().

◆ IMB_filtery()

◆ IMB_getmipmap()

ImBuf * IMB_getmipmap ( ImBuf * ibuf,
int level )

Definition at line 525 of file filter.cc.

References CLAMP, IMB_getmipmap(), ImBuf::mipmap, and ImBuf::miptot.

Referenced by IMB_getmipmap().

◆ IMB_makemipmap()

◆ IMB_mask_clear()

void IMB_mask_clear ( ImBuf * ibuf,
const char * mask,
int val )

◆ IMB_mask_filter_extend()

void IMB_mask_filter_extend ( char * mask,
int width,
int height )

Definition at line 217 of file filter.cc.

References FILTER_MASK_MARGIN, IMB_mask_filter_extend(), mask(), MEM_dupallocN(), MEM_freeN(), x, and y.

Referenced by IMB_mask_filter_extend().

◆ IMB_premultiply_alpha()

◆ IMB_premultiply_rect()

void IMB_premultiply_rect ( uint8_t * rect,
char planes,
int w,
int h )

Definition at line 531 of file filter.cc.

References IMB_premultiply_rect(), w(), x, and y.

Referenced by IMB_premultiply_alpha(), and IMB_premultiply_rect().

◆ IMB_premultiply_rect_float()

void IMB_premultiply_rect_float ( float * rect_float,
int channels,
int w,
int h )

◆ IMB_remakemipmap()

void IMB_remakemipmap ( ImBuf * ibuf,
int use_filter )

◆ IMB_unpremultiply_alpha()

◆ IMB_unpremultiply_rect()

void IMB_unpremultiply_rect ( uint8_t * rect,
char planes,
int w,
int h )

Definition at line 592 of file filter.cc.

References IMB_unpremultiply_rect(), unit_float_to_uchar_clamp(), w(), x, and y.

Referenced by IMB_unpremultiply_alpha(), and IMB_unpremultiply_rect().

◆ IMB_unpremultiply_rect_float()

void IMB_unpremultiply_rect_float ( float * rect_float,
int channels,
int w,
int h )