Blender V2.61 - r43446
Classes | Typedefs | Functions

image_ops.c File Reference

#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "DNA_object_types.h"
#include "DNA_node_types.h"
#include "DNA_packedFile_types.h"
#include "DNA_scene_types.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_image.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_packedFile.h"
#include "BKE_report.h"
#include "BKE_screen.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "RE_pipeline.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "ED_image.h"
#include "ED_render.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_uvedit.h"
#include "ED_util.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "WM_api.h"
#include "WM_types.h"
#include "image_intern.h"

Go to the source code of this file.

Classes

struct  ViewPanData
struct  ViewZoomData
struct  SaveImageOptions
struct  ImageSampleInfo
struct  RecordCompositeData

Typedefs

typedef struct ViewPanData ViewPanData
typedef struct ViewZoomData ViewZoomData
typedef struct ImageSampleInfo ImageSampleInfo
typedef struct RecordCompositeData RecordCompositeData

Functions

static void sima_zoom_set (SpaceImage *sima, ARegion *ar, float zoom)
static void sima_zoom_set_factor (SpaceImage *sima, ARegion *ar, float zoomfac)
static int space_image_buffer_exists_poll (bContext *C)
static int space_image_file_exists_poll (bContext *C)
static int space_image_poll (bContext *C)
int space_image_main_area_poll (bContext *C)
static void image_view_pan_init (bContext *C, wmOperator *op, wmEvent *event)
static void image_view_pan_exit (bContext *C, wmOperator *op, int cancel)
static int image_view_pan_exec (bContext *C, wmOperator *op)
static int image_view_pan_invoke (bContext *C, wmOperator *op, wmEvent *event)
static int image_view_pan_modal (bContext *C, wmOperator *op, wmEvent *event)
static int image_view_pan_cancel (bContext *C, wmOperator *op)
void IMAGE_OT_view_pan (wmOperatorType *ot)
static void image_view_zoom_init (bContext *C, wmOperator *op, wmEvent *event)
static void image_view_zoom_exit (bContext *C, wmOperator *op, int cancel)
static int image_view_zoom_exec (bContext *C, wmOperator *op)
static int image_view_zoom_invoke (bContext *C, wmOperator *op, wmEvent *event)
static int image_view_zoom_modal (bContext *C, wmOperator *op, wmEvent *event)
static int image_view_zoom_cancel (bContext *C, wmOperator *op)
void IMAGE_OT_view_zoom (wmOperatorType *ot)
static int image_view_ndof_invoke (bContext *C, wmOperator *UNUSED(op), wmEvent *event)
void IMAGE_OT_view_ndof (wmOperatorType *ot)
static int image_view_all_exec (bContext *C, wmOperator *UNUSED(op))
void IMAGE_OT_view_all (wmOperatorType *ot)
static int image_view_selected_exec (bContext *C, wmOperator *UNUSED(op))
static int image_view_selected_poll (bContext *C)
void IMAGE_OT_view_selected (wmOperatorType *ot)
static int image_view_zoom_in_exec (bContext *C, wmOperator *UNUSED(op))
void IMAGE_OT_view_zoom_in (wmOperatorType *ot)
static int image_view_zoom_out_exec (bContext *C, wmOperator *UNUSED(op))
void IMAGE_OT_view_zoom_out (wmOperatorType *ot)
static int image_view_zoom_ratio_exec (bContext *C, wmOperator *op)
void IMAGE_OT_view_zoom_ratio (wmOperatorType *ot)
static void image_filesel (bContext *C, wmOperator *op, const char *path)
static void image_open_init (bContext *C, wmOperator *op)
static int image_open_cancel (bContext *UNUSED(C), wmOperator *op)
static int image_open_exec (bContext *C, wmOperator *op)
static int image_open_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void IMAGE_OT_open (wmOperatorType *ot)
static int image_replace_exec (bContext *C, wmOperator *op)
static int image_replace_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void IMAGE_OT_replace (wmOperatorType *ot)
static void save_image_options_defaults (SaveImageOptions *simopts)
static char imtype_best_depth (ImBuf *ibuf, const char imtype)
static int save_image_options_init (SaveImageOptions *simopts, SpaceImage *sima, Scene *scene, const short guess_path)
static void save_image_options_from_op (SaveImageOptions *simopts, wmOperator *op)
static void save_image_options_to_op (SaveImageOptions *simopts, wmOperator *op)
static void save_image_doit (bContext *C, SpaceImage *sima, wmOperator *op, SaveImageOptions *simopts, int do_newpath)
static void image_save_as_free (wmOperator *op)
static int image_save_as_exec (bContext *C, wmOperator *op)
static int image_save_as_check (bContext *UNUSED(C), wmOperator *op)
static int image_save_as_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
static int image_save_as_cancel (bContext *UNUSED(C), wmOperator *op)
static int image_save_as_draw_check_prop (PointerRNA *ptr, PropertyRNA *prop)
static void image_save_as_draw (bContext *UNUSED(C), wmOperator *op)
void IMAGE_OT_save_as (wmOperatorType *ot)
static int image_save_exec (bContext *C, wmOperator *op)
void IMAGE_OT_save (wmOperatorType *ot)
static int image_save_sequence_exec (bContext *C, wmOperator *op)
void IMAGE_OT_save_sequence (wmOperatorType *ot)
static int image_reload_exec (bContext *C, wmOperator *UNUSED(op))
void IMAGE_OT_reload (wmOperatorType *ot)
static int image_new_exec (bContext *C, wmOperator *op)
static int image_new_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void IMAGE_OT_new (wmOperatorType *ot)
static int image_invert_poll (bContext *C)
static int image_invert_exec (bContext *C, wmOperator *op)
void IMAGE_OT_invert (wmOperatorType *ot)
static int image_pack_test (bContext *C, wmOperator *op)
static int image_pack_exec (bContext *C, wmOperator *op)
static int image_pack_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void IMAGE_OT_pack (wmOperatorType *ot)
static int image_unpack_exec (bContext *C, wmOperator *op)
static int image_unpack_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void IMAGE_OT_unpack (wmOperatorType *ot)
static void image_sample_draw (const bContext *UNUSED(C), ARegion *ar, void *arg_info)
static void image_sample_apply (bContext *C, wmOperator *op, wmEvent *event)
static void image_sample_exit (bContext *C, wmOperator *op)
static int image_sample_invoke (bContext *C, wmOperator *op, wmEvent *event)
static int image_sample_modal (bContext *C, wmOperator *op, wmEvent *event)
static int image_sample_cancel (bContext *C, wmOperator *op)
void IMAGE_OT_sample (wmOperatorType *ot)
static int image_sample_line_exec (bContext *C, wmOperator *op)
static int image_sample_line_invoke (bContext *C, wmOperator *op, wmEvent *event)
void IMAGE_OT_sample_line (wmOperatorType *ot)
void IMAGE_OT_curves_point_set (wmOperatorType *ot)
static int image_record_composite_apply (bContext *C, wmOperator *op)
static int image_record_composite_init (bContext *C, wmOperator *op)
static void image_record_composite_exit (bContext *C, wmOperator *op)
static int image_record_composite_exec (bContext *C, wmOperator *op)
static int image_record_composite_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
static int image_record_composite_modal (bContext *C, wmOperator *op, wmEvent *event)
static int image_record_composite_cancel (bContext *C, wmOperator *op)
void IMAGE_OT_record_composite (wmOperatorType *ot)
static int image_cycle_render_slot_poll (bContext *C)
static int image_cycle_render_slot_exec (bContext *C, wmOperator *op)
void IMAGE_OT_cycle_render_slot (wmOperatorType *ot)
void ED_image_update_frame (const Main *mainp, int cfra)

