www.pudn.com > vcmatlab20060426WaterMark.zip > C_imwrite.cpp


// 
// MATLAB Compiler: 2.2 
// Date: Sun May 15 21:37:52 2005 
// Arguments: "-B" "macro_default" "-O" "all" "-O" "fold_scalar_mxarrays:on" 
// "-O" "fold_non_scalar_mxarrays:on" "-O" "optimize_integer_for_loops:on" "-O" 
// "array_indexing:on" "-O" "optimize_conditionals:on" "-B" "sglcpp" "-p" "-W" 
// "main" "-L" "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-W" "mainhg" 
// "libmwsglm.mlib" "-l" "-p" "-W" "main" "-L" "Cpp" "-t" "-T" "link:exe" "-h" 
// "libmmfile.mlib" "-h" "C_imwrite"  
// 
#include "C_imwrite.hpp" 
#include "imshow.hpp" 
#include "libmwsglm.hpp" 
 
static mxChar _array1_[136] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ', 
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i', 
                                'l', 'e', ':', ' ', 'C', '_', 'i', 'm', 'w', 
                                'r', 'i', 't', 'e', ' ', 'L', 'i', 'n', 'e', 
                                ':', ' ', '1', ' ', 'C', 'o', 'l', 'u', 'm', 
                                'n', ':', ' ', '1', ' ', 'T', 'h', 'e', ' ', 
                                'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 
                                '"', 'C', '_', 'i', 'm', 'w', 'r', 'i', 't', 
                                'e', '"', ' ', 'w', 'a', 's', ' ', 'c', 'a', 
                                'l', 'l', 'e', 'd', ' ', 'w', 'i', 't', 'h', 
                                ' ', 'm', 'o', 'r', 'e', ' ', 't', 'h', 'a', 
                                'n', ' ', 't', 'h', 'e', ' ', 'd', 'e', 'c', 
                                'l', 'a', 'r', 'e', 'd', ' ', 'n', 'u', 'm', 
                                'b', 'e', 'r', ' ', 'o', 'f', ' ', 'o', 'u', 
                                't', 'p', 'u', 't', 's', ' ', '(', '0', ')', 
                                '.' }; 
static mwArray _mxarray0_ = mclInitializeString(136, _array1_); 
 
static mxChar _array3_[135] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ', 
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i', 
                                'l', 'e', ':', ' ', 'C', '_', 'i', 'm', 'w', 
                                'r', 'i', 't', 'e', ' ', 'L', 'i', 'n', 'e', 
                                ':', ' ', '1', ' ', 'C', 'o', 'l', 'u', 'm', 
                                'n', ':', ' ', '1', ' ', 'T', 'h', 'e', ' ', 
                                'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', 
                                '"', 'C', '_', 'i', 'm', 'w', 'r', 'i', 't', 
                                'e', '"', ' ', 'w', 'a', 's', ' ', 'c', 'a', 
                                'l', 'l', 'e', 'd', ' ', 'w', 'i', 't', 'h', 
                                ' ', 'm', 'o', 'r', 'e', ' ', 't', 'h', 'a', 
                                'n', ' ', 't', 'h', 'e', ' ', 'd', 'e', 'c', 
                                'l', 'a', 'r', 'e', 'd', ' ', 'n', 'u', 'm', 
                                'b', 'e', 'r', ' ', 'o', 'f', ' ', 'i', 'n', 
                                'p', 'u', 't', 's', ' ', '(', '3', ')', '.' }; 
static mwArray _mxarray2_ = mclInitializeString(135, _array3_); 
 
void InitializeModule_C_imwrite() { 
} 
 
void TerminateModule_C_imwrite() { 
} 
 
static void MC_imwrite(mwArray data, mwArray filename, mwArray type); 
 
_mexLocalFunctionTable _local_function_table_C_imwrite 
  = { 0, (mexFunctionTableEntry *)NULL }; 
 
// 
// The function "C_imwrite" contains the normal interface for the "C_imwrite" 
// M-function from file "D:\matlab资料\学习实例\C_imwrite.m" (lines 1-5). This 
// function processes any input arguments and passes them to the implementation 
// version of the function, appearing above. 
// 
void C_imwrite(mwArray data, mwArray filename, mwArray type) { 
    MC_imwrite(data, filename, type); 
} 
 
// 
// The function "mlxC_imwrite" contains the feval interface for the "C_imwrite" 
// M-function from file "D:\matlab资料\学习实例\C_imwrite.m" (lines 1-5). The 
// feval function calls the implementation version of C_imwrite through this 
// function. This function processes any input arguments and passes them to the 
// implementation version of the function, appearing above. 
// 
void mlxC_imwrite(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) { 
    MW_BEGIN_MLX(); 
    { 
        mwArray mprhs[3]; 
        int i; 
        if (nlhs > 0) { 
            error(_mxarray0_); 
        } 
        if (nrhs > 3) { 
            error(_mxarray2_); 
        } 
        for (i = 0; i < 3 && i < nrhs; ++i) { 
            mprhs[i] = mwArray(prhs[i], 0); 
        } 
        for (; i < 3; ++i) { 
            mprhs[i].MakeDIN(); 
        } 
        MC_imwrite(mprhs[0], mprhs[1], mprhs[2]); 
    } 
    MW_END_MLX(); 
} 
 
// 
// The function "MC_imwrite" is the implementation version of the "C_imwrite" 
// M-function from file "D:\matlab资料\学习实例\C_imwrite.m" (lines 1-5). It 
// contains the actual compiled code for that M-function. It is a static 
// function and must only be called from one of the interface functions, 
// appearing below. 
// 
// 
// function C_imwrite(data,filename,type) 
// 
static void MC_imwrite(mwArray data, mwArray filename, mwArray type) { 
    mclMlineEnterFunction( 
      "D:\\matlab\327\312\301\317\\\321\247" 
      "\317\260\312\265\300\375\\C_imwrite.m", 
      "C_imwrite") 
    mwLocalFunctionTable save_local_function_table_ 
      (&_local_function_table_C_imwrite); 
    mwArray ans(mclGetUninitializedArray()); 
    // 
    // %imwrite(data,'watered_image.bmp','bmp'); 
    // imwrite(data,filename,type); 
    // 
    mclMline(3); 
    imwrite( 
      mwVarargin( 
        mwVa(data, "data"), mwVa(filename, "filename"), mwVa(type, "type"))); 
    // 
    // imshow(data); 
    // 
    mclMline(4); 
    ans.EqAns(Nimshow(0, mwVarargin(mwVa(data, "data")))); 
    mclMlineExitFunction(); 
}