69#include "RNA_prototypes.hh"
99 SpaceImage *sima,
ARegion *region,
float zoom,
const float location[2],
const bool zoom_to_pos)
101 float oldzoom = sima->
zoom;
106 if (sima->
zoom < 0.1f || sima->
zoom > 4.0f) {
111 height *= sima->
zoom;
113 if ((width < 4) && (height < 4) && sima->
zoom < oldzoom) {
114 sima->
zoom = oldzoom;
117 sima->
zoom = oldzoom;
120 sima->
zoom = oldzoom;
124 if (zoom_to_pos && location) {
125 float aspx, aspy,
w, h;
133 sima->
xof += ((location[0] - 0.5f) *
w - sima->
xof) * (sima->
zoom - oldzoom) / sima->
zoom;
134 sima->
yof += ((location[1] - 0.5f) * h - sima->
yof) * (sima->
zoom - oldzoom) / sima->
zoom;
141 const float location[2],
142 const bool zoom_to_pos)
158 image_size[0] = image_size[0] * aspx;
159 image_size[1] = image_size[1] * aspy;
165 float size_xy[2],
size;
187 return (sima) ? sima->
image :
nullptr;
203 return (sima) ? &sima->
iuser :
nullptr;
212 iuser = *iuser_context;
232 if (ima ==
nullptr) {
269 float aspx, aspy, zoomx, zoomy,
w, h;
279 float xof = 0.0f, yof = 0.0f;
282 int x_tiles, y_tiles;
283 if (sima->
image ==
nullptr) {
288 x_tiles = y_tiles = 1;
290 int tile_x = (
tile->tile_number - 1001) % 10;
291 int tile_y = (
tile->tile_number - 1001) / 10;
292 x_tiles =
max_ii(x_tiles, tile_x + 1);
293 y_tiles =
max_ii(y_tiles, tile_y + 1);
296 xof = 0.5f * (x_tiles - 1.0f) *
w;
297 yof = 0.5f * (y_tiles - 1.0f) * h;
307 const int margin = 5;
309 zoomx = float(width) / (
w + 2 * margin);
310 zoomy = float(height) / (h + 2 * margin);
315 if ((
w >= width || h >= height) && (width > 0 && height > 0)) {
316 zoomx = float(width) /
w;
317 zoomy = float(height) / h;
381 if (vpd->own_cursor) {
385 vpd->x =
event->xy[0];
386 vpd->y =
event->xy[1];
387 vpd->xof = sima->
xof;
388 vpd->yof = sima->
yof;
397 ViewPanData *vpd =
static_cast<ViewPanData *
>(op->
customdata);
400 sima->
xof = vpd->xof;
401 sima->
yof = vpd->yof;
405 if (vpd->own_cursor) {
417 sima->
xof += offset[0];
418 sima->
yof += offset[1];
431 offset[0] = (
event->prev_xy[0] -
event->xy[0]) / sima->
zoom;
432 offset[1] = (
event->prev_xy[1] -
event->xy[1]) / sima->
zoom;
446 ViewPanData *vpd =
static_cast<ViewPanData *
>(op->
customdata);
449 switch (event->
type) {
451 sima->
xof = vpd->xof;
452 sima->
yof = vpd->yof;
453 offset[0] = (vpd->x -
event->xy[0]) / sima->
zoom;
454 offset[1] = (vpd->y -
event->xy[1]) / sima->
zoom;
477 ot->name =
"Pan View";
478 ot->idname =
"IMAGE_OT_view_pan";
479 ot->description =
"Pan the view";
499 "Offset in floating-point units, 1.0 is the width and height of the image",
520 double timer_lastdraw;
541 if (vpd->own_cursor) {
545 vpd->origx =
event->xy[0];
546 vpd->origy =
event->xy[1];
547 vpd->zoom = sima->
zoom;
551 ®ion->
v2d, event->
mval[0], event->
mval[1], &vpd->location[0], &vpd->location[1]);
560 vpd->region = region;
568 ViewZoomData *vpd =
static_cast<ViewZoomData *
>(op->
customdata);
571 sima->
zoom = vpd->zoom;
579 if (vpd->own_cursor) {
608 float delta, factor, location[2];
611 ®ion->
v2d, event->
mval[0], event->
mval[1], &location[0], &location[1]);
613 delta =
event->prev_xy[0] -
event->xy[0] +
event->prev_xy[1] -
event->xy[1];
619 factor = 1.0f + delta / 300.0f;
640 const short viewzoom,
641 const short zoom_invert,
642 const bool zoom_to_pos)
649 delta = float(
x - vpd->origx);
652 delta = float(
y - vpd->origy);
656 delta =
x - vpd->origx +
y - vpd->origy;
659 delta /=
U.pixelsize;
667 float time_step = float(time - vpd->timer_lastdraw);
669 zfac = 1.0f + ((delta / 20.0f) * time_step);
670 vpd->timer_lastdraw = time;
672 factor = (vpd->sima->zoom * zfac) / vpd->zoom;
675 factor = 1.0f + delta / 300.0f;
679 sima_zoom_set(vpd->sima, vpd->region, vpd->zoom * factor, vpd->location, zoom_to_pos);
685 ViewZoomData *vpd =
static_cast<ViewZoomData *
>(op->
customdata);
699 else if (event->
type == vpd->launch_event) {
705 switch (event_code) {
740 ot->name =
"Zoom View";
741 ot->idname =
"IMAGE_OT_view_zoom";
742 ot->description =
"Zoom in/out the image";
761 "Zoom factor, values higher than 1.0 zoom in, lower values zoom out",
771#ifdef WITH_INPUT_NDOF
794 const wmNDOFMotionData &ndof = *
static_cast<const wmNDOFMotionData *
>(
event->customdata);
797 blender::float3 pan_vec = ndof.dt * WM_event_ndof_translation_get_for_navigation(ndof);
802 sima->
xof += pan_vec[0];
803 sima->
yof += pan_vec[1];
813 ot->name =
"NDOF Pan/Zoom";
814 ot->idname =
"IMAGE_OT_view_ndof";
815 ot->description =
"Use a 3D mouse device to pan/zoom the view";
818 ot->invoke = image_view_ndof_invoke;
858 ot->name =
"Frame All";
859 ot->idname =
"IMAGE_OT_view_all";
860 ot->description =
"View the entire image";
870 prop =
RNA_def_boolean(
ot->srna,
"fit_view",
false,
"Fit View",
"Fit frame to the viewport");
904 ot->name =
"Cursor To Center View";
905 ot->description =
"Set 2D Cursor To Center View location";
906 ot->idname =
"IMAGE_OT_view_cursor_center";
913 prop =
RNA_def_boolean(
ot->srna,
"fit_view",
false,
"Fit View",
"Fit frame to the viewport");
938 ot->name =
"Center View to Cursor";
939 ot->description =
"Center the view so that the cursor is in the middle of the view";
940 ot->idname =
"IMAGE_OT_view_center_cursor";
972 scene, view_layer,
nullptr);
1009 ot->name =
"View Center";
1010 ot->idname =
"IMAGE_OT_view_selected";
1011 ot->description =
"View all selected UVs";
1048 ®ion->
v2d, event->
mval[0], event->
mval[1], &location[0], &location[1]);
1059 ot->name =
"Zoom In";
1060 ot->idname =
"IMAGE_OT_view_zoom_in";
1061 ot->description =
"Zoom in the image (centered around 2D cursor)";
1079 "Cursor location in screen coordinates",
1109 ®ion->
v2d, event->
mval[0], event->
mval[1], &location[0], &location[1]);
1120 ot->name =
"Zoom Out";
1121 ot->idname =
"IMAGE_OT_view_zoom_out";
1122 ot->description =
"Zoom out the image (centered around 2D cursor)";
1140 "Cursor location in screen coordinates",
1160 sima->
xof = int(sima->
xof);
1161 sima->
yof = int(sima->
yof);
1171 ot->name =
"View Zoom Ratio";
1172 ot->idname =
"IMAGE_OT_view_zoom_ratio";
1173 ot->description =
"Set zoom ratio of the view";
1189 "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out",
1216 sima_view_prev.xof = sima->
xof;
1217 sima_view_prev.yof = sima->
yof;
1218 sima_view_prev.zoom = sima->
zoom;
1224 sima->
xof = sima_view_prev.xof + (sima->
xof - sima_view_prev.xof);
1225 sima->
yof = sima_view_prev.yof + (sima->
yof - sima_view_prev.yof);
1226 sima->
zoom = sima_view_prev.zoom * (sima_view_prev.zoom / sima->
zoom);
1237 ot->name =
"Zoom to Border";
1238 ot->description =
"Zoom in the view to the nearest item contained in the border";
1239 ot->idname =
"IMAGE_OT_view_zoom_border";
1275 op->
customdata = iod = MEM_new<ImageOpenData>(__func__);
1292 const bool use_multiview)
1294 bool exists =
false;
1295 Image *ima =
nullptr;
1306 "Cannot read '%s': %s",
1308 errno ? strerror(errno) :
RPT_(
"unsupported image format"));
1320 if (use_multiview) {
1342 else if (range->
length > 1) {
1356 Image *ima =
nullptr;
1357 int frame_seq_len = 0;
1369 Library *owner_library = owner_id ? owner_id->
lib :
nullptr;
1378 if ((ima ==
nullptr) && ima_range) {
1380 frame_seq_len = range->length;
1381 frame_ofs = range->offset;
1388 if (ima ==
nullptr) {
1413 iuser = &sima->
iuser;
1418 iuser = &tex->
iuser;
1421 if (iuser ==
nullptr) {
1426 if (bgpic->ima == ima) {
1427 iuser = &bgpic->iuser;
1445 iuser->
offset = frame_ofs - 1;
1447 iuser->
scene = scene;
1466 const char *path =
U.textudir;
1467 Image *ima =
nullptr;
1474 if (ima ==
nullptr) {
1481 if (ima ==
nullptr) {
1527 return !
STR_ELEM(prop_id,
"filepath",
"directory",
"filename");
1557 ot->srna,
"allow_path_tokens",
true,
"",
"Allow the path to contain substitution tokens");
1564 ot->name =
"Open Image";
1565 ot->description =
"Open image";
1566 ot->idname =
"IMAGE_OT_open";
1590 "use_sequence_detection",
1593 "Automatically detect animated sequences in selected images (based on file names)");
1595 "use_udim_detecting",
1598 "Detect selected UDIM files and load all matching tiles");
1610 if (ima ==
nullptr) {
1699 ot->name =
"Browse Image";
1701 "Open an image file browser, hold Shift to open the file, Alt to browse containing "
1703 ot->idname =
"IMAGE_OT_file_browse";
1735 if (!ima || !iuser) {
1740 iuser = &tex->
iuser;
1761 ot->name =
"Match Movie Length";
1762 ot->description =
"Set image's user's length to the one of this video";
1763 ot->idname =
"IMAGE_OT_match_movie_length";
1843 ot->name =
"Replace Image";
1844 ot->idname =
"IMAGE_OT_replace";
1845 ot->description =
"Replace current image by another one from disk";
1974 if (isd ==
nullptr) {
2013 if (isd ==
nullptr) {
2032 return !(
STREQ(prop_id,
"filepath") ||
STREQ(prop_id,
"directory") ||
2033 STREQ(prop_id,
"filename") ||
2065 if (!save_as_render) {
2084 if (
G.is_rendering) {
2100 ot->name =
"Save As Image";
2101 ot->idname =
"IMAGE_OT_save_as";
2102 ot->description =
"Save the image with another name and/or settings";
2122 "Save image with render color management.\n"
2123 "For display image formats like PNG, apply view and display transform.\n"
2124 "For intermediate image formats like OpenEXR, use the default render output color space");
2130 "Create a new image file without modifying the current image in Blender");
2242 ot->name =
"Save Image";
2243 ot->idname =
"IMAGE_OT_save";
2244 ot->description =
"Save the image with current name and settings";
2264 ImBuf *ibuf, *first_ibuf =
nullptr;
2267 MovieCacheIter *iter;
2269 if (image ==
nullptr) {
2285 if (image->
cache !=
nullptr) {
2290 if (first_ibuf ==
nullptr) {
2333 ot->name =
"Save Sequence";
2334 ot->idname =
"IMAGE_OT_save_sequence";
2335 ot->description =
"Save a sequence of images";
2396 int num_saveable_images = 0;
2399 ima =
static_cast<Image *
>(ima->id.next))
2401 bool is_format_writable;
2406 num_saveable_images++;
2411 "Packed library image can't be saved: \"%s\" from \"%s\"",
2413 ima->id.lib->filepath);
2416 else if (!is_format_writable) {
2419 "Image can't be saved, use a different file format: \"%s\"",
2424 num_saveable_images++;
2428 "Multiple images can't be saved to an identical path: \"%s\"",
2432 unique_paths.
add(ima->filepath);
2438 "Image can't be saved, no valid file path: \"%s\"",
2445 return num_saveable_images;
2457 ima =
static_cast<Image *
>(ima->id.next))
2459 bool is_format_writable;
2465 else if (is_format_writable) {
2471 ok = ok && saved_successfully;
2484 return num_files > 0;
2496 ot->name =
"Save All Modified";
2497 ot->idname =
"IMAGE_OT_save_all_modified";
2498 ot->description =
"Save all modified images";
2539 ot->name =
"Reload Image";
2540 ot->idname =
"IMAGE_OT_reload";
2541 ot->description =
"Reload current image from disk";
2556#define IMA_DEF_NAME N_("Untitled")
2596 int width, height, floatbuf, gen_type, alpha;
2607 name =
DATA_(name_buffer);
2645 if (
data->pprop.prop) {
2650 if (
data->pprop.ptr.owner_id) {
2686 C, op, 300,
IFACE_(
"Create a New Image"),
IFACE_(
"New Image"));
2715 col[0].label(
"", ICON_NONE);
2716 col[1].prop( op->
ptr,
"use_stereo_3d", 0, std::nullopt, ICON_NONE);
2729 static const float default_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
2732 ot->name =
"New Image";
2733 ot->description =
"Create a new image";
2734 ot->idname =
"IMAGE_OT_new";
2748 prop =
RNA_def_int(
ot->srna,
"width", 1024, 1, INT_MAX,
"Width",
"Image width", 1, 16384);
2750 prop =
RNA_def_int(
ot->srna,
"height", 1024, 1, INT_MAX,
"Height",
"Image height", 1, 16384);
2753 ot->srna,
"color", 4,
nullptr, 0.0f,
FLT_MAX,
"Color",
"Default fill color", 0.0f, 1.0f);
2756 RNA_def_boolean(
ot->srna,
"alpha",
true,
"Alpha",
"Create an image with an alpha channel");
2762 "Fill the image with a grid for UV map testing");
2767 "Create image with 32-bit floating-point bit depth");
2770 ot->srna,
"use_stereo_3d",
false,
"Stereo 3D",
"Create an image with left and right views");
2772 prop =
RNA_def_boolean(
ot->srna,
"tiled",
false,
"Tiled",
"Create a tiled image");
2792 if (ibuf ==
nullptr) {
2800 if (!use_flip_x && !use_flip_y) {
2811 const int size_x = ibuf->
x;
2812 const int size_y = ibuf->
y;
2817 float *orig_float_pixels =
static_cast<float *
>(
MEM_dupallocN(float_pixels));
2818 for (
int x = 0;
x < size_x;
x++) {
2819 const int source_pixel_x = use_flip_x ? size_x -
x - 1 :
x;
2820 for (
int y = 0;
y < size_y;
y++) {
2821 const int source_pixel_y = use_flip_y ? size_y -
y - 1 :
y;
2823 const float *source_pixel =
2824 &orig_float_pixels[4 * (source_pixel_x + source_pixel_y * size_x)];
2825 float *target_pixel = &float_pixels[4 * (
x +
y * size_x)];
2839 for (
int x = 0;
x < size_x;
x++) {
2840 const int source_pixel_x = use_flip_x ? size_x -
x - 1 :
x;
2841 for (
int y = 0;
y < size_y;
y++) {
2842 const int source_pixel_y = use_flip_y ? size_y -
y - 1 :
y;
2844 const uchar *source_pixel =
2845 &orig_char_pixels[4 * (source_pixel_x + source_pixel_y * size_x)];
2846 uchar *target_pixel = &char_pixels[4 * (
x +
y * size_x)];
2880 ot->name =
"Flip Image";
2881 ot->idname =
"IMAGE_OT_flip";
2882 ot->description =
"Flip the image";
2891 ot->srna,
"use_flip_x",
false,
"Horizontal",
"Flip the image horizontally");
2893 prop =
RNA_def_boolean(
ot->srna,
"use_flip_y",
false,
"Vertical",
"Flip the image vertically");
2914 if (ibuf ==
nullptr) {
2954 {90,
"90", 0,
"90 Degrees",
"Rotate 90 degrees clockwise"},
2955 {180,
"180", 0,
"180 Degrees",
"Rotate 180 degrees clockwise"},
2956 {270,
"270", 0,
"270 Degrees",
"Rotate 270 degrees clockwise"},
2957 {0,
nullptr, 0,
nullptr,
nullptr},
2961 ot->name =
"Rotate Image Orthogonal";
2962 ot->idname =
"IMAGE_OT_rotate_orthogonal";
2963 ot->description =
"Rotate the image";
2973 orthogonal_rotation_items,
2976 "Amount of rotation in degrees (90, 180, 270)");
2993 if (ima ==
nullptr) {
3006 bool changed =
false;
3017 ibuf, save_as_render,
true, &image_format);
3023 if (colormanaged_ibuf != ibuf) {
3047 ot->name =
"Copy Image";
3048 ot->idname =
"IMAGE_OT_clipboard_copy";
3049 ot->description =
"Copy the image to the clipboard";
3067 bool changed =
false;
3108 ot->name =
"Paste Image";
3109 ot->idname =
"IMAGE_OT_clipboard_paste";
3110 ot->description =
"Paste new image from the clipboard";
3142 if (ibuf ==
nullptr) {
3157 for (
i =
size_t(ibuf->
x) * ibuf->
y;
i > 0;
i--, fp += 4) {
3159 fp[0] = 1.0f - fp[0];
3162 fp[1] = 1.0f - fp[1];
3165 fp[2] = 1.0f - fp[2];
3168 fp[3] = 1.0f - fp[3];
3179 for (
i =
size_t(ibuf->
x) * ibuf->
y;
i > 0;
i--, cp += 4) {
3181 cp[0] = 255 - cp[0];
3184 cp[1] = 255 - cp[1];
3187 cp[2] = 255 - cp[2];
3190 cp[3] = 255 - cp[3];
3224 ot->name =
"Invert Channels";
3225 ot->idname =
"IMAGE_OT_invert";
3226 ot->description =
"Invert image's channels";
3233 prop =
RNA_def_boolean(
ot->srna,
"invert_r",
false,
"Red",
"Invert red channel");
3235 prop =
RNA_def_boolean(
ot->srna,
"invert_g",
false,
"Green",
"Invert green channel");
3237 prop =
RNA_def_boolean(
ot->srna,
"invert_b",
false,
"Blue",
"Invert blue channel");
3239 prop =
RNA_def_boolean(
ot->srna,
"invert_a",
false,
"Alpha",
"Invert alpha channel");
3259 const int size[2] = {ibuf->
x, ibuf->
y};
3264 C, op, 200,
IFACE_(
"Scale Image to New Size"),
IFACE_(
"Resize"));
3280 if (!is_scaling_all) {
3283 if (ibuf ==
nullptr) {
3309 iuser.
tile = current_tile->tile_number;
3313 if (ibuf ==
nullptr) {
3323 iuser.
tile = current_tile->tile_number;
3357 ot->name =
"Resize Image";
3358 ot->idname =
"IMAGE_OT_resize";
3359 ot->description =
"Resize the image";
3369 ot->srna,
"all_udims",
false,
"All UDIM Tiles",
"Scale all the image's UDIM tiles");
3388 *r_error_message =
"Image is not editable";
3393 *r_error_message =
"Movies or image sequences do not support packing";
3403 const char *error_message =
nullptr;
3409 if (error_message) {
3420 const char *error_message =
nullptr;
3422 if (error_message) {
3443 ot->name =
"Pack Image";
3444 ot->description =
"Pack an image as embedded data into the .blend file";
3445 ot->idname =
"IMAGE_OT_pack";
3494 "AutoPack is enabled, so image will be packed again on file save");
3532 "AutoPack is enabled, so image will be packed again on file save");
3550 ot->name =
"Unpack Image";
3551 ot->description =
"Save an image packed in the .blend file to disk";
3552 ot->idname =
"IMAGE_OT_unpack";
3567 ot->srna,
"id",
nullptr,
MAX_ID_NAME - 2,
"Image Name",
"Image data-block name to unpack");
3584 if (ibuf ==
nullptr) {
3596 SpaceImage *sima,
ARegion *region,
const int mval[2],
float r_col[3],
bool *r_is_data)
3601 if (sima->
image ==
nullptr) {
3612 if (ibuf ==
nullptr) {
3617 if (uv[0] >= 0.0f && uv[1] >= 0.0f && uv[0] < 1.0f && uv[1] < 1.0f) {
3620 int x = int(uv[0] * ibuf->
x),
y = int(uv[1] * ibuf->
y);
3649 ot->name =
"Sample Color";
3650 ot->idname =
"IMAGE_OT_sample";
3651 ot->description =
"Use mouse to sample a color in current image";
3663 prop =
RNA_def_int(
ot->srna,
"size", 1, 1, 128,
"Sample Size",
"", 1, 64);
3686 float uv1[2], uv2[2], ofs[2];
3698 if (ibuf ==
nullptr) {
3743 ot->name =
"Sample Line";
3744 ot->idname =
"IMAGE_OT_sample_line";
3745 ot->description =
"Sample a line and show it in Scope panels";
3769 {0,
"BLACK_POINT", 0,
"Black Point",
""},
3770 {1,
"WHITE_POINT", 0,
"White Point",
""},
3771 {0,
nullptr, 0,
nullptr,
nullptr},
3775 ot->name =
"Set Curves Point";
3776 ot->idname =
"IMAGE_OT_curves_point_set";
3777 ot->description =
"Set black point or white point for curves";
3790 ot->srna,
"point", point_items, 0,
"Point",
"Set black point or white point for curves");
3793 prop =
RNA_def_int(
ot->srna,
"size", 1, 1, 128,
"Sample Size",
"", 1, 64);
3834 ot->name =
"Cycle Render Slot";
3835 ot->idname =
"IMAGE_OT_cycle_render_slot";
3836 ot->description =
"Cycle through all non-void render slots";
3871 ot->name =
"Clear Render Slot";
3872 ot->idname =
"IMAGE_OT_clear_render_slot";
3873 ot->description =
"Clear the currently selected render slot";
3904 ot->name =
"Add Render Slot";
3905 ot->idname =
"IMAGE_OT_add_render_slot";
3906 ot->description =
"Add a new render slot";
3939 ot->name =
"Remove Render Slot";
3940 ot->idname =
"IMAGE_OT_remove_render_slot";
3941 ot->description =
"Remove the current render slot";
3960 if (
G.is_rendering) {
3995 float sfra = scene->
r.
sfra, efra = scene->
r.
efra, framelen = region->
winx / (efra - sfra + 1);
3997 framenr = sfra +
event->mval[0] / framelen;
4033 switch (event->
type) {
4059 ot->name =
"Change Frame";
4060 ot->idname =
"IMAGE_OT_change_frame";
4061 ot->description =
"Interactively change the current frame number";
4086 if (sima->
image ==
nullptr) {
4098 ot->name =
"Open Cached Render";
4099 ot->idname =
"IMAGE_OT_read_viewlayers";
4100 ot->description =
"Read all the current scene's view layers from cache, as needed";
4122 if (re ==
nullptr) {
4153 if ((border.
xmin <= 0.0f && border.
xmax >= 1.0f && border.
ymin <= 0.0f && border.
ymax >= 1.0f) ||
4179 ot->name =
"Render Region";
4180 ot->description =
"Set the boundaries of the render region and enable render region";
4181 ot->idname =
"IMAGE_OT_render_border";
4215 ot->name =
"Clear Render Region";
4216 ot->description =
"Clear the boundaries of the render region and disable render region";
4217 ot->idname =
"IMAGE_OT_clear_render_border";
4265 if (
tile !=
nullptr) {
4277 if (ibuf !=
nullptr) {
4291 static const float default_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
4293 srna,
"color", 4,
nullptr, 0.0f,
FLT_MAX,
"Color",
"Default fill color", 0.0f, 1.0f);
4301 "Fill the image with a grid for UV map testing");
4302 prop =
RNA_def_int(srna,
"width", 1024, 1, INT_MAX,
"Width",
"Image width", 1, 16384);
4304 prop =
RNA_def_int(srna,
"height", 1024, 1, INT_MAX,
"Height",
"Image height", 1, 16384);
4309 srna,
"float",
false,
"32-bit Float",
"Create image with 32-bit floating-point bit depth");
4310 RNA_def_boolean(srna,
"alpha",
true,
"Alpha",
"Create an image with an alpha channel");
4339 for (
int tile_number = start_tile; tile_number <= end_tile; tile_number++) {
4342 if (
tile !=
nullptr) {
4347 last_tile_created =
tile;
4352 if (!last_tile_created) {
4369 int next_number = 0;
4371 next_number =
tile->tile_number + 1;
4372 if (
tile->next ==
nullptr ||
tile->next->tile_number > next_number) {
4387 IFACE_(
"Add Tile to Image"),
4415 ot->name =
"Add Tile";
4416 ot->description =
"Adds a tile to the image";
4417 ot->idname =
"IMAGE_OT_tile_add";
4434 "UDIM number of the tile",
4437 RNA_def_int(
ot->srna,
"count", 1, 1, INT_MAX,
"Count",
"How many tiles to add", 1, 1000);
4438 RNA_def_string(
ot->srna,
"label",
nullptr, 0,
"Label",
"Optional tile label");
4439 prop =
RNA_def_boolean(
ot->srna,
"fill",
true,
"Fill",
"Fill new tile with a generated image");
4477 ot->name =
"Remove Tile";
4478 ot->description =
"Removes a tile from the image";
4479 ot->idname =
"IMAGE_OT_tile_remove";
4527 IFACE_(
"Fill Tile With Generated Image"),
4539 ot->name =
"Fill Tile";
4540 ot->description =
"Fill the current tile with a generated image";
4541 ot->idname =
"IMAGE_OT_tile_fill";
Image * CTX_data_edit_image(const bContext *C)
SpaceImage * CTX_wm_space_image(const bContext *C)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_icon_changed(int icon_id)
int BKE_icon_id_ensure(struct ID *id)
int BKE_image_get_tile_from_pos(Image *ima, const float uv[2], float r_uv[2], float r_ofs[2])
RenderSlot * BKE_image_get_renderslot(Image *ima, int index)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void BKE_image_user_frame_calc(Image *ima, ImageUser *iuser, int cfra)
bool BKE_image_has_filepath(const Image *ima)
void BKE_image_mark_dirty(Image *image, ImBuf *ibuf)
Image * BKE_image_load_exists_in_lib(Main *bmain, std::optional< Library * > owner_library, const char *filepath, bool *r_exists=nullptr)
Image * BKE_image_ensure_viewer(Main *bmain, int type, const char *name)
bool BKE_image_fill_tile(Image *ima, ImageTile *tile)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
RenderSlot * BKE_image_add_renderslot(Image *ima, const char *name)
void BKE_image_user_file_path(const ImageUser *iuser, const Image *ima, char *filepath)
bool BKE_image_memorypack(Image *ima)
void BKE_image_packfiles(ReportList *reports, Image *ima, const char *basepath)
bool BKE_image_is_dirty(Image *image)
Image * BKE_image_add_from_imbuf(Main *bmain, ImBuf *ibuf, const char *name)
void BKE_image_sort_tiles(Image *ima)
bool BKE_image_has_anim(Image *image)
void BKE_imageuser_default(ImageUser *iuser)
#define IMA_SIGNAL_SRC_CHANGE
bool BKE_image_is_multiview(const Image *ima)
#define IMA_SIGNAL_USER_NEW_IMAGE
void BKE_image_ensure_tile_token(char *filepath, size_t filepath_maxncpy)
#define IMA_SIGNAL_RELOAD
void BKE_image_free_views(Image *image)
bool BKE_image_has_packedfile(const Image *image)
bool BKE_image_remove_renderslot(Image *ima, ImageUser *iuser, int slot)
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
bool BKE_image_clear_renderslot(Image *ima, ImageUser *iuser, int slot)
void BKE_image_init_imageuser(Image *ima, ImageUser *iuser)
ImageTile * BKE_image_add_tile(Image *ima, int tile_number, const char *label)
bool BKE_image_remove_tile(Image *ima, ImageTile *tile)
bool BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
void BKE_image_partial_update_mark_full_update(Image *image)
Mark the whole image to be updated.
void BKE_image_free_packedfiles(Image *image)
bool BKE_image_is_dirty_writable(Image *image, bool *r_is_writable)
Image * BKE_image_add_generated(Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, const float color[4], bool stereo3d, bool is_data, bool tiled)
bool BKE_image_buffer_format_writable(ImBuf *ibuf)
bool BKE_image_save(ReportList *reports, Main *bmain, Image *ima, ImageUser *iuser, const ImageSaveOptions *opts)
bool BKE_image_save_options_init(ImageSaveOptions *opts, Main *bmain, Scene *scene, Image *ima, ImageUser *iuser, const bool guess_path, const bool save_as_render)
void BKE_image_save_options_update(ImageSaveOptions *opts, const Image *image)
void BKE_image_save_options_free(ImageSaveOptions *opts)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
void BKE_id_move_to_same_lib(Main &bmain, ID &id, const ID &owner_id)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
void BKE_mask_coord_to_image(struct Image *image, struct ImageUser *iuser, float r_co[2], const float co[2])
int BKE_packedfile_unpack_image(Main *bmain, ReportList *reports, Image *ima, enum ePF_FileStatus how)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_reports_free(ReportList *reports)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_reports_init(ReportList *reports, int flag)
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_file_is_writable(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_INLINE bool BLI_listbase_is_single(const ListBase *lb)
MINLINE int round_fl_to_int(float a)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE float power_of_2(float f)
void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
bool BLI_path_extension_check_array(const char *path, const char **ext_array) ATTR_NONNULL(1
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
void void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
const char * BLI_path_slash_rfind(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
void BLI_rctf_scale(rctf *rect, float scale)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
char * STRNCPY(char(&dst)[N], const char *src)
Platform independent time functions.
double BLI_time_now_seconds(void)
#define POINTER_AS_INT(i)
#define BLT_I18NCONTEXT_ID_IMAGE
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
struct SpaceImage SpaceImage
#define FRAMENUMBER_MIN_CLAMP(cfra)
#define NDOF_PIXELS_PER_SECOND
void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
ImBuf * ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile)
bool ED_space_image_check_show_maskedit(SpaceImage *sima, Object *obedit)
void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic)
ListBase ED_image_filesel_detect_sequences(blender::StringRefNull root_path, wmOperator *op, bool detect_udim)
bool ED_space_image_has_buffer(SpaceImage *sima)
bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit)
bool ED_image_slot_cycle(Image *image, int direction)
void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
bool ED_space_image_cursor_poll(bContext *C)
Image * ED_space_image(const SpaceImage *sima)
void ED_image_view_center_to_point(SpaceImage *sima, float x, float y)
bool ED_space_image_show_cache_and_mval_over(const SpaceImage *sima, ARegion *region, const int mval[2])
bool ED_mask_selected_minmax(const bContext *C, float min[2], float max[2], bool handles_as_control_point)
bool ED_maskedit_poll(bContext *C)
void ED_image_undo_push_begin_with_image(const char *name, Image *image, ImBuf *ibuf, ImageUser *iuser)
void ED_image_undo_push_begin_with_image_all_udims(const char *name, Image *image, ImageUser *iuser)
void ED_image_undo_push_end()
void ED_imapaint_clear_partial_redraw()
void ED_preview_kill_jobs(wmWindowManager *wm, Main *bmain)
void ED_area_tag_redraw(ScrArea *area)
void ED_region_tag_redraw(ARegion *region)
bool ED_operator_uvedit(bContext *C)
void ED_undo_push_op(bContext *C, wmOperator *op)
void unpack_menu(bContext *C, const char *opname, const char *id_name, const char *abs_name, const char *folder, PackedFile *pf)
void ED_imbuf_sample_cancel(bContext *C, wmOperator *op)
wmOperatorStatus ED_imbuf_sample_modal(bContext *C, wmOperator *op, const wmEvent *event)
bool ED_imbuf_sample_poll(bContext *C)
wmOperatorStatus ED_imbuf_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool ED_uvedit_minmax_multi(const Scene *scene, blender::Span< Object * > objects_edit, float r_min[2], float r_max[2])
void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], const ColorSpace *colorspace)
ImBuf * IMB_colormanagement_imbuf_for_write(ImBuf *ibuf, bool save_as_render, bool allocate_result, const ImageFormatData *image_format)
void IMB_byte_from_float(ImBuf *ibuf)
void IMB_freeImBuf(ImBuf *ibuf)
bool IMB_rotate_orthogonal(ImBuf *ibuf, int degrees)
bool IMB_save_image(ImBuf *ibuf, const char *filepath, const int flags)
bool IMB_scale(ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
@ IB_DISPLAY_BUFFER_INVALID
const char * imb_ext_movie[]
@ IMB_COLORMANAGE_IS_DATA
MovieCacheIter * IMB_moviecacheIter_new(MovieCache *cache)
void IMB_moviecacheIter_free(MovieCacheIter *iter)
bool IMB_moviecacheIter_done(MovieCacheIter *iter)
void IMB_moviecacheIter_step(MovieCacheIter *iter)
ImBuf * IMB_moviecacheIter_getImBuf(MovieCacheIter *iter)
Read Guarded memory(de)allocation.
void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, bool color_management)
@ UI_BUT_LABEL_ALIGN_NONE
eAutoPropButsReturn uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, bool(*check_prop)(PointerRNA *ptr, PropertyRNA *prop, void *user_data), void *user_data, PropertyRNA *prop_activate_init, eButLabelAlign label_align, bool compact)
void UI_context_active_but_prop_get_templateID(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop)
void uiTemplateImageFormatViews(uiLayout *layout, PointerRNA *imfptr, PointerRNA *ptr)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void UI_view2d_region_to_view_rctf(const View2D *v2d, const rctf *rect_src, rctf *rect_dst) ATTR_NONNULL()
#define ND_RENDER_OPTIONS
static wmOperatorStatus change_frame_exec(bContext *C, wmOperator *op)
static wmOperatorStatus change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static float frame_from_event(bContext *C, const wmEvent *event)
static bool change_frame_poll(bContext *C)
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool contains_as(const ForwardKey &key) const
static wmOperatorStatus view_center_cursor_exec(bContext *C, wmOperator *)
constexpr T degrees(T) RET
#define ID_IS_LINKED(_id)
#define ID_BLEND_PATH(_bmain, _id)
#define ID_IS_EDITABLE(_id)
bool space_image_main_region_poll(bContext *C)
static wmOperatorStatus image_match_len_exec(bContext *C, wmOperator *)
void IMAGE_OT_view_cursor_center(wmOperatorType *ot)
static wmOperatorStatus image_view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
static bool tile_remove_poll(bContext *C)
void IMAGE_OT_change_frame(wmOperatorType *ot)
int ED_image_save_all_modified_info(const Main *bmain, ReportList *reports)
static bool image_pack_poll(bContext *C)
static void image_filesel(bContext *C, wmOperator *op, const char *path)
void IMAGE_OT_save_sequence(wmOperatorType *ot)
static bool save_image_op(Main *bmain, Image *ima, ImageUser *iuser, wmOperator *op, const ImageSaveOptions *opts)
static bool image_has_valid_path(Image *ima)
static wmOperatorStatus image_unpack_invoke(bContext *C, wmOperator *op, const wmEvent *)
static bool image_should_be_saved(Image *ima, bool *r_is_format_writable)
static wmOperatorStatus image_sample_line_exec(bContext *C, wmOperator *op)
void IMAGE_OT_view_zoom(wmOperatorType *ot)
static wmOperatorStatus image_save_exec(bContext *C, wmOperator *op)
void IMAGE_OT_cycle_render_slot(wmOperatorType *ot)
void IMAGE_OT_match_movie_length(wmOperatorType *ot)
static void tile_add_draw(bContext *, wmOperator *op)
static wmOperatorStatus image_reload_exec(bContext *C, wmOperator *)
void IMAGE_OT_save_all_modified(wmOperatorType *ot)
void IMAGE_OT_save_as(wmOperatorType *ot)
static void image_save_options_from_op(Main *bmain, ImageSaveOptions *opts, wmOperator *op)
static bool image_view_selected_poll(bContext *C)
static wmOperatorStatus image_pack_exec(bContext *C, wmOperator *op)
void IMAGE_OT_sample(wmOperatorType *ot)
static wmOperatorStatus image_file_browse_exec(bContext *C, wmOperator *op)
static wmOperatorStatus image_scale_invoke(bContext *C, wmOperator *op, const wmEvent *)
static bool image_pack_test(Image *ima, const char **r_error_message)
static wmOperatorStatus image_open_invoke(bContext *C, wmOperator *op, const wmEvent *)
static bool image_open_draw_check_prop(PointerRNA *, PropertyRNA *prop, void *)
static wmOperatorStatus tile_add_invoke(bContext *C, wmOperator *op, const wmEvent *)
static void sima_zoom_set_factor(SpaceImage *sima, ARegion *region, float zoomfac, const float location[2], const bool zoom_to_pos)
static void image_new_cancel(bContext *, wmOperator *op)
static void image_view_pan_exit(bContext *C, wmOperator *op, bool cancel)
bool ED_image_should_save_modified(const Main *bmain)
static wmOperatorStatus image_remove_render_slot_exec(bContext *C, wmOperator *)
static void image_save_as_draw(bContext *, wmOperator *op)
static void image_view_zoom_cancel(bContext *C, wmOperator *op)
static void def_fill_tile(StructOrFunctionRNA *srna)
static Image * image_from_context(const bContext *C)
void IMAGE_OT_tile_fill(wmOperatorType *ot)
static bool tile_add_poll(bContext *C)
void IMAGE_OT_remove_render_slot(wmOperatorType *ot)
static bool image_clipboard_paste_poll(bContext *C)
static wmOperatorStatus image_scale_exec(bContext *C, wmOperator *op)
static wmOperatorStatus image_save_as_exec(bContext *C, wmOperator *op)
static bool image_save_as_check(bContext *C, wmOperator *op)
static wmOperatorStatus image_new_exec(bContext *C, wmOperator *op)
static bool do_fill_tile(PointerRNA *ptr, Image *ima, ImageTile *tile)
static wmOperatorStatus image_view_zoom_in_exec(bContext *C, wmOperator *op)
void IMAGE_OT_view_zoom_border(wmOperatorType *ot)
static bool image_from_context_has_data_poll(bContext *C)
static bool tile_fill_poll(bContext *C)
static wmOperatorStatus image_save_sequence_exec(bContext *C, wmOperator *op)
static wmOperatorStatus tile_remove_exec(bContext *C, wmOperator *)
static wmOperatorStatus image_view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void IMAGE_OT_reload(wmOperatorType *ot)
void IMAGE_OT_unpack(wmOperatorType *ot)
void IMAGE_OT_view_selected(wmOperatorType *ot)
void IMAGE_OT_tile_add(wmOperatorType *ot)
void IMAGE_OT_pack(wmOperatorType *ot)
void IMAGE_OT_open(wmOperatorType *ot)
void IMAGE_OT_read_viewlayers(wmOperatorType *ot)
static void image_view_all(SpaceImage *sima, ARegion *region, wmOperator *op)
static void image_operator_prop_allow_tokens(wmOperatorType *ot)
static bool image_save_as_poll(bContext *C)
static bool image_clipboard_copy_poll(bContext *C)
static wmOperatorStatus change_frame_exec(bContext *C, wmOperator *op)
static wmOperatorStatus image_add_render_slot_exec(bContext *C, wmOperator *)
static wmOperatorStatus image_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *)
void IMAGE_OT_invert(wmOperatorType *ot)
static void image_open_cancel(bContext *, wmOperator *op)
void IMAGE_OT_resize(wmOperatorType *ot)
void IMAGE_OT_clear_render_slot(wmOperatorType *ot)
static wmOperatorStatus tile_fill_exec(bContext *C, wmOperator *op)
void IMAGE_OT_view_zoom_in(wmOperatorType *ot)
void IMAGE_OT_view_zoom_out(wmOperatorType *ot)
void IMAGE_OT_rotate_orthogonal(wmOperatorType *ot)
static void tile_fill_draw(bContext *, wmOperator *op)
void IMAGE_OT_view_all(wmOperatorType *ot)
static wmOperatorStatus image_view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event)
void IMAGE_OT_render_border(wmOperatorType *ot)
static wmOperatorStatus image_read_viewlayers_exec(bContext *C, wmOperator *)
static wmOperatorStatus image_view_zoom_ratio_exec(bContext *C, wmOperator *op)
void IMAGE_OT_view_pan(wmOperatorType *ot)
static int frame_from_event(bContext *C, const wmEvent *event)
static void draw_fill_tile(PointerRNA *ptr, uiLayout *layout)
static wmOperatorStatus image_view_zoom_out_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus image_clipboard_copy_exec(bContext *C, wmOperator *op)
void IMAGE_OT_clipboard_copy(wmOperatorType *ot)
static wmOperatorStatus image_view_zoom_in_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus image_cycle_render_slot_exec(bContext *C, wmOperator *op)
static void image_view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event)
static bool image_not_packed_poll(bContext *C)
static wmOperatorStatus image_new_invoke(bContext *C, wmOperator *op, const wmEvent *)
static void image_save_as_free(wmOperator *op)
static wmOperatorStatus change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event)
static bool image_file_format_writable(Image *ima, ImageUser *iuser)
static bool image_should_be_saved_when_modified(Image *ima)
void IMAGE_OT_save(wmOperatorType *ot)
static wmOperatorStatus image_rotate_orthogonal_exec(bContext *C, wmOperator *op)
static wmOperatorStatus tile_add_exec(bContext *C, wmOperator *op)
static void image_save_as_cancel(bContext *, wmOperator *op)
static void image_open_draw(bContext *, wmOperator *op)
void IMAGE_OT_file_browse(wmOperatorType *ot)
static void image_view_pan_init(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus image_view_all_exec(bContext *C, wmOperator *op)
static wmOperatorStatus change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus image_save_all_modified_exec(bContext *C, wmOperator *op)
static wmOperatorStatus image_flip_exec(bContext *C, wmOperator *op)
static wmOperatorStatus image_save_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void image_view_zoom_exit(bContext *C, wmOperator *op, bool cancel)
static ImageSaveData * image_save_as_init(bContext *C, wmOperator *op)
void IMAGE_OT_clipboard_paste(wmOperatorType *ot)
static bool image_cycle_render_slot_poll(bContext *C)
static wmOperatorStatus image_view_zoom_out_exec(bContext *C, wmOperator *op)
static wmOperatorStatus image_sample_line_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus render_border_exec(bContext *C, wmOperator *op)
static bool image_save_as_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop, void *user_data)
static wmOperatorStatus view_cursor_center_exec(bContext *C, wmOperator *op)
void IMAGE_OT_add_render_slot(wmOperatorType *ot)
void IMAGE_OT_tile_remove(wmOperatorType *ot)
static wmOperatorStatus tile_fill_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus image_view_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void image_open_init(bContext *C, wmOperator *op)
static void tile_fill_init(PointerRNA *ptr, Image *ima, ImageTile *tile)
static wmOperatorStatus image_invert_exec(bContext *C, wmOperator *op)
static wmOperatorStatus image_unpack_exec(bContext *C, wmOperator *op)
bool space_image_main_region_poll(bContext *C)
bool ED_space_image_get_position(SpaceImage *sima, ARegion *region, const int mval[2], float r_fpos[2])
static Image * image_open_single(Main *bmain, Library *owner_library, wmOperator *op, const ImageFrameRange *range, const bool use_multiview)
void IMAGE_OT_flip(wmOperatorType *ot)
static bool image_save_all_modified_poll(bContext *C)
static wmOperatorStatus image_replace_invoke(bContext *C, wmOperator *op, const wmEvent *)
static bool image_should_pack_during_save_all(const Image *ima)
void IMAGE_OT_sample_line(wmOperatorType *ot)
static wmOperatorStatus image_view_zoom_exec(bContext *C, wmOperator *op)
void IMAGE_OT_replace(wmOperatorType *ot)
static void sima_zoom_set_from_bounds(SpaceImage *sima, ARegion *region, const rctf *bounds)
static bool change_frame_poll(bContext *C)
static ImageNewData * image_new_init(bContext *C, wmOperator *op)
static bool image_save_poll(bContext *C)
static void image_view_pan_cancel(bContext *C, wmOperator *op)
static wmOperatorStatus image_replace_exec(bContext *C, wmOperator *op)
static void sima_zoom_set(SpaceImage *sima, ARegion *region, float zoom, const float location[2], const bool zoom_to_pos)
static wmOperatorStatus image_file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus view_center_cursor_exec(bContext *C, wmOperator *)
static wmOperatorStatus image_view_pan_exec(bContext *C, wmOperator *op)
void IMAGE_OT_view_center_cursor(wmOperatorType *ot)
bool ED_image_save_all_modified(const bContext *C, ReportList *reports)
void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot)
static wmOperatorStatus image_view_zoom_border_exec(bContext *C, wmOperator *op)
static wmOperatorStatus image_open_exec(bContext *C, wmOperator *op)
static void image_new_draw(bContext *, wmOperator *op)
static wmOperatorStatus clear_render_border_exec(bContext *C, wmOperator *)
static ImageUser image_user_from_context_and_active_tile(const bContext *C, Image *ima)
@ GEN_CONTEXT_PAINT_CANVAS
@ GEN_CONTEXT_PAINT_STENCIL
void IMAGE_OT_new(wmOperatorType *ot)
static void change_frame_apply(bContext *C, wmOperator *op)
bool ED_space_image_color_sample(SpaceImage *sima, ARegion *region, const int mval[2], float r_col[3], bool *r_is_data)
static bool image_file_browse_poll(bContext *C)
static ImageUser * image_user_from_context(const bContext *C)
static void image_new_free(wmOperator *op)
void IMAGE_OT_clear_render_border(wmOperatorType *ot)
static bool space_image_main_area_not_uv_brush_poll(bContext *C)
static wmOperatorStatus image_clipboard_paste_exec(bContext *C, wmOperator *op)
static wmOperatorStatus image_view_selected_exec(bContext *C, wmOperator *)
void IMAGE_OT_curves_point_set(wmOperatorType *ot)
static bool image_from_context_editable_has_data_poll_active_tile(bContext *C)
static wmOperatorStatus image_clear_render_slot_exec(bContext *C, wmOperator *)
static void 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)
RenderData * RE_engine_get_render_data(Render *re)
const ccl_global KernelWorkTile * tile
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
int MOV_get_duration_frames(MovieReader *anim, IMB_Timecode_Type tc)
VecBase< float, 3 > float3
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen, int *r_len)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values)
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const char * RNA_property_identifier(const PropertyRNA *prop)
PointerRNA RNA_id_pointer_create(ID *id)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
const EnumPropertyItem rna_enum_image_generated_type_items[]
const EnumPropertyItem rna_enum_unpack_method_items[]
Render * RE_GetSceneRender(const Scene *scene)
bool RE_ReadRenderResult(Scene *scene, Scene *scenode)
struct ListBase bg_images
const ColorSpace * colorspace
char filepath[IMB_FILEPATH_SIZE]
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
ImBuf * mipmap[IMB_MIPMAP_LEVELS]
ImageFormatData im_format
ImageFormatData im_format
struct MovieCache * cache
struct ListBase packedfiles
struct Stereo3dFormat * stereo3d_format
LibraryRuntimeHandle * runtime
struct RenderResult * render
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
struct Histogram sample_line_hist
uiLayout & column(bool align)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)
wmEventModifierFlag modifier
struct ReportList * reports
struct wmOperatorType * type
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
void WM_cursor_wait(bool val)
int WM_userdef_event_type_from_keymap_type(int kmitype)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_main_add_notifier(uint type, void *reference)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
wmOperatorStatus WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
void WM_gesture_straightline_cancel(bContext *C, wmOperator *op)
wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_operator_properties_border_to_rctf(wmOperator *op, rctf *r_rect)
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
void WM_operator_properties_border(wmOperatorType *ot)
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
void WM_operator_properties_use_cursor_init(wmOperatorType *ot)
void WM_operator_properties_gesture_box_zoom(wmOperatorType *ot)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
wmOperatorStatus WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default)
bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const ImageFormatData *im_format)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)
ImBuf * WM_clipboard_image_get()
wmTimer * WM_event_timer_add(wmWindowManager *wm, wmWindow *win, const wmEventType event_type, const double time_step)
bool WM_clipboard_image_available()
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
bool WM_clipboard_image_set_byte_buffer(ImBuf *ibuf)