lcd 显示(二)

CdrDisplay::CdrDisplay(int disp_id,    ViewInfo *sur)
{
 mCD = new CedarDisplay(disp_id);
 mHlay = mCD->requestSurface(sur);
 mLayerOpened = true;
}

int CdrDisplay::getHandle()
{
 return mHlay; 
}

CdrDisplay::CdrDisplay(int disp_id)
{
 ViewInfo sur;
 memset(&sur, 0, sizeof(ViewInfo));
 CdrDisplay(disp_id, &sur);
}

CdrDisplay::~CdrDisplay()
{
 db_msg("CdrDisplay Destructor\n");
 mCD->releaseSurface(mHlay);
 delete mCD;
 mCD = NULL;
}

void CdrDisplay::setBottom()
{
 }

void CdrDisplay::setRect(CDR_RECT &rect)
{
 ViewInfo vi;
 if(mCD) {
  vi.x = rect.x;
  vi.y = rect.y;
  vi.w = rect.w;
  vi.h = rect.h;

  db_msg("[richard ]x=%d,y=%d,w=%d,h=%d\n",vi.x,vi.y,vi.w,vi.h);
  
  mCD->setPreviewRect(&vi);
 } else {
  db_error("mCD is invalid\n"); 
 }
}

void CdrDisplay::open()               // UI图层2,0默认就是打开的                  
{

 db_msg("<**CdrDisplay::open**>");
 if(mLayerOpened == true)
  return;
 if (mCD) {
  int ret;
  ret = mCD->open(mHlay, 1);
  db_msg("ret is %d\n", ret);
  if(ret == 0)
   mLayerOpened = true;
 }
}

void CdrDisplay::openAdasScreen()
{
 db_msg("<**CdrDisplay::openAdasScreen**>");
 if (mCD) {
  int ret;
  ret = mCD->open(9, 1);                                              //  2*4+1  ,adas图层是2,1

  db_msg("ret is %d\n", ret);
  if(ret != 0)
   db_msg("<****openAdasScreen failed****>");
 }
}

void CdrDisplay::close()
{
// if(mLayerOpened == false)
//  return;
 if (mCD) {
  int ret;
  ret = mCD->open(mHlay, 0);
  db_msg("ret is %d\n", ret);
  if(ret == 0)
   mLayerOpened = false;
 }
}

void CdrDisplay::closeAdasScreen()
{
 db_msg("<**CdrDisplay::closeAdasScreen**>");
 if (mCD) {
  int ret;
  ret = mCD->open(9, 0);
  db_msg("ret is %d\n", ret);
  if(ret != 0)
   db_msg("<****closeAdasScreen failed****>");
 }
}

void CdrDisplay::exchange(int hlay, int flag)
{
 mCD->exchangeSurface(mHlay, hlay, flag);
}

void CdrDisplay::otherScreen(int screen, int hlay)
{
 mCD->otherScreen(screen, mHlay, hlay);
}

void CdrDisplay::clean(void)
{
 mCD->clearSurface(mHlay);
}

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值