Blender V4.3
texture_image.cc File Reference
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <cstdio>
#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_color.h"
#include "BLI_math_interp.hh"
#include "BLI_math_vector.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 675 of file texture_image.cc.

Function Documentation

◆ alpha_clip_aniso()

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

◆ area_sample()

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

◆ boxsample()

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

◆ boxsampleclip()

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

◆ clipx_rctf()

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

Definition at line 421 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()

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

Definition at line 292 of file texture_image.cc.

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

Referenced by boxsample().

◆ clipy_rctf()

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

Definition at line 443 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()

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

Definition at line 352 of file texture_image.cc.

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

Referenced by boxsample().

◆ ewa_eval()

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

◆ ewa_read_pixel_cb()

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

Definition at line 815 of file texture_image.cc.

References ibuf_get_color_clip().

Referenced by ewa_eval().

◆ feline_eval()

◆ ibuf_get_color()

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

◆ ibuf_get_color_clip()

static 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 681 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()

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

Definition at line 749 of file texture_image.cc.

References col, floorf, ibuf_get_color_clip(), int, 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()

static void image_mipmap_test ( Tex * tex,
ImBuf * ibuf )
static

◆ image_sample()

◆ imagewrap()

◆ imagewraposa()

◆ imagewraposa_aniso()

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 )
static

◆ square_rctf()

static float square_rctf ( const rctf * rf)
static

Definition at line 412 of file texture_image.cc.

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

Referenced by boxsample().