Blender V5.3
image_ops.cc File Reference
#include <cerrno>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <string>
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "BLI_fileops.hh"
#include "BLI_listbase.hh"
#include "BLI_path_utils.hh"
#include "BLI_set.hh"
#include "BLI_string.hh"
#include "BLI_time.hh"
#include "BLI_utildefines.hh"
#include "BLT_translation.hh"
#include "DNA_camera_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "BKE_colortools.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_icons.hh"
#include "BKE_image.hh"
#include "BKE_image_format.hh"
#include "BKE_image_save.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_library.hh"
#include "BKE_main.hh"
#include "BKE_mask.hh"
#include "BKE_packedFile.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "DEG_depsgraph.hh"
#include "IMB_cache.hh"
#include "IMB_colormanagement.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "IMB_partial_update.hh"
#include "MOV_read.hh"
#include "RE_pipeline.h"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "RNA_prototypes.hh"
#include "ED_image.hh"
#include "ED_mask.hh"
#include "ED_paint.hh"
#include "ED_render.hh"
#include "ED_screen.hh"
#include "ED_undo.hh"
#include "ED_util.hh"
#include "ED_util_imbuf.hh"
#include "ED_uvedit.hh"
#include "UI_interface.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "UI_view2d.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "RE_engine.h"
#include "image_intern.hh"

Go to the source code of this file.

Classes

struct  blender::ImageOpenData
struct  blender::ImageSaveData
struct  blender::ImageNewData

Namespaces

namespace  blender
 BMesh Iterators.

Functions

View Navigation Utilities
static void blender::sima_zoom_set (SpaceImage *sima, ARegion *region, float zoom, const float location[2], const bool zoom_to_pos)
static void blender::sima_zoom_set_factor (SpaceImage *sima, ARegion *region, float zoomfac, const float location[2], const bool zoom_to_pos)
static void blender::sima_zoom_set_from_bounds (SpaceImage *sima, ARegion *region, const rctf *bounds)
static Image * blender::image_from_context (const bContext *C)
static ImageUser * blender::image_user_from_context (const bContext *C)
static ImageUser blender::image_user_from_context_and_active_tile (const bContext *C, Image *ima)
static bool blender::image_from_context_has_data_poll (bContext *C)
static bool blender::image_from_context_editable_has_data_poll_active_tile (bContext *C)
static bool blender::image_not_packed_poll (bContext *C)
static void blender::image_view_all (SpaceImage *sima, ARegion *region, wmOperator *op)
bool blender::space_image_poll (bContext *C)
bool blender::space_image_main_region_poll (bContext *C)
static bool blender::space_image_main_area_not_uv_brush_poll (bContext *C)
View Pan Operator

Move (pan) in incremental steps. For interactive pan see VIEW3D_OT_move.

