~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/compositor/intern/COM_MemoryProxy.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2011, Blender Foundation.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License
 
6
 * as published by the Free Software Foundation; either version 2
 
7
 * of the License, or (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software Foundation,
 
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
 *
 
18
 * Contributor: 
 
19
 *              Jeroen Bakker 
 
20
 *              Monique Dewanchand
 
21
 */
 
22
 
 
23
class MemoryProxy;
 
24
 
 
25
 
 
26
#ifndef _COM_MemoryProxy_h_
 
27
#define _COM_MemoryProxy_h_
 
28
#include "COM_ExecutionGroup.h"
 
29
 
 
30
class ExecutionGroup;
 
31
 
 
32
/**
 
33
 * @brief A MemoryProxy is a unique identifier for a memory buffer.
 
34
 * A single MemoryProxy is used among all chunks of the same buffer,
 
35
 * the MemoryBuffer only stores the data of a single chunk.
 
36
 * @ingroup Memory
 
37
 */
 
38
class MemoryProxy {
 
39
private:
 
40
        /**
 
41
         * @brief reference to the ouput operation of the executiongroup
 
42
         */
 
43
        WriteBufferOperation *m_writeBufferOperation;
 
44
        
 
45
        /**
 
46
         * @brief reference to the executor. the Execution group that can fill a chunk
 
47
         */
 
48
        ExecutionGroup *m_executor;
 
49
        
 
50
        /**
 
51
         * @brief datatype of this MemoryProxy
 
52
         */
 
53
        /* DataType m_datatype; */ /* UNUSED */
 
54
        
 
55
        /**
 
56
         * @brief channel information of this buffer
 
57
         */
 
58
        /* ChannelInfo m_channelInfo[COM_NUMBER_OF_CHANNELS]; */ /* UNUSED */
 
59
 
 
60
        /**
 
61
         * @brief the allocated memory
 
62
         */
 
63
        MemoryBuffer *m_buffer;
 
64
 
 
65
public:
 
66
        MemoryProxy();
 
67
        
 
68
        /**
 
69
         * @brief set the ExecutionGroup that can be scheduled to calculate a certain chunk.
 
70
         * @param group the ExecutionGroup to set
 
71
         */
 
72
        void setExecutor(ExecutionGroup *executor) { this->m_executor = executor; }
 
73
 
 
74
        /**
 
75
         * @brief get the ExecutionGroup that can be scheduled to calculate a certain chunk.
 
76
         */
 
77
        ExecutionGroup *getExecutor() { return this->m_executor; }
 
78
 
 
79
        /**
 
80
         * @brief set the WriteBufferOperation that is responsible for writing to this MemoryProxy
 
81
         * @param operation
 
82
         */
 
83
        void setWriteBufferOperation(WriteBufferOperation *operation) { this->m_writeBufferOperation = operation; }
 
84
 
 
85
        /**
 
86
         * @brief get the WriteBufferOperation that is responsible for writing to this MemoryProxy
 
87
         * @return WriteBufferOperation
 
88
         */
 
89
        WriteBufferOperation *getWriteBufferOperation() { return this->m_writeBufferOperation; }
 
90
 
 
91
        /**
 
92
         * @brief allocate memory of size width x height
 
93
         */
 
94
        void allocate(unsigned int width, unsigned int height);
 
95
 
 
96
        /**
 
97
         * @brief free the allocated memory
 
98
         */
 
99
        void free();
 
100
 
 
101
        /**
 
102
         * @brief get the allocated memory
 
103
         */
 
104
        inline MemoryBuffer *getBuffer() { return this->m_buffer; }
 
105
 
 
106
#ifdef WITH_CXX_GUARDEDALLOC
 
107
        MEM_CXX_CLASS_ALLOC_FUNCS("COM:MemoryProxy")
 
108
#endif
 
109
};
 
110
 
 
111
#endif