// * // \brief Create a copy of the current texture image buffer // \note You have to delete cloned object by yourself! // // //ORIGINAL LINE: TextureBuffer* clone() const public TextureBuffer clone() { TextureBuffer clon = new TextureBuffer(mWidth); //C++ TO C# CONVERTER TODO TASK: The memory management function 'memcpy' has no equivalent in C#: memcpy(clon.mPixels, mPixels, mWidth * mHeight * 4 * sizeof(byte)); return(clon); }
// * // \brief Copy image data (RGBA) from an other TextureBuffer object // \param buffer Image buffer as source for copy /// <summary> /// 外部保证buffer的长宽等于当前的长宽 /// </summary> /// <param name="buffer"></param> public void setData(TextureBuffer buffer) { if (buffer == null) { return; } if (buffer.getWidth() != mWidth || buffer.getHeight() != mHeight) { return; } //C++ TO C# CONVERTER TODO TASK: The memory management function 'memcpy' has no equivalent in C#: memcpy(mPixels, buffer.mPixels, (mWidth * mHeight * 4 * sizeof(byte))); }
// * // \brief Standard constructor which copy a given image // \param tocopy Image which to copy // \exception Ogre::InvalidParametersException Pointer to source image must not be NULL! // public TextureBuffer(TextureBuffer tocopy) { if (tocopy == null) { OGRE_EXCEPT("Ogre::Exception::ERR_INVALIDPARAMS", "Pointer to source image must not be NULL!", "Procedural::TextureBuffer::TextureBuffer(Procedural::TextureBufferPtr)"); } ; mWidth = (uint)tocopy.getWidth(); mHeight = (uint)tocopy.getHeight(); mPixels = new byte[mWidth * mHeight * 4]; //C++ TO C# CONVERTER TODO TASK: The memory management function 'memcpy' has no equivalent in C#: memcpy(mPixels, tocopy.mPixels, mWidth * mHeight * 4 * sizeof(byte)); }
// * // Default constructor. // \param pBuffer Image buffer where to store the generated image. // \param name Filter name // \exception Ogre::InvalidParametersException Texture buffer is not set! // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public TextureProcessing(TextureBuffer pBuffer, string name) { if (pBuffer == null) { OGRE_EXCEPT("Ogre::Exception::ERR_INVALIDPARAMS", "Texture buffer is not set!", "Procedural::TextureProcessing::TextureProcessing(TextureBufferPtr, Ogre::String)"); } ; mBuffer = pBuffer; mName = name; #if OGRE_DEBUG_MODE mLog = true; #else mLog = false; #endif }