dasoffset.cpp 652 B

12345678910111213141516171819202122232425262728293031
  1. #include "mex.h"
  2. #include "DasControl.h"
  3. void mexFunction(
  4. int nlhs, mxArray *plhs[],
  5. int nrhs, const mxArray *prhs[])
  6. {
  7. float X, Y;
  8. ScaleOff SO = {};
  9. double *OFF;
  10. /* Check for proper number of arguments */
  11. if (nrhs != 2) {
  12. mexErrMsgTxt("Two input arguments required.");
  13. return;
  14. }
  15. plhs[0] = mxCreateDoubleMatrix(4, 1, mxREAL);
  16. OFF = mxGetPr(plhs[0]);
  17. X = (float)mxGetScalar(prhs[0]);
  18. Y = (float)mxGetScalar(prhs[1]);
  19. SO = ShiftOffset( X, Y);
  20. OFF[0] = SO.Offx;
  21. OFF[1] = SO.Offy;
  22. OFF[2] = SO.SCx;
  23. OFF[3] = SO.SCy;
  24. }