colorlib.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:6k
源码类别:

Symbian

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: colorlib.h,v 1.4.18.1 2004/07/09 01:59:56 hubbe Exp $
  3.  * 
  4.  * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
  5.  * 
  6.  * The contents of this file, and the files included with this file,
  7.  * are subject to the current version of the RealNetworks Public
  8.  * Source License (the "RPSL") available at
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed
  10.  * the file under the current version of the RealNetworks Community
  11.  * Source License (the "RCSL") available at
  12.  * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
  13.  * will apply. You may also obtain the license terms directly from
  14.  * RealNetworks.  You may not use this file except in compliance with
  15.  * the RPSL or, if you have a valid RCSL with RealNetworks applicable
  16.  * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
  17.  * the rights, obligations and limitations governing use of the
  18.  * contents of the file.
  19.  * 
  20.  * Alternatively, the contents of this file may be used under the
  21.  * terms of the GNU General Public License Version 2 or later (the
  22.  * "GPL") in which case the provisions of the GPL are applicable
  23.  * instead of those above. If you wish to allow use of your version of
  24.  * this file only under the terms of the GPL, and not to allow others
  25.  * to use your version of this file under the terms of either the RPSL
  26.  * or RCSL, indicate your decision by deleting the provisions above
  27.  * and replace them with the notice and other provisions required by
  28.  * the GPL. If you do not delete the provisions above, a recipient may
  29.  * use your version of this file under the terms of any one of the
  30.  * RPSL, the RCSL or the GPL.
  31.  * 
  32.  * This file is part of the Helix DNA Technology. RealNetworks is the
  33.  * developer of the Original Code and owns the copyrights in the
  34.  * portions it created.
  35.  * 
  36.  * This file, and the files included with this file, is distributed
  37.  * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
  38.  * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
  39.  * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
  40.  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
  41.  * ENJOYMENT OR NON-INFRINGEMENT.
  42.  * 
  43.  * Technology Compatibility Kit Test Suite(s) Location:
  44.  *    http://www.helixcommunity.org/content/tck
  45.  * 
  46.  * Contributor(s):
  47.  * 
  48.  * ***** END LICENSE BLOCK ***** */
  49. #ifndef __COLORLIB_H__
  50. #define __COLORLIB_H__  1
  51. #include "yuv.h"
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55. /*
  56.  * Initializes "from/to I420" converters.
  57.  * Use:
  58.  *  void SetSrcI420Colors (float Brightness, float Contrast, float Saturation, float Hue);
  59.  * Input:
  60.  *  Brightness - brightness adjustment [-1,1], 0 - default;
  61.  *  Contrast   - contrast adjustment   [-1,1], 0 - default;
  62.  *  Saturation - saturation adjustment [-1,1], 0 - default;
  63.  *  Hue        - hue adjustment        [-1,1], 0 - default;
  64.  * Returns:
  65.  *  none.
  66.  */
  67. void SetSrcI420Colors (float Brightness, float Contrast, float Saturation, float Hue,
  68.        color_data_t* pcd);
  69. /*
  70.  * YUV 4:2:0 chroma resampling mode:
  71.  * Input chroma     a b
  72.  *  samples:        c d
  73.  */
  74. #define CRM_11_11   0       /* (a+b+c+d) / 4 */
  75. #define CRM_11_00   1       /* (a+b) / 2     */
  76. #define CRM_00_11   2       /* (c+d) / 2     */
  77. /*
  78.  * Format-conversion routines.
  79.  * Use:
  80.  *  int XXXXtoYYYY (unsigned char *dest_ptr, int dest_width, int dest_height,
  81.  *      int dest_pitch, int dest_x, int dest_y, int dest_dx, int dest_dy,
  82.  *      unsigned char *src_ptr, int src_width, int src_height, int src_pitch,
  83.  *      int src_x, int src_y, int src_dx, int src_dy);
  84.  * Input:
  85.  *  dest_ptr - pointer to a destination buffer
  86.  *  dest_width, dest_height - width/height of the destination image (pixels)
  87.  *  dest_pitch - pitch of the dest. buffer (in bytes; <0 - if bottom up image)
  88.  *  dest_x, dest_y, dest_dx, dest_dy - destination rectangle (pixels)
  89.  *  src_ptr - pointer to an input image
  90.  *  src_width, src_height - width/height of the input image (pixels)
  91.  *  src_pitch - pitch of the source buffer (in bytes; <0 - if bottom up image)
  92.  *  src_x, src_y, src_dx, src_dy - source rectangle (pixels)
  93.  * Returns:
  94.  *  0 - if success; -1 if failure.
  95.  * Notes:
  96.  *  a) In all cases, pointers to the source and destination buffers must be
  97.  *     DWORD aligned, and both pitch parameters must be multiple of 4!!!
  98.  *  b) Converters that deal with YUV 4:2:2, or 4:2:0 formats may also require
  99.  *     rectangle parameters (x,y,dx,dy) to be multiple of 2. Failure to provide
  100.  *     aligned rectangles will result in partially converted image.
  101.  *  c) Currently only scale factors of 1:1 and 2:1 are supported; if the rates
  102.  *     dest_dx/src_dx & dest_dy/src_dy are neither 1, or 2, the converters
  103.  *     will fail.
  104.  */
  105.   int I420toRGB565   (unsigned char *, int, int, int, int, int, int, int, unsigned char *, int, int, int, int, int, int, int, color_data_t* pcd);
  106.   int I420toRGB444   (unsigned char *, int, int, int, int, int, int, int, unsigned char *, int, int, int, int, int, int, int, color_data_t* pcd);
  107.   int I420toRGB444v565   (unsigned char *, int, int, int, int, int, int, int, unsigned char *, int, int, int, int, int, int, int, color_data_t* pcd);
  108.   void InitI420toRGB565(float, float, float, float, color_data_t* pcd);
  109.   void InitI420toRGB444(float, float, float, float, color_data_t* pcd);
  110.   void InitI420toRGB444v565(float, float, float, float, color_data_t* pcd);
  111.   void UninitI420toRGB565( );
  112.   void UninitI420toRGB444( );
  113.   void UninitI420toRGB444v565( );
  114. #if defined(HELIX_FEATURE_SMIL_SITE)
  115.     int RGB32toRGB444( unsigned char *dest_ptr,
  116.                        int dest_width, int dest_height, int dest_pitch, int dest_x,
  117.                        int dest_y, int dest_dx, int dest_dy,
  118.                        unsigned char *src_ptr,
  119.                        int src_width, int src_height, int src_pitch,
  120.                        int src_x, int src_y, int src_dx, int src_dy,
  121.                        color_data_t* not_used);
  122.     int RGB444toRGB444(unsigned char *dest_ptr,
  123.                        int dest_width, int dest_height, int dest_pitch, int dest_x,
  124.                        int dest_y, int dest_dx, int dest_dy,
  125.                        unsigned char *src_ptr,
  126.                        int src_width, int src_height, int src_pitch,
  127.                        int src_x, int src_y, int src_dx, int src_dy,
  128.                        color_data_t* not_used);
  129. #endif
  130. #ifdef __cplusplus
  131. }
  132. #endif
  133. #endif /* __COLORLIB_H__ */