/* ------------------------------------------------------------------
 * GEM - Graphics Environment for Multimedia
 *
 * SPDX-FileCopyrightText: © 2002, Chris Clepper and the GEM contributors
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * ------------------------------------------------------------------
 */

#ifndef _INCLUDE__GEM_PIXES_PIX_MOTIONBLUR_H_
#define _INCLUDE__GEM_PIXES_PIX_MOTIONBLUR_H_

#include "Base/GemPixObj.h"

/*-----------------------------------------------------------------
  -------------------------------------------------------------------
  CLASS
  pix_motionblur

  KEYWORDS
  pix
  yuv

  DESCRIPTION

  does motion blur by mixing the current and previous frames for a video 'feedback' effect

  -----------------------------------------------------------------*/

class GEM_EXTERN pix_motionblur : public GemPixObj
{
  CPPEXTERN_HEADER(pix_motionblur, GemPixObj);

public:

  //////////
  // Constructor
  pix_motionblur(int, t_atom*);

protected:

  //////////
  // Destructor
  virtual ~pix_motionblur(void);


  void motionblurMessage(t_symbol*, int, t_atom*);

  //////////
  // Do the processing
  virtual void  processRGBAImage(imageStruct &image);
  virtual void  processGrayImage(imageStruct &image);
  virtual void  processYUVImage(imageStruct &image);

#ifdef __MMX__
  virtual void    processMMX(imageStruct &image);

  virtual void    processRGBAMMX(imageStruct &image);
  virtual void    processYUVMMX(imageStruct &image);
  virtual void    processGrayMMX(imageStruct &image);
#endif

#ifdef __VEC__
  virtual void  processYUVAltivec(imageStruct &image);
#endif

  imageStruct     m_savedImage;
  int           m_blur0, m_blur1;
  t_inlet         *inletmotionblur;
};

#endif
