XilinxProcessorIPLib/drivers/v_letterbox/src/xv_letterbox_l2.c
void XV_LboxSetBackgroundColor(XV_Lbox_l2    *InstancePtr,
                                XLboxColorId ColorId,
                                XVidC_ColorFormat cfmt,
                                XVidC_ColorDepth  bpc)
{
  u16 Cr_b_val,y_r_val,Cb_g_val;
  u16 scale;

  /*
   * Assert validates the input arguments
   */
  Xil_AssertVoid(InstancePtr != NULL);
  Xil_AssertVoid((bpc >= XVIDC_BPC_8) &&
                 (bpc <= InstancePtr->Lbox.Config.MaxDataWidth))

  if(cfmt == XVIDC_CSF_RGB)
  {
    scale = ((1<<bpc)-1);
    y_r_val  = bkgndColorRGB[ColorId][0] * scale;
    Cb_g_val = bkgndColorRGB[ColorId][1] * scale;
    Cr_b_val = bkgndColorRGB[ColorId][2] * scale;
  }
  else //YUV
  {
    scale =  (1<<(bpc-XVIDC_BPC_8));
    y_r_val  = bkgndColorYUV[ColorId][0] * scale;
    Cb_g_val = bkgndColorYUV[ColorId][1] * scale;
    Cr_b_val = bkgndColorYUV[ColorId][2] * scale;
  }

  /* Set video format */
  XV_letterbox_Set_HwReg_video_format(&InstancePtr->Lbox, cfmt);

  /* Set Background color (outside window) */
  XV_letterbox_Set_HwReg_Y_R_value(&InstancePtr->Lbox,  y_r_val);
  XV_letterbox_Set_HwReg_Cb_G_value(&InstancePtr->Lbox, Cb_g_val);
  XV_letterbox_Set_HwReg_Cr_B_value(&InstancePtr->Lbox, Cr_b_val);
}
/*****************************************************************************/
/**
* This function configures the background color to be painted outside active
* window
*
* @param  InstancePtr is a pointer to the core instance to be worked on.
* @param  ColorId is the background color requested
* @param  cfmt is the color format of the input stream
* @param  bpc is the color depth (bits per channel)
*
* @return None
*
******************************************************************************/
This function configures the background color to be painted outside active
window
This function configures the background color to be painted outside active window
void XV_LboxSetBackgroundColor(XV_Lbox_l2    *InstancePtr,
                                XLboxColorId ColorId,
                                XVidC_ColorFormat cfmt,
                                XVidC_ColorDepth  bpc)
{
  u16 Cr_b_val,y_r_val,Cb_g_val;
  u16 scale;
  Xil_AssertVoid(InstancePtr != NULL);
  Xil_AssertVoid((bpc >= XVIDC_BPC_8) &&
                 (bpc <= InstancePtr->Lbox.Config.MaxDataWidth))
  if(cfmt == XVIDC_CSF_RGB)
  {
    scale = ((1<<bpc)-1);
    y_r_val  = bkgndColorRGB[ColorId][0] * scale;
    Cb_g_val = bkgndColorRGB[ColorId][1] * scale;
    Cr_b_val = bkgndColorRGB[ColorId][2] * scale;
  }
  else 
  {
    scale =  (1<<(bpc-XVIDC_BPC_8));
    y_r_val  = bkgndColorYUV[ColorId][0] * scale;
    Cb_g_val = bkgndColorYUV[ColorId][1] * scale;
    Cr_b_val = bkgndColorYUV[ColorId][2] * scale;
  }
  XV_letterbox_Set_HwReg_video_format(&InstancePtr->Lbox, cfmt);
  XV_letterbox_Set_HwReg_Y_R_value(&InstancePtr->Lbox,  y_r_val);
  XV_letterbox_Set_HwReg_Cb_G_value(&InstancePtr->Lbox, Cb_g_val);
  XV_letterbox_Set_HwReg_Cr_B_value(&InstancePtr->Lbox, Cr_b_val);
}
void XV_LboxSetBackgroundColor ( XV_Lbox_l2 * InstancePtr , XLboxColorId ColorId , XVidC_ColorFormat cfmt , XVidC_ColorDepth bpc ) { u16 Cr_b_val , y_r_val , Cb_g_val ; u16 scale ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( ( bpc >= XVIDC_BPC_8 ) && ( bpc <= InstancePtr -> Lbox . Config . MaxDataWidth ) ) if ( cfmt == XVIDC_CSF_RGB ) { scale = ( ( 1 << bpc ) - 1 ) ; y_r_val = bkgndColorRGB [ ColorId ] [ 0 ] * scale ; Cb_g_val = bkgndColorRGB [ ColorId ] [ 1 ] * scale ; Cr_b_val = bkgndColorRGB [ ColorId ] [ 2 ] * scale ; } else { scale = ( 1 << ( bpc - XVIDC_BPC_8 ) ) ; y_r_val = bkgndColorYUV [ ColorId ] [ 0 ] * scale ; Cb_g_val = bkgndColorYUV [ ColorId ] [ 1 ] * scale ; Cr_b_val = bkgndColorYUV [ ColorId ] [ 2 ] * scale ; } XV_letterbox_Set_HwReg_video_format ( & InstancePtr -> Lbox , cfmt ) ; XV_letterbox_Set_HwReg_Y_R_value ( & InstancePtr -> Lbox , y_r_val ) ; XV_letterbox_Set_HwReg_Cb_G_value ( & InstancePtr -> Lbox , Cb_g_val ) ; XV_letterbox_Set_HwReg_Cr_B_value ( & InstancePtr -> Lbox , Cr_b_val ) ; }
This function configures the background color to be painted outside active
window
This function configures the background color to be painted outside active window
/*
   * Assert validates the input arguments
   */ //YUV /* Set video format */ /* Set Background color (outside window) */