From 7862b2fa13c0437d9c17eae78e7b79a421dacf05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 17 May 2012 22:55:28 +0000 Subject: style cleanup: compositor, pointer syntax, function brace placement, line length --- .../compositor/operations/COM_CropOperation.cpp | 38 ++++++++++++++-------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'source/blender/compositor/operations/COM_CropOperation.cpp') diff --git a/source/blender/compositor/operations/COM_CropOperation.cpp b/source/blender/compositor/operations/COM_CropOperation.cpp index 3c4e3428ec2..192ad8d0bda 100644 --- a/source/blender/compositor/operations/COM_CropOperation.cpp +++ b/source/blender/compositor/operations/COM_CropOperation.cpp @@ -23,22 +23,24 @@ #include "COM_CropOperation.h" #include "BLI_math.h" -CropBaseOperation::CropBaseOperation() :NodeOperation() { +CropBaseOperation::CropBaseOperation() :NodeOperation() +{ this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE); this->addOutputSocket(COM_DT_COLOR); this->inputOperation = NULL; this->settings = NULL; } -void CropBaseOperation::updateArea() { +void CropBaseOperation::updateArea() +{ SocketReader * inputReference = this->getInputSocketReader(0); float width = inputReference->getWidth(); float height = inputReference->getHeight(); if (this->relative) { - settings->x1= width * settings->fac_x1; - settings->x2= width * settings->fac_x2; - settings->y1= height * settings->fac_y1; - settings->y2= height * settings->fac_y2; + settings->x1 = width * settings->fac_x1; + settings->x2 = width * settings->fac_x2; + settings->y1 = height * settings->fac_y1; + settings->y2 = height * settings->fac_y2; } if (width <= settings->x1 + 1) settings->x1 = width - 1; @@ -55,19 +57,23 @@ void CropBaseOperation::updateArea() { this->ymin = MIN2(settings->y1, settings->y2); } -void CropBaseOperation::initExecution() { +void CropBaseOperation::initExecution() +{ this->inputOperation = this->getInputSocketReader(0); updateArea(); } -void CropBaseOperation::deinitExecution() { +void CropBaseOperation::deinitExecution() +{ this->inputOperation = NULL; } -CropOperation::CropOperation() :CropBaseOperation() { +CropOperation::CropOperation() :CropBaseOperation() +{ } -void CropOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { +void CropOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) +{ if ((x < this->xmax && x >= xmin) && (y < ymax && y >= ymin)) { inputOperation->read(color, x, y, sampler, inputBuffers); } @@ -79,10 +85,12 @@ void CropOperation::executePixel(float *color, float x, float y, PixelSampler sa } } -CropImageOperation::CropImageOperation() :CropBaseOperation() { +CropImageOperation::CropImageOperation() :CropBaseOperation() +{ } -bool CropImageOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) { +bool CropImageOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) +{ rcti newInput; newInput.xmax = input->xmax + this->xmin; @@ -93,13 +101,15 @@ bool CropImageOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } -void CropImageOperation::determineResolution(unsigned int resolution[], unsigned int preferedResolution[]) { +void CropImageOperation::determineResolution(unsigned int resolution[], unsigned int preferedResolution[]) +{ NodeOperation::determineResolution(resolution, preferedResolution); updateArea(); resolution[0] = this->xmax - this->xmin; resolution[1] = this->ymax - this->ymin; } -void CropImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { +void CropImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) +{ this->inputOperation->read(color, (x + this->xmin), (y + this->ymin), sampler, inputBuffers); } -- cgit v1.2.3