Blender V4.5
texture_image.cc File Reference
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "DNA_image_types.h"
#include "DNA_texture_types.h"
#include "BLI_math_interp.hh"
#include "BLI_math_vector.h"
#include "BLI_rect.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BKE_image.hh"
#include "RE_texture.h"
#include "texture_common.h"

Go to the source code of this file.

Classes

struct  afdata_t
struct  ReadEWAData

Enumerations

enum  { TXC_XMIR = 1 , TXC_YMIR , TXC_REPT , TXC_EXTD }

Functions

static void boxsample (ImBuf *ibuf, float minx, float miny, float maxx, float maxy, TexResult *texres, const short imaprepeat, const short imapextend)
static void ibuf_get_color (float col[4], ImBuf *ibuf, int x, int y)
int imagewrap (Tex *tex, Image *ima, const float texvec[3], TexResult *texres, ImagePool *pool, const bool skip_load_image)
static void clipx_rctf_swap (rctf *stack, short *count, float x1, float x2)
static void clipy_rctf_swap (rctf *stack, short *count, float y1, float y2)
static float square_rctf (const rctf *rf)
static float clipx_rctf (rctf *rf, float x1, float x2)
static float clipy_rctf (rctf *rf, float y1, float y2)
static void boxsampleclip (ImBuf *ibuf, const rctf *rf, TexResult *texres)
static int ibuf_get_color_clip (float col[4], ImBuf *ibuf, int x, int y, int extflag)
static int ibuf_get_color_clip_bilerp (float col[4], ImBuf *ibuf, float u, float v, int intpol, int extflag)
static void area_sample (TexResult *texr, ImBuf *ibuf, float fx, float fy, const afdata_t *AFD)
static void ewa_read_pixel_cb (void *userdata, int x, int y, float result[4])
static void ewa_eval (TexResult *texr, ImBuf *ibuf, float fx, float fy, const afdata_t *AFD)
static void feline_eval (TexResult *texr, ImBuf *ibuf, float fx, float fy, const afdata_t *AFD)
static void alpha_clip_aniso (const ImBuf *ibuf, float minx, float miny, float maxx, float maxy, int extflag, TexResult *texres)
static void image_mipmap_test (Tex *tex, ImBuf *ibuf)
static int imagewraposa_aniso (Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], float dxt[2], float dyt[2], TexResult *texres, ImagePool *pool, const bool skip_load_image)
int imagewraposa (Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const float DXT[2], const float DYT[2], TexResult *texres, ImagePool *pool, const bool skip_load_image)
void image_sample (Image *ima, float fx, float fy, float dx, float dy, float result[4], ImagePool *pool)
void ibuf_sample (ImBuf *ibuf, float fx, float fy, float dx, float dy, float result[4])

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TXC_XMIR 
TXC_YMIR 
TXC_REPT 
TXC_EXTD 

Definition at line 654 of file texture_image.cc.

Function Documentation

◆ alpha_clip_aniso()

void alpha_clip_aniso ( const ImBuf * ibuf,
float minx,
float miny,
float maxx,
float maxy,
int extflag,
TexResult * texres )
static

◆ area_sample()

void area_sample ( TexResult * texr,
ImBuf * ibuf,
float fx,
float fy,
const afdata_t * AFD )
static

◆ boxsample()

void boxsample ( ImBuf * ibuf,
float minx,
float miny,
float maxx,
float maxy,
TexResult * texres,
const short imaprepeat,
const short imapextend )
static

◆ boxsampleclip()

void boxsampleclip ( ImBuf * ibuf,
const rctf * rf,
TexResult * texres )
static

◆ clipx_rctf()

float clipx_rctf ( rctf * rf,
float x1,
float x2 )
static

Definition at line 412 of file texture_image.cc.

References BLI_rctf_size_x(), size(), rctf::xmax, and rctf::xmin.

Referenced by alpha_clip_aniso(), and boxsample().

◆ clipx_rctf_swap()

void clipx_rctf_swap ( rctf * stack,
short * count,
float x1,
float x2 )
static

Definition at line 291 of file texture_image.cc.

References count, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by boxsample().

◆ clipy_rctf()

float clipy_rctf ( rctf * rf,
float y1,
float y2 )
static

Definition at line 430 of file texture_image.cc.

References BLI_rctf_size_y(), size(), rctf::ymax, and rctf::ymin.

Referenced by alpha_clip_aniso(), and boxsample().

◆ clipy_rctf_swap()

void clipy_rctf_swap ( rctf * stack,
short * count,
float y1,
float y2 )
static

Definition at line 347 of file texture_image.cc.

References count, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by boxsample().

◆ ewa_eval()

void ewa_eval ( TexResult * texr,
ImBuf * ibuf,
float fx,
float fy,
const afdata_t * AFD )
static

◆ ewa_read_pixel_cb()

void ewa_read_pixel_cb ( void * userdata,
int x,
int y,
float result[4] )
static

Definition at line 790 of file texture_image.cc.

References data, ibuf_get_color_clip(), result, x, and y.

Referenced by ewa_eval().

◆ feline_eval()

◆ ibuf_get_color()

void ibuf_get_color ( float col[4],
ImBuf * ibuf,
int x,
int y )
static

◆ ibuf_get_color_clip()

int ibuf_get_color_clip ( float col[4],
ImBuf * ibuf,
int x,
int y,
int extflag )
static

Similar to ibuf_get_color() but clips/wraps coords according to repeat/extend flags returns true if out of range in clip-mode.

Definition at line 660 of file texture_image.cc.

References ImBuf::byte_buffer, ImBuf::channels, col, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, TXC_EXTD, TXC_REPT, TXC_XMIR, TXC_YMIR, ImBuf::x, x, ImBuf::y, and y.

Referenced by ewa_read_pixel_cb(), and ibuf_get_color_clip_bilerp().

◆ ibuf_get_color_clip_bilerp()

int ibuf_get_color_clip_bilerp ( float col[4],
ImBuf * ibuf,
float u,
float v,
int intpol,
int extflag )
static

Definition at line 724 of file texture_image.cc.

References col, floorf, ibuf_get_color_clip(), and v.

Referenced by area_sample(), and feline_eval().

◆ ibuf_sample()

void ibuf_sample ( ImBuf * ibuf,
float fx,
float fy,
float dx,
float dy,
float result[4] )

◆ image_mipmap_test()

◆ image_sample()

void image_sample ( Image * ima,
float fx,
float fy,
float dx,
float dy,
float result[4],
ImagePool * pool )

◆ imagewrap()

◆ imagewraposa()

◆ imagewraposa_aniso()

◆ square_rctf()

float square_rctf ( const rctf * rf)
static

Definition at line 403 of file texture_image.cc.

References BLI_rctf_size_x(), BLI_rctf_size_y(), x, and y.

Referenced by boxsample().