|
Blender V4.5
|
#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]) |
| anonymous enum |
| Enumerator | |
|---|---|
| TXC_XMIR | |
| TXC_YMIR | |
| TXC_REPT | |
| TXC_EXTD | |
Definition at line 654 of file texture_image.cc.
|
static |
Definition at line 861 of file texture_image.cc.
References clipx_rctf(), clipy_rctf(), ELEM, max_ff(), TexResult::trgba, TXC_EXTD, TXC_REPT, ImBuf::x, rctf::xmax, rctf::xmin, ImBuf::y, rctf::ymax, and rctf::ymin.
Referenced by imagewraposa_aniso().
|
static |
Definition at line 747 of file texture_image.cc.
References afdata_t::dxt, afdata_t::dyt, afdata_t::extflag, ibuf_get_color_clip_bilerp(), afdata_t::intpol, out, sqrtf, TexResult::talpha, TexResult::trgba, ImBuf::x, and ImBuf::y.
Referenced by imagewraposa_aniso().
|
static |
Definition at line 534 of file texture_image.cc.
References boxsampleclip(), CLAMP, clipx_rctf(), clipx_rctf_swap(), clipy_rctf(), clipy_rctf_swap(), count, square_rctf(), TexResult::talpha, TexResult::trgba, ImBuf::x, rctf::xmax, rctf::xmin, ImBuf::y, rctf::ymax, and rctf::ymin.
Referenced by image_sample(), imagewrap(), and imagewraposa().
Definition at line 449 of file texture_image.cc.
References add_v4_v4(), col, floor, ibuf_get_color(), madd_v4_v4fl(), mul_v4_fl(), TexResult::trgba, ImBuf::x, x, rctf::xmax, rctf::xmin, ImBuf::y, y, rctf::ymax, rctf::ymin, and zero_v4().
Referenced by boxsample().
|
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().
|
static |
Definition at line 291 of file texture_image.cc.
References count, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by boxsample().
|
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().
|
static |
Definition at line 347 of file texture_image.cc.
References count, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by boxsample().
Definition at line 796 of file texture_image.cc.
References BLI_ewa_filter(), data, afdata_t::dxt, afdata_t::dyt, ewa_read_pixel_cb(), afdata_t::intpol, TexResult::talpha, TexResult::trgba, ImBuf::x, and ImBuf::y.
Referenced by ibuf_sample(), and imagewraposa_aniso().
|
static |
Definition at line 790 of file texture_image.cc.
References data, ibuf_get_color_clip(), result, x, and y.
Referenced by ewa_eval().
|
static |
Definition at line 814 of file texture_image.cc.
References cosf, D, afdata_t::dusc, afdata_t::dvsc, EWA_MAXIDX, EWA_WTS, expf, afdata_t::extflag, ibuf_get_color_clip_bilerp(), afdata_t::intpol, afdata_t::iProbes, afdata_t::majrad, afdata_t::minrad, sinf, TexResult::talpha, afdata_t::theta, TexResult::trgba, v, ImBuf::x, and ImBuf::y.
Referenced by imagewraposa_aniso().
|
static |
Definition at line 50 of file texture_image.cc.
References ImBuf::byte_buffer, ImBuf::channels, col, copy_v3_v3(), copy_v4_v4(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, ImBuf::x, x, and y.
Referenced by boxsampleclip(), and imagewrap().
|
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().
|
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().
| void ibuf_sample | ( | ImBuf * | ibuf, |
| float | fx, | ||
| float | fy, | ||
| float | dx, | ||
| float | dy, | ||
| float | result[4] ) |
Definition at line 1713 of file texture_image.cc.
References copy_v4_v4(), afdata_t::dxt, afdata_t::dyt, ewa_eval(), afdata_t::extflag, afdata_t::intpol, result, TexResult::trgba, and TXC_EXTD.
Definition at line 895 of file texture_image.cc.
References BLI_thread_lock(), BLI_thread_unlock(), IB_MIPMAP_INVALID, Tex::imaflag, IMB_makemipmap(), IMB_remakemipmap(), LOCK_IMAGE, ImBuf::mipmap, TEX_GAUSS_MIP, TEX_MIPMAP, and ImBuf::userflags.
Referenced by imagewraposa(), and imagewraposa_aniso().
| void image_sample | ( | Image * | ima, |
| float | fx, | ||
| float | fy, | ||
| float | dx, | ||
| float | dy, | ||
| float | result[4], | ||
| ImagePool * | pool ) |
Definition at line 1693 of file texture_image.cc.
References BKE_image_pool_acquire_ibuf(), BKE_image_pool_release_ibuf(), boxsample(), copy_v4_v4(), Image::flag, IMA_USED_FOR_RENDER, result, TexResult::talpha, TexResult::trgba, UNLIKELY, and zero_v4().
| int imagewrap | ( | Tex * | tex, |
| Image * | ima, | ||
| const float | texvec[3], | ||
| TexResult * | texres, | ||
| ImagePool * | pool, | ||
| const bool | skip_load_image ) |
Definition at line 84 of file texture_image.cc.
References Image::alpha_mode, BKE_image_get_tile_from_pos(), BKE_image_has_loaded_ibuf(), BKE_image_pool_acquire_ibuf(), BKE_image_pool_release_ibuf(), boxsample(), BRICONTRGB, ImBuf::byte_buffer, Tex::checkerdist, ImBufByteBuffer::data, ImBufFloatBuffer::data, ELEM, Tex::extend, Tex::filtersize, Image::flag, Tex::flag, ImBuf::float_buffer, floor, floorf, ibuf_get_color(), IMA_ALPHA_IGNORE, IMA_SRC_TILED, IMA_USED_FOR_RENDER, Tex::imaflag, Tex::iuser, max_fff(), Image::source, TexResult::talpha, TEX_CALCALPHA, TEX_CHECKER, TEX_CHECKER_EVEN, TEX_CHECKER_ODD, TEX_CLIP, TEX_CLIPCUBE, TEX_EXTEND, TEX_IMAROT, TEX_INTERPOL, TEX_NEGALPHA, TEX_REPEAT, TEX_RGB, TEX_USEALPHA, ImageUser::tile, TexResult::tin, TexResult::trgba, ImBuf::x, x, ImBuf::y, and y.
Referenced by multitex().
| 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 ) |
Definition at line 1323 of file texture_image.cc.
References Image::alpha_mode, BKE_image_has_loaded_ibuf(), BKE_image_pool_acquire_ibuf(), BKE_image_pool_release_ibuf(), boxsample(), BRICONTRGB, ImBuf::byte_buffer, Tex::checkerdist, copy_v2_v2(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ELEM, Tex::extend, Tex::filtersize, Image::flag, Tex::flag, ImBuf::float_buffer, floor, IMA_ALPHA_IGNORE, IMA_USED_FOR_RENDER, Tex::imaflag, image_mipmap_test(), imagewraposa_aniso(), Tex::iuser, max_ff(), max_fff(), min_fff(), ImBuf::mipmap, mul_v3_fl(), TexResult::talpha, TEX_CALCALPHA, TEX_CHECKER, TEX_CHECKER_EVEN, TEX_CHECKER_ODD, TEX_CLIP, TEX_CLIPCUBE, TEX_EXTEND, TEX_FILTER_MIN, TEX_IMAROT, TEX_INTERPOL, TEX_MIPMAP, TEX_NEGALPHA, TEX_REPEAT, TEX_REPEAT_XMIR, TEX_REPEAT_YMIR, TEX_RGB, TEX_USEALPHA, Tex::texfilter, TexResult::tin, TexResult::trgba, TXF_BOX, ImBuf::x, and ImBuf::y.
Referenced by multitex().
|
static |
Definition at line 920 of file texture_image.cc.
References A, Tex::afmax, alpha_clip_aniso(), Image::alpha_mode, area_sample(), B, b, BKE_image_has_loaded_ibuf(), BKE_image_pool_acquire_ibuf(), BKE_image_pool_release_ibuf(), BLI_ewa_imp2radangle(), BRICONTRGB, ImBuf::byte_buffer, C, Tex::checkerdist, copy_v2_v2(), ImBufByteBuffer::data, ImBufFloatBuffer::data, afdata_t::dusc, afdata_t::dvsc, afdata_t::dxt, afdata_t::dyt, ELEM, ewa_eval(), Tex::extend, afdata_t::extflag, F, feline_eval(), Tex::filtersize, Image::flag, Tex::flag, ImBuf::float_buffer, floorf, IMA_ALPHA_IGNORE, IMA_USED_FOR_RENDER, Tex::imaflag, image_mipmap_test(), IMB_MIPMAP_LEVELS, afdata_t::intpol, afdata_t::iProbes, isnan, Tex::iuser, len_v2(), logf, M_LOG2E, afdata_t::majrad, max_ff(), max_fff(), min_fff(), afdata_t::minrad, ImBuf::mipmap, mul_v2_fl(), round_fl_to_int(), sqrtf, TexResult::talpha, TEX_CALCALPHA, TEX_CHECKER, TEX_CHECKER_EVEN, TEX_CHECKER_ODD, TEX_CLIP, TEX_CLIPCUBE, TEX_EXTEND, TEX_FILTER_MIN, TEX_IMAROT, TEX_INTERPOL, TEX_MIPMAP, TEX_NEGALPHA, TEX_REPEAT, TEX_REPEAT_XMIR, TEX_REPEAT_YMIR, TEX_RGB, TEX_USEALPHA, Tex::texfilter, afdata_t::theta, TexResult::tin, TexResult::trgba, TXC_EXTD, TXC_REPT, TXC_XMIR, TXC_YMIR, TXF_AREA, TXF_EWA, TXF_FELINE, ImBuf::x, and ImBuf::y.
Referenced by imagewraposa().
|
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().