|
Blender
V2.93
|
#include <math.h>#include "BLI_math_color.h"#include "BLI_math_interp.h"#include "BLI_utildefines.h"#include "MEM_guardedalloc.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "imbuf.h"#include "IMB_filter.h"#include "BLI_sys_types.h"Go to the source code of this file.
Classes | |
| struct | scale_outpix_byte |
| struct | scale_outpix_float |
| struct | imbufRGBA |
| struct | ScaleTreadInitData |
| struct | ScaleThreadData |
Typedefs | |
| typedef struct ScaleTreadInitData | ScaleTreadInitData |
| typedef struct ScaleThreadData | ScaleThreadData |
Functions | |
| static void | imb_half_x_no_alloc (struct ImBuf *ibuf2, struct ImBuf *ibuf1) |
| struct ImBuf * | IMB_half_x (struct ImBuf *ibuf1) |
| struct ImBuf * | IMB_double_fast_x (struct ImBuf *ibuf1) |
| struct ImBuf * | IMB_double_x (struct ImBuf *ibuf1) |
| static void | imb_half_y_no_alloc (struct ImBuf *ibuf2, struct ImBuf *ibuf1) |
| struct ImBuf * | IMB_half_y (struct ImBuf *ibuf1) |
| struct ImBuf * | IMB_double_fast_y (struct ImBuf *ibuf1) |
| struct ImBuf * | IMB_double_y (struct ImBuf *ibuf1) |
| MINLINE void | straight_uchar_to_premul_ushort (unsigned short result[4], const unsigned char color[4]) |
| MINLINE void | premul_ushort_to_straight_uchar (unsigned char *result, const unsigned short color[4]) |
| void | imb_onehalf_no_alloc (struct ImBuf *ibuf2, struct ImBuf *ibuf1) |
| ImBuf * | IMB_onehalf (struct ImBuf *ibuf1) |
| static void | enlarge_picture_byte (unsigned char *src, unsigned char *dst, int src_width, int src_height, int dst_width, int dst_height) |
| static void | shrink_picture_byte (unsigned char *src, unsigned char *dst, int src_width, int src_height, int dst_width, int dst_height) |
| static void | q_scale_byte (unsigned char *in, unsigned char *out, int in_width, int in_height, int dst_width, int dst_height) |
| static void | enlarge_picture_float (float *src, float *dst, int src_width, int src_height, int dst_width, int dst_height) |
| static void | shrink_picture_float (const float *src, float *dst, int src_width, int src_height, int dst_width, int dst_height) |
| static void | q_scale_float (float *in, float *out, int in_width, int in_height, int dst_width, int dst_height) |
| static bool | q_scale_linear_interpolation (struct ImBuf *ibuf, int newx, int newy) |
| static ImBuf * | scaledownx (struct ImBuf *ibuf, int newx) |
| static ImBuf * | scaledowny (struct ImBuf *ibuf, int newy) |
| static ImBuf * | scaleupx (struct ImBuf *ibuf, int newx) |
| static ImBuf * | scaleupy (struct ImBuf *ibuf, int newy) |
| static void | scalefast_Z_ImBuf (ImBuf *ibuf, int newx, int newy) |
| bool | IMB_scaleImBuf (struct ImBuf *ibuf, unsigned int newx, unsigned int newy) |
| bool | IMB_scalefastImBuf (struct ImBuf *ibuf, unsigned int newx, unsigned int newy) |
| static void | scale_thread_init (void *data_v, int start_line, int tot_line, void *init_data_v) |
| static void * | do_scale_thread (void *data_v) |
| void | IMB_scaleImBuf_threaded (ImBuf *ibuf, unsigned int newx, unsigned int newy) |
| typedef struct ScaleThreadData ScaleThreadData |
| typedef struct ScaleTreadInitData ScaleTreadInitData |
|
static |
Definition at line 1855 of file scaling.c.
References BLI_bilinear_interpolation_char(), BLI_bilinear_interpolation_fl(), ImBuf::channels, data, float(), NULL, ImBuf::rect, ImBuf::rect_float, v, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_scaleImBuf_threaded().
|
static |
Definition at line 124 of file scaling.c.
References col, ImBuf::flags, IMB_allocImBuf(), NULL, ImBuf::planes, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by IMB_double_x().
Definition at line 278 of file scaling.c.
References ImBuf::flags, IMB_allocImBuf(), NULL, ImBuf::planes, ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_double_y().
Definition at line 169 of file scaling.c.
References IMB_double_fast_x(), imb_filterx(), NULL, ImBuf::rect, and ImBuf::rect_float.
Definition at line 326 of file scaling.c.
References IMB_double_fast_y(), IMB_filtery(), NULL, and ImBuf::rect.
Definition at line 99 of file scaling.c.
References ImBuf::flags, IMB_allocImBuf(), IMB_dupImBuf(), imb_half_x_no_alloc(), NULL, ImBuf::planes, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by IMB_onehalf().
Definition at line 40 of file scaling.c.
References Freestyle::a, NULL, r, ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_half_x(), and imb_onehalf_no_alloc().
Definition at line 253 of file scaling.c.
References ImBuf::flags, IMB_allocImBuf(), IMB_dupImBuf(), imb_half_y_no_alloc(), NULL, ImBuf::planes, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by IMB_onehalf().
Definition at line 186 of file scaling.c.
References Freestyle::a, NULL, r, ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_half_y(), and imb_onehalf_no_alloc().
Definition at line 453 of file scaling.c.
References ImBuf::flags, IMB_allocImBuf(), IMB_half_x(), IMB_half_y(), imb_onehalf_no_alloc(), NULL, ImBuf::planes, ImBuf::rect, ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by IMB_makemipmap().
Definition at line 376 of file scaling.c.
References imb_addrectImBuf(), imb_half_x_no_alloc(), imb_half_y_no_alloc(), NULL, premul_ushort_to_straight_uchar(), ImBuf::rect, ImBuf::rect_float, straight_uchar_to_premul_ushort(), x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_onehalf(), and IMB_remakemipmap().
| bool IMB_scalefastImBuf | ( | struct ImBuf * | ibuf, |
| unsigned int | newx, | ||
| unsigned int | newy | ||
| ) |
Return true if ibuf is modified.
Definition at line 1715 of file scaling.c.
References BLI_assert, IB_rect, IB_rectfloat, imb_freerectfloatImBuf(), imb_freerectImBuf(), ImBuf::mall, MEM_freeN, MEM_mallocN, NULL, ImBuf::rect, ImBuf::rect_float, scalefast_Z_ImBuf(), x, ImBuf::x, y, and ImBuf::y.
Referenced by icon_copy_rect(), py_imbuf_resize(), and seq_proxy_build_frame().
| bool IMB_scaleImBuf | ( | struct ImBuf * | ibuf, |
| unsigned int | newx, | ||
| unsigned int | newy | ||
| ) |
Return true if ibuf is modified.
Definition at line 1667 of file scaling.c.
References BLI_assert, NULL, q_scale_linear_interpolation(), ImBuf::rect, ImBuf::rect_float, scaledownx(), scaledowny(), scalefast_Z_ImBuf(), scaleupx(), scaleupy(), x, ImBuf::x, y, and ImBuf::y.
Referenced by accessor_get_ibuf(), BKE_image_scale(), BKE_previewimg_ensure(), blend_file_thumb(), get_undistorted_ibuf(), icon_draw_rect(), icon_verify_datatoc(), image_scale_exec(), imb_gpu_get_data(), Freestyle::Canvas::loadMap(), movieclip_build_proxy_ibuf(), py_imbuf_resize(), thumb_create_ex(), ui_draw_but_IMAGE(), update_do_scale(), wm_block_create_about(), and wm_block_splash_image().
| void IMB_scaleImBuf_threaded | ( | struct ImBuf * | ibuf, |
| unsigned int | newx, | ||
| unsigned int | newy | ||
| ) |
Definition at line 1889 of file scaling.c.
References BLI_assert, ImBuf::channels, do_scale_thread(), IB_rect, IB_rectfloat, imb_freerectfloatImBuf(), imb_freerectImBuf(), IMB_processor_apply_threaded(), init_data(), ImBuf::mall, MEM_mallocN, NULL, ImBuf::rect, ImBuf::rect_float, scale_thread_init(), ImBuf::x, and ImBuf::y.
Referenced by imb_stereo3d_squeeze_ImBuf(), imb_stereo3d_squeeze_rect(), imb_stereo3d_squeeze_rectf(), imb_stereo3d_unsqueeze_ImBuf(), and movieclip_build_proxy_ibuf().
| MINLINE void premul_ushort_to_straight_uchar | ( | unsigned char * | result, |
| const unsigned short | color[4] | ||
| ) |
Definition at line 357 of file scaling.c.
References alpha, result, and unit_ushort_to_uchar().
Referenced by imb_onehalf_no_alloc().
|
static |
Definition at line 666 of file scaling.c.
References enlarge_picture_byte(), and shrink_picture_byte().
Referenced by q_scale_linear_interpolation().
|
static |
Definition at line 852 of file scaling.c.
References enlarge_picture_float(), and shrink_picture_float().
Referenced by q_scale_linear_interpolation().
|
static |
q_scale_linear_interpolation (derived from ppmqscale, http://libdv.sf.net)
q stands for quick and quality :)
only handles common cases when we either
scale both, x and y or shrink both, x and y
but that is pretty fast:
Should be comparable in speed to the ImBuf ..._fast functions at least for byte-buffers.
NOTE: disabled, due to unacceptable inaccuracy and quality loss, see bug T18609 (ton)
Definition at line 884 of file scaling.c.
References IB_rect, IB_rectfloat, imb_freerectfloatImBuf(), imb_freerectImBuf(), ImBuf::mall, MEM_mallocN, q_scale_byte(), q_scale_float(), ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_scaleImBuf().
|
static |
Definition at line 1838 of file scaling.c.
References data, and init_data().
Referenced by IMB_scaleImBuf_threaded().
Definition at line 911 of file scaling.c.
References add(), BLI_assert, IB_rect, IB_rectfloat, imb_freerectfloatImBuf(), imb_freerectImBuf(), ImBuf::mall, MEM_freeN, MEM_mallocN, NULL, ImBuf::rect, ImBuf::rect_float, rect_size(), blender::compositor::sample(), x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_scaleImBuf().
Definition at line 1052 of file scaling.c.
References add(), BLI_assert, IB_rect, IB_rectfloat, imb_freerectfloatImBuf(), imb_freerectImBuf(), ImBuf::mall, MEM_freeN, MEM_mallocN, NULL, ImBuf::rect, ImBuf::rect_float, rect_size(), blender::compositor::sample(), x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_scaleImBuf().
|
static |
Definition at line 1599 of file scaling.c.
References IB_zbuf, IB_zbuffloat, IMB_freezbuffloatImBuf(), IMB_freezbufImBuf(), ImBuf::mall, MEM_mallocN, NULL, x, ImBuf::x, y, ImBuf::y, ImBuf::zbuf, and ImBuf::zbuf_float.
Referenced by IMB_scalefastImBuf(), and IMB_scaleImBuf().
Definition at line 1194 of file scaling.c.
References add(), IB_rect, IB_rectfloat, imb_freerectfloatImBuf(), imb_freerectImBuf(), ImBuf::mall, MEM_freeN, MEM_mallocN, NULL, ImBuf::rect, ImBuf::rect_float, blender::compositor::sample(), UNLIKELY, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_scaleImBuf().
Definition at line 1396 of file scaling.c.
References add(), IB_rect, IB_rectfloat, imb_freerectfloatImBuf(), imb_freerectImBuf(), ImBuf::mall, MEM_freeN, MEM_mallocN, NULL, ImBuf::rect, ImBuf::rect_float, blender::compositor::sample(), UNLIKELY, x, ImBuf::x, y, and ImBuf::y.
Referenced by IMB_scaleImBuf().
|
static |
Definition at line 551 of file scaling.c.
References scale_outpix_byte::a, scale_outpix_byte::b, double(), scale_outpix_byte::g, MEM_callocN, MEM_freeN, NULL, scale_outpix_byte::r, w(), scale_outpix_byte::weight, and x.
Referenced by q_scale_byte().
|
static |
Definition at line 743 of file scaling.c.
References scale_outpix_float::a, scale_outpix_float::b, double(), scale_outpix_float::g, MEM_callocN, MEM_freeN, scale_outpix_float::r, w(), scale_outpix_float::weight, and x.
Referenced by q_scale_float().