Detailed Description

Definition in file image_ops.c.


Typedef Documentation

typedef struct ViewPanData ViewPanData
typedef struct ViewZoomData ViewZoomData

Function Documentation

void ED_image_update_frame ( const Main *  mainp,
int  cfra 
)
static int image_cycle_render_slot_exec ( bContext *  C,
wmOperator *  op 
) [static]
static int image_cycle_render_slot_poll ( bContext *  C) [static]

Definition at line 2246 of file image_ops.c.

References CTX_data_edit_image(), IMA_TYPE_R_RESULT, and Image::type.

Referenced by IMAGE_OT_cycle_render_slot().

static void image_filesel ( bContext *  C,
wmOperator *  op,
const char *  path 
) [static]
static int image_invert_exec ( bContext *  C,
wmOperator *  op 
) [static]
static int image_invert_poll ( bContext *  C) [static]

Definition at line 1504 of file image_ops.c.

References BKE_image_get_ibuf(), CTX_data_edit_image(), and NULL.

Referenced by IMAGE_OT_invert().

static int image_new_exec ( bContext *  C,
wmOperator *  op 
) [static]
static int image_new_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  UNUSEDevent 
) [static]

Definition at line 1468 of file image_ops.c.

References WM_operator_props_dialog_popup().

Referenced by IMAGE_OT_new().

