亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cimgmatlab.h

?? this a image processing program
?? H
字號:
/***************************************************************** * cimgmatlab.h * ------------- * * cimgmatlab.h is a "plugin" for the CImg library that allows  * to convert CImg<T> images from/to matlab arrays, so that CImg * can be used to write matlab mex files. * How to use it: * file cimgmatlab.h must be in a directory that the  * compiler can locate. * Prior to include CImg.h, mex.h must be included first, else it * will result in a compiler error. * after the inclusion of mex.h, one must define the macro * cimg_plugin as "cimgmatlab.h" or <cimgmatlab.h> or similar * * // my fantastic mex file source code * #include <mex.h> * ... * #define cimg_plugin  <cimgmatlab.h> * #include <CImg.h> * ... * * * Copyright: Francois Lauze, The IT University of Copenhagen. * Licence: the Gnu General Public License *          http://www.gnu.org/copyleft/gpl.html *  *****************************************************************/#if !defined mex_h#error the file mex.h must be included!#endif#if !defined cimg_version#error cimgmatlab.h requires that CImg.h is included#endif// begin of included methods// They are just added as member functions / constructor// for the CImg<T> class. private:    // internally used to transfer Matlab array values to CImg<> objects,     // check wether the array type is a "numerical" one (including logical)     static int isNumericalClassID(mxClassID id) {		// all these constants are defined in matrix.h included by mex.h        switch (id) {         case mxLOGICAL_CLASS:        case mxDOUBLE_CLASS:        case mxSINGLE_CLASS:        case mxINT8_CLASS:        case mxUINT8_CLASS:        case mxINT16_CLASS:        case mxUINT16_CLASS:        case mxINT32_CLASS:        case mxUINT32_CLASS:	case mxINT64_CLASS:	case mxUINT64_CLASS:            return 1;        default:            return 0;        }    }            // driving routine that will copy the content of    // a MatLab array to this->data    // The type names used are defined in tmwtypes.h     void makeImageFromMatlabData(const mxArray *matlabArray, mxClassID classID) {        if (classID == mxLOGICAL_CLASS) {            // logical type works a bit differently than the numerical types            mxLogical *mdata = mxGetLogicals(matlabArray);            cpMatlabData((const mxLogical *)mdata);        } else {            void *mdata = mxGetPr(matlabArray);            switch (classID) {            case mxDOUBLE_CLASS:                cpMatlabData((const real64_T *)mdata);                break;            case mxSINGLE_CLASS:                cpMatlabData((const real32_T *)mdata);                break;            case mxINT8_CLASS:                cpMatlabData((const int8_T *)mdata);                break;            case mxUINT8_CLASS:                cpMatlabData((const uint8_T *)mdata);                break;            case mxINT16_CLASS:                cpMatlabData((const int16_T *)mdata);                break;            case mxUINT16_CLASS:                cpMatlabData((const uint16_T *)mdata);                break;            case mxINT32_CLASS:                cpMatlabData((const int32_T *)mdata);                break;            case mxUINT32_CLASS:                cpMatlabData((const uint32_T *)mdata);                break;	    case mxINT64_CLASS:		cpMatlabData((const int64_T *)mdata);		break;	    case mxUINT64_CLASS:		cpMatlabData((const uint64_T *)mdata);		break;	            }        }    }        // the actual memory copy and base type conversion    // is then performed by this routine that handles the     // annoying x-y problem of MatLab when dealing with images:    // we switch line and column storage: Matlab A(x,y)     // becones CImg img(y,x)    template <typename t> void cpMatlabData(const t* mdata) {        cimg_mapXYZV(*this, x, y, z, v) {            (*this)(x, y, z, v) = (T)(mdata[((v*depth + z)*width+x)*height+y]);        }    }public:    // Consruct a CImg<T> object from a MatLab mxArray.    // The Matlab array must be AT MOST 4-dimensional.    // the boolean argument vdata is employed in the     // case the the input mxArray has dimension 3,    // say M x N x K.    // In that case, if vdata is true, the last dimension    // is assumed to be "vectorial" and the resulting CImg<T>    // object has dimension N x M x 1 x K. Otherwise, the    // resulting object has dimension N x M x K x 1.    // When Matlab array has dimension 2 or 4, vdata    // has no effects.	// We do not use shared memory mechanisms.	CImg(const mxArray *matlabArray, bool vdata = false) : is_shared(false) {        int nbdims = mxGetNumberOfDimensions(matlabArray);        mxClassID classID = mxGetClassID(matlabArray);        if (nbdims > 4 || !isNumericalClassID(classID)) {            data=NULL; width=height=depth=dim=0;#if cimg_debug>1            cimg::warn(1,"Matlab array is more than 4D"                       " or/and not numerical, returning null image.");#endif              } else {            const mwSize *dims = mxGetDimensions(matlabArray);            depth = dim = 1;            width = (unsigned int)dims[1]; height = (unsigned int)dims[0];            if (nbdims == 4) {                depth = (unsigned int)dims[2];                  dim = (unsigned int)dims[3];            } else if (nbdims == 3) {                if (vdata) dim = (unsigned int)dims[2];                else depth = (unsigned int)dims[2];            }            data = new T[size()];            makeImageFromMatlabData(matlabArray, classID);        }    }                // operator=(). Copy  mxMarray data mArray into the current image    // Works as the previous constructor, but without the vdata stuff.    // don't know if it is of any use...    CImg & operator=(const mxArray *matlabArray) {        int nbdims = mxGetNumberOfDimensions(matlabArray);        int classID = mxGetClassID(matlabArray);        if (nbdims > 4 || !isNumericalClassID(classID)) {            delete [] data; data = NULL; width=height=depth=dim=0;#if cimg_debug>1            cimg::warn(1,"Matlab array is more than 4D "                       "or/and not numerical, returning null image.");#endif              } else {            const size_t *dims = mxGetDimensions(matlabArray);            depth = dim = 1;            width = (unsigned int)dims[1]; height = (unsigned int)dims[0];             if (nbdims > 2) depth = (unsigned int)dims[2];            if (nbdims > 3) dim = (unsigned int)dims[3];            delete [] data;            data = new T[size()];            makeImageFromMatlabData(matlabArray, classID);        }    }     private:          // private routines used for transfering a CImg<T> to a mxArray    // here also, we have to exchange the x and y dims so we get the     // expected matlab array    template <typename c>        void populate_maltlab_array(c *mdata) const {        cimg_mapXYZV(*this, x, y, z, v)             mdata[((v*depth + z)*width+x)*height+y] = (c)(*this)(x, y, z, v);    }    // the specialized version for "logical" entries    void populate_maltlab_array(mxLogical *mdata) const {        cimg_mapXYZV(*this, x, y, z, v)             mdata[((v*depth + z)*width+x)*height+y] = (mxLogical)((*this)(x, y, z, v)!=0);    }         public:    // export a CImg image to a matlab array.      mxArray *toMatlab(mxClassID classID = mxDOUBLE_CLASS, bool squeeze = false) const {        if (!isNumericalClassID(classID)) {#if cimg_debug>1            cimg::warn(1,"Invalid Matlab Class Id Specified.");#endif            return NULL;        }        mwSize dims[4];        dims[0] = height;        dims[1] = width;        dims[2] = depth;        dims[3] = dim;        if (squeeze && depth == 1) {            dims[2] = dim;            dims[3] = 1;        }        mxArray *matlabArray = mxCreateNumericArray(4,dims,classID,mxREAL);        if (classID == mxLOGICAL_CLASS) {            mxLogical *mdata = mxGetLogicals(matlabArray);            populate_maltlab_array(mdata);        } else {            void *mdata = mxGetPr(matlabArray);            switch (classID) {            case mxDOUBLE_CLASS:                populate_maltlab_array((real64_T *)mdata);                break;            case mxSINGLE_CLASS:                populate_maltlab_array((real32_T *)mdata);                break;            case mxINT8_CLASS:                populate_maltlab_array((int8_T *)mdata);                break;            case mxUINT8_CLASS:                populate_maltlab_array((uint8_T *)mdata);                break;            case mxINT16_CLASS:                populate_maltlab_array((int16_T *)mdata);                break;            case mxUINT16_CLASS:                populate_maltlab_array((uint16_T *)mdata);                break;              case mxINT32_CLASS:                populate_maltlab_array((int32_T *)mdata);                break;            case mxUINT32_CLASS:                populate_maltlab_array((uint32_T *)mdata);                break;			case mxINT64_CLASS:                populate_maltlab_array((int64_T *)mdata);                break;			case mxUINT64_CLASS:                populate_maltlab_array((uint64_T *)mdata);                break;            }           }        return matlabArray;    }   // end of cimgmatlab.h

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产污污免费网站入口 | 精品福利av导航| 国产精品99久久久久久久vr| 一卡二卡欧美日韩| 久久久99久久| 91精品国产综合久久精品麻豆| 成人深夜视频在线观看| 免费看日韩a级影片| 亚洲激情六月丁香| 欧美极品少妇xxxxⅹ高跟鞋| 日韩欧美一二三区| 欧美性xxxxx极品少妇| 99久久99久久久精品齐齐| 国产一区二区三区精品欧美日韩一区二区三区 | 91浏览器打开| 精品中文字幕一区二区小辣椒| 亚洲精品日产精品乱码不卡| 久久久久高清精品| 日韩欧美国产不卡| 欧美日韩在线直播| 日本乱人伦一区| 99久久精品久久久久久清纯| 国产精品一区二区三区乱码| 久久99蜜桃精品| 秋霞电影一区二区| 偷拍与自拍一区| 亚洲国产成人porn| 亚洲一级不卡视频| 依依成人综合视频| 亚洲欧美一区二区不卡| 国产精品久久久久影院亚瑟| 中文字幕欧美日本乱码一线二线| 国产一区在线看| 亚洲精品免费在线| 精品区一区二区| 91精品国产高清一区二区三区| 欧美日韩在线观看一区二区| 欧美在线播放高清精品| 在线观看视频欧美| 欧美怡红院视频| 欧美日韩国产综合一区二区 | 精品免费国产二区三区| 精品久久国产字幕高潮| 日韩一区二区三区高清免费看看| 777奇米四色成人影色区| 欧美日韩久久久一区| 国产成人福利片| 国产精品18久久久久久久久久久久 | 国产精品免费aⅴ片在线观看| 中文字幕av一区二区三区| 欧美激情在线看| 亚洲欧洲在线观看av| 亚洲精品成人在线| 久久综合久久综合久久| 日韩国产欧美视频| 国产精品国模大尺度视频| 国产精品三级av| 国产精品久久久久久久久图文区| 中文字幕一区av| 亚洲一区二区三区小说| 午夜婷婷国产麻豆精品| 久久不见久久见免费视频7| 国产成人综合在线| 91蜜桃传媒精品久久久一区二区| 色噜噜久久综合| 欧美一区二区精品在线| 久久久99精品久久| 亚洲女性喷水在线观看一区| 日韩vs国产vs欧美| 高清国产午夜精品久久久久久| 99久久精品免费精品国产| 欧美日韩一区二区在线视频| 精品剧情在线观看| 国产精品国产自产拍在线| 视频一区免费在线观看| 国产不卡高清在线观看视频| 在线一区二区三区做爰视频网站| 欧美一区二区成人6969| 中文字幕不卡一区| 亚洲mv在线观看| 国产成人免费xxxxxxxx| 精品视频资源站| 国产日产欧产精品推荐色| 亚洲一区二区五区| 国内外成人在线视频| 91国产免费观看| 久久精品视频在线看| 一区二区三区91| 国产福利91精品一区二区三区| 欧美性xxxxxxxx| 中文字幕第一区二区| 婷婷久久综合九色国产成人| 本田岬高潮一区二区三区| 欧美一区二区性放荡片| 亚洲欧洲精品一区二区三区| 精品一区二区三区久久久| 91麻豆免费在线观看| 欧美精品一区二区三区很污很色的| 亚洲免费在线播放| 国产美女娇喘av呻吟久久| 欧美蜜桃一区二区三区| 亚洲欧美激情视频在线观看一区二区三区 | 国产精品香蕉一区二区三区| 欧美日韩国产在线观看| 中文字幕av不卡| 青青草原综合久久大伊人精品优势| 91在线云播放| 久久精品网站免费观看| 久久国产三级精品| 欧美日韩高清一区二区三区| 一区在线观看视频| 国产91丝袜在线播放九色| 日韩视频国产视频| 一区二区三区高清在线| k8久久久一区二区三区| 国产清纯白嫩初高生在线观看91 | 久久国产精品第一页| 欧美精品亚洲一区二区在线播放| 亚洲视频一区二区在线| 风间由美性色一区二区三区| 精品久久久久99| 看片的网站亚洲| 2023国产精品| 日韩高清在线一区| 欧美精品一二三四| 亚洲第一主播视频| 欧美性色综合网| 亚洲综合激情小说| 日本精品视频一区二区三区| 1000部国产精品成人观看| 成人黄页毛片网站| 国产精品久久久久久久久快鸭| 精品一区免费av| 久久色在线视频| 国产一区二区三区在线观看免费视频| 欧美成人a∨高清免费观看| 麻豆成人91精品二区三区| 日韩亚洲电影在线| 狠狠久久亚洲欧美| 久久视频一区二区| 国产成人高清在线| 国产精品高潮呻吟| 色八戒一区二区三区| 亚洲在线观看免费| 欧美色视频一区| 三级在线观看一区二区| 日韩一区二区免费视频| 韩国女主播成人在线观看| 久久综合九色综合97_久久久| 国产在线国偷精品产拍免费yy| 久久综合五月天婷婷伊人| 成人理论电影网| 一区二区三区在线播| 在线观看91av| 久久福利资源站| 国产亚洲婷婷免费| 972aa.com艺术欧美| 一区二区理论电影在线观看| 欧美日韩国产123区| 久久丁香综合五月国产三级网站 | 日韩美女视频一区二区在线观看| 久久成人久久爱| 欧美国产1区2区| 91老师片黄在线观看| 天天操天天干天天综合网| 精品电影一区二区| 成人av中文字幕| 亚洲最大成人综合| 日韩视频在线一区二区| 国产91精品一区二区麻豆网站 | 欧美国产日韩a欧美在线观看| av在线这里只有精品| 偷拍自拍另类欧美| 国产亚洲一区二区三区四区 | 日韩一区二区三区免费观看| 国产a精品视频| 亚洲午夜激情网站| 精品国产乱码91久久久久久网站| 偷拍一区二区三区| 久久亚洲精精品中文字幕早川悠里| eeuss国产一区二区三区| 亚洲1区2区3区视频| 国产欧美一区二区三区沐欲| 欧美性一级生活| 国产成人精品aa毛片| 丝袜亚洲精品中文字幕一区| 国产日韩欧美麻豆| 69久久99精品久久久久婷婷 | 国产福利一区二区三区在线视频| 亚洲老司机在线| 久久综合久久久久88| 欧美中文字幕一区二区三区亚洲| 国产一区二区中文字幕| 亚洲高清免费视频| 欧美国产精品中文字幕| 日韩一区二区精品| 色综合夜色一区| 国产不卡在线播放| 蜜臀av一区二区| 亚洲自拍偷拍欧美|