diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/compositor/intern/COM_SocketReader.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/compositor/intern/COM_SocketReader.h')
-rw-r--r-- | source/blender/compositor/intern/COM_SocketReader.h | 178 |
1 files changed, 100 insertions, 78 deletions
diff --git a/source/blender/compositor/intern/COM_SocketReader.h b/source/blender/compositor/intern/COM_SocketReader.h index dfab1084dae..82bebd5e7b9 100644 --- a/source/blender/compositor/intern/COM_SocketReader.h +++ b/source/blender/compositor/intern/COM_SocketReader.h @@ -22,13 +22,13 @@ #include "COM_defines.h" #ifdef WITH_CXX_GUARDEDALLOC -#include "MEM_guardedalloc.h" +# include "MEM_guardedalloc.h" #endif typedef enum PixelSampler { - COM_PS_NEAREST = 0, - COM_PS_BILINEAR = 1, - COM_PS_BICUBIC = 2, + COM_PS_NEAREST = 0, + COM_PS_BILINEAR = 1, + COM_PS_BICUBIC = 2, } PixelSampler; class MemoryBuffer; @@ -38,82 +38,104 @@ class MemoryBuffer; * \ingroup Execution */ class SocketReader { -private: -protected: - /** - * \brief Holds the width of the output of this operation. - */ - unsigned int m_width; - - /** - * \brief Holds the height of the output of this operation. - */ - unsigned int m_height; - - - /** - * \brief calculate a single pixel - * \note this method is called for non-complex - * \param result: is a float[4] array to store the result - * \param x: the x-coordinate of the pixel to calculate in image space - * \param y: the y-coordinate of the pixel to calculate in image space - * \param inputBuffers: chunks that can be read by their ReadBufferOperation. - */ - virtual void executePixelSampled(float /*output*/[4], - float /*x*/, - float /*y*/, - PixelSampler /*sampler*/) { } - - /** - * \brief calculate a single pixel - * \note this method is called for complex - * \param result: is a float[4] array to store the result - * \param x: the x-coordinate of the pixel to calculate in image space - * \param y: the y-coordinate of the pixel to calculate in image space - * \param inputBuffers: chunks that can be read by their ReadBufferOperation. - * \param chunkData: chunk specific data a during execution time. - */ - virtual void executePixel(float output[4], int x, int y, void * /*chunkData*/) { - executePixelSampled(output, x, y, COM_PS_NEAREST); - } - - /** - * \brief calculate a single pixel using an EWA filter - * \note this method is called for complex - * \param result: is a float[4] array to store the result - * \param x: the x-coordinate of the pixel to calculate in image space - * \param y: the y-coordinate of the pixel to calculate in image space - * \param dx: - * \param dy: - * \param inputBuffers: chunks that can be read by their ReadBufferOperation. - */ - virtual void executePixelFiltered(float /*output*/[4], - float /*x*/, float /*y*/, - float /*dx*/[2], float /*dy*/[2]) {} - -public: - inline void readSampled(float result[4], float x, float y, PixelSampler sampler) { - executePixelSampled(result, x, y, sampler); - } - inline void read(float result[4], int x, int y, void *chunkData) { - executePixel(result, x, y, chunkData); - } - inline void readFiltered(float result[4], float x, float y, float dx[2], float dy[2]) { - executePixelFiltered(result, x, y, dx, dy); - } - - virtual void *initializeTileData(rcti * /*rect*/) { return 0; } - virtual void deinitializeTileData(rcti * /*rect*/, void * /*data*/) {} - - virtual ~SocketReader() {} - - virtual MemoryBuffer *getInputMemoryBuffer(MemoryBuffer ** /*memoryBuffers*/) { return 0; } - - inline unsigned int getWidth() const { return this->m_width; } - inline unsigned int getHeight() const { return this->m_height; } + private: + protected: + /** + * \brief Holds the width of the output of this operation. + */ + unsigned int m_width; + + /** + * \brief Holds the height of the output of this operation. + */ + unsigned int m_height; + + /** + * \brief calculate a single pixel + * \note this method is called for non-complex + * \param result: is a float[4] array to store the result + * \param x: the x-coordinate of the pixel to calculate in image space + * \param y: the y-coordinate of the pixel to calculate in image space + * \param inputBuffers: chunks that can be read by their ReadBufferOperation. + */ + virtual void executePixelSampled(float /*output*/[4], + float /*x*/, + float /*y*/, + PixelSampler /*sampler*/) + { + } + + /** + * \brief calculate a single pixel + * \note this method is called for complex + * \param result: is a float[4] array to store the result + * \param x: the x-coordinate of the pixel to calculate in image space + * \param y: the y-coordinate of the pixel to calculate in image space + * \param inputBuffers: chunks that can be read by their ReadBufferOperation. + * \param chunkData: chunk specific data a during execution time. + */ + virtual void executePixel(float output[4], int x, int y, void * /*chunkData*/) + { + executePixelSampled(output, x, y, COM_PS_NEAREST); + } + + /** + * \brief calculate a single pixel using an EWA filter + * \note this method is called for complex + * \param result: is a float[4] array to store the result + * \param x: the x-coordinate of the pixel to calculate in image space + * \param y: the y-coordinate of the pixel to calculate in image space + * \param dx: + * \param dy: + * \param inputBuffers: chunks that can be read by their ReadBufferOperation. + */ + virtual void executePixelFiltered( + float /*output*/[4], float /*x*/, float /*y*/, float /*dx*/[2], float /*dy*/[2]) + { + } + + public: + inline void readSampled(float result[4], float x, float y, PixelSampler sampler) + { + executePixelSampled(result, x, y, sampler); + } + inline void read(float result[4], int x, int y, void *chunkData) + { + executePixel(result, x, y, chunkData); + } + inline void readFiltered(float result[4], float x, float y, float dx[2], float dy[2]) + { + executePixelFiltered(result, x, y, dx, dy); + } + + virtual void *initializeTileData(rcti * /*rect*/) + { + return 0; + } + virtual void deinitializeTileData(rcti * /*rect*/, void * /*data*/) + { + } + + virtual ~SocketReader() + { + } + + virtual MemoryBuffer *getInputMemoryBuffer(MemoryBuffer ** /*memoryBuffers*/) + { + return 0; + } + + inline unsigned int getWidth() const + { + return this->m_width; + } + inline unsigned int getHeight() const + { + return this->m_height; + } #ifdef WITH_CXX_GUARDEDALLOC - MEM_CXX_CLASS_ALLOC_FUNCS("COM:SocketReader") + MEM_CXX_CLASS_ALLOC_FUNCS("COM:SocketReader") #endif }; |