⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imread.cpp

📁 matlab的可执行程序
💻 CPP
📖 第 1 页 / 共 3 页
字号:
//
// MATLAB Compiler: 3.0
// Date: Wed Jul 14 12:15:03 2004
// 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" "QQchabu.m" 
//
#include "imread.hpp"
#include "libmatlbm.hpp"
#include "libmmfile.hpp"
#include "libmwsglm.hpp"

static mxChar _array1_[2] = { '%', 's' };
static mwArray _mxarray0_ = mclInitializeString(2, _array1_);

static mxChar _array3_[3] = { ':', '/', '/' };
static mwArray _mxarray2_ = mclInitializeString(3, _array3_);

static mxChar _array5_[3] = { 'm', 'w', 't' };
static mwArray _mxarray4_ = mclInitializeString(3, _array5_);

static mxChar _array7_[51] = { 'R', 'e', 'a', 'd', 'i', 'n', 'g', ' ', 'f',
                               'r', 'o', 'm', ' ', 'a', ' ', 'U', 'R', 'L',
                               ' ', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 's',
                               ' ', 'a', ' ', 'J', 'a', 'v', 'a', ' ', 'V',
                               'i', 'r', 't', 'u', 'a', 'l', ' ', 'M', 'a',
                               'c', 'h', 'i', 'n', 'e', '.' };
static mwArray _mxarray6_ = mclInitializeString(51, _array7_);

static mxChar _array9_[20] = { 'C', 'a', 'n', 0x0027, 't', ' ',
                               'r', 'e', 'a', 'd', ' ', 'U', 'R',
                               'L', ' ', '"', '%', 's', '"', '.' };
static mwArray _mxarray8_ = mclInitializeString(20, _array9_);

static mxChar _array11_[1] = { 'r' };
static mwArray _mxarray10_ = mclInitializeString(1, _array11_);
static mwArray _mxarray12_ = mclInitializeDouble(-1.0);

static mxChar _array14_[68] = { 'C', 'a', 'n', 0x0027, 't', ' ', 'o', 'p',
                                'e', 'n', ' ', 'f', 'i', 'l', 'e', ' ', '"',
                                '%', 's', '"', ' ', 'f', 'o', 'r', ' ', 'r',
                                'e', 'a', 'd', 'i', 'n', 'g', ';', 0x005c,
                                'n', 'y', 'o', 'u', ' ', 'm', 'a', 'y', ' ',
                                'n', 'o', 't', ' ', 'h', 'a', 'v', 'e', ' ',
                                'r', 'e', 'a', 'd', ' ', 'p', 'e', 'r', 'm',
                                'i', 's', 's', 'i', 'o', 'n', '.' };
static mwArray _mxarray13_ = mclInitializeString(68, _array14_);

static mxChar _array16_[25] = { 'F', 'i', 'l', 'e', ' ', '"', '%', 's', '"',
                                ' ', 'd', 'o', 'e', 's', ' ', 'n', 'o', 't',
                                ' ', 'e', 'x', 'i', 's', 't', '.' };
static mwArray _mxarray15_ = mclInitializeString(25, _array16_);

static mxChar _array18_[36] = { 'U', 'n', 'a', 'b', 'l', 'e', ' ', 't', 'o',
                                ' ', 'd', 'e', 't', 'e', 'r', 'm', 'i', 'n',
                                'e', ' ', 't', 'h', 'e', ' ', 'f', 'i', 'l',
                                'e', ' ', 'f', 'o', 'r', 'm', 'a', 't', '.' };
static mwArray _mxarray17_ = mclInitializeString(36, _array18_);

static mxChar _array20_[70] = { 'C', 'o', 'u', 'l', 'd', 'n', 0x0027, 't',
                                ' ', 'f', 'i', 'n', 'd', ' ', 'f', 'o', 'r',
                                'm', 'a', 't', ' ', '%', 's', ' ', 'i', 'n',
                                ' ', 't', 'h', 'e', ' ', 'f', 'o', 'r', 'm',
                                'a', 't', ' ', 'r', 'e', 'g', 'i', 's', 't',
                                'r', 'y', '.', ' ', ' ', 'S', 'e', 'e', ' ',
                                '"', 'h', 'e', 'l', 'p', ' ', 'i', 'm', 'f',
                                'o', 'r', 'm', 'a', 't', 's', '"', '.' };
