69#include "RNA_prototypes.hh"
100 SpaceImage *sima,
ARegion *region,
float zoom,
const float location[2],
const bool zoom_to_pos)
102 float oldzoom = sima->
zoom;
107 if (sima->
zoom < 0.1f || sima->
zoom > 4.0f) {
112 height *= sima->
zoom;
114 if ((width < 4) && (height < 4) && sima->
zoom < oldzoom) {
115 sima->
zoom = oldzoom;
118 sima->
zoom = oldzoom;
121 sima->
zoom = oldzoom;
125 if (zoom_to_pos && location) {
126 float aspx, aspy,
w, h;
134 sima->
xof += ((location[0] - 0.5f) *
w - sima->
xof) * (sima->
zoom - oldzoom) / sima->
zoom;
135 sima->
yof += ((location[1] - 0.5f) * h - sima->
yof) * (sima->
zoom - oldzoom) / sima->
zoom;
142 const float location[2],
143 const bool zoom_to_pos)
159 image_size[0] = image_size[0] * aspx;
160 image_size[1] = image_size[1] * aspy;
166 float size_xy[2],
size;
188 return (sima) ? sima->
image :
nullptr;
204 return (sima) ? &sima->
iuser :
nullptr;
213 iuser = *iuser_context;
233 if (ima ==
nullptr) {
270 float aspx, aspy, zoomx, zoomy,
w, h;
280 float xof = 0.0f, yof = 0.0f;
283 int x_tiles, y_tiles;
284 if (sima->
image ==
nullptr) {
289 x_tiles = y_tiles = 1;
291 int tile_x = (
tile->tile_number - 1001) % 10;
292 int tile_y = (
tile->tile_number - 1001) / 10;
293 x_tiles =
max_ii(x_tiles, tile_x + 1);
294 y_tiles =
max_ii(y_tiles, tile_y + 1);
297 xof = 0.5f * (x_tiles - 1.0f) *
w;
298 yof = 0.5f * (y_tiles - 1.0f) * h;
308 const int margin = 5;
310 zoomx =
float(width) / (
w + 2 * margin);
311 zoomy =
float(height) / (h + 2 * margin);
316 if ((
w >= width || h >= height) && (width > 0 && height > 0)) {
318 zoomy =
float(height) / h;
382 if (vpd->own_cursor) {
386 vpd->x =
event->xy[0];
387 vpd->y =
event->xy[1];
388 vpd->xof = sima->
xof;
389 vpd->yof = sima->
yof;
398 ViewPanData *vpd =
static_cast<ViewPanData *
>(op->
customdata);
401 sima->
xof = vpd->xof;
402 sima->
yof = vpd->yof;
406 if (vpd->own_cursor) {
418 sima->
xof += offset[0];
419 sima->
yof += offset[1];
432 offset[0] = (
event->prev_xy[0] -
event->xy[0]) / sima->
zoom;
433 offset[1] = (
event->prev_xy[1] -
event->xy[1]) / sima->
zoom;
447 ViewPanData *vpd =
static_cast<ViewPanData *
>(op->
customdata);
450 switch (event->
type) {
452 sima->
xof = vpd->xof;
453 sima->
yof = vpd->yof;
454 offset[0] = (vpd->x -
event->xy[0]) / sima->
zoom;
455 offset[1] = (vpd->y -
event->xy[1]) / sima->
zoom;
478 ot->name =
"Pan View";
479 ot->idname =
"IMAGE_OT_view_pan";
480 ot->description =
"Pan the view";
500 "Offset in floating-point units, 1.0 is the width and height of the image",
521 double timer_lastdraw;
542 if (vpd->own_cursor) {
546 vpd->origx =
event->xy[0];
547 vpd->origy =
event->xy[1];
548 vpd->zoom = sima->
zoom;
552 ®ion->
v2d, event->
mval[0], event->
mval[1], &vpd->location[0], &vpd->location[1]);
561 vpd->region = region;
569 ViewZoomData *vpd =
static_cast<ViewZoomData *
>(op->
customdata);
572 sima->
zoom = vpd->zoom;
580 if (vpd->own_cursor) {
609 float delta, factor, location[2];
612 ®ion->
v2d, event->
mval[0], event->
mval[1], &location[0], &location[1]);
614 delta =
event->prev_xy[0] -
event->xy[0] +
event->prev_xy[1] -
event->xy[1];
620 factor = 1.0f + delta / 300.0f;
641 const short viewzoom,
642 const short zoom_invert,
643 const bool zoom_to_pos)
650 delta =
float(
x - vpd->origx);
653 delta =
float(
y - vpd->origy);
657 delta =
x - vpd->origx +
y - vpd->origy;
660 delta /=
U.pixelsize;
668 float time_step =
float(time - vpd->timer_lastdraw);
670 zfac = 1.0f + ((delta / 20.0f) * time_step);
671 vpd->timer_lastdraw = time;
673 factor = (vpd->sima->zoom * zfac) / vpd->zoom;
676 factor = 1.0f + delta / 300.0f;
680 sima_zoom_set(vpd->sima, vpd->region, vpd->zoom * factor, vpd->location, zoom_to_pos);
686 ViewZoomData *vpd =
static_cast<ViewZoomData *
>(op->
customdata);
700 else if (event->
type == vpd->launch_event) {
706 switch (event_code) {
741 ot->name =
"Zoom View";
742 ot->idname =
"IMAGE_OT_view_zoom";
743 ot->description =
"Zoom in/out the image";
762 "Zoom factor, values higher than 1.0 zoom in, lower values zoom out",
772#ifdef WITH_INPUT_NDOF
795 const wmNDOFMotionData &ndof = *
static_cast<const wmNDOFMotionData *
>(
event->customdata);
798 blender::float3 pan_vec = ndof.time_delta * WM_event_ndof_translation_get_for_navigation(ndof);
803 sima->
xof += pan_vec[0];
804 sima->
yof += pan_vec[1];
814 ot->name =
"NDOF Pan/Zoom";
815 ot->idname =
"IMAGE_OT_view_ndof";
816 ot->description =
"Use a 3D mouse device to pan/zoom the view";
819 ot->invoke = image_view_ndof_invoke;
859 ot->name =
"Frame All";
860 ot->idname =
"IMAGE_OT_view_all";
861 ot->description =
"View the entire image";
871 prop =
RNA_def_boolean(
ot->srna,
"fit_view",
false,
"Fit View",
"Fit frame to the viewport");
905 ot->name =
"Cursor To Center View";
906 ot->description =
"Set 2D Cursor To Center View location";
907 ot->idname =
"IMAGE_OT_view_cursor_center";
914 prop =
RNA_def_boolean(
ot->srna,
"fit_view",
false,
"Fit View",
"Fit frame to the viewport");
939 ot->name =
"Center View to Cursor";
940 ot->description =
"Center the view so that the cursor is in the middle of the view";
941 ot->idname =
"IMAGE_OT_view_center_cursor";
973 scene, view_layer,
nullptr);
1010 ot->name =
"View Center";
1011 ot->idname =
"IMAGE_OT_view_selected";
1012 ot->description =
"View all selected UVs";
1049 ®ion->
v2d, event->
mval[0], event->
mval[1], &location[0], &location[1]);
1060 ot->name =
"Zoom In";
1061 ot->idname =
"IMAGE_OT_view_zoom_in";
1062 ot->description =
"Zoom in the image (centered around 2D cursor)";
1080 "Cursor location in screen coordinates",
1110 ®ion->
v2d, event->
mval[0], event->
mval[1], &location[0], &location[1]);
1121 ot->name =
"Zoom Out";
1122 ot->idname =
"IMAGE_OT_view_zoom_out";
1123 ot->description =
"Zoom out the image (centered around 2D cursor)";
1141 "Cursor location in screen coordinates",
1161 sima->
xof = int(sima->
xof);
1162 sima->
yof = int(sima->
yof);
1172 ot->name =
"View Zoom Ratio";
1173 ot->idname =
"IMAGE_OT_view_zoom_ratio";
1174 ot->description =
"Set zoom ratio of the view";
1190 "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out",
1217 sima_view_prev.xof = sima->
xof;
1218 sima_view_prev.yof = sima->
yof;
1219 sima_view_prev.zoom = sima->
zoom;
1225 sima->
xof = sima_view_prev.xof + (sima->
xof - sima_view_prev.xof);
1226 sima->
yof = sima_view_prev.yof + (sima->
yof - sima_view_prev.yof);
1227 sima->
zoom = sima_view_prev.zoom * (sima_view_prev.zoom / sima->
zoom);
1238 ot->name =
"Zoom to Border";
1239 ot->description =
"Zoom in the view to the nearest item contained in the border";
1240 ot->idname =
"IMAGE_OT_view_zoom_border";
1276 op->
customdata = iod = MEM_new<ImageOpenData>(__func__);
1293 const bool use_multiview)
1295 bool exists =
false;
1296 Image *ima =
nullptr;
1307 "Cannot read '%s': %s",
1309 errno ? strerror(errno) :
RPT_(
"unsupported image format"));
1321 if (use_multiview) {
1343 else if (range->
length > 1) {
1357 Image *ima =
nullptr;
1358 int frame_seq_len = 0;
1370 Library *owner_library = owner_id ? owner_id->
lib :
nullptr;
1380 if ((ima ==
nullptr) && ima_range) {
1382 frame_seq_len = range->length;
1383 frame_ofs = range->offset;
1391 if (ima ==
nullptr) {
1416 iuser = &sima->
iuser;
1421 iuser = &tex->
iuser;
1424 if (iuser ==
nullptr) {
1429 if (bgpic->ima == ima) {
1430 iuser = &bgpic->iuser;
1448 iuser->
offset = frame_ofs - 1;
1450 iuser->
scene = scene;
1469 const char *path =
U.textudir;
1470 Image *ima =
nullptr;
1477 if (ima ==
nullptr) {
1484 if (ima ==
nullptr) {
1530 return !
STR_ELEM(prop_id,
"filepath",
"directory",
"filename");
1560 ot->srna,
"allow_path_tokens",
true,
"",
"Allow the path to contain substitution tokens");
1567 ot->name =
"Open Image";
1568 ot->description =
"Open image";
1569 ot->idname =
"IMAGE_OT_open";
1593 "use_sequence_detection",
1596 "Automatically detect animated sequences in selected images (based on file names)");
1598 "use_udim_detecting",
1601 "Detect selected UDIM files and load all matching tiles");
1613 if (ima ==
nullptr) {
1703 ot->name =
"Browse Image";
1705 "Open an image file browser, hold Shift to open the file, Alt to browse containing "
1707 ot->idname =
"IMAGE_OT_file_browse";
1739 if (!ima || !iuser) {
1744 iuser = &tex->
iuser;
1765 ot->name =
"Match Movie Length";
1766 ot->description =
"Set image's user's length to the one of this video";
1767 ot->idname =
"IMAGE_OT_match_movie_length";
1847 ot->name =
"Replace Image";
1848 ot->idname =
"IMAGE_OT_replace";
1849 ot->description =
"Replace current image by another one from disk";
1978 if (isd ==
nullptr) {
2017 if (isd ==
nullptr) {
2036 return !(
STREQ(prop_id,
"filepath") ||
STREQ(prop_id,
"directory") ||
2037 STREQ(prop_id,
"filename") ||
2069 if (!save_as_render) {
2088 if (
G.is_rendering) {
2104 ot->name =
"Save As Image";
2105 ot->idname =
"IMAGE_OT_save_as";
2106 ot->description =
"Save the image with another name and/or settings";
2126 "Save image with render color management.\n"
2127 "For display image formats like PNG, apply view and display transform.\n"
2128 "For intermediate image formats like OpenEXR, use the default render output color space");
2134 "Create a new image file without modifying the current image in Blender");
2247 ot->name =
"Save Image";
2248 ot->idname =
"IMAGE_OT_save";
2249 ot->description =
"Save the image with current name and settings";
2269 ImBuf *ibuf, *first_ibuf =
nullptr;
2272 MovieCacheIter *iter;
2274 if (image ==
nullptr) {
2290 if (image->
cache !=
nullptr) {
2295 if (first_ibuf ==
nullptr) {
2338 ot->name =
"Save Sequence";
2339 ot->idname =
"IMAGE_OT_save_sequence";
2340 ot->description =
"Save a sequence of images";
2401 int num_saveable_images = 0;
2404 ima =
static_cast<Image *
>(ima->id.next))
2406 bool is_format_writable;
2411 num_saveable_images++;
2416 "Packed library image cannot be saved: \"%s\" from \"%s\"",
2418 ima->id.lib->filepath);
2421 else if (!is_format_writable) {
2424 "Image cannot be saved, use a different file format: \"%s\"",
2429 num_saveable_images++;
2433 "Multiple images cannot be saved to an identical path: \"%s\"",
2437 unique_paths.
add(ima->filepath);
2443 "Image cannot be saved, no valid file path: \"%s\"",
2450 return num_saveable_images;
2462 ima =
static_cast<Image *
>(ima->id.next))
2464 bool is_format_writable;
2470 else if (is_format_writable) {
2475 bool saved_successfully =
BKE_image_save(reports, bmain, ima,
nullptr, &opts);
2476 ok = ok && saved_successfully;
2489 return num_files > 0;
2501 ot->name =
"Save All Modified";
2502 ot->idname =
"IMAGE_OT_save_all_modified";
2503 ot->description =
"Save all modified images";
2544 ot->name =
"Reload Image";
2545 ot->idname =
"IMAGE_OT_reload";
2546 ot->description =
"Reload current image from disk";
2561#define IMA_DEF_NAME N_("Untitled")
2601 int width, height, floatbuf, gen_type, alpha;
2650 if (
data->pprop.prop) {
2655 if (
data->pprop.ptr.owner_id) {
2691 C, op, 300,
IFACE_(
"Create a New Image"),
IFACE_(
"New Image"));
2720 col[0].label(
"", ICON_NONE);
2721 col[1].prop( op->
ptr,
"use_stereo_3d", 0, std::nullopt, ICON_NONE);
2734 static const float default_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
2737 ot->name =
"New Image";
2738 ot->description =
"Create a new image";
2739 ot->idname =
"IMAGE_OT_new";
2753 prop =
RNA_def_int(
ot->srna,
"width", 1024, 1, INT_MAX,
"Width",
"Image width", 1, 16384);
2755 prop =
RNA_def_int(
ot->srna,
"height", 1024, 1, INT_MAX,
"Height",
"Image height", 1, 16384);
2758 ot->srna,
"color", 4,
nullptr, 0.0f,
FLT_MAX,
"Color",
"Default fill color", 0.0f, 1.0f);
2761 RNA_def_boolean(
ot->srna,
"alpha",
true,
"Alpha",
"Create an image with an alpha channel");
2767 "Fill the image with a grid for UV map testing");
2772 "Create image with 32-bit floating-point bit depth");
2775 ot->srna,
"use_stereo_3d",
false,
"Stereo 3D",
"Create an image with left and right views");
2777 prop =
RNA_def_boolean(
ot->srna,
"tiled",
false,
"Tiled",
"Create a tiled image");
2797 if (ibuf ==
nullptr) {
2805 if (!use_flip_x && !use_flip_y) {
2816 const int size_x = ibuf->
x;
2817 const int size_y = ibuf->
y;
2822 float *orig_float_pixels =
static_cast<float *
>(
MEM_dupallocN(float_pixels));
2823 for (
int x = 0;
x < size_x;
x++) {
2824 const int source_pixel_x = use_flip_x ? size_x -
x - 1 :
x;
2825 for (
int y = 0;
y < size_y;
y++) {
2826 const int source_pixel_y = use_flip_y ? size_y -
y - 1 :
y;
2828 const float *source_pixel =
2829 &orig_float_pixels[4 * (source_pixel_x + source_pixel_y * size_x)];
2830 float *target_pixel = &float_pixels[4 * (
x +
y * size_x)];
2844 for (
int x = 0;
x < size_x;
x++) {
2845 const int source_pixel_x = use_flip_x ? size_x -
x - 1 :
x;
2846 for (
int y = 0;
y < size_y;
y++) {
2847 const int source_pixel_y = use_flip_y ? size_y -
y - 1 :
y;
2849 const uchar *source_pixel =
2850 &orig_char_pixels[4 * (source_pixel_x + source_pixel_y * size_x)];
2851 uchar *target_pixel = &char_pixels[4 * (
x +
y * size_x)];
2881 ot->name =
"Flip Image";
2882 ot->idname =
"IMAGE_OT_flip";
2883 ot->description =
"Flip the image";
2892 ot->srna,
"use_flip_x",
false,
"Horizontal",
"Flip the image horizontally");
2894 prop =
RNA_def_boolean(
ot->srna,
"use_flip_y",
false,
"Vertical",
"Flip the image vertically");
2915 if (ibuf ==
nullptr) {
2951 {90,
"90", 0,
"90 Degrees",
"Rotate 90 degrees clockwise"},
2952 {180,
"180", 0,
"180 Degrees",
"Rotate 180 degrees clockwise"},
2953 {270,
"270", 0,
"270 Degrees",
"Rotate 270 degrees clockwise"},
2954 {0,
nullptr, 0,
nullptr,
nullptr},
2958 ot->name =
"Rotate Image Orthogonal";
2959 ot->idname =
"IMAGE_OT_rotate_orthogonal";
2960 ot->description =
"Rotate the image";
2970 orthogonal_rotation_items,
2973 "Amount of rotation in degrees (90, 180, 270)");
2990 if (ima ==
nullptr) {
3003 bool changed =
false;
3014 ibuf, save_as_render,
true, &image_format);
3020 if (colormanaged_ibuf != ibuf) {
3044 ot->name =
"Copy Image";
3045 ot->idname =
"IMAGE_OT_clipboard_copy";
3046 ot->description =
"Copy the image to the clipboard";
3064 bool changed =
false;
3105 ot->name =
"Paste Image";
3106 ot->idname =
"IMAGE_OT_clipboard_paste";
3107 ot->description =
"Paste new image from the clipboard";
3139 if (ibuf ==
nullptr) {
3154 for (
i =
size_t(ibuf->
x) * ibuf->
y;
i > 0;
i--, fp += 4) {
3156 fp[0] = 1.0f - fp[0];
3159 fp[1] = 1.0f - fp[1];
3162 fp[2] = 1.0f - fp[2];
3165 fp[3] = 1.0f - fp[3];
3176 for (
i =
size_t(ibuf->
x) * ibuf->
y;
i > 0;
i--, cp += 4) {
3178 cp[0] = 255 - cp[0];
3181 cp[1] = 255 - cp[1];
3184 cp[2] = 255 - cp[2];
3187 cp[3] = 255 - cp[3];
3217 ot->name =
"Invert Channels";
3218 ot->idname =
"IMAGE_OT_invert";
3219 ot->description =
"Invert image's channels";
3226 prop =
RNA_def_boolean(
ot->srna,
"invert_r",
false,
"Red",
"Invert red channel");
3228 prop =
RNA_def_boolean(
ot->srna,
"invert_g",
false,
"Green",
"Invert green channel");
3230 prop =
RNA_def_boolean(
ot->srna,
"invert_b",
false,
"Blue",
"Invert blue channel");
3232 prop =
RNA_def_boolean(
ot->srna,
"invert_a",
false,
"Alpha",
"Invert alpha channel");
3252 const int size[2] = {ibuf->
x, ibuf->
y};
3257 C, op, 200,
IFACE_(
"Scale Image to New Size"),
IFACE_(
"Resize"));
3273 if (!is_scaling_all) {
3276 if (ibuf ==
nullptr) {
3302 iuser.
tile = current_tile->tile_number;
3306 if (ibuf ==
nullptr) {
3316 iuser.
tile = current_tile->tile_number;
3350 ot->name =
"Resize Image";
3351 ot->idname =
"IMAGE_OT_resize";
3352 ot->description =
"Resize the image";
3362 ot->srna,
"all_udims",
false,
"All UDIM Tiles",
"Scale all the image's UDIM tiles");
3381 *r_error_message =
"Image is not editable";
3386 *r_error_message =
"Movies or image sequences do not support packing";
3396 const char *error_message =
nullptr;
3402 if (error_message) {
3413 const char *error_message =
nullptr;
3415 if (error_message) {
3436 ot->name =
"Pack Image";
3437 ot->description =
"Pack an image as embedded data into the .blend file";
3438 ot->idname =
"IMAGE_OT_pack";
3487 "AutoPack is enabled, so image will be packed again on file save");
3525 "AutoPack is enabled, so image will be packed again on file save");
3543 ot->name =
"Unpack Image";
3544 ot->description =
"Save an image packed in the .blend file to disk";
3545 ot->idname =
"IMAGE_OT_unpack";
3560 ot->srna,
"id",
nullptr,
MAX_ID_NAME - 2,
"Image Name",
"Image data-block name to unpack");
3577 if (ibuf ==
nullptr) {
3589 SpaceImage *sima,
ARegion *region,
const int mval[2],
float r_col[3],
bool *r_is_data)
3594 if (sima->
image ==
nullptr) {
3605 if (ibuf ==
nullptr) {
3610 if (uv[0] >= 0.0f && uv[1] >= 0.0f && uv[0] < 1.0f && uv[1] < 1.0f) {
3613 int x = int(uv[0] * ibuf->
x),
y = int(uv[1] * ibuf->
y);
3642 ot->name =
"Sample Color";
3643 ot->idname =
"IMAGE_OT_sample";
3644 ot->description =
"Use mouse to sample a color in current image";
3656 prop =
RNA_def_int(
ot->srna,
"size", 1, 1, 128,
"Sample Size",
"", 1, 64);
3679 float uv1[2], uv2[2], ofs[2];
3691 if (ibuf ==
nullptr) {
3736 ot->name =
"Sample Line";
3737 ot->idname =
"IMAGE_OT_sample_line";
3738 ot->description =
"Sample a line and show it in Scope panels";
3762 {0,
"BLACK_POINT", 0,
"Black Point",
""},
3763 {1,
"WHITE_POINT", 0,
"White Point",
""},
3764 {0,
nullptr, 0,
nullptr,
nullptr},
3768 ot->name =
"Set Curves Point";
3769 ot->idname =
"IMAGE_OT_curves_point_set";
3770 ot->description =
"Set black point or white point for curves";
3783 ot->srna,
"point", point_items, 0,
"Point",
"Set black point or white point for curves");
3786 prop =
RNA_def_int(
ot->srna,
"size", 1, 1, 128,
"Sample Size",
"", 1, 64);
3827 ot->name =
"Cycle Render Slot";
3828 ot->idname =
"IMAGE_OT_cycle_render_slot";
3829 ot->description =
"Cycle through all non-void render slots";
3864 ot->name =
"Clear Render Slot";
3865 ot->idname =
"IMAGE_OT_clear_render_slot";
3866 ot->description =
"Clear the currently selected render slot";
3897 ot->name =
"Add Render Slot";
3898 ot->idname =
"IMAGE_OT_add_render_slot";
3899 ot->description =
"Add a new render slot";
3932 ot->name =
"Remove Render Slot";
3933 ot->idname =
"IMAGE_OT_remove_render_slot";
3934 ot->description =
"Remove the current render slot";
3953 if (
G.is_rendering) {
3988 float sfra = scene->
r.
sfra, efra = scene->
r.
efra, framelen = region->
winx / (efra - sfra + 1);
3990 framenr = sfra +
event->mval[0] / framelen;
4026 switch (event->
type) {
4052 ot->name =
"Change Frame";
4053 ot->idname =
"IMAGE_OT_change_frame";
4054 ot->description =
"Interactively change the current frame number";
4079 if (sima->
image ==
nullptr) {
4091 ot->name =
"Open Cached Render";
4092 ot->idname =
"IMAGE_OT_read_viewlayers";
4093 ot->description =
"Read all the current scene's view layers from cache, as needed";
4115 if (re ==
nullptr) {
4146 if ((border.
xmin <= 0.0f && border.
xmax >= 1.0f && border.
ymin <= 0.0f && border.
ymax >= 1.0f) ||
4172 ot->name =
"Render Region";
4173 ot->description =
"Set the boundaries of the render region and enable render region";
4174 ot->idname =
"IMAGE_OT_render_border";
4208 ot->name =
"Clear Render Region";
4209 ot->description =
"Clear the boundaries of the render region and disable render region";
4210 ot->idname =
"IMAGE_OT_clear_render_border";
4258 if (
tile !=
nullptr) {
4270 if (ibuf !=
nullptr) {
4284 static const float default_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
4286 srna,
"color", 4,
nullptr, 0.0f,
FLT_MAX,
"Color",
"Default fill color", 0.0f, 1.0f);
4294 "Fill the image with a grid for UV map testing");
4295 prop =
RNA_def_int(srna,
"width", 1024, 1, INT_MAX,
"Width",
"Image width", 1, 16384);
4297 prop =
RNA_def_int(srna,
"height", 1024, 1, INT_MAX,
"Height",
"Image height", 1, 16384);
4302 srna,
"float",
false,
"32-bit Float",
"Create image with 32-bit floating-point bit depth");
4303 RNA_def_boolean(srna,
"alpha",
true,
"Alpha",
"Create an image with an alpha channel");
4332 for (
int tile_number = start_tile; tile_number <= end_tile; tile_number++) {
4335 if (
tile !=
nullptr) {
4340 last_tile_created =
tile;
4344 if (!last_tile_created) {
4361 int next_number = 0;
4363 next_number =
tile->tile_number + 1;
4364 if (
tile->next ==
nullptr ||
tile->next->tile_number > next_number) {
4379 IFACE_(
"Add Tile to Image"),
4407 ot->name =
"Add Tile";
4408 ot->description =
"Adds a tile to the image";
4409 ot->idname =
"IMAGE_OT_tile_add";
4426 "UDIM number of the tile",
4429 RNA_def_int(
ot->srna,
"count", 1, 1, INT_MAX,
"Count",
"How many tiles to add", 1, 1000);
4430 RNA_def_string(
ot->srna,
"label",
nullptr, 0,
"Label",
"Optional tile label");
4431 prop =
RNA_def_boolean(
ot->srna,
"fill",
true,
"Fill",
"Fill new tile with a generated image");
4469 ot->name =
"Remove Tile";
4470 ot->description =
"Removes a tile from the image";
4471 ot->idname =
"IMAGE_OT_tile_remove";
4519 IFACE_(
"Fill Tile With Generated Image"),
4531 ot->name =
"Fill Tile";
4532 ot->description =
"Fill the current tile with a generated image";
4533 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)
MINLINE 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)
#define ID_IS_LINKED(_id)
#define ID_BLEND_PATH(_bmain, _id)
#define ID_IS_EDITABLE(_id)
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)
ListBase ED_image_filesel_detect_sequences(blender::StringRefNull blendfile_path, blender::StringRefNull root_path, wmOperator *op, bool detect_udim)
void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic)
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, bContext *C, PointerRNA *imfptr, bool color_management, const char *panel_idname=nullptr)
@ 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 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
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)
@ GEN_CONTEXT_PAINT_CANVAS
@ GEN_CONTEXT_PAINT_STENCIL
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_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_save_as_draw(bContext *C, 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)
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)
int RNA_int_get(PointerRNA *ptr, const char *name)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
float RNA_float_get(PointerRNA *ptr, const char *name)
std::string RNA_string_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
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
void use_property_decorate_set(bool is_sep)
uiLayout & column(bool align)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
void use_property_split_set(bool value)
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)
bool WM_cursor_modal_is_set_ok(const wmWindow *win)
int WM_userdef_event_type_from_keymap_type(int kmitype)
wmOperatorStatus WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
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)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
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, std::optional< std::string > message)
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)