41 : path_(path), format_(
format), save_as_render_(save_as_render)
43 render_result_ = MEM_cnew<RenderResult>(
"Temporary Render Result For File Output");
45 render_result_->
rectx = size.x;
46 render_result_->
recty = size.y;
53 RenderLayer *render_layer = MEM_cnew<RenderLayer>(
"Render Layer For File Output.");
55 render_layer->
name[0] =
'\0';
58 format_.
flag &= ~R_IMF_FLAG_PREVIEW_JPG;
71 RenderView *render_view = MEM_cnew<RenderView>(
"Render View For File Output.");
78 RenderView *render_view = MEM_cnew<RenderView>(
"Render View For File Output.");
83 render_result_->
rectx, render_result_->
recty, channels * 8, 0);
89 const char *view_name,
97 RenderPass *render_pass = MEM_cnew<RenderPass>(
"Render Pass For File Output.");
103 const int channels_count =
BLI_strnlen(channels, 4);
106 render_pass->
channels = channels_count;
109 render_result_->
rectx, render_result_->
recty, channels_count * 8, 0);
116 meta_data_.
add(key, value);
126 for (
const auto &field : meta_data_.
items()) {
131 &reports, render_result_, scene,
true, path_.c_str(), &format_, save_as_render_);
145 return *file_outputs_.lookup_or_add_cb(
146 path, [&]() {
return std::make_unique<FileOutput>(path,
format, size, save_as_render); });
151 for (std::unique_ptr<FileOutput> &file_output : file_outputs_.values()) {
152 file_output->save(scene);
void BKE_render_result_stamp_info(Scene *scene, Object *camera, RenderResult *rr, bool allocate_only)
void BKE_render_result_stamp_data(RenderResult *rr, const char *key, const char *value)
bool BKE_image_render_write(ReportList *reports, RenderResult *rr, const Scene *scene, const bool stamp, const char *filepath_basis, const ImageFormatData *format=nullptr, bool save_as_render=true)
void BKE_reports_free(ReportList *reports)
void BKE_reports_init(ReportList *reports, int flag)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define STRNCPY(dst, src)
int char char int int int int size_t BLI_strnlen(const char *str, size_t maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
@ R_IMF_IMTYPE_MULTILAYER
void IMB_assign_float_buffer(ImBuf *ibuf, float *buffer_data, ImBufOwnership ownership)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
bool add(const Key &key, const Value &value)
ItemIterator items() const
FileOutput(const std::string &path, const ImageFormatData &format, int2 size, bool save_as_render)
void add_view(const char *view_name)
void add_pass(const char *pass_name, const char *view_name, const char *channels, float *buffer)
void add_meta_data(std::string key, std::string value)
FileOutput & get_file_output(std::string path, ImageFormatData format, int2 size, bool save_as_render)
void save_file_outputs(Scene *scene)
struct ImBuf * IMB_allocImBuf(unsigned int, unsigned int, unsigned char, unsigned int)
void RE_FreeRenderResult(RenderResult *rr)