Beispiel #1
0
        public bool Save2File(CRenderContext rc, string fileName, EIMAGE_FILE_FORMAT Type)
        {
            unsafe
            {
                Support.CBlobObject data = new Support.CBlobObject();
                Save2Memory(rc, data, EIMAGE_FILE_FORMAT.BMP);

                return(Save2File(fileName, data, Type));
            }
            //return (bool)SDK_IShaderResourceView_Save2File(CoreObject, rc.CoreObject, fileName, Type);
        }
Beispiel #2
0
        public bool Save2File(string fileName, Support.CBlobObject data, EIMAGE_FILE_FORMAT format)
        {
            unsafe
            {
                var        dataPtr = (byte *)data.Data.ToPointer();
                PixelDesc *desc    = (PixelDesc *)dataPtr;

                var descSize = sizeof(PixelDesc);

                var srcBytes = data.ToBytes();
                var tagBytes = new byte[srcBytes.Length - descSize];
                for (int i = 0; i < tagBytes.Length; i += 4)
                {
                    // bgra         rgba
                    tagBytes[i]     = srcBytes[i + 2 + descSize];
                    tagBytes[i + 1] = srcBytes[i + 1 + descSize];
                    tagBytes[i + 2] = srcBytes[i + descSize];
                    tagBytes[i + 3] = srcBytes[i + 3 + descSize];
                }

                return(Save2File(fileName, desc->Width, desc->Height, desc->Stride, tagBytes, format));
            }
        }
Beispiel #3
0
 public CBlobProxy(CBlobObject blob)
 {
     DataPtr    = blob.Data;
     DataLength = blob.Size;
     Current    = 0;
 }
Beispiel #4
0
 public void BeginRead()
 {
     DataPtr    = CBlobObject.SDK_IBlobObject_GetData(CoreObject);
     DataLength = CBlobObject.SDK_IBlobObject_GetSize(CoreObject);
     Current    = 0;
 }
Beispiel #5
0
 public unsafe void BuildImageBlob(Support.CBlobObject blob, void *pData, uint RowPitch)
 {
     SDK_ITexture2D_BuildImageBlob(CoreObject, blob.CoreObject, pData, RowPitch);
 }
Beispiel #6
0
 //这个函数要从显卡取数据,根据目前的渲染器结构,要求在Render线程执行,调用的时候要注意Post
 public void GetBufferData(CRenderContext rc, Support.CBlobObject blob)
 {
     SDK_IVertexBuffer_GetBufferData(CoreObject, rc.CoreObject, blob.CoreObject);
 }
 public bool GetBufferData(CRenderContext rc, Support.CBlobObject blob)
 {
     return(SDK_IGpuBuffer_GetBufferData(CoreObject, rc.CoreObject, blob.CoreObject));
 }