Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-06-22 19:06:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-22 19:06:52 +0400
commit0b0ac3aa9ee94ad8020639e9d1df4c94a23a3fcf (patch)
tree3652f4e913b6231abc4708bea8202ad651f1a547 /source/blender/compositor/operations
parent590f5fdbdfc2357c5b0490a406c9c39cf66de50a (diff)
remove scene from new compositor classes. only needs RenderData
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.cpp12
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_OutputFileOperation.cpp20
-rw-r--r--source/blender/compositor/operations/COM_OutputFileOperation.h8
-rw-r--r--source/blender/compositor/operations/COM_TextureOperation.cpp6
-rw-r--r--source/blender/compositor/operations/COM_TextureOperation.h4
6 files changed, 27 insertions, 27 deletions
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp
index 2b1a804b432..622cd50f349 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.cpp
+++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp
@@ -41,7 +41,7 @@ CompositorOperation::CompositorOperation() : NodeOperation()
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
- this->setScene(NULL);
+ this->setRenderData(NULL);
this->outputBuffer = NULL;
this->imageInput = NULL;
this->alphaInput = NULL;
@@ -60,8 +60,8 @@ void CompositorOperation::initExecution()
void CompositorOperation::deinitExecution()
{
if (!isBreaked()) {
- const Scene *scene = this->scene;
- Render *re = RE_GetRender(scene->id.name);
+ const RenderData *rd = this->rd;
+ Render *re = RE_GetRender_FromData(rd);
RenderResult *rr = RE_AcquireResultWrite(re);
if (rr) {
if (rr->rectf != NULL) {
@@ -127,12 +127,12 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber, Mem
void CompositorOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
{
- int width = this->scene->r.xsch * this->scene->r.size / 100;
- int height = this->scene->r.ysch * this->scene->r.size / 100;
+ int width = this->rd->xsch * this->rd->size / 100;
+ int height = this->rd->ysch * this->rd->size / 100;
// check actual render resolution with cropping it may differ with cropped border.rendering
// FIX for: [31777] Border Crop gives black (easy)
- Render *re = RE_GetRender(this->scene->id.name);
+ Render *re = RE_GetRender_FromData(this->rd);
if (re) {
RenderResult *rr = RE_AcquireResultRead(re);
if (rr) {
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.h b/source/blender/compositor/operations/COM_CompositorOperation.h
index 0129c953946..280f39b7729 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.h
+++ b/source/blender/compositor/operations/COM_CompositorOperation.h
@@ -34,7 +34,7 @@ private:
/**
* @brief local reference to the scene
*/
- const Scene *scene;
+ const RenderData *rd;
/**
* @brief reference to the output float buffer
@@ -53,7 +53,7 @@ private:
public:
CompositorOperation();
void executeRegion(rcti *rect, unsigned int tileNumber, MemoryBuffer **memoryBuffers);
- void setScene(const Scene *scene) { this->scene = scene; }
+ void setRenderData(const RenderData *rd) { this->rd = rd; }
bool isOutputOperation(bool rendering) const { return true; }
void initExecution();
void deinitExecution();
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
index e71178a811d..c0aa139b032 100644
--- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp
+++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
@@ -92,9 +92,9 @@ static void write_buffer_rect(rcti *rect, MemoryBuffer **memoryBuffers, const bN
OutputSingleLayerOperation::OutputSingleLayerOperation(
- const Scene *scene, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path)
+ const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path)
{
- this->scene = scene;
+ this->rd = rd;
this->tree = tree;
this->addInputSocket(datatype);
@@ -130,13 +130,13 @@ void OutputSingleLayerOperation::deinitExecution()
ibuf->channels = size;
ibuf->rect_float = this->outputBuffer;
ibuf->mall |= IB_rectfloat;
- ibuf->dither = scene->r.dither_intensity;
+ ibuf->dither = this->rd->dither_intensity;
- if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+ if (this->rd->color_mgt_flag & R_COLOR_MANAGEMENT)
ibuf->profile = IB_PROFILE_LINEAR_RGB;
- BKE_makepicstring(filename, this->path, bmain->name, this->scene->r.cfra, this->format->imtype,
- (this->scene->r.scemode & R_EXTENSION), true);
+ BKE_makepicstring(filename, this->path, bmain->name, this->rd->cfra, this->format->imtype,
+ (this->rd->scemode & R_EXTENSION), true);
if (0 == BKE_imbuf_write(ibuf, filename, this->format))
printf("Cannot save Node File Output to %s\n", filename);
@@ -160,9 +160,9 @@ OutputOpenExrLayer::OutputOpenExrLayer(const char *name, DataType datatype)
}
OutputOpenExrMultiLayerOperation::OutputOpenExrMultiLayerOperation(
- const Scene *scene, const bNodeTree *tree, const char *path, char exr_codec)
+ const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec)
{
- this->scene = scene;
+ this->rd = rd;
this->tree = tree;
BLI_strncpy(this->path, path, sizeof(this->path));
@@ -199,8 +199,8 @@ void OutputOpenExrMultiLayerOperation::deinitExecution()
char filename[FILE_MAX];
void *exrhandle = IMB_exr_get_handle();
- BKE_makepicstring(filename, this->path, bmain->name, this->scene->r.cfra, R_IMF_IMTYPE_MULTILAYER,
- (this->scene->r.scemode & R_EXTENSION), true);
+ BKE_makepicstring(filename, this->path, bmain->name, this->rd->cfra, R_IMF_IMTYPE_MULTILAYER,
+ (this->rd->scemode & R_EXTENSION), true);
BLI_make_existing_file(filename);
for (unsigned int i = 0; i < layers.size(); ++i) {
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.h b/source/blender/compositor/operations/COM_OutputFileOperation.h
index cfc5f7e41f2..25ee5b31ec0 100644
--- a/source/blender/compositor/operations/COM_OutputFileOperation.h
+++ b/source/blender/compositor/operations/COM_OutputFileOperation.h
@@ -32,7 +32,7 @@
/* Writes the image to a single-layer file. */
class OutputSingleLayerOperation : public NodeOperation {
private:
- const Scene *scene;
+ const RenderData *rd;
const bNodeTree *tree;
ImageFormatData *format;
@@ -43,7 +43,7 @@ private:
SocketReader *imageInput;
public:
- OutputSingleLayerOperation(const Scene *scene, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path);
+ OutputSingleLayerOperation(const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path);
void executeRegion(rcti *rect, unsigned int tileNumber, MemoryBuffer **memoryBuffers);
bool isOutputOperation(bool rendering) const { return true; }
@@ -67,7 +67,7 @@ class OutputOpenExrMultiLayerOperation : public NodeOperation {
private:
typedef std::vector<OutputOpenExrLayer> LayerList;
- const Scene *scene;
+ const RenderData *rd;
const bNodeTree *tree;
char path[FILE_MAX];
@@ -75,7 +75,7 @@ private:
LayerList layers;
public:
- OutputOpenExrMultiLayerOperation(const Scene *scene, const bNodeTree *tree, const char *path, char exr_codec);
+ OutputOpenExrMultiLayerOperation(const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec);
void add_layer(const char *name, DataType datatype);
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp
index 072528f3fc6..dbdd17adbe4 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.cpp
+++ b/source/blender/compositor/operations/COM_TextureOperation.cpp
@@ -32,7 +32,7 @@ TextureBaseOperation::TextureBaseOperation() : NodeOperation()
this->texture = NULL;
this->inputSize = NULL;
this->inputOffset = NULL;
- this->scene = NULL;
+ this->rd = NULL;
}
TextureOperation::TextureOperation() : TextureBaseOperation()
{
@@ -57,8 +57,8 @@ void TextureBaseOperation::deinitExecution()
void TextureBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
{
if (preferredResolution[0] == 0 || preferredResolution[1] == 0) {
- int width = this->scene->r.xsch * this->scene->r.size / 100;
- int height = this->scene->r.ysch * this->scene->r.size / 100;
+ int width = this->rd->xsch * this->rd->size / 100;
+ int height = this->rd->ysch * this->rd->size / 100;
resolution[0] = width;
resolution[1] = height;
}
diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h
index e862a1f1910..14714242511 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.h
+++ b/source/blender/compositor/operations/COM_TextureOperation.h
@@ -43,7 +43,7 @@ extern "C" {
class TextureBaseOperation : public NodeOperation {
private:
Tex *texture;
- const Scene *scene;
+ const RenderData *rd;
SocketReader *inputSize;
SocketReader *inputOffset;
@@ -65,7 +65,7 @@ public:
void setTexture(Tex *texture) { this->texture = texture; }
void initExecution();
void deinitExecution();
- void setScene(const Scene *scene) { this->scene = scene; }
+ void setRenderData(const RenderData *rd) { this->rd = rd; }
};
class TextureOperation : public TextureBaseOperation {