static mwArray _mxarray19_ = mclInitializeString(70, _array20_);
static mwArray _mxarray21_ = mclInitializeDoubleVector(0, 0, (double *)NULL);

static mxChar _array23_[1] = { '.' };
static mwArray _mxarray22_ = mclInitializeString(1, _array23_);

static mxChar _array25_[57] = { 'N', 'o', ' ', 'r', 'e', 'a', 'd', 'i', 'n',
                                'g', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
                                'n', ' ', 'f', 'o', 'r', ' ', 'f', 'o', 'r',
                                'm', 'a', 't', ' ', '%', 's', '.', ' ', ' ',
                                'S', 'e', 'e', ' ', '"', 'h', 'e', 'l', 'p',
                                ' ', 'i', 'm', 'f', 'o', 'r', 'm', 'a', 't',
                                's', '"', '.' };
static mwArray _mxarray24_ = mclInitializeString(57, _array25_);
static mwArray _mxarray26_ = mclInitializeDouble(1.0);

static mxChar _array28_[33] = { 'C', 'a', 'n', 0x0027, 't', ' ', 'd', 'e',
                                'l', 'e', 't', 'e', ' ', 't', 'e', 'm', 'p',
                                'o', 'r', 'a', 'r', 'y', ' ', 'f', 'i', 'l',
                                'e', ' ', '"', '%', 's', '"', '.' };
static mwArray _mxarray27_ = mclInitializeString(33, _array28_);
static mwArray _mxarray29_ = mclInitializeCharVector(0, 0, (mxChar *)NULL);
static mwArray _mxarray30_ = mclInitializeCellVector(0, 0, (mxArray * *)NULL);
static mwArray _mxarray31_ = mclInitializeDouble(0.0);

static mxChar _array33_[24] = { 'T', 'o', 'o', ' ', 'f', 'e', 'w', ' ',
                                'i', 'n', 'p', 'u', 't', ' ', 'a', 'r',
                                'g', 'u', 'm', 'e', 'n', 't', 's', '.' };
static mwArray _mxarray32_ = mclInitializeString(24, _array33_);
static mwArray _mxarray34_ = mclInitializeDouble(2.0);
static mwArray _mxarray35_ = mclInitializeDouble(3.0);

void InitializeModule_imread() {
}

void TerminateModule_imread() {
}

static void imread_delete_download(mwArray filename = mwArray::DIN);
#ifdef __cplusplus
extern "C"
#endif
void mlxImread_delete_download(int nlhs,
                               mxArray * plhs[],
                               int nrhs,
                               mxArray * prhs[]);
static mwArray imread_parse_inputs(mwArray * format,
                                   mwArray * extraArgs,
                                   mwArray * msg,
                                   mwVarargin varargin = mwVarargin::DIN);
#ifdef __cplusplus
extern "C"
#endif
void mlxImread_parse_inputs(int nlhs,
                            mxArray * plhs[],
                            int nrhs,
                            mxArray * prhs[]);
static mwArray Mimread(mwArray * map,
                       mwArray * alpha,
                       int nargout_,
                       mwArray varargin);
static void Mimread_delete_download(mwArray filename);
static mwArray Mimread_parse_inputs(mwArray * format,
                                    mwArray * extraArgs,
                                    mwArray * msg,
                                    int nargout_,
                                    mwArray varargin);

static mexFunctionTableEntry local_function_table_[2]
  = { { "delete_download", mlxImread_delete_download, 1, 0, NULL },
      { "parse_inputs", mlxImread_parse_inputs, -1, 4, NULL } };

_mexLocalFunctionTable _local_function_table_imread
  = { 2, local_function_table_ };

