View Single Post
Old 12th August 2016, 19:49   #4  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,316
Need help from C++ expert, why Intel compiler is not happy ?
Of course, no issue with Visual Studio.

Code is :
Code:
class ResamplingFunction 
/**
  * Pure virtual base class for resampling functions
  */
{
public:
  virtual double f(double x) = 0;
  virtual double support() = 0;

  virtual ResamplingProgram* GetResamplingProgram(int source_size, double crop_start, double crop_size, int target_size, IScriptEnvironment* env);
};


class PointFilter : public ResamplingFunction 
/**
  * Nearest neighbour (point sampler), used in PointResize
 **/
{
public:
  double f(double x);  
  double support() { return 0.0001; }  // 0.0 crashes it.
};

static PClip CreateResize( PClip clip, int target_width, int target_height, int _threads, const AVSValue* args, 
                           ResamplingFunction* f, IScriptEnvironment* env );


return CreateResize( args[0].AsClip(), args[1].AsInt(), args[2].AsInt(),args[7].AsInt(0), &args[3],
                       &PointFilter(), env );
Error message is :
Code:
1>resample.cpp(2458): error : expression must be an lvalue or a function designator
1>                           &PointFilter(), env );
1>                            ^
I also have :
Code:
1>resample.cpp(2472): warning #1563: taking the address of a temporary
1>                           &MitchellNetravaliFilter(args[3].AsDblDef(1./3.), args[4].AsDblDef(1./3.)), env );
1>                           ^
Expert help needed...

Last edited by jpsdr; 12th August 2016 at 19:52.
jpsdr is offline   Reply With Quote