Blender  V3.3
Classes | Typedefs | Enumerations | Functions
texture_image.c File Reference
#include <fcntl.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "DNA_image_types.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BKE_image.h"
#include "RE_texture.h"
#include "render_types.h"
#include "texture_common.h"

Go to the source code of this file.

Classes

struct  afdata_t
 
struct  ReadEWAData
 

Typedefs

typedef struct afdata_t afdata_t
 
typedef struct ReadEWAData 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], struct ImBuf *ibuf, int x, int y)
 
int imagewrap (Tex *tex, Image *ima, const float texvec[3], TexResult *texres, struct 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 (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 (struct ImBuf *ibuf, 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, 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, afdata_t *AFD)
 
static void feline_eval (TexResult *texr, ImBuf *ibuf, float fx, float fy, afdata_t *AFD)
 
static void alpha_clip_aniso (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, struct 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, struct ImagePool *pool, const bool skip_load_image)
 
void image_sample (Image *ima, float fx, float fy, float dx, float dy, float result[4], struct ImagePool *pool)
 
void ibuf_sample (ImBuf *ibuf, float fx, float fy, float dx, float dy, float result[4])
 

Typedef Documentation

◆ afdata_t

typedef struct afdata_t afdata_t

◆ ReadEWAData

typedef struct ReadEWAData ReadEWAData

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TXC_XMIR 
TXC_YMIR 
TXC_REPT 
TXC_EXTD 

Definition at line 673 of file texture_image.c.

Function Documentation

◆ alpha_clip_aniso()

static void alpha_clip_aniso ( 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,
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 ( struct ImBuf ibuf,
rctf rf,
TexResult texres 
)
static

◆ clipx_rctf()

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

Definition at line 419 of file texture_image.c.

References BLI_rctf_size_x(), size(), x2, 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 290 of file texture_image.c.

References Freestyle::a, count, x2, 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 441 of file texture_image.c.

References BLI_rctf_size_y(), size(), y1, 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 350 of file texture_image.c.

References Freestyle::a, count, rctf::xmax, rctf::xmin, y1, rctf::ymax, and rctf::ymin.

Referenced by boxsample().

◆ ewa_eval()

static void ewa_eval ( TexResult texr,
ImBuf ibuf,
float  fx,
float  fy,
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 813 of file texture_image.c.

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

Referenced by ewa_eval().

◆ feline_eval()

static void feline_eval ( TexResult texr,
ImBuf ibuf,
float  fx,
float  fy,
afdata_t AFD 
)
static

◆ ibuf_get_color()

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

Definition at line 50 of file texture_image.c.

References ImBuf::channels, col, copy_v3_v3(), copy_v4_v4(), float(), ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, and y.

Referenced by boxsampleclip(), and imagewrap().

◆ 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 679 of file texture_image.c.

References ImBuf::channels, col, if(), ImBuf::rect, ImBuf::rect_float, TXC_EXTD, TXC_REPT, TXC_XMIR, TXC_YMIR, x, ImBuf::x, y, and ImBuf::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 747 of file texture_image.c.

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

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

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

◆ imagewrap()

int imagewrap ( Tex tex,
Image ima,
const float  texvec[3],
TexResult texres,
struct ImagePool pool,
const bool  skip_load_image 
)

◆ imagewraposa()

int imagewraposa ( Tex tex,
Image ima,
ImBuf ibuf,
const float  texvec[3],
const float  DXT[2],
const float  DYT[2],
TexResult texres,
struct ImagePool pool,
const bool  skip_load_image 
)

◆ imagewraposa_aniso()

static int imagewraposa_aniso ( Tex tex,
Image ima,
ImBuf ibuf,
const float  texvec[3],
float  dxt[2],
float  dyt[2],
TexResult texres,
struct ImagePool pool,
const bool  skip_load_image 
)
static

◆ square_rctf()

static float square_rctf ( rctf rf)
static

Definition at line 410 of file texture_image.c.

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

Referenced by boxsample().