Cleanup: Use const pointers for ImageSaveOptions and ImageFormatData
Use const pointers to ImageSaveOptions and ImageFormatData for API parameters where appropriate. Differential Revision: https://developer.blender.org/D15400
This commit is contained in:
parent
178868cf42
commit
675f6ef089
|
@ -97,7 +97,7 @@ int BKE_imbuf_write(struct ImBuf *ibuf, const char *name, const struct ImageForm
|
|||
*/
|
||||
int BKE_imbuf_write_as(struct ImBuf *ibuf,
|
||||
const char *name,
|
||||
struct ImageFormatData *imf,
|
||||
const struct ImageFormatData *imf,
|
||||
bool save_copy);
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,14 +48,14 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts,
|
|||
struct ImageUser *iuser,
|
||||
const bool guess_path,
|
||||
const bool save_as_render);
|
||||
void BKE_image_save_options_update(struct ImageSaveOptions *opts, struct Image *ima);
|
||||
void BKE_image_save_options_update(struct ImageSaveOptions *opts, const struct Image *ima);
|
||||
void BKE_image_save_options_free(struct ImageSaveOptions *opts);
|
||||
|
||||
bool BKE_image_save(struct ReportList *reports,
|
||||
struct Main *bmain,
|
||||
struct Image *ima,
|
||||
struct ImageUser *iuser,
|
||||
struct ImageSaveOptions *opts);
|
||||
const struct ImageSaveOptions *opts);
|
||||
|
||||
/* Render saving. */
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ void BKE_ffmpeg_filepath_get(char *string,
|
|||
const char *suffix);
|
||||
|
||||
void BKE_ffmpeg_preset_set(struct RenderData *rd, int preset);
|
||||
void BKE_ffmpeg_image_type_verify(struct RenderData *rd, struct ImageFormatData *imf);
|
||||
void BKE_ffmpeg_image_type_verify(struct RenderData *rd, const struct ImageFormatData *imf);
|
||||
bool BKE_ffmpeg_alpha_channel_is_supported(const struct RenderData *rd);
|
||||
|
||||
void *BKE_ffmpeg_context_create(void);
|
||||
|
|
|
@ -2475,7 +2475,10 @@ int BKE_imbuf_write(ImBuf *ibuf, const char *name, const ImageFormatData *imf)
|
|||
return ok;
|
||||
}
|
||||
|
||||
int BKE_imbuf_write_as(ImBuf *ibuf, const char *name, ImageFormatData *imf, const bool save_copy)
|
||||
int BKE_imbuf_write_as(ImBuf *ibuf,
|
||||
const char *name,
|
||||
const ImageFormatData *imf,
|
||||
const bool save_copy)
|
||||
{
|
||||
ImBuf ibuf_back = *ibuf;
|
||||
int ok;
|
||||
|
|
|
@ -204,7 +204,7 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts,
|
|||
return (ibuf != nullptr);
|
||||
}
|
||||
|
||||
void BKE_image_save_options_update(ImageSaveOptions *opts, Image *image)
|
||||
void BKE_image_save_options_update(ImageSaveOptions *opts, const Image *image)
|
||||
{
|
||||
/* Auto update color space when changing save as render and file type. */
|
||||
if (opts->save_as_render) {
|
||||
|
@ -272,7 +272,7 @@ static void image_save_post(ReportList *reports,
|
|||
Image *ima,
|
||||
ImBuf *ibuf,
|
||||
int ok,
|
||||
ImageSaveOptions *opts,
|
||||
const ImageSaveOptions *opts,
|
||||
int save_copy,
|
||||
const char *filepath,
|
||||
bool *r_colorspace_changed)
|
||||
|
@ -359,7 +359,7 @@ static void imbuf_save_post(ImBuf *ibuf, ImBuf *colormanaged_ibuf)
|
|||
static bool image_save_single(ReportList *reports,
|
||||
Image *ima,
|
||||
ImageUser *iuser,
|
||||
ImageSaveOptions *opts,
|
||||
const ImageSaveOptions *opts,
|
||||
bool *r_colorspace_changed)
|
||||
{
|
||||
void *lock;
|
||||
|
@ -375,7 +375,7 @@ static bool image_save_single(ReportList *reports,
|
|||
ImBuf *colormanaged_ibuf = nullptr;
|
||||
const bool save_copy = opts->save_copy;
|
||||
const bool save_as_render = opts->save_as_render;
|
||||
ImageFormatData *imf = &opts->im_format;
|
||||
const ImageFormatData *imf = &opts->im_format;
|
||||
|
||||
if (ima->type == IMA_TYPE_R_RESULT) {
|
||||
/* enforce user setting for RGB or RGBA, but skip BW */
|
||||
|
@ -620,7 +620,7 @@ static bool image_save_single(ReportList *reports,
|
|||
}
|
||||
|
||||
bool BKE_image_save(
|
||||
ReportList *reports, Main *bmain, Image *ima, ImageUser *iuser, ImageSaveOptions *opts)
|
||||
ReportList *reports, Main *bmain, Image *ima, ImageUser *iuser, const ImageSaveOptions *opts)
|
||||
{
|
||||
/* For saving a tiled image we need an iuser, so use a local one if there isn't already one. */
|
||||
ImageUser save_iuser;
|
||||
|
|
|
@ -1485,7 +1485,7 @@ void BKE_ffmpeg_preset_set(RenderData *rd, int preset)
|
|||
}
|
||||
}
|
||||
|
||||
void BKE_ffmpeg_image_type_verify(RenderData *rd, ImageFormatData *imf)
|
||||
void BKE_ffmpeg_image_type_verify(RenderData *rd, const ImageFormatData *imf)
|
||||
{
|
||||
int audio = 0;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ OutputOpenExrSingleLayerMultiViewOperation::OutputOpenExrSingleLayerMultiViewOpe
|
|||
const RenderData *rd,
|
||||
const bNodeTree *tree,
|
||||
DataType datatype,
|
||||
ImageFormatData *format,
|
||||
const ImageFormatData *format,
|
||||
const char *path,
|
||||
const char *view_name,
|
||||
const bool save_as_render)
|
||||
|
@ -243,7 +243,7 @@ OutputStereoOperation::OutputStereoOperation(const Scene *scene,
|
|||
const RenderData *rd,
|
||||
const bNodeTree *tree,
|
||||
DataType datatype,
|
||||
ImageFormatData *format,
|
||||
const ImageFormatData *format,
|
||||
const char *path,
|
||||
const char *name,
|
||||
const char *view_name,
|
||||
|
|
|
@ -22,7 +22,7 @@ class OutputOpenExrSingleLayerMultiViewOperation : public OutputSingleLayerOpera
|
|||
const RenderData *rd,
|
||||
const bNodeTree *tree,
|
||||
DataType datatype,
|
||||
ImageFormatData *format,
|
||||
const ImageFormatData *format,
|
||||
const char *path,
|
||||
const char *view_name,
|
||||
bool save_as_render);
|
||||
|
@ -57,7 +57,7 @@ class OutputStereoOperation : public OutputSingleLayerOperation {
|
|||
const RenderData *rd,
|
||||
const bNodeTree *tree,
|
||||
DataType datatype,
|
||||
struct ImageFormatData *format,
|
||||
const struct ImageFormatData *format,
|
||||
const char *path,
|
||||
const char *name,
|
||||
const char *view_name,
|
||||
|
|
|
@ -204,7 +204,7 @@ OutputSingleLayerOperation::OutputSingleLayerOperation(const Scene *scene,
|
|||
const RenderData *rd,
|
||||
const bNodeTree *tree,
|
||||
DataType datatype,
|
||||
ImageFormatData *format,
|
||||
const ImageFormatData *format,
|
||||
const char *path,
|
||||
const char *view_name,
|
||||
const bool save_as_render)
|
||||
|
|
|
@ -35,7 +35,7 @@ class OutputSingleLayerOperation : public MultiThreadedOperation {
|
|||
const RenderData *rd,
|
||||
const bNodeTree *tree,
|
||||
DataType datatype,
|
||||
ImageFormatData *format,
|
||||
const ImageFormatData *format,
|
||||
const char *path,
|
||||
const char *view_name,
|
||||
bool save_as_render);
|
||||
|
|
|
@ -324,7 +324,7 @@ static bool write_external_bake_pixels(const char *filepath,
|
|||
const int height,
|
||||
const int margin,
|
||||
const int margin_type,
|
||||
ImageFormatData *im_format,
|
||||
ImageFormatData const *im_format,
|
||||
const bool is_noncolor,
|
||||
Mesh const *mesh_eval,
|
||||
char const *uv_layer,
|
||||
|
|
|
@ -1830,7 +1830,7 @@ static void image_save_options_from_op(Main *bmain, ImageSaveOptions *opts, wmOp
|
|||
}
|
||||
|
||||
static bool save_image_op(
|
||||
Main *bmain, Image *ima, ImageUser *iuser, wmOperator *op, ImageSaveOptions *opts)
|
||||
Main *bmain, Image *ima, ImageUser *iuser, wmOperator *op, const ImageSaveOptions *opts)
|
||||
{
|
||||
WM_cursor_wait(true);
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ void ntreeCompositClearTags(struct bNodeTree *ntree);
|
|||
struct bNodeSocket *ntreeCompositOutputFileAddSocket(struct bNodeTree *ntree,
|
||||
struct bNode *node,
|
||||
const char *name,
|
||||
struct ImageFormatData *im_format);
|
||||
const struct ImageFormatData *im_format);
|
||||
|
||||
int ntreeCompositOutputFileRemoveActiveSocket(struct bNodeTree *ntree, struct bNode *node);
|
||||
void ntreeCompositOutputFileSetPath(struct bNode *node,
|
||||
|
|
|
@ -114,7 +114,7 @@ void ntreeCompositOutputFileUniqueLayer(ListBase *list,
|
|||
bNodeSocket *ntreeCompositOutputFileAddSocket(bNodeTree *ntree,
|
||||
bNode *node,
|
||||
const char *name,
|
||||
ImageFormatData *im_format)
|
||||
const ImageFormatData *im_format)
|
||||
{
|
||||
NodeImageMultiFile *nimf = (NodeImageMultiFile *)node->storage;
|
||||
bNodeSocket *sock = nodeAddStaticSocket(
|
||||
|
|
Loading…
Reference in New Issue