Home | History | Annotate | Download | only in inc
      1 /*
      2  * Copyright (C) 2011 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16  /**
     17  ******************************************************************************
     18  * @file        M4TRAN_transition.h
     19  * @brief
     20  * @note
     21  ******************************************************************************
     22 */
     23 
     24 #ifndef __M4VFL_TRANSITION_H__
     25 #define __M4VFL_TRANSITION_H__
     26 
     27 #ifdef __cplusplus
     28 extern "C" {
     29 #endif
     30 typedef unsigned char UInt8;
     31 typedef unsigned long UInt32;
     32 
     33 typedef    struct S_M4ViComImagePlane
     34 {
     35     UInt32        u_width;            /* active width, in pixels */
     36     UInt32        u_height;            /* active height, in lines */
     37     UInt32        u_topleft;            /* index of 1st active pixel */
     38     UInt32        u_stride;            /* line stride, in bytes */
     39     UInt8        *pac_data;            /* buffer address */
     40 }    M4ViComImagePlane;
     41 
     42 typedef struct S_M4VFL_modifLumParam
     43 {
     44     unsigned short lum_factor;
     45     unsigned short copy_chroma;
     46 } M4VFL_ModifLumParam;
     47 
     48 #define     M4VIFI_OK                       0
     49 #define     M4VIFI_ILLEGAL_FRAME_HEIGHT     8
     50 #define     M4VIFI_ILLEGAL_FRAME_WIDTH      9
     51 
     52 unsigned char M4VFL_modifyLumaByStep(M4ViComImagePlane *plane_in, M4ViComImagePlane *plane_out,
     53                                          M4VFL_ModifLumParam *lum_param, void *user_data);
     54 
     55 unsigned char M4VFL_modifyLumaWithScale(M4ViComImagePlane *plane_in, M4ViComImagePlane *plane_out,
     56                                          unsigned long lum_factor, void *user_data);
     57 
     58 /**
     59  *************************************************************************************************
     60  * M4OSA_ERR M4VIFI_ImageBlendingonYUV420 (void *pUserData,
     61  *                                                  M4VIFI_ImagePlane *pPlaneIn1,
     62  *                                                  M4VIFI_ImagePlane *pPlaneIn2,
     63  *                                                  M4VIFI_ImagePlane *pPlaneOut,
     64  *                                                  M4VIFI_UInt32 Progress)
     65  * @brief   Blends two YUV 4:2:0 Planar images.
     66  * @note    Blends YUV420 planar images,
     67  *          Map the value of progress from (0 - 1000) to (0 - 1024)
     68  *          Set the range of blendingfactor,
     69  *                  1. from 0 to (Progress << 1)            ;for Progress <= 512
     70  *                  2. from (( Progress - 512)<< 1) to 1024 ;otherwise
     71  *          Set the increment of blendingfactor for each element in the image row by the factor,
     72  *                  =  (Range-1) / (image width-1)  ;for width >= range
     73  *                  =  (Range) / (image width)      ;otherwise
     74  *          Loop on each(= i) row of output Y plane (steps of 2)
     75  *              Loop on each(= j) column of output Y plane (steps of 2)
     76  *                  Get four Y samples and one U & V sample from two input YUV4:2:0 images and
     77  *                  Compute four Y sample and one U & V sample for output YUV4:2:0 image
     78  *                      using the following,
     79  *                  Out(i,j) = blendingfactor(i,j) * In1(i,j)+ (l - blendingfactor(i,j)) * In2(i,j)
     80  *              end loop column
     81  *          end loop row.
     82  * @param   pUserData: (IN)  User Specific Parameter
     83  * @param   pPlaneIn1: (IN)  Pointer to an array of image plane structures maintained for Y, U
     84  *                            and V planes.
     85  * @param   pPlaneIn2: (IN)  Pointer to an array of image plane structures maintained for Y, U
     86  *                            and V planes.
     87  * @param   pPlaneOut: (OUT) Pointer to an array of image plane structures maintained for Y, U
     88  *                            and V planes.
     89  * @param   Progress:  (IN)  Progress value (varies between 0 and 1000)
     90  * @return  M4VIFI_OK: No error
     91  * @return  M4VIFI_ILLEGAL_FRAME_HEIGHT: Error in height
     92  * @return  M4VIFI_ILLEGAL_FRAME_WIDTH:  Error in width
     93  ***********************************************************************************************/
     94 unsigned char M4VIFI_ImageBlendingonYUV420 (void *pUserData, M4ViComImagePlane *pPlaneIn1,
     95                                                 M4ViComImagePlane *pPlaneIn2,
     96                                                 M4ViComImagePlane *pPlaneOut, UInt32 Progress);
     97 
     98 #ifdef __cplusplus
     99 }
    100 #endif /* __cplusplus */
    101 
    102 #endif // __M4VFL_TRANSITION_H__
    103