//
// The function "Nimread" contains the nargout interface for the "imread"
// M-function from file "e:\matlab6.5\toolbox\matlab\iofun\imread.m" (lines
// 1-297). This interface is only produced if the M-function uses the special
// variable "nargout". The nargout interface allows the number of requested
// outputs to be specified via the nargout argument, as opposed to the normal
// interface which dynamically calculates the number of outputs based on the
// number of non-NULL inputs it receives. This function processes any input
// arguments and passes them to the implementation version of the function,
// appearing above.
//
mwArray Nimread(int nargout,
                mwArray * map,
                mwArray * alpha,
                mwVarargin varargin) {
    mwArray X = mwArray::UNDEFINED;
    mwArray map__ = mwArray::UNDEFINED;
    mwArray alpha__ = mwArray::UNDEFINED;
    X = Mimread(&map__, &alpha__, nargout, varargin.ToArray());
    if (map != NULL) {
        *map = map__;
    }
    if (alpha != NULL) {
        *alpha = alpha__;
    }
    return X;
}

//
// The function "imread" contains the normal interface for the "imread"
// M-function from file "e:\matlab6.5\toolbox\matlab\iofun\imread.m" (lines
// 1-297). This function processes any input arguments and passes them to the
// implementation version of the function, appearing above.
//
mwArray imread(mwArray * map, mwArray * alpha, mwVarargin varargin) {
    int nargout = 1;
    mwArray X = mwArray::UNDEFINED;
    mwArray map__ = mwArray::UNDEFINED;
    mwArray alpha__ = mwArray::UNDEFINED;
    if (map != NULL) {
        ++nargout;
    }
    if (alpha != NULL) {
        ++nargout;
    }
    X = Mimread(&map__, &alpha__, nargout, varargin.ToArray());
    if (map != NULL) {
        *map = map__;
    }
    if (alpha != NULL) {
        *alpha = alpha__;
    }
    return X;
}

//
// The function "Vimread" contains the void interface for the "imread"
// M-function from file "e:\matlab6.5\toolbox\matlab\iofun\imread.m" (lines
// 1-297). The void interface is only produced if the M-function uses the
// special variable "nargout", and has at least one output. The void interface
// function specifies zero output arguments to the implementation version of
// the function, and in the event that the implementation version still returns
// an output (which, in MATLAB, would be assigned to the "ans" variable), it
// deallocates the output. This function processes any input arguments and
// passes them to the implementation version of the function, appearing above.
//
void Vimread(mwVarargin varargin) {
    mwArray X = mwArray::UNDEFINED;
    mwArray map = mwArray::UNDEFINED;
    mwArray alpha = mwArray::UNDEFINED;
    X = Mimread(&map, &alpha, 0, varargin.ToArray());
}

//
// The function "mlxImread" contains the feval interface for the "imread"
// M-function from file "e:\matlab6.5\toolbox\matlab\iofun\imread.m" (lines
// 1-297). The feval function calls the implementation version of imread
// through this function. This function processes any input arguments and
// passes them to the implementation version of the function, appearing above.
//
void mlxImread(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
    MW_BEGIN_MLX();
    {
        mwArray mprhs[1];
        mwArray mplhs[3];
        int i;
        mclCppUndefineArrays(3, mplhs);
        if (nlhs > 3) {
            error(
              mwVarargin(
                mwArray(
                  "Run-time Error: File: imread Line: 1 Column: 1"
                  " The function \"imread\" was called with more "
                  "than the declared number of outputs (3).")));
        }
        mprhs[0] = mclCreateVararginCell(nrhs, prhs);
        mplhs[0] = Mimread(&mplhs[1], &mplhs[2], nlhs, mprhs[0]);
        plhs[0] = mplhs[0].FreezeData();
        for (i = 1; i < 3 && i < nlhs; ++i) {
            plhs[i] = mplhs[i].FreezeData();
        }
    }
    MW_END_MLX();
}

//
// The function "imread_delete_download" contains the normal interface for the
// "imread/delete_download" M-function from file
// "e:\matlab6.5\toolbox\matlab\iofun\imread.m" (lines 297-311). This function
// processes any input arguments and passes them to the implementation version
// of the function, appearing above.
//
static void imread_delete_download(mwArray filename) {
    Mimread_delete_download(filename);
}

