/* Network-Integrated Multimedia Middleware (NMM)
 * http://www.motama.com/nmm.html
 *  
 * Copyright (C) 2006-2007
 * Motama GmbH, Saarbruecken, Germany
 * http://www.motama.com
 *  
 * This file is part of NMM. 
 * 
 * NMM is free software; you can redistribute it and/or modify it    
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; only version 2 of the License.      
 * 
 * NMM is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 
 * License for more details.  
 * 
 * You should have received a copy of the GNU General Public License 
 * along with NMM; if not, write to the Free Software Foundation,    
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */

#ifndef _NMM_CONVERTER_HPP
#define _NMM_CNVERTER_HPP

extern "C" {
  /**
   * converts rgba bitmap to yv12a
   * \param yuv_buffer pointer to destination buffer (make sure enough buffer space is allocated)
   * \param rgb_buffer pointer to rgba bitmap
   * \param width width of the bitmap
   * \param height height of the bitmap
   */
  void RGBAtoYV12A( unsigned char* yuv_buffer, unsigned char* rgbbuffer, int width, int height);
  /**
   * computes the Y-component of an YUV-image from RGB-values
   * \param R red color component
   * \param G green color component
   * \param B blue color component
   * \return Y color component 
  */
  double getYComponent( unsigned char R, unsigned char G, unsigned char B );
  /**
   * computes the U-component of an YUV-image from RGB-values
   * \param R red color component
   * \param G green color component
   * \param B blue color component
   * \return U color component
   */
  double getUComponent( unsigned char R, unsigned char G, unsigned char B );
  /**
   * computes the V-component of an YUV-image from RGB-values
   * \param R red color component
   * \param G green color component
   * \param B blue color component
   * \return V color component
   */
  double getVComponent( unsigned char R, unsigned char G, unsigned char B );

}
#endif

