38#include "RNA_prototypes.hh"
75 scd->
dumpsx = dumprect_size[0];
76 scd->
dumpsy = dumprect_size[1];
100 const bool use_crop =
STREQ(op->
idname,
"SCREEN_OT_screenshot_area");
104 if (scd ==
nullptr) {
155 const bool use_crop =
STREQ(op->
idname,
"SCREEN_OT_screenshot_area");
161 if (area_test !=
nullptr) {
174 if (blendfile_path[0] !=
'\0') {
175 STRNCPY(filepath, blendfile_path);
208 return !
STREQ(prop_id,
"filepath");
224 uiDefAutoButsRNA(&layout,
262 ot->
name =
"Save Screenshot";
263 ot->
idname =
"SCREEN_OT_screenshot";
264 ot->
description =
"Capture a picture of the whole Blender window";
274 ot->
name =
"Save Screenshot (Editor)";
275 ot->
idname =
"SCREEN_OT_screenshot_area";
276 ot->
description =
"Capture a picture of an editor";
#define STRNCPY_UTF8(dst, src)
Read Blender memory allocation and freeing.
bool bool BLI_path_extension_strip(char *path) ATTR_NONNULL(1)
ScrArea * CTX_wm_area(const bContext *C)
char * STRNCPY(char(&dst)[N], const char *src)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
static void screenshot_data_free(wmOperator *op)
static bool screenshot_check(bContext *, wmOperator *op)
const char * RNA_property_identifier(const PropertyRNA *prop)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
static void screenshot_draw(bContext *C, wmOperator *op)
static bool screenshot_draw_check_prop(PointerRNA *, PropertyRNA *prop, void *)
static void screenshot_cancel(bContext *, wmOperator *op)
wmWindow * CTX_wm_window(const bContext *C)
uint8_t * WM_window_pixels_read(bContext *C, wmWindow *win, int r_size[2])
const char * BKE_main_blendfile_path_from_global()
static wmOperatorStatus screenshot_exec(bContext *C, wmOperator *op)
static int screenshot_data_create(bContext *C, wmOperator *op, ScrArea *area)
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 IMB_crop(ImBuf *ibuf, const int2 &rect_pos, const int2 &rect_size)
static wmOperatorStatus screenshot_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void SCREEN_OT_screenshot_area(wmOperatorType *ot)
@ R_IMF_IMTYPE_MULTILAYER
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< int32_t, 2 > int2
static void screen_screenshot_impl(wmOperatorType *ot)
void WM_redraw_windows(bContext *C)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void IMB_color_to_bw(ImBuf *ibuf)
void uiTemplateImageSettings(ui::Layout *layout, bContext *C, PointerRNA *imfptr, bool color_management, const char *panel_idname=nullptr)
void BKE_image_format_init(ImageFormatData *imf)
ScrArea ScrArea * BKE_screen_find_area_xy(const bScreen *screen, int spacetype, const int xy[2]) ATTR_NONNULL(1
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, ImBufFlags flags)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bool WM_operator_winactive(bContext *C)
bScreen * CTX_wm_screen(const bContext *C)
@ OPTYPE_DEPENDS_ON_CURSOR
std::string RNA_string_get(PointerRNA *ptr, const char *name)
static bool screenshot_poll(bContext *C)
bool BKE_imbuf_write(ImBuf *ibuf, const char *filepath, const ImageFormatData *imf)
void SCREEN_OT_screenshot(wmOperatorType *ot)
bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const ImageFormatData *im_format)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void assign_byte_data(uint8_t *data)
ImageFormatData im_format
void use_property_decorate_set(bool is_decorate)
void use_property_split_set(bool is_sep)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) check(bContext *C, wmOperator *op)
void(*) cancel(bContext *C, wmOperator *op)
void(*) ui(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports