//    *
 //	\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));
        }