static int image_open_cancel ( bContext *  UNUSEDC,
wmOperator *  op 
) [static]

Definition at line 726 of file image_ops.c.

References wmOperator::customdata, MEM_freeN(), NULL, and OPERATOR_CANCELLED.

Referenced by IMAGE_OT_open().

static int image_open_exec ( bContext *  C,
wmOperator *  op 
) [static]
static void image_open_init ( bContext *  C,
wmOperator *  op 
) [static]
static int image_open_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  UNUSEDevent 
) [static]
void IMAGE_OT_curves_point_set ( wmOperatorType *  ot)
void IMAGE_OT_cycle_render_slot ( wmOperatorType *  ot)
void IMAGE_OT_invert ( wmOperatorType *  ot)
void IMAGE_OT_new ( wmOperatorType *  ot)
void IMAGE_OT_open ( wmOperatorType *  ot)
void IMAGE_OT_pack ( wmOperatorType *  ot)
void IMAGE_OT_record_composite ( wmOperatorType *  ot)
void IMAGE_OT_reload ( wmOperatorType *  ot)
void IMAGE_OT_replace ( wmOperatorType *  ot)
void IMAGE_OT_sample ( wmOperatorType *  ot)
void IMAGE_OT_sample_line ( wmOperatorType *  ot)
void IMAGE_OT_save ( wmOperatorType *  ot)
void IMAGE_OT_save_as ( wmOperatorType *  ot)
void IMAGE_OT_save_sequence ( wmOperatorType *  ot)
void IMAGE_OT_unpack ( wmOperatorType *  ot)
void IMAGE_OT_view_all ( wmOperatorType *  ot)
void IMAGE_OT_view_ndof ( wmOperatorType *  ot)
void IMAGE_OT_view_pan ( wmOperatorType *  ot)
void IMAGE_OT_view_selected ( wmOperatorType *  ot)
void IMAGE_OT_view_zoom ( wmOperatorType *  ot)
void IMAGE_OT_view_zoom_in ( wmOperatorType *  ot)
void IMAGE_OT_view_zoom_out ( wmOperatorType *  ot)
void IMAGE_OT_view_zoom_ratio ( wmOperatorType *  ot)
static int image_pack_exec ( bContext *  C,
wmOperator *  op 
) [static]
static int image_pack_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  UNUSEDevent 
) [static]
static int image_pack_test ( bContext *  C,
wmOperator *  op 
) [static]
static int image_record_composite_apply ( bContext *  C,
wmOperator *  op 
) [static]
static int image_record_composite_cancel ( bContext *  C,
wmOperator *  op 
) [static]

Definition at line 2224 of file image_ops.c.

References image_record_composite_exit(), and OPERATOR_CANCELLED.

Referenced by IMAGE_OT_record_composite().

static int image_record_composite_exec ( bContext *  C,
wmOperator *  op 
) [static]
static void image_record_composite_exit ( bContext *  C,
wmOperator *  op 
) [static]
static int image_record_composite_init ( bContext *  C,
wmOperator *  op 
) [static]
static int image_record_composite_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  UNUSEDevent 
) [static]
static int image_record_composite_modal ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_reload_exec ( bContext *  C,
wmOperator *  UNUSEDop 
) [static]
static int image_replace_exec ( bContext *  C,
wmOperator *  op 
) [static]
static int image_replace_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  UNUSEDevent 
) [static]
static void image_sample_apply ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_sample_cancel ( bContext *  C,
wmOperator *  op 
) [static]

Definition at line 1936 of file image_ops.c.

References image_sample_exit(), and OPERATOR_CANCELLED.

Referenced by IMAGE_OT_curves_point_set(), and IMAGE_OT_sample().

static void image_sample_draw ( const bContext *  UNUSEDC,
ARegion *  ar,
void *  arg_info 
) [static]
static void image_sample_exit ( bContext *  C,
wmOperator *  op 
) [static]
static int image_sample_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_sample_line_exec ( bContext *  C,
wmOperator *  op 
) [static]
static int image_sample_line_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_sample_modal ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_save_as_cancel ( bContext *  UNUSEDC,
wmOperator *  op 
) [static]

Definition at line 1201 of file image_ops.c.

References image_save_as_free(), and OPERATOR_CANCELLED.

Referenced by IMAGE_OT_save_as().