static void blender::image_view_pan_init (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::image_view_pan_exit (bContext *C, wmOperator *op, bool cancel)
static wmOperatorStatus blender::image_view_pan_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_view_pan_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus blender::image_view_pan_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::image_view_pan_cancel (bContext *C, wmOperator *op)
void blender::IMAGE_OT_view_pan (wmOperatorType *ot)
View All Operator

Move & Zoom the view to fit all of its contents.

static wmOperatorStatus blender::image_view_all_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_view_all (wmOperatorType *ot)
Cursor To Center View Operator
static wmOperatorStatus blender::view_cursor_center_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_view_cursor_center (wmOperatorType *ot)
Center View To Cursor Operator
static wmOperatorStatus blender::view_center_cursor_exec (bContext *C, wmOperator *)
void blender::IMAGE_OT_view_center_cursor (wmOperatorType *ot)
Frame Selected Operator

Move & Zoom the view to fit selected contents.

static wmOperatorStatus blender::image_view_selected_exec (bContext *C, wmOperator *)
static bool blender::image_view_selected_poll (bContext *C)
void blender::IMAGE_OT_view_selected (wmOperatorType *ot)
View Zoom In/Out Operator
static wmOperatorStatus blender::image_view_zoom_in_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_view_zoom_in_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::IMAGE_OT_view_zoom_in (wmOperatorType *ot)
static wmOperatorStatus blender::image_view_zoom_out_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_view_zoom_out_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::IMAGE_OT_view_zoom_out (wmOperatorType *ot)
View Zoom Ratio Operator
static wmOperatorStatus blender::image_view_zoom_ratio_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_view_zoom_ratio (wmOperatorType *ot)
View Border-Zoom Operator
static wmOperatorStatus blender::image_view_zoom_border_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_view_zoom_border (wmOperatorType *ot)
static void blender::image_filesel (bContext *C, wmOperator *op, const char *path)
Open Image Operator
static void blender::image_open_init (bContext *C, wmOperator *op)
static void blender::image_open_cancel (bContext *, wmOperator *op)
static Image * blender::image_open_single (Main *bmain, Library *owner_library, wmOperator *op, const ImageFrameRange *range, const bool use_multiview)
static wmOperatorStatus blender::image_open_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_open_invoke (bContext *C, wmOperator *op, const wmEvent *)
static bool blender::image_open_draw_check_prop (PointerRNA *, PropertyRNA *prop, void *)
static void blender::image_open_draw (bContext *, wmOperator *op)
static void blender::image_operator_prop_allow_tokens (wmOperatorType *ot)
void blender::IMAGE_OT_open (wmOperatorType *ot)
Browse Image Operator
static wmOperatorStatus blender::image_file_browse_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_file_browse_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static bool blender::image_file_browse_poll (bContext *C)
void blender::IMAGE_OT_file_browse (wmOperatorType *ot)
Match Movie Length Operator
static wmOperatorStatus blender::image_match_len_exec (bContext *C, wmOperator *)
void blender::IMAGE_OT_match_movie_length (wmOperatorType *ot)
Replace Image Operator
static wmOperatorStatus blender::image_replace_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_replace_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::IMAGE_OT_replace (wmOperatorType *ot)
Save Image As Operator
static void blender::image_save_options_from_op (Main *bmain, ImageSaveOptions *opts, wmOperator *op)
static bool blender::save_image_op (Main *bmain, Image *ima, ImageUser *iuser, wmOperator *op, const ImageSaveOptions *opts)
static ImageSaveData * blender::image_save_as_init (bContext *C, wmOperator *op)
static void blender::image_save_as_free (wmOperator *op)
static wmOperatorStatus blender::image_save_as_exec (bContext *C, wmOperator *op)
static bool blender::image_save_as_check (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_save_as_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void blender::image_save_as_cancel (bContext *, wmOperator *op)
static bool blender::image_save_as_draw_check_prop (PointerRNA *ptr, PropertyRNA *prop, void *user_data)
static void blender::image_save_as_draw (bContext *C, wmOperator *op)
static bool blender::image_save_as_poll (bContext *C)
void blender::IMAGE_OT_save_as (wmOperatorType *ot)
Save Image Operator
static bool blender::image_file_format_writable (Image *ima, ImageUser *iuser)
static bool blender::image_save_poll (bContext *C)
static wmOperatorStatus blender::image_save_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_save_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::IMAGE_OT_save (wmOperatorType *ot)
Save Sequence Operator
static wmOperatorStatus blender::image_save_sequence_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_save_sequence (wmOperatorType *ot)
Save All Operator
static bool blender::image_should_be_saved_when_modified (Image *ima)
static bool blender::image_should_be_saved (Image *ima, bool *r_is_format_writable)
static bool blender::image_has_valid_path (Image *ima)
static bool blender::image_should_pack_during_save_all (const Image *ima)
bool blender::ED_image_should_save_modified (const Main *bmain)
int blender::ED_image_save_all_modified_info (const Main *bmain, ReportList *reports)
bool blender::ED_image_save_all_modified (const bContext *C, ReportList *reports)
void blender::ED_image_internal_autosave_flush (const Main *bmain)
static bool blender::image_save_all_modified_poll (bContext *C)
static wmOperatorStatus blender::image_save_all_modified_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_save_all_modified (wmOperatorType *ot)
Reload Image Operator
static wmOperatorStatus blender::image_reload_exec (bContext *C, wmOperator *)
void blender::IMAGE_OT_reload (wmOperatorType *ot)
Flip Operator
static wmOperatorStatus blender::image_flip_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_flip (wmOperatorType *ot)
Rotate Orthogonal Operator (90, 180, 270)
static wmOperatorStatus blender::image_rotate_orthogonal_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_rotate_orthogonal (wmOperatorType *ot)
Clipboard Copy Operator
static wmOperatorStatus blender::image_clipboard_copy_exec (bContext *C, wmOperator *op)
static bool blender::image_clipboard_copy_poll (bContext *C)
void blender::IMAGE_OT_clipboard_copy (wmOperatorType *ot)
Clipboard Paste Operator
static wmOperatorStatus blender::image_clipboard_paste_exec (bContext *C, wmOperator *op)
static bool blender::image_clipboard_paste_poll (bContext *C)
void blender::IMAGE_OT_clipboard_paste (wmOperatorType *ot)
Invert Operators
static wmOperatorStatus blender::image_invert_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_invert (wmOperatorType *ot)
Scale Operator
static wmOperatorStatus blender::image_scale_invoke (bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus blender::image_scale_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_resize (wmOperatorType *ot)
Pack Operator
static bool blender::image_pack_test (Image *ima, const char **r_error_message)
static bool blender::image_pack_poll (bContext *C)
static wmOperatorStatus blender::image_pack_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_pack (wmOperatorType *ot)
Unpack Operator
static wmOperatorStatus blender::image_unpack_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_unpack_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::IMAGE_OT_unpack (wmOperatorType *ot)
Sample Image Operator
bool blender::ED_space_image_get_position (SpaceImage *sima, ARegion *region, const int mval[2], float r_fpos[2])
bool blender::ED_space_image_color_sample (SpaceImage *sima, ARegion *region, const int mval[2], float r_col[3], bool *r_is_data)
void blender::IMAGE_OT_sample (wmOperatorType *ot)
Sample Line Operator
static wmOperatorStatus blender::image_sample_line_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_sample_line_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::IMAGE_OT_sample_line (wmOperatorType *ot)
Set Curve Point Operator
void blender::IMAGE_OT_curves_point_set (wmOperatorType *ot)
Cycle Render Slot Operator
static bool blender::image_cycle_render_slot_poll (bContext *C)
static wmOperatorStatus blender::image_cycle_render_slot_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_cycle_render_slot (wmOperatorType *ot)
Clear Render Slot Operator
static wmOperatorStatus blender::image_clear_render_slot_exec (bContext *C, wmOperator *)
void blender::IMAGE_OT_clear_render_slot (wmOperatorType *ot)
Add Render Slot Operator
static wmOperatorStatus blender::image_add_render_slot_exec (bContext *C, wmOperator *)
void blender::IMAGE_OT_add_render_slot (wmOperatorType *ot)
Remove Render Slot Operator
static wmOperatorStatus blender::image_remove_render_slot_exec (bContext *C, wmOperator *)
void blender::IMAGE_OT_remove_render_slot (wmOperatorType *ot)
Change Frame Operator
static bool blender::change_frame_poll (bContext *C)
static void blender::change_frame_apply (bContext *C, wmOperator *op)
static wmOperatorStatus blender::change_frame_exec (bContext *C, wmOperator *op)
static int blender::frame_from_event (bContext *C, const wmEvent *event)
static wmOperatorStatus blender::change_frame_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus blender::change_frame_modal (bContext *C, wmOperator *op, const wmEvent *event)
void blender::IMAGE_OT_change_frame (wmOperatorType *ot)
static wmOperatorStatus blender::image_read_viewlayers_exec (bContext *C, wmOperator *)
void blender::IMAGE_OT_read_viewlayers (wmOperatorType *ot)
Render Border Operator
static wmOperatorStatus blender::render_border_exec (bContext *C, wmOperator *op)
void blender::IMAGE_OT_render_border (wmOperatorType *ot)
Clear Render Border Operator
static wmOperatorStatus blender::clear_render_border_exec (bContext *C, wmOperator *)
void blender::IMAGE_OT_clear_render_border (wmOperatorType *ot)
Add Tile Operator
static bool blender::do_fill_tile (PointerRNA *ptr, Image *ima, ImageTile *tile)
static void blender::draw_fill_tile (PointerRNA *ptr, ui::Layout &layout)
static void blender::tile_fill_init (PointerRNA *ptr, Image *ima, ImageTile *tile)
static void blender::def_fill_tile (StructOrFunctionRNA *srna)
static bool blender::tile_add_poll (bContext *C)
static wmOperatorStatus blender::tile_add_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::tile_add_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void blender::tile_add_draw (bContext *, wmOperator *op)
void blender::IMAGE_OT_tile_add (wmOperatorType *ot)
Remove Tile Operator
static bool blender::tile_remove_poll (bContext *C)
static wmOperatorStatus blender::tile_remove_exec (bContext *C, wmOperator *)
void blender::IMAGE_OT_tile_remove (wmOperatorType *ot)
Fill Tile Operator
static bool blender::tile_fill_poll (bContext *C)
static wmOperatorStatus blender::tile_fill_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::tile_fill_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void blender::tile_fill_draw (bContext *, wmOperator *op)
void blender::IMAGE_OT_tile_fill (wmOperatorType *ot)

New Image Operator

#define IMA_DEF_NAME   N_("Untitled")
enum  { blender::GEN_CONTEXT_NONE = 0 , blender::GEN_CONTEXT_PAINT_CANVAS = 1 , blender::GEN_CONTEXT_PAINT_STENCIL = 2 }
static ImageNewData * blender::image_new_init (bContext *C, wmOperator *op)
static void blender::image_new_free (wmOperator *op)
static wmOperatorStatus blender::image_new_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_new_invoke (bContext *C, wmOperator *op, const wmEvent *)
static void blender::image_new_draw (bContext *, wmOperator *op)
static void blender::image_new_cancel (bContext *, wmOperator *op)
void blender::IMAGE_OT_new (wmOperatorType *ot)

View Zoom Operator

enum  { blender::VIEW_PASS = 0 , blender::VIEW_APPLY , blender::VIEW_CONFIRM }
static void blender::image_view_zoom_init (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::image_view_zoom_exit (bContext *C, wmOperator *op, bool cancel)
static wmOperatorStatus blender::image_view_zoom_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::image_view_zoom_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::image_zoom_apply (ViewZoomData *vpd, wmOperator *op, const int x, const int y, const short viewzoom, const short zoom_invert, const bool zoom_to_pos, const bool snap, const bool precision)
static wmOperatorStatus blender::image_view_zoom_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void blender::image_view_zoom_cancel (bContext *C, wmOperator *op)
void blender::IMAGE_OT_view_zoom (wmOperatorType *ot)

Macro Definition Documentation

◆ IMA_DEF_NAME

#define IMA_DEF_NAME   N_("Untitled")

Definition at line 2667 of file image_ops.cc.