Blender V4.3
BLI_rect.h File Reference
#include "BLI_compiler_compat.h"
#include "BLI_sys_types.h"
#include "DNA_vec_types.h"

Go to the source code of this file.

Macros

#define print_rctf_id(rect)   print_rctf(STRINGIFY(rect), rect)
 
#define print_rcti_id(rect)   print_rcti(STRINGIFY(rect), rect)
 

Functions

bool BLI_rcti_is_empty (const struct rcti *rect)
 
bool BLI_rctf_is_empty (const struct rctf *rect)
 
void BLI_rctf_init (struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
 
void BLI_rcti_init (struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
 
bool BLI_rctf_is_valid (const struct rctf *rect)
 
bool BLI_rcti_is_valid (const struct rcti *rect)
 
void BLI_rctf_sanitize (struct rctf *rect)
 
void BLI_rcti_sanitize (struct rcti *rect)
 
void BLI_rctf_init_pt_radius (struct rctf *rect, const float xy[2], float size)
 
void BLI_rcti_init_pt_radius (struct rcti *rect, const int xy[2], int size)
 
void BLI_rcti_init_minmax (struct rcti *rect)
 
void BLI_rctf_init_minmax (struct rctf *rect)
 
void BLI_rcti_do_minmax_v (struct rcti *rect, const int xy[2])
 
void BLI_rctf_do_minmax_v (struct rctf *rect, const float xy[2])
 
void BLI_rcti_do_minmax_rcti (struct rcti *rect, const struct rcti *other)
 
void BLI_rctf_transform_pt_v (const rctf *dst, const rctf *src, float xy_dst[2], const float xy_src[2])
 
void BLI_rctf_transform_calc_m4_pivot_min_ex (const rctf *dst, const rctf *src, float matrix[4][4], uint x, uint y)
 
void BLI_rctf_transform_calc_m4_pivot_min (const rctf *dst, const rctf *src, float matrix[4][4])
 
void BLI_rctf_translate (struct rctf *rect, float x, float y)
 
void BLI_rcti_translate (struct rcti *rect, int x, int y)
 
void BLI_rctf_mul (struct rctf *rect, float factor)
 
void BLI_rcti_mul (struct rcti *rect, int factor)
 
void BLI_rcti_recenter (struct rcti *rect, int x, int y)
 
void BLI_rctf_recenter (struct rctf *rect, float x, float y)
 
void BLI_rcti_resize (struct rcti *rect, int x, int y)
 
void BLI_rcti_resize_x (struct rcti *rect, int x)
 
void BLI_rcti_resize_y (struct rcti *rect, int y)
 
void BLI_rcti_pad (struct rcti *rect, int pad_x, int pad_y)
 
void BLI_rctf_pad (struct rctf *rect, float pad_x, float pad_y)
 
void BLI_rctf_resize (struct rctf *rect, float x, float y)
 
void BLI_rctf_resize_x (struct rctf *rect, float x)
 
void BLI_rctf_resize_y (struct rctf *rect, float y)
 
void BLI_rcti_scale (rcti *rect, float scale)
 
void BLI_rctf_scale (rctf *rect, float scale)
 
void BLI_rctf_pad_y (struct rctf *rect, float boundary_size, float pad_min, float pad_max)
 
void BLI_rctf_interp (struct rctf *rect, const struct rctf *rect_a, const struct rctf *rect_b, float fac)
 
bool BLI_rctf_clamp_pt_v (const struct rctf *rect, float xy[2])
 
bool BLI_rcti_clamp_pt_v (const struct rcti *rect, int xy[2])
 
bool BLI_rctf_clamp (struct rctf *rect, const struct rctf *rect_bounds, float r_xy[2])
 
bool BLI_rcti_clamp (struct rcti *rect, const struct rcti *rect_bounds, int r_xy[2])
 
bool BLI_rctf_compare (const struct rctf *rect_a, const struct rctf *rect_b, float limit)
 
bool BLI_rcti_compare (const struct rcti *rect_a, const struct rcti *rect_b)
 
bool BLI_rctf_isect (const struct rctf *src1, const struct rctf *src2, struct rctf *dest)
 
bool BLI_rcti_isect (const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
 
bool BLI_rctf_isect_rect_x (const struct rctf *src1, const struct rctf *src2, float range_x[2])
 
bool BLI_rctf_isect_rect_y (const struct rctf *src1, const struct rctf *src2, float range_y[2])
 
bool BLI_rcti_isect_rect_x (const struct rcti *src1, const struct rcti *src2, int range_x[2])
 
bool BLI_rcti_isect_rect_y (const struct rcti *src1, const struct rcti *src2, int range_y[2])
 
bool BLI_rcti_isect_x (const rcti *rect, int x)
 
bool BLI_rcti_isect_y (const rcti *rect, int y)
 
bool BLI_rcti_isect_pt (const struct rcti *rect, int x, int y)
 
bool BLI_rcti_isect_pt_v (const struct rcti *rect, const int xy[2])
 
bool BLI_rctf_isect_x (const rctf *rect, float x)
 
bool BLI_rctf_isect_y (const rctf *rect, float y)
 
bool BLI_rctf_isect_pt (const struct rctf *rect, float x, float y)
 
bool BLI_rctf_isect_pt_v (const struct rctf *rect, const float xy[2])
 
int BLI_rcti_length_x (const rcti *rect, int x)
 
int BLI_rcti_length_y (const rcti *rect, int y)
 
float BLI_rctf_length_x (const rctf *rect, float x)
 
float BLI_rctf_length_y (const rctf *rect, float y)
 
bool BLI_rcti_isect_segment (const struct rcti *rect, const int s1[2], const int s2[2])
 
bool BLI_rctf_isect_segment (const struct rctf *rect, const float s1[2], const float s2[2])
 
bool BLI_rcti_isect_circle (const struct rcti *rect, const float xy[2], float radius)
 
bool BLI_rctf_isect_circle (const struct rctf *rect, const float xy[2], float radius)
 
bool BLI_rcti_inside_rcti (const rcti *rct_a, const rcti *rct_b)
 
bool BLI_rctf_inside_rctf (const rctf *rct_a, const rctf *rct_b)
 
void BLI_rcti_union (struct rcti *rct_a, const struct rcti *rct_b)
 
void BLI_rctf_union (struct rctf *rct_a, const struct rctf *rct_b)
 
void BLI_rcti_rctf_copy (struct rcti *dst, const struct rctf *src)
 
void BLI_rctf_rcti_copy (struct rctf *dst, const struct rcti *src)
 
void BLI_rcti_rctf_copy_floor (struct rcti *dst, const struct rctf *src)
 
void BLI_rcti_rctf_copy_round (struct rcti *dst, const struct rctf *src)
 
void BLI_rctf_rotate_expand (rctf *dst, const rctf *src, float angle)
 
void print_rctf (const char *str, const struct rctf *rect)
 
void print_rcti (const char *str, const struct rcti *rect)
 
BLI_INLINE float BLI_rcti_cent_x_fl (const struct rcti *rct)
 
BLI_INLINE float BLI_rcti_cent_y_fl (const struct rcti *rct)
 
BLI_INLINE int BLI_rcti_cent_x (const struct rcti *rct)
 
BLI_INLINE int BLI_rcti_cent_y (const struct rcti *rct)
 
BLI_INLINE float BLI_rctf_cent_x (const struct rctf *rct)
 
BLI_INLINE float BLI_rctf_cent_y (const struct rctf *rct)
 
BLI_INLINE int BLI_rcti_size_x (const struct rcti *rct)
 
BLI_INLINE int BLI_rcti_size_y (const struct rcti *rct)
 
BLI_INLINE float BLI_rctf_size_x (const struct rctf *rct)
 
BLI_INLINE float BLI_rctf_size_y (const struct rctf *rct)
 

Macro Definition Documentation

◆ print_rctf_id

#define print_rctf_id ( rect)    print_rctf(STRINGIFY(rect), rect)

Definition at line 161 of file BLI_rect.h.

◆ print_rcti_id

#define print_rcti_id ( rect)    print_rcti(STRINGIFY(rect), rect)

Definition at line 162 of file BLI_rect.h.

Function Documentation

◆ BLI_rctf_cent_x()

◆ BLI_rctf_cent_y()

◆ BLI_rctf_clamp()

bool BLI_rctf_clamp ( struct rctf * rect,
const struct rctf * rect_bounds,
float r_xy[2] )

Clamp rect within rect_bounds, setting r_xy to the offset.

Keeps the top left corner within the bounds, which for user interface elements is typically where the most important information is.

Returns
true if a change is made.

◆ BLI_rctf_clamp_pt_v()

bool BLI_rctf_clamp_pt_v ( const struct rctf * rect,
float xy[2] )

◆ BLI_rctf_compare()

◆ BLI_rctf_do_minmax_v()

void BLI_rctf_do_minmax_v ( struct rctf * rect,
const float xy[2] )

◆ BLI_rctf_init()

◆ BLI_rctf_init_minmax()

◆ BLI_rctf_init_pt_radius()

◆ BLI_rctf_inside_rctf()

◆ BLI_rctf_interp()

void BLI_rctf_interp ( struct rctf * rect,
const struct rctf * rect_a,
const struct rctf * rect_b,
float fac )

◆ BLI_rctf_is_empty()

bool BLI_rctf_is_empty ( const struct rctf * rect)

◆ BLI_rctf_is_valid()

bool BLI_rctf_is_valid ( const struct rctf * rect)

Check if X-min and Y-min are less than or equal to X-max and Y-max, respectively. If this returns false, BLI_rctf_sanitize() can be called to address this.

This is not a hard constraint or invariant for rectangles, in some cases it may be useful to have max < min. Usually this is what you'd want though.

Referenced by ANIM_frame_channel_y_extents(), calculate_fcurve_bounds_and_unhide(), calculate_fpt_bounds(), calculate_selection_fcurve_bounds(), and view_curve_in_graph_editor_exec().

◆ BLI_rctf_isect()

◆ BLI_rctf_isect_circle()

bool BLI_rctf_isect_circle ( const struct rctf * rect,
const float xy[2],
float radius )

◆ BLI_rctf_isect_pt()

◆ BLI_rctf_isect_pt_v()

◆ BLI_rctf_isect_rect_x()

bool BLI_rctf_isect_rect_x ( const struct rctf * src1,
const struct rctf * src2,
float range_x[2] )

Referenced by ui_handler_region_menu().

◆ BLI_rctf_isect_rect_y()

bool BLI_rctf_isect_rect_y ( const struct rctf * src1,
const struct rctf * src2,
float range_y[2] )

Referenced by ui_handler_region_menu().

◆ BLI_rctf_isect_segment()

◆ BLI_rctf_isect_x()

bool BLI_rctf_isect_x ( const rctf * rect,
float x )

◆ BLI_rctf_isect_y()

bool BLI_rctf_isect_y ( const rctf * rect,
float y )

◆ BLI_rctf_length_x()

float BLI_rctf_length_x ( const rctf * rect,
float x )

Definition at line 171 of file rct.c.

References x, rctf::xmax, and rctf::xmin.

Referenced by blender::ed::space_node::node_link_dim_factor(), and strip_to_frame_distance().

◆ BLI_rctf_length_y()

float BLI_rctf_length_y ( const rctf * rect,
float y )

Definition at line 182 of file rct.c.

References y, rctf::ymax, and rctf::ymin.

Referenced by blender::ed::space_node::node_link_dim_factor().

◆ BLI_rctf_mul()

void BLI_rctf_mul ( struct rctf * rect,
float factor )

Definition at line 582 of file rct.c.

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

Referenced by BKE_camera_params_compute_viewplane(), and vfont_to_curve().

◆ BLI_rctf_pad()

◆ BLI_rctf_pad_y()

void BLI_rctf_pad_y ( struct rctf * rect,
float boundary_size,
float pad_min,
float pad_max )

◆ BLI_rctf_rcti_copy()

◆ BLI_rctf_recenter()

◆ BLI_rctf_resize()

◆ BLI_rctf_resize_x()

void BLI_rctf_resize_x ( struct rctf * rect,
float x )

Definition at line 639 of file rct.c.

References BLI_rctf_cent_x(), x, rctf::xmax, and rctf::xmin.

Referenced by sequencer_draw_scopes().

◆ BLI_rctf_resize_y()

void BLI_rctf_resize_y ( struct rctf * rect,
float y )

Definition at line 645 of file rct.c.

References BLI_rctf_cent_y(), y, rctf::ymax, and rctf::ymin.

Referenced by graphkeys_viewall(), and sequencer_draw_scopes().

◆ BLI_rctf_rotate_expand()

void BLI_rctf_rotate_expand ( rctf * dst,
const rctf * src,
float angle )

Expand the rectangle to fit a rotated src.

Definition at line 1099 of file rct.c.

References BLI_rctf_cent_x(), BLI_rctf_cent_y(), cosf, fabsf, MAX2, ROTATE_SINCOS, sinf, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

◆ BLI_rctf_sanitize()

void BLI_rctf_sanitize ( struct rctf * rect)

Ensure X-min and Y-min are less than or equal to X-max and Y-max, respectively.

Definition at line 438 of file rct.c.

References BLI_assert, BLI_rctf_is_valid(), SWAP, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by BLI_rctf_init().

◆ BLI_rctf_scale()

◆ BLI_rctf_size_x()

BLI_INLINE float BLI_rctf_size_x ( const struct rctf * rct)

Definition at line 197 of file BLI_rect.h.

References rctf::xmax, and rctf::xmin.

Referenced by actkeys_viewall(), ANIM_center_frame(), ANIM_frame_range_view2d_add_xmargin(), annotation_stroke_convertcoords(), areas_do_frame_follow(), BKE_camera_params_crop_viewplane(), BKE_curvemapping_changed(), BKE_curveprofile_update(), BLI_rctf_scale(), BLI_rctf_transform_calc_m4_pivot_min_ex(), BLI_rcti_rctf_copy(), button_activate_init(), calculate_pixel_distance(), calculate_pixels_per_unit(), calculateZfac(), camera_frame_fit_calc_from_data(), clipx_rctf(), colorband_buttons_layout(), convertViewVec2D(), convertViewVec2D_mask(), createTransActionData(), curve_profile_can_zoom_in(), curve_profile_can_zoom_out(), curve_profile_zoom_in(), curve_profile_zoom_out(), curvemap_buttons_zoom_in(), curvemap_buttons_zoom_out(), curvemap_can_zoom_in(), curvemap_can_zoom_out(), dopesheet_view_all_exec(), draw_anti_tria_rect(), draw_channel_labels(), draw_emboss(), draw_fcurve_active_vertex(), draw_fcurve_curve_keys(), draw_fcurve_modifier_controls_envelope(), draw_icon_centered(), draw_nla_main_data(), draw_seq_in_view(), draw_seq_waveform_overlay(), draw_vectorscope_graticule(), drawLine(), drawSnapping(), drawWalkPixel(), ED_clip_graph_center_current_frame(), ED_fileselect_init_layout(), ED_fileselect_layout_numfiles(), ed_marker_move_modal(), ED_mask_draw_region(), ED_region_panels_layout_ex(), ED_space_clip_get_zoom(), ED_space_image_get_zoom(), ED_view3d_calc_camera_border_size(), ED_view3d_calc_render_border(), ED_view3d_update_viewmat(), edge_pan_speed(), eevee_engine_init(), file_draw_invalid_asset_library_hint(), file_draw_invalid_library_hint(), find_nearest_seq(), blender::ed::space_node::frame_node_draw_label(), blender::geometry::get_aspect_scaled_area(), blender::geometry::get_aspect_scaled_extent(), blender::ed::space_node::gizmo_node_crop_prop_matrix_get(), gizmo_render_border_prop_matrix_get(), gpencil_point_to_xy(), icon_draw_rect_input(), icon_draw_rect_input_text(), blender::draw::image_engine::SpaceImageAccessor::init_ss_to_texture_matrix(), initFlyInfo(), layer_bucket_init(), nlaedit_viewall(), blender::ed::space_node::node_circleselect_exec(), blender::ed::space_node::node_draw_extra_info_panel(), blender::ed::space_node::node_draw_hidden(), blender::ed::space_node::node_draw_preview(), blender::ed::space_node::node_draw_zones_and_frames(), blender::ed::space_node::node_link_dim_factor(), blender::ed::space_node::viewer_linking::position_viewer_node(), print_rctf(), RE_GetWindowMatrixWithOverscan(), region_scale_modal(), render_border_exec(), blender::geometry::rotate_inside_square(), screen_animation_region_tag_redraw(), scroller_activate_init(), seq_view_collection_rect_preview(), sequencer_box_select_exec(), sequencer_draw_scopes(), sequencer_preview_get_rect(), sima_zoom_set_from_bounds(), smooth_view_rect_to_fac(), blender::ed::space_node::snode_setup_v2d(), blender::ed::space_node::space_node_view_flag(), square_rctf(), blender::ed::seq::StripsDrawBatch::StripsDrawBatch(), TargetSnapOffset(), timeline_draw_context_get(), ui_block_align_but_to_region(), ui_block_bounds_calc(), ui_block_bounds_calc_centered(), ui_block_bounds_calc_popup(), ui_block_bounds_calc_text(), ui_block_func_POPOVER(), ui_block_func_POPUP(), ui_but_can_align(), ui_but_update_ex(), ui_do_but_COLORBAND(), ui_do_but_GRIP(), ui_do_but_SCROLL(), ui_do_but_SLI(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), ui_draw_but_HISTOGRAM(), ui_draw_but_TRACKPREVIEW(), ui_draw_but_VECTORSCOPE(), ui_draw_but_WAVEFORM(), ui_item_size(), ui_numedit_but_COLORBAND(), ui_numedit_but_CURVE(), ui_numedit_but_CURVEPROFILE(), ui_numedit_but_HSVCIRCLE(), ui_numedit_but_HSVCUBE(), ui_numedit_but_SLI(), ui_numedit_but_TRACKPREVIEW(), ui_numedit_but_UNITVEC(), ui_numedit_set_active(), ui_pie_handler(), ui_popup_block_position(), ui_popup_block_refresh(), UI_region_button_sections_draw(), ui_searchbox_region_layout_fn(), ui_view2d_cur_ensure_rect_in_view(), ui_view2d_curRect_validate_resize(), UI_view2d_dot_grid_draw(), UI_view2d_edge_pan_init(), UI_view2d_offset(), UI_view2d_region_to_view_rctf(), UI_view2d_region_to_view_x(), UI_view2d_scale_get_inverse(), UI_view2d_scale_get_x(), UI_view2d_view_ortho(), UI_view2d_view_to_region(), UI_view2d_view_to_region_clip(), UI_view2d_view_to_region_fl(), UI_view2d_view_to_region_rcti(), UI_view2d_view_to_region_rcti_clip(), UI_view2d_view_to_region_segment_clip(), UI_view2d_view_to_region_x(), view2d_major_step_x__continuous(), view2d_major_step_x__discrete(), view2d_major_step_x__time(), view2d_map_cur_using_mask(), view2d_masks(), view2d_scrollers_calc(), view3d_camera_border(), view3d_winmatrix_set(), view_all_exec(), view_borderzoom_exec(), view_ghost_border_exec(), view_pan_init(), view_zoomdrag_apply(), view_zoomdrag_invoke(), view_zoomdrag_modal(), view_zoomstep_apply_ex(), and WIDGETGROUP_camera_view_draw_prepare().

◆ BLI_rctf_size_y()

BLI_INLINE float BLI_rctf_size_y ( const struct rctf * rct)

Definition at line 201 of file BLI_rect.h.

References rctf::ymax, and rctf::ymin.

Referenced by ANIM_channel_draw_widgets(), annotation_stroke_convertcoords(), BKE_camera_params_crop_viewplane(), BKE_curvemapping_changed(), BKE_curveprofile_update(), BLI_rctf_pad_y(), BLI_rctf_scale(), BLI_rctf_transform_calc_m4_pivot_min_ex(), BLI_rcti_rctf_copy(), button_activate_init(), calculate_pixel_distance(), calculate_pixels_per_unit(), camera_frame_fit_calc_from_data(), blender::ui::TreeViewItemDropTarget::choose_drop_location(), clipy_rctf(), console_main_region_init(), convertViewVec2D(), convertViewVec2D_mask(), createTransActionData(), blender::ed::asset::shelf::current_tile_draw_height(), curve_profile_zoom_in(), curve_profile_zoom_out(), curvemap_buttons_zoom_in(), curvemap_buttons_zoom_out(), draw_anti_tria_rect(), draw_channel_labels(), draw_emboss(), draw_icon_centered(), draw_seq_in_view(), draw_vectorscope_graticule(), drawLine(), drawWalkPixel(), ED_fileselect_init_layout(), ED_fileselect_layout_numfiles(), ED_mask_draw_region(), ED_region_generic_tools_region_snap_size(), ED_space_clip_get_zoom(), ED_space_image_get_zoom(), ED_view3d_calc_camera_border_size(), ED_view3d_calc_render_border(), ED_view3d_update_viewmat(), eevee_engine_init(), blender::geometry::get_aspect_scaled_area(), blender::geometry::get_aspect_scaled_extent(), get_normalized_fcurve_bounds(), blender::ed::space_node::gizmo_node_crop_prop_matrix_get(), gizmo_render_border_prop_matrix_get(), gpencil_point_to_xy(), graphkeys_viewall(), icon_draw_rect_input_text(), blender::draw::image_engine::SpaceImageAccessor::init_ss_to_texture_matrix(), initFlyInfo(), layer_bucket_init(), blender::ed::space_node::node_draw_hidden(), blender::ed::space_node::node_draw_preview(), blender::ed::space_node::viewer_linking::position_viewer_node(), print_rctf(), RE_GetWindowMatrixWithOverscan(), render_border_exec(), blender::geometry::rotate_inside_square(), scroller_activate_init(), seq_view_collection_rect_preview(), seq_view_collection_rect_timeline(), sequencer_draw_scopes(), sequencer_main_clamp_view(), sequencer_preview_get_rect(), sima_zoom_set_from_bounds(), smooth_view_rect_to_fac(), blender::ed::space_node::space_node_view_flag(), square_rctf(), blender::ed::seq::StripsDrawBatch::StripsDrawBatch(), TargetSnapOffset(), timeline_draw_context_get(), ui_block_align_but_to_region(), ui_block_bounds_calc_centered(), ui_block_bounds_calc_popup(), ui_but_can_align(), ui_but_extra_operator_icon_mouse_over_get(), ui_do_but_GRIP(), ui_do_but_SCROLL(), ui_do_drag(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), ui_draw_but_HISTOGRAM(), ui_draw_but_TRACKPREVIEW(), ui_draw_but_VECTORSCOPE(), ui_draw_but_WAVEFORM(), ui_draw_dropshadow(), ui_item_size(), ui_numedit_but_CURVE(), ui_numedit_but_CURVEPROFILE(), ui_numedit_but_HSVCIRCLE(), ui_numedit_but_HSVCUBE(), ui_numedit_but_SLI(), ui_numedit_but_TRACKPREVIEW(), ui_numedit_set_active(), ui_pie_handler(), ui_popup_block_position(), ui_popup_block_refresh(), ui_searchbox_region_layout_fn(), UI_tooltip_create_from_button_or_extra_icon(), ui_view2d_cur_ensure_rect_in_view(), UI_view2d_curRect_clamp_y(), ui_view2d_curRect_validate_resize(), UI_view2d_edge_pan_init(), UI_view2d_offset(), UI_view2d_offset_y_snap_to_closest_page(), UI_view2d_region_to_view_rctf(), UI_view2d_region_to_view_y(), UI_view2d_scale_get_inverse(), UI_view2d_scale_get_y(), UI_view2d_view_ortho(), UI_view2d_view_to_region(), UI_view2d_view_to_region_clip(), UI_view2d_view_to_region_fl(), UI_view2d_view_to_region_rcti(), UI_view2d_view_to_region_rcti_clip(), UI_view2d_view_to_region_segment_clip(), UI_view2d_view_to_region_y(), view2d_major_step_y__continuous(), view2d_map_cur_using_mask(), view2d_masks(), view2d_scrollers_calc(), view3d_camera_border(), view3d_winmatrix_set(), view_all_exec(), view_borderzoom_exec(), view_ghost_border_exec(), view_pan_init(), view_zoomdrag_apply(), view_zoomdrag_invoke(), view_zoomdrag_modal(), view_zoomstep_apply_ex(), and WIDGETGROUP_camera_view_draw_prepare().

◆ BLI_rctf_transform_calc_m4_pivot_min()

void BLI_rctf_transform_calc_m4_pivot_min ( const rctf * dst,
const rctf * src,
float matrix[4][4] )

◆ BLI_rctf_transform_calc_m4_pivot_min_ex()

void BLI_rctf_transform_calc_m4_pivot_min_ex ( const rctf * dst,
const rctf * src,
float matrix[4][4],
uint x,
uint y )

Calculate a 4x4 matrix representing the transformation between two rectangles.

Note
Multiplying a vector by this matrix does not give the same value as BLI_rctf_transform_pt_v.

Definition at line 542 of file rct.c.

References BLI_assert, BLI_rctf_size_x(), BLI_rctf_size_y(), unit_m4(), x, rctf::xmin, y, and rctf::ymin.

Referenced by BLI_rctf_transform_calc_m4_pivot_min().

◆ BLI_rctf_transform_pt_v()

void BLI_rctf_transform_pt_v ( const rctf * dst,
const rctf * src,
float xy_dst[2],
const float xy_src[2] )

◆ BLI_rctf_translate()

◆ BLI_rctf_union()

◆ BLI_rcti_cent_x()

◆ BLI_rcti_cent_x_fl()

BLI_INLINE float BLI_rcti_cent_x_fl ( const struct rcti * rct)

◆ BLI_rcti_cent_y()

◆ BLI_rcti_cent_y_fl()

BLI_INLINE float BLI_rcti_cent_y_fl ( const struct rcti * rct)

◆ BLI_rcti_clamp()

bool BLI_rcti_clamp ( struct rcti * rect,
const struct rcti * rect_bounds,
int r_xy[2] )

◆ BLI_rcti_clamp_pt_v()

bool BLI_rcti_clamp_pt_v ( const struct rcti * rect,
int xy[2] )

◆ BLI_rcti_compare()

◆ BLI_rcti_do_minmax_rcti()

◆ BLI_rcti_do_minmax_v()

◆ BLI_rcti_init()

void BLI_rcti_init ( struct rcti * rect,
int xmin,
int xmax,
int ymin,
int ymax )

Definition at line 418 of file rct.c.

References BLI_rcti_sanitize(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.

Referenced by blender::compositor::BuffersIteratorBuilder< T >::add_input(), area_azone_init(), blender::bke::image::partial_update::BKE_image_partial_update_collect_changes(), BKE_image_update_gputexture_delayed(), blender::compositor::BufferArea< T >::BufferArea(), blender::bke::pbvh::pixels::clamp(), blender::compositor::ViewerOperation::clear_display_buffer(), blender::compositor::compute_bloom_downsample_chain(), blender::compositor::compute_symmetric_separable_blur_weights(), blender::compositor::ConstantFolder::ConstantFolder(), blender::compositor::create_rect(), blender::compositor::tests::create_rect(), blender::compositor::tests::create_rect(), blender::compositor::BaseImageOperation::determine_canvas(), blender::compositor::BokehImageOperation::determine_canvas(), blender::compositor::CompositorOperation::determine_canvas(), blender::compositor::MovieClipBaseOperation::determine_canvas(), blender::compositor::PreviewOperation::determine_canvas(), blender::compositor::RenderLayersProg::determine_canvas(), blender::ed::space_node::draw_nodespace_back_pix(), blender::ed::spreadsheet::draw_spreadsheet_in_region(), DRW_render_gpencil(), DRW_render_to_image(), ED_image_draw_info(), ED_imapaint_dirty_region(), eevee_engine_init(), blender::compositor::ExecutionSystem::execute_work(), file_tile_boundbox(), blender::bke::pbvh::pixels::Rows::find_copy_source(), find_file_mouse_rect(), blender::bke::pbvh::pixels::Rows::find_second_source(), fullscreen_azone_init(), fullscreen_click_rcti_init(), graph_main_region_draw_overlay(), graph_region_draw(), hud_region_hide(), image_gpu_texture_partial_update_changes_available(), image_paint_partial_redraw_expand(), IMB_display_buffer_acquire(), IMB_float_from_rect(), IMB_partial_display_buffer_update_delayed(), blender::eevee::Film::init(), ViewportColorSampleSession::init(), blender::compositor::MemoryBuffer::MemoryBuffer(), RE_GetViewPlane(), region_azone_edge(), region_azone_tab_plus(), region_draw_azones(), region_rect_recursive(), region_update_rect(), screen_global_statusbar_area_refresh(), screen_global_topbar_area_refresh(), blender::compositor::tests::BuffersIteratorTest::SetUpTestCase(), blender::compositor::step_update_memory_buffer(), blender::compositor::symmetric_separable_blur_variable_size(), blender::eevee::Camera::sync(), blender::bke::image::partial_update::TEST_F(), blender::bke::image::partial_update::TEST_F(), blender::bke::image::partial_update::TEST_F(), blender::bke::image::partial_update::TEST_F(), blender::bke::image::partial_update::TEST_F(), blender::bke::image::partial_update::TEST_F(), blender::bke::image::partial_update::TEST_F(), blender::ed::sculpt_paint::greasepencil::trim_stroke_ends(), blender::draw::image_engine::OneTexture::update_bounds(), blender::compositor::PreviewOperation::update_memory_buffer_partial(), and WM_window_rect_calc().

◆ BLI_rcti_init_minmax()

◆ BLI_rcti_init_pt_radius()

◆ BLI_rcti_inside_rcti()

◆ BLI_rcti_is_empty()

◆ BLI_rcti_is_valid()

bool BLI_rcti_is_valid ( const struct rcti * rect)

◆ BLI_rcti_isect()

◆ BLI_rcti_isect_circle()

bool BLI_rcti_isect_circle ( const struct rcti * rect,
const float xy[2],
float radius )

◆ BLI_rcti_isect_pt()

◆ BLI_rcti_isect_pt_v()

◆ BLI_rcti_isect_rect_x()

bool BLI_rcti_isect_rect_x ( const struct rcti * src1,
const struct rcti * src2,
int range_x[2] )

◆ BLI_rcti_isect_rect_y()

bool BLI_rcti_isect_rect_y ( const struct rcti * src1,
const struct rcti * src2,
int range_y[2] )

◆ BLI_rcti_isect_segment()

◆ BLI_rcti_isect_x()

bool BLI_rcti_isect_x ( const rcti * rect,
int x )

Definition at line 37 of file rct.c.

References x, and rcti::xmax.

Referenced by UI_region_button_sections_is_inside_x().

◆ BLI_rcti_isect_y()

bool BLI_rcti_isect_y ( const rcti * rect,
int y )

Definition at line 48 of file rct.c.

References y, and rcti::ymax.

◆ BLI_rcti_length_x()

int BLI_rcti_length_x ( const rcti * rect,
int x )
Returns
shortest distance from rect to x (0 if inside)

Definition at line 149 of file rct.c.

References x, rcti::xmax, and rcti::xmin.

Referenced by area_actionzone_refresh_xy(), and file_box_select_find_last_selected().

◆ BLI_rcti_length_y()

int BLI_rcti_length_y ( const rcti * rect,
int y )
Returns
shortest distance from rect to y (0 if inside)

Definition at line 160 of file rct.c.

References y, rcti::ymax, and rcti::ymin.

Referenced by area_actionzone_refresh_xy(), and file_box_select_find_last_selected().

◆ BLI_rcti_mul()

void BLI_rcti_mul ( struct rcti * rect,
int factor )

Definition at line 575 of file rct.c.

References rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.

◆ BLI_rcti_pad()

◆ BLI_rcti_rctf_copy()

◆ BLI_rcti_rctf_copy_floor()

void BLI_rcti_rctf_copy_floor ( struct rcti * dst,
const struct rctf * src )

◆ BLI_rcti_rctf_copy_round()

void BLI_rcti_rctf_copy_round ( struct rcti * dst,
const struct rctf * src )

◆ BLI_rcti_recenter()

void BLI_rcti_recenter ( struct rcti * rect,
int x,
int y )

Definition at line 590 of file rct.c.

References BLI_rcti_cent_x(), BLI_rcti_cent_y(), and BLI_rcti_translate().

◆ BLI_rcti_resize()

◆ BLI_rcti_resize_x()

void BLI_rcti_resize_x ( struct rcti * rect,
int x )

Change width & height around the central X location.

Definition at line 603 of file rct.c.

References BLI_rcti_cent_x(), x, rcti::xmax, and rcti::xmin.

Referenced by blender::compositor::TranslateOperation::get_area_of_interest(), view3d_zoom_border_exec(), widget_list_itembut(), and wm_window_check_size().

◆ BLI_rcti_resize_y()

void BLI_rcti_resize_y ( struct rcti * rect,
int y )

Change width & height around the central Y location.

Definition at line 609 of file rct.c.

References BLI_rcti_cent_y(), y, rcti::ymax, and rcti::ymin.

Referenced by blender::compositor::TranslateOperation::get_area_of_interest(), view3d_zoom_border_exec(), widget_list_itembut(), and wm_window_check_size().

◆ BLI_rcti_sanitize()

void BLI_rcti_sanitize ( struct rcti * rect)

◆ BLI_rcti_scale()

void BLI_rcti_scale ( rcti * rect,
float scale )

◆ BLI_rcti_size_x()

BLI_INLINE int BLI_rcti_size_x ( const struct rcti * rct)

Definition at line 189 of file BLI_rect.h.

References rcti::xmax, and rcti::xmin.

Referenced by actkeys_box_select_exec(), blender::compositor::BuffersIteratorBuilder< T >::add_input(), ANIM_channel_draw(), ANIM_channel_draw_widgets(), ANIM_frame_range_view2d_add_xmargin(), blender::compositor::MemoryBuffer::apply_processor(), area_calc_totrct(), area_max_regionsize(), BKE_camera_params_crop_viewplane(), blf_font_width(), blf_font_width_and_height(), BLI_rcti_scale(), blender::compositor::BuffersIteratorBuilder< T >::BuffersIteratorBuilder(), calctrackballvec(), calculate_pixels_per_unit(), calculateZfac(), channel_list_draw_keys(), blender::compositor::ScaleOperation::clamp_area_size_max(), clip_draw_dopesheet_main(), clip_view_calculate_view_selection(), blender::compositor::colorspace_to_scene_linear(), convertViewVec2D(), convertViewVec2D_mask(), blender::compositor::MemoryBuffer::copy_from(), createTransActionData(), blender::compositor::BokehBlurOperation::determine_canvas(), blender::compositor::GlareThresholdOperation::determine_canvas(), blender::compositor::PreviewOperation::determine_canvas(), blender::compositor::ScaleOperation::determine_canvas(), do_text_effect(), draw_fcurve_curve_keys(), draw_filled_lasso(), draw_horizontal_scale_indicators(), draw_nla_main_data(), draw_parallel_lines(), draw_seq_in_view(), blender::ed::space_node::draw_tree_path(), drawSnapping(), DRW_draw_select_loop(), DRW_select_buffer_find_nearest_to_point(), DRW_select_buffer_read(), ED_image_draw_info(), ed_marker_move_modal(), ED_mask_draw_region(), ED_preview_draw(), ed_preview_draw_rect(), ED_region_info_draw_multiline(), ED_screen_draw_edges(), ED_space_clip_get_zoom(), ED_space_image_get_zoom(), ED_time_scrub_channel_search_draw(), ED_view3d_update_viewmat(), edge_pan_speed(), blender::compositor::TranslateOperation::ensure_delta(), blender::draw::image_engine::OneTexture::ensure_gpu_textures_allocation(), file_add_preview_drag_but(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), blender::bke::pbvh::pixels::Rows::find_copy_source(), find_nearest_seq(), blender::bke::pbvh::pixels::Rows::find_second_source(), blender::realtime_compositor::Context::get_compositing_region_size(), blender::compositor::RotateOperation::get_rotation_center(), blender::compositor::RotateOperation::get_rotation_offset(), blender::compositor::ScaleOperation::get_scale_area_of_interest(), blender::compositor::ScaleOperation::get_scale_offset(), blender::compositor::MemoryBuffer::get_width(), blender::compositor::NodeOperation::get_width(), GPENCIL_render_init(), GPENCIL_render_result_combined(), GPENCIL_render_result_z(), GPU_select_buffer_stride_realign(), gpu_select_next_get_pick_area_center(), gpu_select_pick_begin(), gpu_select_query_begin(), GPU_viewport_bind(), GPU_viewport_draw_to_screen_ex(), graphkeys_box_select_exec(), icon_draw_rect_input_text(), image_buffer_rect_update(), image_gpu_texture_partial_update_changes_available(), image_main_region_set_view2d(), image_rect_update(), image_view_all(), imapaint_image_update(), IMB_float_from_rect_ex(), IMB_rect_crop(), blender::eevee::Film::init(), blender::eevee::Instance::init(), blender::realtime_compositor::Context::is_valid_compositing_region(), movieclip_main_area_set_view2d(), nla_action_draw_keyframes(), nlaedit_box_select_exec(), blender::ed::space_node::node_circleselect_exec(), blender::ed::outliner::outliner_draw_tree(), blender::ed::sculpt_paint::paint_draw_tex_overlay(), print_rcti(), blender::ed::sculpt_paint::paint::image::push_undo(), rct_fits(), re_init_resolution(), rect_crop_16bytes(), rect_crop_4bytes(), rect_subregion_stride_calc(), region_rect_recursive(), region_scale_modal(), region_update_rect(), render_result_new(), reset_exec(), round_box__edges(), blender::compositor::ScaleOperation::scale_area(), sclip_zoom_set(), screen_geom_vertices_scale_pass(), scroller_activate_init(), sequencer_box_select_exec(), sequencer_preview_get_rect(), sequencer_retiming_keys_draw(), sequencer_view_zoom_ratio_exec(), shape_preset_init_trias_ex(), shape_preset_trias_from_rect_menu(), sima_zoom_set(), sima_zoom_set_from_bounds(), blender::ed::geometry::store_input_node_values_rna_props(), blender::ed::seq::StripsDrawBatch::StripsDrawBatch(), timeline_draw_context_get(), ui_block_to_region_fl(), ui_but_contains_point_px_icon(), ui_draw_but(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), ui_draw_but_HSVCIRCLE(), ui_draw_but_IMAGE(), ui_draw_but_UNITVEC(), ui_draw_gradient(), ui_draw_menu_item(), ui_draw_preview_item_stateless(), UI_draw_widget_scroll(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), ui_hsvcircle_pos_from_vals(), ui_hsvcircle_vals_from_pos(), ui_hsvcube_pos_from_vals(), UI_region_button_sections_draw(), ui_searchbox_butrect(), ui_searchbox_region_draw_cb__operator(), ui_searchbox_region_draw_fn(), ui_searchbox_region_layout_fn(), ui_text_clip_cursor(), ui_text_clip_middle(), ui_text_clip_middle_protect_right(), ui_text_clip_right_label(), ui_tooltip_create_with_data(), UI_view2d_curRect_reset(), ui_view2d_curRect_validate_resize(), UI_view2d_dot_grid_draw(), UI_view2d_edge_pan_init(), UI_view2d_region_to_view_rctf(), UI_view2d_region_to_view_x(), UI_view2d_scale_get_inverse(), UI_view2d_scale_get_x(), UI_view2d_scrollers_draw_ex(), UI_view2d_text_cache_draw(), UI_view2d_view_ortho(), UI_view2d_view_restore(), UI_view2d_view_to_region(), UI_view2d_view_to_region_clip(), UI_view2d_view_to_region_fl(), UI_view2d_view_to_region_rcti(), UI_view2d_view_to_region_rcti_clip(), UI_view2d_view_to_region_segment_clip(), UI_view2d_view_to_region_x(), ui_window_to_block_fl(), blender::compositor::IDMaskOperation::update_memory_buffer_partial(), blender::compositor::MixBaseOperation::update_memory_buffer_partial(), view2d_major_step_x__continuous(), view2d_major_step_x__discrete(), view2d_major_step_x__time(), view2d_map_cur_using_mask(), view2d_scrollers_calc(), view3d_depths_rect_create(), view3d_opengl_read_Z_pixels(), view3d_zoom_border_exec(), view_all_exec(), view_pan_init(), view_zoomdrag_modal(), view_zoomstep_apply_ex(), widget_draw_preview(), widget_draw_text_icon(), widget_numbut_draw(), widget_numslider(), widget_optionbut(), widget_progress_type_bar(), widget_scroll(), blender::compositor::BufferArea< T >::width(), wm_draw_region_blend(), wm_paintcursor_draw(), wm_window_check_size(), WM_window_open(), wmGetProjectionMatrix(), wmPartialViewport(), wmViewport(), write_render_color_output(), and write_render_z_output().

◆ BLI_rcti_size_y()

BLI_INLINE int BLI_rcti_size_y ( const struct rcti * rct)

Definition at line 193 of file BLI_rect.h.

References rcti::ymax, and rcti::ymin.

Referenced by actkeys_box_select_exec(), actkeys_viewall(), blender::compositor::MemoryBuffer::apply_processor(), area_calc_totrct(), area_max_regionsize(), BKE_camera_params_crop_viewplane(), blf_font_height(), blf_font_width_and_height(), BLI_rcti_scale(), blender::compositor::BuffersIteratorBuilder< T >::BuffersIteratorBuilder(), calctrackballvec(), calculate_pixels_per_unit(), channel_list_draw_keys(), blender::compositor::ScaleOperation::clamp_area_size_max(), clip_draw_dopesheet_channels(), clip_draw_dopesheet_main(), clip_view_calculate_view_selection(), blender::compositor::colorspace_to_scene_linear(), convertViewVec2D(), convertViewVec2D_mask(), blender::compositor::MemoryBuffer::copy_from(), createTransActionData(), blender::ed::asset::shelf::current_tile_draw_height(), blender::compositor::BokehBlurOperation::determine_canvas(), blender::compositor::GlareThresholdOperation::determine_canvas(), blender::compositor::PreviewOperation::determine_canvas(), blender::compositor::ScaleOperation::determine_canvas(), draw_filled_lasso(), draw_parallel_lines(), draw_seq_in_view(), draw_vertical_scale_indicators(), DRW_draw_select_loop(), DRW_select_buffer_read(), ED_mask_draw_region(), ED_preview_draw(), ed_preview_draw_rect(), ED_region_generic_tools_region_snap_size(), ED_region_info_draw_multiline(), ED_screen_draw_edges(), ED_space_clip_get_zoom(), ED_space_image_get_zoom(), ED_view3d_update_viewmat(), blender::compositor::TranslateOperation::ensure_delta(), blender::draw::image_engine::OneTexture::ensure_gpu_textures_allocation(), blender::compositor::ExecutionSystem::execute_work(), file_add_preview_drag_but(), file_draw_string_multiline(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), blender::bke::pbvh::pixels::Rows::find_copy_source(), blender::bke::pbvh::pixels::Rows::find_second_source(), blender::realtime_compositor::Context::get_compositing_region_size(), blender::compositor::MemoryBuffer::get_height(), blender::compositor::NodeOperation::get_height(), blender::compositor::RotateOperation::get_rotation_center(), blender::compositor::RotateOperation::get_rotation_offset(), blender::compositor::ScaleOperation::get_scale_area_of_interest(), blender::compositor::ScaleOperation::get_scale_offset(), GPENCIL_render_init(), GPENCIL_render_result_combined(), GPENCIL_render_result_z(), GPU_select_buffer_stride_realign(), gpu_select_next_get_pick_area_center(), gpu_select_pick_begin(), gpu_select_query_begin(), GPU_viewport_bind(), GPU_viewport_draw_to_screen_ex(), graphkeys_box_select_exec(), blender::compositor::BufferArea< T >::height(), icon_draw_rect_input_text(), image_buffer_rect_update(), image_gpu_texture_partial_update_changes_available(), image_main_region_set_view2d(), image_rect_update(), image_view_all(), imapaint_image_update(), IMB_float_from_rect_ex(), IMB_rect_crop(), blender::eevee::Film::init(), blender::eevee::Instance::init(), blender::realtime_compositor::Context::is_valid_compositing_region(), movieclip_main_area_set_view2d(), nla_action_draw_keyframes(), nlaedit_box_select_exec(), nlaedit_viewall(), blender::ed::space_node::node_socket_draw(), blender::ed::outliner::outliner_item_rename_invoke(), blender::ed::outliner::outliner_scroll_page_exec(), blender::ed::outliner::outliner_show_active_exec(), blender::ed::sculpt_paint::paint_draw_tex_overlay(), panel_draw_aligned_widgets(), print_rcti(), blender::ed::sculpt_paint::paint::image::push_undo(), rct_fits(), re_init_resolution(), rect_crop_16bytes(), rect_crop_4bytes(), rect_subregion_stride_calc(), region_rect_recursive(), region_update_rect(), render_result_new(), reset_exec(), round_box__edges(), blender::compositor::ScaleOperation::scale_area(), sclip_zoom_set(), screen_geom_vertices_scale_pass(), scroller_activate_init(), sequencer_main_clamp_view(), sequencer_preview_get_rect(), sequencer_retiming_keys_draw(), sequencer_view_zoom_ratio_exec(), shape_preset_init_trias_ex(), shape_preset_trias_from_rect_checkmark(), shape_preset_trias_from_rect_dash(), shape_preset_trias_from_rect_menu(), sima_zoom_set(), sima_zoom_set_from_bounds(), blender::ed::geometry::store_input_node_values_rna_props(), blender::ed::seq::StripsDrawBatch::StripsDrawBatch(), timeline_draw_context_get(), ui_block_to_region_fl(), ui_but_contains_point_px_icon(), ui_do_drag(), ui_draw_but(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), ui_draw_but_HSV_v(), ui_draw_but_HSVCIRCLE(), ui_draw_but_IMAGE(), ui_draw_but_UNITVEC(), ui_draw_colorband_handle(), ui_draw_gradient(), ui_draw_menu_item(), UI_draw_widget_scroll(), UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), ui_hsvcircle_pos_from_vals(), ui_hsvcircle_vals_from_pos(), ui_hsvcube_pos_from_vals(), UI_panel_category_draw_all(), ui_searchbox_butrect(), ui_searchbox_region_layout_fn(), ui_tooltip_create_with_data(), UI_view2d_curRect_reset(), ui_view2d_curRect_validate_resize(), UI_view2d_edge_pan_init(), UI_view2d_region_to_view_rctf(), UI_view2d_region_to_view_y(), UI_view2d_scale_get_inverse(), UI_view2d_scale_get_y(), UI_view2d_scrollers_draw_ex(), UI_view2d_text_cache_draw(), UI_view2d_view_ortho(), UI_view2d_view_restore(), UI_view2d_view_to_region(), UI_view2d_view_to_region_clip(), UI_view2d_view_to_region_fl(), UI_view2d_view_to_region_rcti(), UI_view2d_view_to_region_rcti_clip(), UI_view2d_view_to_region_segment_clip(), UI_view2d_view_to_region_y(), ui_window_to_block_fl(), view2d_major_step_y__continuous(), view2d_map_cur_using_mask(), view2d_page_size_y(), view2d_scrollers_calc(), view3d_depths_rect_create(), view3d_opengl_read_Z_pixels(), view3d_zoom_border_exec(), view_all_exec(), view_pan_init(), view_zoomdrag_modal(), view_zoomstep_apply_ex(), widget_draw_preview(), widget_draw_text_icon(), widget_menubut(), widget_nodesocket(), widget_numbut_draw(), widget_numslider(), widget_optionbut(), widget_radius_from_rcti(), widget_scroll(), wm_draw_region_blend(), wm_paintcursor_draw(), wm_window_check_size(), WM_window_open(), wmGetProjectionMatrix(), wmPartialViewport(), wmViewport(), write_render_color_output(), and write_render_z_output().

◆ BLI_rcti_translate()

◆ BLI_rcti_union()

◆ print_rctf()

void print_rctf ( const char * str,
const struct rctf * rect )

◆ print_rcti()

void print_rcti ( const char * str,
const struct rcti * rect )