Blender  V2.93
ED_image.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_listBase.h"
27 #include "DNA_space_types.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 struct ARegion;
34 struct ImBuf;
35 struct Image;
36 struct ImageUser;
37 struct Main;
38 struct ReportList;
39 struct Scene;
40 struct SpaceImage;
41 struct bContext;
42 struct wmOperator;
43 struct wmWindowManager;
44 
45 /* image_edit.c, exported for transform */
46 struct Image *ED_space_image(struct SpaceImage *sima);
47 void ED_space_image_set(struct Main *bmain,
48  struct SpaceImage *sima,
49  struct Object *obedit,
50  struct Image *ima,
51  bool automatic);
52 void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima);
53 struct Mask *ED_space_image_get_mask(struct SpaceImage *sima);
54 void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask);
55 
56 bool ED_space_image_get_position(struct SpaceImage *sima,
57  struct ARegion *region,
58  int mval[2],
59  float fpos[2]);
61  struct SpaceImage *sima, struct ARegion *region, int mval[2], float r_col[3], bool *r_is_data);
62 struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile);
64 void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock);
65 bool ED_space_image_has_buffer(struct SpaceImage *sima);
66 
67 void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height);
68 void ED_space_image_get_size_fl(struct SpaceImage *sima, float r_size[2]);
69 void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy);
71  const struct ARegion *region,
72  float *r_zoomx,
73  float *r_zoomy);
74 void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy);
75 
76 void ED_space_image_scopes_update(const struct bContext *C,
77  struct SpaceImage *sima,
78  struct ImBuf *ibuf,
79  bool use_view_settings);
80 
81 void ED_space_image_paint_update(struct Main *bmain,
82  struct wmWindowManager *wm,
83  struct Scene *scene);
84 
85 void ED_image_get_uv_aspect(struct Image *ima,
86  struct ImageUser *iuser,
87  float *r_aspx,
88  float *r_aspy);
89 void ED_image_mouse_pos(struct SpaceImage *sima,
90  const struct ARegion *region,
91  const int mval[2],
92  float co[2]);
93 void ED_image_view_center_to_point(struct SpaceImage *sima, float x, float y);
94 void ED_image_point_pos(struct SpaceImage *sima,
95  const struct ARegion *region,
96  float x,
97  float y,
98  float *r_x,
99  float *r_y);
101  const struct ARegion *region,
102  const float co[2],
103  float r_co[2]);
104 bool ED_image_slot_cycle(struct Image *image, int direction);
105 
106 bool ED_space_image_show_render(struct SpaceImage *sima);
107 bool ED_space_image_show_paint(struct SpaceImage *sima);
108 bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit);
109 
111 
112 bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *obedit);
116 
117 void ED_image_draw_info(struct Scene *scene,
118  struct ARegion *region,
119  bool color_manage,
120  bool use_default_view,
121  int channels,
122  int x,
123  int y,
124  const unsigned char cp[4],
125  const float fp[4],
126  const float linearcol[4],
127  const int *zp,
128  const float *zpf);
129 
130 bool ED_space_image_show_cache(struct SpaceImage *sima);
131 
132 bool ED_image_should_save_modified(const struct Main *bmain);
133 int ED_image_save_all_modified_info(const struct Main *bmain, struct ReportList *reports);
134 bool ED_image_save_all_modified(const struct bContext *C, struct ReportList *reports);
135 
136 /* image_sequence.c */
137 typedef struct ImageFrameRange {
139 
142  /* Sequence parameters. */
143  int length;
144  int offset;
145  /* UDIM tiles. */
147 
148  /* Temporary data. */
151 
153  struct wmOperator *op,
154  const bool detect_udim);
155 
156 #ifdef __cplusplus
157 }
158 #endif
#define FILE_MAX
These structs are the foundation for all linked lists in the library system.
void ED_image_point_pos(struct SpaceImage *sima, const struct ARegion *region, float x, float y, float *r_x, float *r_y)
bool ED_image_should_save_modified(const struct Main *bmain)
void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock)
Definition: image_edit.c:171
struct Mask * ED_space_image_get_mask(struct SpaceImage *sima)
Definition: image_edit.c:122
void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask)
Definition: image_edit.c:127
void ED_image_get_uv_aspect(struct Image *ima, struct ImageUser *iuser, float *r_aspx, float *r_aspy)
Definition: image_edit.c:302
struct ImageFrameRange ImageFrameRange
bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *obedit)
Definition: image_edit.c:484
bool ED_space_image_show_paint(struct SpaceImage *sima)
Definition: image_edit.c:451
void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima)
bool ED_space_image_has_buffer(struct SpaceImage *sima)
Definition: image_edit.c:202
bool ED_space_image_maskedit_mask_poll(struct bContext *C)
Definition: image_edit.c:522
void ED_image_draw_info(struct Scene *scene, struct ARegion *region, bool color_manage, bool use_default_view, int channels, int x, int y, const unsigned char cp[4], const float fp[4], const float linearcol[4], const int *zp, const float *zpf)
Definition: image_draw.c:145
void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:282
bool ED_space_image_color_sample(struct SpaceImage *sima, struct ARegion *region, int mval[2], float r_col[3], bool *r_is_data)
Definition: image_ops.c:3220
bool ED_space_image_maskedit_poll(struct bContext *C)
Definition: image_edit.c:494
void ED_space_image_scopes_update(const struct bContext *C, struct SpaceImage *sima, struct ImBuf *ibuf, bool use_view_settings)
Definition: image_edit.c:416
void ED_space_image_paint_update(struct Main *bmain, struct wmWindowManager *wm, struct Scene *scene)
Definition: paint_image.c:807
bool ED_image_save_all_modified(const struct bContext *C, struct ReportList *reports)
struct Image * ED_space_image(struct SpaceImage *sima)
Definition: image_edit.c:55
void ED_image_view_center_to_point(struct SpaceImage *sima, float x, float y)
Definition: image_edit.c:334
void ED_space_image_get_zoom(struct SpaceImage *sima, const struct ARegion *region, float *r_zoomx, float *r_zoomy)
ListBase ED_image_filesel_detect_sequences(struct Main *bmain, struct wmOperator *op, const bool detect_udim)
bool ED_space_image_paint_curve(const struct bContext *C)
void ED_image_point_pos__reverse(struct SpaceImage *sima, const struct ARegion *region, const float co[2], float r_co[2])
void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, struct Object *obedit, struct Image *ima, bool automatic)
Definition: image_edit.c:60
bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit)
Definition: image_edit.c:460
bool ED_space_image_show_cache(struct SpaceImage *sima)
Definition: image_draw.c:982
void ED_image_mouse_pos(struct SpaceImage *sima, const struct ARegion *region, const int mval[2], float co[2])
bool ED_space_image_get_position(struct SpaceImage *sima, struct ARegion *region, int mval[2], float fpos[2])
Definition: image_ops.c:3203
bool ED_image_slot_cycle(struct Image *image, int direction)
Definition: image_edit.c:382
bool ED_space_image_show_render(struct SpaceImage *sima)
Definition: image_edit.c:446
int ED_space_image_get_display_channel_mask(struct ImBuf *ibuf)
Definition: image_edit.c:179
void ED_space_image_get_size_fl(struct SpaceImage *sima, float r_size[2])
Definition: image_edit.c:248
int ED_image_save_all_modified_info(const struct Main *bmain, struct ReportList *reports)
void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height)
Definition: image_edit.c:215
void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:256
struct ImBuf * ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile)
Definition: image_edit.c:139
bool ED_space_image_cursor_poll(struct bContext *C)
Definition: image_edit.c:532
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define C
Definition: RandGen.cpp:39
Scene scene
int channels
struct ImageFrameRange * prev
Definition: ED_image.h:138
ListBase frames
Definition: ED_image.h:149
struct ImageFrameRange * next
Definition: ED_image.h:138
char filepath[FILE_MAX]
Definition: ED_image.h:141
ListBase udim_tiles
Definition: ED_image.h:146
Definition: BKE_main.h:116
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)