//
// The function "mlxImread_delete_download" contains the feval interface for
// the "imread/delete_download" M-function from file
// "e:\matlab6.5\toolbox\matlab\iofun\imread.m" (lines 297-311). The feval
// function calls the implementation version of imread/delete_download through
// this function. This function processes any input arguments and passes them
// to the implementation version of the function, appearing above.
//
void mlxImread_delete_download(int nlhs,
                               mxArray * plhs[],
                               int nrhs,
                               mxArray * prhs[]) {
    MW_BEGIN_MLX();
    {
        mwArray mprhs[1];
        int i;
        if (nlhs > 0) {
            error(
              mwVarargin(
                mwArray(
                  "Run-time Error: File: imread/delete_download Line: 297 Co"
                  "lumn: 1 The function \"imread/delete_download\" was calle"
                  "d with more than the declared number of outputs (0).")));
        }
        if (nrhs > 1) {
            error(
              mwVarargin(
                mwArray(
                  "Run-time Error: File: imread/delete_download Line: 297 Co"
                  "lumn: 1 The function \"imread/delete_download\" was calle"
                  "d with more than the declared number of inputs (1).")));
        }
        for (i = 0; i < 1 && i < nrhs; ++i) {
            mprhs[i] = mwArray(prhs[i], 0);
        }
        for (; i < 1; ++i) {
            mprhs[i].MakeDIN();
        }
        Mimread_delete_download(mprhs[0]);
    }
    MW_END_MLX();
}

//
// The function "imread_parse_inputs" contains the normal interface for the
// "imread/parse_inputs" M-function from file
// "e:\matlab6.5\toolbox\matlab\iofun\imread.m" (lines 311-354). This function
// processes any input arguments and passes them to the implementation version
// of the function, appearing above.
//
static mwArray imread_parse_inputs(mwArray * format,
                                   mwArray * extraArgs,
                                   mwArray * msg,
                                   mwVarargin varargin) {
    int nargout = 1;
    mwArray filename = mwArray::UNDEFINED;
    mwArray format__ = mwArray::UNDEFINED;
    mwArray extraArgs__ = mwArray::UNDEFINED;
    mwArray msg__ = mwArray::UNDEFINED;
    if (format != NULL) {
        ++nargout;
    }
    if (extraArgs != NULL) {
        ++nargout;
    }
    if (msg != NULL) {
        ++nargout;
    }
    filename
      = Mimread_parse_inputs(
          &format__, &extraArgs__, &msg__, nargout, varargin.ToArray());
    if (format != NULL) {
        *format = format__;
    }
    if (extraArgs != NULL) {
        *extraArgs = extraArgs__;
    }
    if (msg != NULL) {
        *msg = msg__;
    }
    return filename;
}

//
// The function "mlxImread_parse_inputs" contains the feval interface for the
// "imread/parse_inputs" M-function from file
// "e:\matlab6.5\toolbox\matlab\iofun\imread.m" (lines 311-354). The feval
// function calls the implementation version of imread/parse_inputs through
// this function. This function processes any input arguments and passes them
// to the implementation version of the function, appearing above.
//
void mlxImread_parse_inputs(int nlhs,
                            mxArray * plhs[],
                            int nrhs,
                            mxArray * prhs[]) {
    MW_BEGIN_MLX();
    {
        mwArray mprhs[1];
        mwArray mplhs[4];
        int i;
        mclCppUndefineArrays(4, mplhs);
        if (nlhs > 4) {
            error(
              mwVarargin(
                mwArray(
                  "Run-time Error: File: imread/parse_inputs Line: 311 Col"
                  "umn: 1 The function \"imread/parse_inputs\" was called "
                  "with more than the declared number of outputs (4).")));
        }
        mprhs[0] = mclCreateVararginCell(nrhs, prhs);
        mplhs[0]
          = Mimread_parse_inputs(
              &mplhs[1], &mplhs[2], &mplhs[3], nlhs, mprhs[0]);
        plhs[0] = mplhs[0].FreezeData();
        for (i = 1; i < 4 && i < nlhs; ++i) {
            plhs[i] = mplhs[i].FreezeData();
        }
    }
    MW_END_MLX();
}

//
// The function "Mimread" is the implementation version of the "imread"
// M-function from file "e:\matlab6.5\toolbox\matlab\iofun\imread.m" (lines
// 1-297). 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 [X, map, alpha] = imread(varargin)
//
static mwArray Mimread(mwArray * map,
                       mwArray * alpha,
                       int nargout_,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -