Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/include/ED_image.h
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| struct wmWindowManager; | struct wmWindowManager; | ||||
| struct View2D; | struct View2D; | ||||
| /* image_draw.c */ | /* image_draw.c */ | ||||
| float ED_space_image_zoom_level(const struct View2D *v2d, const int grid_dimension); | float ED_space_image_zoom_level(const struct View2D *v2d, const int grid_dimension); | ||||
| void ED_space_image_grid_steps(struct SpaceImage *sima, | void ED_space_image_grid_steps(struct SpaceImage *sima, | ||||
| float grid_steps[SI_GRID_STEPS_LEN], | float grid_steps[SI_GRID_STEPS_LEN], | ||||
| const int grid_dimension); | const int grid_dimension); | ||||
| /** | |||||
| * Calculate the increment snapping value for UV/image editor based on the zoom factor | |||||
| * The code in here (except the offset part) is used in `grid_frag.glsl` (see `grid_res`) for | |||||
| * drawing the grid overlay for the UV/Image editor. | |||||
| */ | |||||
| float ED_space_image_increment_snap_value(const int grid_dimesnions, | float ED_space_image_increment_snap_value(const int grid_dimesnions, | ||||
| const float grid_steps[SI_GRID_STEPS_LEN], | const float grid_steps[SI_GRID_STEPS_LEN], | ||||
| const float zoom_factor); | const float zoom_factor); | ||||
| /* image_edit.c, exported for transform */ | /* image_edit.c, exported for transform. */ | ||||
| struct Image *ED_space_image(const struct SpaceImage *sima); | struct Image *ED_space_image(const struct SpaceImage *sima); | ||||
| void ED_space_image_set(struct Main *bmain, | void ED_space_image_set(struct Main *bmain, | ||||
| struct SpaceImage *sima, | struct SpaceImage *sima, | ||||
| struct Image *ima, | struct Image *ima, | ||||
| bool automatic); | bool automatic); | ||||
| void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima); | void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima); | ||||
| struct Mask *ED_space_image_get_mask(const struct SpaceImage *sima); | struct Mask *ED_space_image_get_mask(const struct SpaceImage *sima); | ||||
| void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask); | void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask); | ||||
| /** | |||||
| * Returns mouse position in image space. | |||||
| */ | |||||
| bool ED_space_image_get_position(struct SpaceImage *sima, | bool ED_space_image_get_position(struct SpaceImage *sima, | ||||
| struct ARegion *region, | struct ARegion *region, | ||||
| int mval[2], | int mval[2], | ||||
| float fpos[2]); | float fpos[2]); | ||||
| /** | |||||
| * Returns color in linear space, matching #ED_space_node_color_sample(). | |||||
| */ | |||||
| bool ED_space_image_color_sample( | bool ED_space_image_color_sample( | ||||
| struct SpaceImage *sima, struct ARegion *region, int mval[2], float r_col[3], bool *r_is_data); | struct SpaceImage *sima, struct ARegion *region, int mval[2], float r_col[3], bool *r_is_data); | ||||
| struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile); | struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile); | ||||
| /** | |||||
| * Get the #SpaceImage flag that is valid for the given ibuf. | |||||
| */ | |||||
| int ED_space_image_get_display_channel_mask(struct ImBuf *ibuf); | int ED_space_image_get_display_channel_mask(struct ImBuf *ibuf); | ||||
| void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock); | void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock); | ||||
| bool ED_space_image_has_buffer(struct SpaceImage *sima); | bool ED_space_image_has_buffer(struct SpaceImage *sima); | ||||
| void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height); | void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height); | ||||
| void ED_space_image_get_size_fl(struct SpaceImage *sima, float r_size[2]); | void ED_space_image_get_size_fl(struct SpaceImage *sima, float r_size[2]); | ||||
| void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy); | void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy); | ||||
| void ED_space_image_get_zoom(struct SpaceImage *sima, | void ED_space_image_get_zoom(struct SpaceImage *sima, | ||||
| const struct ARegion *region, | const struct ARegion *region, | ||||
| float *r_zoomx, | float *r_zoomx, | ||||
| float *r_zoomy); | float *r_zoomy); | ||||
| void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy); | void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy); | ||||
| void ED_space_image_scopes_update(const struct bContext *C, | void ED_space_image_scopes_update(const struct bContext *C, | ||||
| struct SpaceImage *sima, | struct SpaceImage *sima, | ||||
| struct ImBuf *ibuf, | struct ImBuf *ibuf, | ||||
| bool use_view_settings); | bool use_view_settings); | ||||
| /** | |||||
| * Enable the paint cursor if it isn't already. | |||||
| * | |||||
| * purpose is to make sure the paint cursor is shown if paint mode is enabled in the image editor. | |||||
| * The paint poll will ensure that the cursor is hidden when not in paint mode. | |||||
| */ | |||||
| void ED_space_image_paint_update(struct Main *bmain, | void ED_space_image_paint_update(struct Main *bmain, | ||||
| struct wmWindowManager *wm, | struct wmWindowManager *wm, | ||||
| struct Scene *scene); | struct Scene *scene); | ||||
| void ED_image_get_uv_aspect(struct Image *ima, | void ED_image_get_uv_aspect(struct Image *ima, | ||||
| struct ImageUser *iuser, | struct ImageUser *iuser, | ||||
| float *r_aspx, | float *r_aspx, | ||||
| float *r_aspy); | float *r_aspy); | ||||
| /** Takes `event->mval`. */ | |||||
| void ED_image_mouse_pos(struct SpaceImage *sima, | void ED_image_mouse_pos(struct SpaceImage *sima, | ||||
| const struct ARegion *region, | const struct ARegion *region, | ||||
| const int mval[2], | const int mval[2], | ||||
| float co[2]); | float co[2]); | ||||
| void ED_image_view_center_to_point(struct SpaceImage *sima, float x, float y); | void ED_image_view_center_to_point(struct SpaceImage *sima, float x, float y); | ||||
| void ED_image_point_pos(struct SpaceImage *sima, | void ED_image_point_pos(struct SpaceImage *sima, | ||||
| const struct ARegion *region, | const struct ARegion *region, | ||||
| float x, | float x, | ||||
| float y, | float y, | ||||
| float *r_x, | float *r_x, | ||||
| float *r_y); | float *r_y); | ||||
| void ED_image_point_pos__reverse(struct SpaceImage *sima, | void ED_image_point_pos__reverse(struct SpaceImage *sima, | ||||
| const struct ARegion *region, | const struct ARegion *region, | ||||
| const float co[2], | const float co[2], | ||||
| float r_co[2]); | float r_co[2]); | ||||
| /** | |||||
| * This is more a user-level functionality, for going to `next/prev` used slot, | |||||
| * Stepping onto the last unused slot too. | |||||
| */ | |||||
| bool ED_image_slot_cycle(struct Image *image, int direction); | bool ED_image_slot_cycle(struct Image *image, int direction); | ||||
| bool ED_space_image_show_render(const struct SpaceImage *sima); | bool ED_space_image_show_render(const struct SpaceImage *sima); | ||||
| bool ED_space_image_show_paint(const struct SpaceImage *sima); | bool ED_space_image_show_paint(const struct SpaceImage *sima); | ||||
| bool ED_space_image_show_uvedit(const struct SpaceImage *sima, struct Object *obedit); | bool ED_space_image_show_uvedit(const struct SpaceImage *sima, struct Object *obedit); | ||||
| bool ED_space_image_paint_curve(const struct bContext *C); | bool ED_space_image_paint_curve(const struct bContext *C); | ||||
| /** | |||||
| * Matches clip function. | |||||
| */ | |||||
| bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *obedit); | bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *obedit); | ||||
| bool ED_space_image_maskedit_poll(struct bContext *C); | bool ED_space_image_maskedit_poll(struct bContext *C); | ||||
| bool ED_space_image_maskedit_mask_poll(struct bContext *C); | bool ED_space_image_maskedit_mask_poll(struct bContext *C); | ||||
| bool ED_space_image_cursor_poll(struct bContext *C); | bool ED_space_image_cursor_poll(struct bContext *C); | ||||
| /** | |||||
| * Used by node view too. | |||||
| */ | |||||
| void ED_image_draw_info(struct Scene *scene, | void ED_image_draw_info(struct Scene *scene, | ||||
| struct ARegion *region, | struct ARegion *region, | ||||
| bool color_manage, | bool color_manage, | ||||
| bool use_default_view, | bool use_default_view, | ||||
| int channels, | int channels, | ||||
| int x, | int x, | ||||
| int y, | int y, | ||||
| const unsigned char cp[4], | const unsigned char cp[4], | ||||
| Show All 22 Lines | typedef struct ImageFrameRange { | ||||
| int offset; | int offset; | ||||
| /* UDIM tiles. */ | /* UDIM tiles. */ | ||||
| ListBase udim_tiles; | ListBase udim_tiles; | ||||
| /* Temporary data. */ | /* Temporary data. */ | ||||
| ListBase frames; | ListBase frames; | ||||
| } ImageFrameRange; | } ImageFrameRange; | ||||
| /** | |||||
| * Used for both images and volume file loading. | |||||
| */ | |||||
| ListBase ED_image_filesel_detect_sequences(struct Main *bmain, | ListBase ED_image_filesel_detect_sequences(struct Main *bmain, | ||||
| struct wmOperator *op, | struct wmOperator *op, | ||||
| const bool detect_udim); | const bool detect_udim); | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||