static int image_save_as_check ( bContext *  UNUSEDC,
wmOperator *  op 
) [static]
static void image_save_as_draw ( bContext *  UNUSEDC,
wmOperator *  op 
) [static]
static int image_save_as_draw_check_prop ( PointerRNA *  ptr,
PropertyRNA *  prop 
) [static]

Definition at line 1208 of file image_ops.c.

References RNA_boolean_get(), and RNA_property_identifier().

Referenced by image_save_as_draw().

static int image_save_as_exec ( bContext *  C,
wmOperator *  op 
) [static]
static void image_save_as_free ( wmOperator *  op) [static]

Definition at line 1134 of file image_ops.c.

References wmOperator::customdata, MEM_freeN(), and NULL.

Referenced by image_save_as_cancel(), and image_save_as_exec().

static int image_save_as_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  UNUSEDevent 
) [static]
static int image_save_exec ( bContext *  C,
wmOperator *  op 
) [static]
static int image_save_sequence_exec ( bContext *  C,
wmOperator *  op 
) [static]
static int image_unpack_exec ( bContext *  C,
wmOperator *  op 
) [static]
static int image_unpack_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  UNUSEDevent 
) [static]
static int image_view_all_exec ( bContext *  C,
wmOperator *  UNUSEDop 
) [static]
static int image_view_ndof_invoke ( bContext *  C,
wmOperator *  UNUSEDop,
wmEvent *  event 
) [static]
static int image_view_pan_cancel ( bContext *  C,
wmOperator *  op 
) [static]

Definition at line 289 of file image_ops.c.

References image_view_pan_exit(), and OPERATOR_CANCELLED.

Referenced by IMAGE_OT_view_pan().

static int image_view_pan_exec ( bContext *  C,
wmOperator *  op 
) [static]
static void image_view_pan_exit ( bContext *  C,
wmOperator *  op,
int  cancel 
) [static]
static void image_view_pan_init ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_view_pan_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_view_pan_modal ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_view_selected_exec ( bContext *  C,
wmOperator *  UNUSEDop 
) [static]
static int image_view_selected_poll ( bContext *  C) [static]

Definition at line 603 of file image_ops.c.

References ED_operator_uvedit(), and space_image_main_area_poll().

Referenced by IMAGE_OT_view_selected().

static int image_view_zoom_cancel ( bContext *  C,
wmOperator *  op 
) [static]

Definition at line 420 of file image_ops.c.

References image_view_zoom_exit(), and OPERATOR_CANCELLED.

Referenced by IMAGE_OT_view_zoom().

static int image_view_zoom_exec ( bContext *  C,
wmOperator *  op 
) [static]
static void image_view_zoom_exit ( bContext *  C,
wmOperator *  op,
int  cancel 
) [static]
static int image_view_zoom_in_exec ( bContext *  C,
wmOperator *  UNUSEDop 
) [static]
static void image_view_zoom_init ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_view_zoom_invoke ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_view_zoom_modal ( bContext *  C,
wmOperator *  op,
wmEvent *  event 
) [static]
static int image_view_zoom_out_exec ( bContext *  C,
wmOperator *  UNUSEDop 
) [static]
static int image_view_zoom_ratio_exec ( bContext *  C,
wmOperator *  op 
) [static]
static char imtype_best_depth ( ImBuf *  ibuf,
const char  imtype 
) [static]
static void save_image_doit ( bContext *  C,
SpaceImage *  sima,
wmOperator *  op,
SaveImageOptions *  simopts,
int  do_newpath 
) [static]
static void save_image_options_defaults ( SaveImageOptions *  simopts) [static]
static void save_image_options_from_op ( SaveImageOptions *  simopts,
wmOperator *  op 
) [static]
static int save_image_options_init ( SaveImageOptions *  simopts,
SpaceImage *  sima,
Scene *  scene,
const short  guess_path 
) [static]
static void save_image_options_to_op ( SaveImageOptions *  simopts,
wmOperator *  op 
) [static]
static void sima_zoom_set ( SpaceImage *  sima,
ARegion *  ar,
float  zoom 
) [static]
static void sima_zoom_set_factor ( SpaceImage *  sima,
ARegion *  ar,
float  zoomfac 
) [static]
static int space_image_buffer_exists_poll ( bContext *  C) [static]
static int space_image_file_exists_poll ( bContext *  C) [static]
int space_image_main_area_poll ( bContext *  C)
static int space_image_poll ( bContext *  C) [static]

Definition at line 162 of file image_ops.c.

References CTX_wm_space_image(), SpaceImage::image, SPACE_IMAGE, and SpaceImage::spacetype.

Referenced by IMAGE_OT_replace().