cubeMap并行实现.rar


运用GPU和Matlab混合编程实现cubemap,压缩包包含测试图片素材、源代码以及编译链接生成的文件、测试结果。
资源截图
代码片段和文件信息
#include “mex.h“
#include “CubeMap.h“

void mexFunction(int nlhs mxArray *plhs[] int nrhs mxArray *prhs[])
{
    if (nrhs != 18)
        mexErrMsgTxt(“Invaid number of input arguments“);
    
    if (nlhs != 3)
        mexErrMsgTxt(“Invalid number of outputs“);
    
    if (!mxIsSingle(prhs[0]) && !mxIsSingle(prhs[1]) && !mxIsSingle(prhs[2]))
        mexErrMsgTxt(“input matrix data type must be single“);
    if (!mxIsSingle(prhs[3]) && !mxIsSingle(prhs[4]) && !mxIsSingle(prhs[5]))
        mexErrMsgTxt(“input matrix data type must be single“);
    if (!mxIsSingle(prhs[6]) && !mxIsSingle(prhs[7]) && !mxIsSingle(prhs[8]))
        mexErrMsgTxt(“input matrix data type must be single“);
    if (!mxIsSingle(prhs[9]) && !mxIsSingle(prhs[10]) && !mxIsSingle(prhs[11]))
        mexErrMsgTxt(“input matrix data type must be single“);
    if (!mxIsSingle(prhs[12]) && !mxIsSingle(prhs[13]) && !mxIsSingle(prhs[14]))
        mexErrMsgTxt(“input matrix data type must be single“);
    if (!mxIsSingle(prhs[15]) && !mxIsSingle(prhs[16]) && !mxIsSingle(prhs[17]))
        mexErrMsgTxt(“input matrix data type must be single“);
    
    //获取纹理贴图的行数和列数
    int inNumRows = (int)mxGetM(prhs[0]);
    int inNumCols = (int)mxGetN(prhs[0]); 
    
    float* A = (float*)mxGetData(prhs[0]);
    float* B = (float*)mxGetData(prhs[1]);
    float* C = (float*)mxGetData(prhs[2]);
    RGB front = {ABC};
    
    float* D = (float*)mxGetData(prhs[3]);
    float* E = (float*)mxGetData(prhs[4]);
    float* F = (float*)mxGetData(prhs[5]);
    RGB back = {DEF};

    float* I = (float*)mxGetData(prhs[6]);
    float* J = (float*)mxGetData(prhs[7]);
    float* K = (float*)mxGetData(prhs[8]);
    RGB top = {IJK};
    
    float* L = (float*)mxGetData(prhs[9]);
    float* M = (float*)mxGetData(prhs[10]);
    float* N = (float*)mxGetData(prhs[11]);
    RGB bottom = {LMN};
    
    float* O = (float*)mxGetData(prhs[12]);
    float* P = (float*)mxGetData(prhs[13]);
    float* Q = (float*)mxGetData(prhs[14]);
    RGB left = {OPQ};
    
    float* R = (float*)mxGetData(prhs[15]);
    float* S = (float*)mxGetData(prhs[16]);
    float* T = (float*)mxGetData(prhs[17]);
    RGB right = {RST};

    /*Coordinates p = {0.600};  
    //Vector v = {001};//向量v与向量op不平行
    Vector v = {00-1};
    float a = 90;//水平夹角
    float b = 90;//竖直夹角
    int outNumRows = 512;
    int outNumCols = 512;*/
    
    Coordinates p = {-1-11};  
    //Vector v = {001};//向量v与向量op不平行
    Vector v = {00-1};
    float a = 90;//水平夹角
    float b = 90;//竖直夹角
    int outNumRows = 512;
    int outNumCols = 512;
    
    plhs[0] = mxCreateNumericMatrix(outNumRows outNumCols mxSINGLE_CLASS mxREAL);
    plhs[1] = mxCreateNumericMatrix(outNumRows outNumCols mxSINGLE_CLASS mxREAL);
    plhs[2] = mxCreateNumericMatrix(outNumRows outNumCols mxSINGLE_CLASS mxREAL);
    float* U = (float*)mxGetData(plhs[0]);
    float* V = (float*)mxGe

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      23034  2019-05-13 15:53  result
esult1.jpg

     文件      34466  2019-05-13 16:02  result水平夹角aa=90.jpg

     文件      35232  2019-05-13 16:08  result水平夹角aa=120.jpg

     文件      31929  2019-05-13 16:11  result水平夹角aa=60.jpg

     文件      35330  2019-05-13 16:14  result水平夹角aa=150.jpg

     文件      62158  2019-05-13 16:24  result竖直夹角b=90.jpg

     文件      33833  2019-05-13 16:27  result竖直夹角b=60.jpg

     文件      52776  2019-05-13 16:29  result竖直夹角b=120.jpg

     文件      43691  2019-05-13 16:30  result竖直夹角b=150.jpg

     文件      35330  2019-05-13 16:37  result
ow_and_colextend1:1.jpg

     文件      47860  2019-05-13 16:39  result
ow_and_colextend1:1.5.jpg

     文件      60337  2019-05-13 16:40  result
ow_and_colextend1:2.jpg

     文件      36697  2019-05-13 16:41  result
ow_and_colextend1:4.jpg

     文件      37560  2019-05-13 16:42  result
ow_and_colextend1:8.jpg

     文件      40425  2019-05-13 16:47  result
ow_and_colsharpness256-256.jpg

     文件      31858  2019-05-13 16:48  result
ow_and_colsharpness128-128.jpg

     文件      23703  2019-05-13 16:49  result
ow_and_colsharpness64-64.jpg

     文件      69857  2019-05-14 16:34  result
ow_and_colsharpness512-512.jpg

     文件      24709  2019-05-13 17:03  result
esult2.jpg

     文件      21043  2019-05-13 17:07  result
esult3.jpg

     文件     216618  2019-05-11 17:49  texture
ight.jpg

     文件     124008  2019-05-11 17:49  texture op.jpg

     文件     186970  2019-05-11 17:49  textureack.jpg

     文件     113005  2019-05-11 17:49  textureottom.jpg

     文件     316341  2019-05-11 17:49  texturefront.jpg

     文件     245975  2019-05-11 17:49  textureleft.jpg

     文件      35312  2019-05-13 15:40  texturejoint.JPG

     文件    1115465  2019-05-14 18:49  texture纹理贴图.rar

     文件      70182  2019-05-14 15:24  cubeMap.pptx

     文件      32256  2019-05-13 17:05  codeCubeMapCuda.mexw64

............此处省略18个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)