[657] | 1 | <html> |
---|
| 2 | <head> |
---|
| 3 | <title>OgreHardwarePixelBuffer.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
| 4 | <link type="text/css" rel="stylesheet" href="style.css"> |
---|
| 5 | </head> |
---|
| 6 | |
---|
| 7 | <body> |
---|
| 8 | <!-- Generated by Doxygen 1.3.6 --> |
---|
| 9 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> |
---|
| 10 | <h1>OgreHardwarePixelBuffer.h</h1><a href="OgreHardwarePixelBuffer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> |
---|
| 11 | 00002 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
| 12 | 00003 <span class="comment">This source file is part of OGRE</span> |
---|
| 13 | 00004 <span class="comment"> (Object-oriented Graphics Rendering Engine)</span> |
---|
| 14 | 00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span> |
---|
| 15 | 00006 <span class="comment"></span> |
---|
| 16 | 00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span> |
---|
| 17 | 00008 <span class="comment">Also see acknowledgements in Readme.html</span> |
---|
| 18 | 00009 <span class="comment"></span> |
---|
| 19 | 00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span> |
---|
| 20 | 00011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span> |
---|
| 21 | 00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span> |
---|
| 22 | 00013 <span class="comment">version.</span> |
---|
| 23 | 00014 <span class="comment"></span> |
---|
| 24 | 00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span> |
---|
| 25 | 00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span> |
---|
| 26 | 00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span> |
---|
| 27 | 00018 <span class="comment"></span> |
---|
| 28 | 00019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span> |
---|
| 29 | 00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span> |
---|
| 30 | 00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span> |
---|
| 31 | 00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span> |
---|
| 32 | 00023 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
| 33 | 00024 <span class="comment">*/</span> |
---|
| 34 | 00025 <span class="preprocessor">#ifndef __HardwarePixelBuffer__</span> |
---|
| 35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define __HardwarePixelBuffer__</span> |
---|
| 36 | 00027 <span class="preprocessor"></span> |
---|
| 37 | 00028 <span class="comment">// Precompiler options</span> |
---|
| 38 | 00029 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span> |
---|
| 39 | 00030 <span class="preprocessor">#include "<a class="code" href="OgreHardwareBuffer_8h.html">OgreHardwareBuffer.h</a>"</span> |
---|
| 40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreSharedPtr_8h.html">OgreSharedPtr.h</a>"</span> |
---|
| 41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgrePixelFormat_8h.html">OgrePixelFormat.h</a>"</span> |
---|
| 42 | 00033 <span class="preprocessor">#include "<a class="code" href="OgreImage_8h.html">OgreImage.h</a>"</span> |
---|
| 43 | 00034 |
---|
| 44 | 00035 <span class="keyword">namespace </span>Ogre { |
---|
| 45 | <a name="l00042"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html">00042</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> HardwarePixelBuffer : <span class="keyword">public</span> <a class="code" href="classOgre_1_1HardwareBuffer.html">HardwareBuffer</a> |
---|
| 46 | 00043 { |
---|
| 47 | 00044 <span class="keyword">protected</span>: |
---|
| 48 | 00045 <span class="comment">// Extents</span> |
---|
| 49 | <a name="l00046"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBufferp0">00046</a> size_t mWidth, mHeight, mDepth; |
---|
| 50 | 00047 <span class="comment">// Pitches (offsets between rows and slices)</span> |
---|
| 51 | <a name="l00048"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBufferp4">00048</a> size_t mRowPitch, mSlicePitch; |
---|
| 52 | 00049 <span class="comment">// Internal format</span> |
---|
| 53 | <a name="l00050"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBufferp5">00050</a> <a class="code" href="namespaceOgre.html#a667">PixelFormat</a> mFormat; |
---|
| 54 | 00051 <span class="comment">// Currently locked region</span> |
---|
| 55 | <a name="l00052"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBufferp6">00052</a> <a class="code" href="classOgre_1_1PixelBox.html">PixelBox</a> mCurrentLock; |
---|
| 56 | 00053 |
---|
| 57 | 00055 <span class="keyword">virtual</span> <a class="code" href="classOgre_1_1PixelBox.html">PixelBox</a> lockImpl(<span class="keyword">const</span> <a class="code" href="structOgre_1_1Box.html">Image::Box</a> lockBox, LockOptions options) = 0; |
---|
| 58 | 00056 |
---|
| 59 | 00059 <span class="keyword">virtual</span> <span class="keywordtype">void</span>* lockImpl(size_t offset, size_t length, LockOptions options); |
---|
| 60 | 00060 |
---|
| 61 | 00062 <span class="comment">// virtual void unlockImpl(void) = 0;</span> |
---|
| 62 | 00063 <span class="keyword">public</span>: |
---|
| 63 | 00065 HardwarePixelBuffer(size_t mWidth, size_t mHeight, size_t mDepth, |
---|
| 64 | 00066 PixelFormat mFormat, |
---|
| 65 | 00067 HardwareBuffer::Usage usage, <span class="keywordtype">bool</span> useSystemMemory, <span class="keywordtype">bool</span> useShadowBuffer); |
---|
| 66 | 00068 ~HardwarePixelBuffer(); |
---|
| 67 | 00069 |
---|
| 68 | 00073 <span class="keyword">using</span> HardwareBuffer::lock; |
---|
| 69 | 00074 |
---|
| 70 | 00081 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classOgre_1_1PixelBox.html">PixelBox</a>& lock(<span class="keyword">const</span> <a class="code" href="structOgre_1_1Box.html">Image::Box</a>& lockBox, LockOptions options); |
---|
| 71 | 00083 <span class="keyword">virtual</span> <span class="keywordtype">void</span>* lock(size_t offset, size_t length, LockOptions options); |
---|
| 72 | 00084 |
---|
| 73 | 00089 <span class="keyword">const</span> <a class="code" href="classOgre_1_1PixelBox.html">PixelBox</a>& getCurrentLock(); |
---|
| 74 | 00090 |
---|
| 75 | 00092 <span class="keyword">virtual</span> <span class="keywordtype">void</span> readData(size_t offset, size_t length, <span class="keywordtype">void</span>* pDest); |
---|
| 76 | 00094 <span class="keyword">virtual</span> <span class="keywordtype">void</span> writeData(size_t offset, size_t length, <span class="keyword">const</span> <span class="keywordtype">void</span>* pSource, |
---|
| 77 | 00095 <span class="keywordtype">bool</span> discardWholeBuffer = <span class="keyword">false</span>); |
---|
| 78 | 00096 |
---|
| 79 | 00107 <span class="keyword">virtual</span> <span class="keywordtype">void</span> blit(HardwarePixelBuffer *src, <span class="keyword">const</span> <a class="code" href="structOgre_1_1Box.html">Image::Box</a> &srcBox, <span class="keyword">const</span> <a class="code" href="structOgre_1_1Box.html">Image::Box</a> &dstBox); |
---|
| 80 | 00108 |
---|
| 81 | <a name="l00114"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera8">00114</a> <span class="keywordtype">void</span> blit(HardwarePixelBuffer *src) |
---|
| 82 | 00115 { |
---|
| 83 | 00116 blit(src, |
---|
| 84 | 00117 <a class="code" href="structOgre_1_1Box.html">Box</a>(0,0,0,src-><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera13">getWidth</a>(),src-><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera14">getHeight</a>(),src-><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera15">getDepth</a>()), |
---|
| 85 | 00118 <a class="code" href="structOgre_1_1Box.html">Box</a>(0,0,0,mWidth,mHeight,mDepth) |
---|
| 86 | 00119 ); |
---|
| 87 | 00120 } |
---|
| 88 | 00121 |
---|
| 89 | 00131 <span class="keyword">virtual</span> <span class="keywordtype">void</span> blitFromMemory(<span class="keyword">const</span> <a class="code" href="classOgre_1_1PixelBox.html">PixelBox</a> &src, <span class="keyword">const</span> <a class="code" href="structOgre_1_1Box.html">Image::Box</a> &dstBox) = 0; |
---|
| 90 | 00132 |
---|
| 91 | <a name="l00138"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera10">00138</a> <span class="keywordtype">void</span> blitFromMemory(<span class="keyword">const</span> <a class="code" href="classOgre_1_1PixelBox.html">PixelBox</a> &src) |
---|
| 92 | 00139 { |
---|
| 93 | 00140 blitFromMemory(src, <a class="code" href="structOgre_1_1Box.html">Box</a>(0,0,0,mWidth,mHeight,mDepth)); |
---|
| 94 | 00141 } |
---|
| 95 | 00142 |
---|
| 96 | 00150 <span class="keyword">virtual</span> <span class="keywordtype">void</span> blitToMemory(<span class="keyword">const</span> <a class="code" href="structOgre_1_1Box.html">Image::Box</a> &srcBox, <span class="keyword">const</span> <a class="code" href="classOgre_1_1PixelBox.html">PixelBox</a> &dst) = 0; |
---|
| 97 | 00151 |
---|
| 98 | <a name="l00157"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera12">00157</a> <span class="keywordtype">void</span> blitToMemory(<span class="keyword">const</span> <a class="code" href="classOgre_1_1PixelBox.html">PixelBox</a> &dst) |
---|
| 99 | 00158 { |
---|
| 100 | 00159 blitToMemory(<a class="code" href="structOgre_1_1Box.html">Box</a>(0,0,0,mWidth,mHeight,mDepth), dst); |
---|
| 101 | 00160 } |
---|
| 102 | 00161 |
---|
| 103 | <a name="l00163"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera13">00163</a> size_t getWidth()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mWidth; } |
---|
| 104 | <a name="l00165"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera14">00165</a> size_t getHeight()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mHeight; } |
---|
| 105 | <a name="l00167"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera15">00167</a> size_t getDepth()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mDepth; } |
---|
| 106 | <a name="l00169"></a><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera16">00169</a> <a class="code" href="namespaceOgre.html#a667">PixelFormat</a> getFormat()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mFormat; } |
---|
| 107 | 00170 }; |
---|
| 108 | 00171 |
---|
| 109 | <a name="l00173"></a><a class="code" href="classOgre_1_1HardwarePixelBufferSharedPtr.html">00173</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> HardwarePixelBufferSharedPtr : <span class="keyword">public</span> <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><HardwarePixelBuffer> |
---|
| 110 | 00174 { |
---|
| 111 | 00175 <span class="keyword">public</span>: |
---|
| 112 | <a name="l00176"></a><a class="code" href="classOgre_1_1HardwarePixelBufferSharedPtr.html#Ogre_1_1HardwarePixelBufferSharedPtra0">00176</a> HardwarePixelBufferSharedPtr() : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><HardwarePixelBuffer>() {} |
---|
| 113 | 00177 <span class="keyword">explicit</span> HardwarePixelBufferSharedPtr(HardwarePixelBuffer* buf); |
---|
| 114 | 00178 |
---|
| 115 | 00179 |
---|
| 116 | 00180 }; |
---|
| 117 | 00181 |
---|
| 118 | 00182 } |
---|
| 119 | 00183 <span class="preprocessor">#endif</span> |
---|
| 120 | 00184 <span class="preprocessor"></span> |
---|
| 121 | </pre></div><hr> |
---|
| 122 | <p> |
---|
| 123 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
| 124 | <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/> |
---|
| 125 | This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/> |
---|
| 126 | <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
---|
| 127 | <Work rdf:about=""> |
---|
| 128 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
| 129 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
| 130 | </Work> |
---|
| 131 | <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> |
---|
| 132 | |
---|
| 133 | Last modified Sun Feb 12 12:59:46 2006 |
---|
| 134 | </p> |
---|
| 135 | </body> |
---|
| 136 | </html> |
---|