Blender V5.0
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
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 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 *AFD)
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 650 of file texture_image.cc.

Function Documentation

◆ 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 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 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 * AFD )
static

◆ ewa_read_pixel_cb()

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

Definition at line 724 of file texture_image.cc.

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

Referenced by ewa_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 656 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().

◆ ibuf_sample()

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

◆ image_sample()

◆ imagewrap()

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