2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2008 Blender Foundation.
19 * All rights reserved.
21 * Contributor(s): Blender Foundation
23 * ***** END GPL LICENSE BLOCK *****
30 #ifndef __ED_IMAGE_H__
31 #define __ED_IMAGE_H__
40 struct wmWindowManager;
44 /* image_edit.c, exported for transform */
45 struct Image *ED_space_image(struct SpaceImage *sima);
46 void ED_space_image_set(struct SpaceImage *sima, struct Scene *scene, struct Object *obedit, struct Image *ima);
47 struct Mask *ED_space_image_get_mask(struct SpaceImage *sima);
48 void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask);
50 struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **lock_r);
51 void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock);
52 int ED_space_image_has_buffer(struct SpaceImage *sima);
54 void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height);
55 void ED_space_image_get_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
56 void ED_space_image_get_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy);
57 void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
59 void ED_space_image_paint_update(struct wmWindowManager *wm, struct ToolSettings *settings);
60 void ED_space_image_uv_sculpt_update(struct wmWindowManager *wm, struct ToolSettings *settings);
62 void ED_image_get_size(struct Image *ima, int *width, int *height);
63 void ED_image_get_aspect(struct Image *ima, float *aspx, float *aspy);
64 void ED_image_get_uv_aspect(struct Image *ima, float *aspx, float *aspy);
65 void ED_image_mouse_pos(struct SpaceImage *sima, struct ARegion *ar, struct wmEvent *event, float co[2]);
66 void ED_image_point_pos(struct SpaceImage *sima, struct ARegion *ar, float x, float y, float *xr, float *yr);
67 void ED_image_point_pos__reverse(struct SpaceImage *sima, struct ARegion *ar, const float co[2], float r_co[2]);
69 int ED_space_image_show_render(struct SpaceImage *sima);
70 int ED_space_image_show_paint(struct SpaceImage *sima);
71 int ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit);
72 int ED_space_image_show_uvshadow(struct SpaceImage *sima, struct Object *obedit);
74 int ED_space_image_check_show_maskedit(struct SpaceImage *sima);
75 int ED_space_image_maskedit_poll(struct bContext *C);
76 int ED_space_image_maskedit_mask_poll(struct bContext *C);
78 /* UI level image (texture) updating... render calls own stuff (too) */
79 void ED_image_update_frame(const struct Main *mainp, int cfra);
81 void ED_image_draw_info(struct ARegion *ar, int color_manage, int channels, int x, int y,
82 const unsigned char cp[4], const float fp[4], int *zp, float *zpf);
84 #endif /* __ED_IMAGE_H__ */