Blender V4.3
divers.cc File Reference
#include "BLI_rect.h"
#include "BLI_task.hh"
#include "BLI_utildefines.h"
#include "IMB_filter.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "imbuf.hh"
#include "IMB_colormanagement.hh"
#include "IMB_colormanagement_intern.hh"
#include "MEM_guardedalloc.h"

Go to the source code of this file.

Classes

struct  DitherContext
 
struct  FloatToFloatThreadData
 

Macros

#define USHORTTOFLOAT(val)   (float(val) / 65535.0f)
 

Functions

Floyd-Steinberg dithering
static DitherContextcreate_dither_context (float dither)
 
static void clear_dither_context (DitherContext *di)
 
Generic Buffer Conversion
MINLINE void ushort_to_byte_v4 (uchar b[4], const ushort us[4])
 
MINLINE uchar ftochar (float value)
 
MINLINE void ushort_to_byte_dither_v4 (uchar b[4], const ushort us[4], DitherContext *di, float s, float t)
 
MINLINE void float_to_byte_dither_v4 (uchar b[4], const float f[4], DitherContext *di, float s, float t)
 
bool IMB_alpha_affects_rgb (const ImBuf *ibuf)
 
void IMB_buffer_byte_from_float (uchar *rect_to, const float *rect_from, int channels_from, float dither, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
 
void IMB_buffer_byte_from_float_mask (uchar *rect_to, const float *rect_from, int channels_from, float dither, bool predivide, int width, int height, int stride_to, int stride_from, char *mask)
 
void IMB_buffer_float_from_byte (float *rect_to, const uchar *rect_from, int profile_to, int profile_from, bool 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, bool predivide, int width, int height, int stride_to, int stride_from)
 
static void imb_buffer_float_from_float_thread_do (void *data_v, int scanline)
 
void IMB_buffer_float_from_float_threaded (float *rect_to, const float *rect_from, int channels_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
 
void IMB_buffer_float_from_float_mask (float *rect_to, const float *rect_from, int channels_from, int width, int height, int stride_to, int stride_from, char *mask)
 
void IMB_buffer_byte_from_byte (uchar *rect_to, const uchar *rect_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
 
ImBuf Conversion
void IMB_rect_from_float (ImBuf *ibuf)
 
void IMB_float_from_rect_ex (ImBuf *dst, const ImBuf *src, const rcti *region_to_update)
 
void IMB_float_from_rect (ImBuf *ibuf)
 
Color to Gray-Scale
void IMB_color_to_bw (ImBuf *ibuf)
 
Alter Saturation
void IMB_saturation (ImBuf *ibuf, float sat)
 

Macro Definition Documentation

◆ USHORTTOFLOAT

#define USHORTTOFLOAT ( val)    (float(val) / 65535.0f)

Function Documentation

◆ clear_dither_context()

static void clear_dither_context ( DitherContext * di)
static

Definition at line 42 of file divers.cc.

References MEM_freeN().

Referenced by IMB_buffer_byte_from_float(), and IMB_buffer_byte_from_float_mask().

◆ create_dither_context()

static DitherContext * create_dither_context ( float dither)
static

Definition at line 32 of file divers.cc.

References DitherContext::dither.

Referenced by IMB_buffer_byte_from_float(), and IMB_buffer_byte_from_float_mask().

◆ float_to_byte_dither_v4()

MINLINE void float_to_byte_dither_v4 ( uchar b[4],
const float f[4],
DitherContext * di,
float s,
float t )

◆ ftochar()

MINLINE uchar ftochar ( float value)

Definition at line 61 of file divers.cc.

References unit_float_to_uchar_clamp.

Referenced by float_to_byte_dither_v4(), and ushort_to_byte_dither_v4().

◆ IMB_alpha_affects_rgb()

◆ IMB_buffer_byte_from_byte()

void IMB_buffer_byte_from_byte ( unsigned char * rect_to,
const unsigned char * rect_from,
int profile_to,
int profile_from,
bool predivide,
int width,
int height,
int stride_to,
int stride_from )

◆ IMB_buffer_byte_from_float()

◆ IMB_buffer_byte_from_float_mask()

void IMB_buffer_byte_from_float_mask ( unsigned char * rect_to,
const float * rect_from,
int channels_from,
float dither,
bool predivide,
int width,
int height,
int stride_to,
int stride_from,
char * mask )

◆ IMB_buffer_float_from_byte()

void IMB_buffer_float_from_byte ( float * rect_to,
const unsigned char * rect_from,
int profile_to,
int profile_from,
bool predivide,
int width,
int height,
int stride_to,
int stride_from )

◆ IMB_buffer_float_from_float()

◆ IMB_buffer_float_from_float_mask()

void IMB_buffer_float_from_float_mask ( float * rect_to,
const float * rect_from,
int channels_from,
int width,
int height,
int stride_to,
int stride_from,
char * mask )

Float to float pixels, output 4-channel RGBA.

Definition at line 572 of file divers.cc.

References copy_v3_v3(), copy_v4_v4(), FILTER_MASK_USED, x, and y.

Referenced by blender::ed::object::write_internal_bake_pixels().

◆ imb_buffer_float_from_float_thread_do()

static void imb_buffer_float_from_float_thread_do ( void * data_v,
int scanline )
static

◆ IMB_buffer_float_from_float_threaded()

void IMB_buffer_float_from_float_threaded ( float * rect_to,
const float * rect_from,
int channels_from,
int profile_to,
int profile_from,
bool predivide,
int width,
int height,
int stride_to,
int stride_from )

◆ IMB_color_to_bw()

◆ IMB_float_from_rect()

◆ IMB_float_from_rect_ex()

◆ IMB_rect_from_float()

◆ IMB_saturation()

◆ ushort_to_byte_dither_v4()

MINLINE void ushort_to_byte_dither_v4 ( uchar b[4],
const ushort us[4],
DitherContext * di,
float s,
float t )

◆ ushort_to_byte_v4()

MINLINE void ushort_to_byte_v4 ( uchar b[4],
const ushort us[4] )

Definition at line 53 of file divers.cc.

References b, and unit_ushort_to_uchar.

Referenced by IMB_buffer_byte_from_float().