MTK平台下图片旋转90的函数

刚工作的时候写的,呵呵,就是存档而已,先留着,以后说不定要回顾一下呢


static  U8* rotate_ptr =NULL;
void mmi_save_resized_layer(void)
{
    PU8 img_end_ptr;
    U8 byte_per_pixel;  
    U16 n,m;
    PU8 img_src_ptr;
    U32 i=0;
       rotate_ptr= (U8*) mmi_frm_scrmem_alloc(((GDI_LCD_WIDTH*GDI_LCD_HEIGHT*GDI_MAINLCD_BIT_PER_PIXEL)>>3));
 memset(rotate_ptr, 0x00, ((GDI_LCD_WIDTH*GDI_LCD_HEIGHT*GDI_MAINLCD_BIT_PER_PIXEL)>>3));
 gdi_layer_get_buffer_ptr(&img_src_ptr);
       img_end_ptr=img_src_ptr+((GDI_LCD_WIDTH*GDI_LCD_HEIGHT*GDI_MAINLCD_BIT_PER_PIXEL)>>3);//-2;
  byte_per_pixel=GDI_MAINLCD_BIT_PER_PIXEL>>3;
 for(n=0;n<320;n++)
  {
         for(m=0;m<240;m++)
          {
          //  rotate_ptr[i]=*(img_end_ptr-((m+1)*320+n-1-m-240)*byte_per_pixel);
           rotate_ptr[i]=*(img_end_ptr-((m+1)*320-n)*byte_per_pixel);
     i++;
   // rotate_ptr[i]=*(img_end_ptr-((m+1)*320+n-1-m-240)*byte_per_pixel+1);
           rotate_ptr[i]=*(img_end_ptr-((m+1)*320-n)*byte_per_pixel+1);
   i++;
          }
  }
      gdi_image_bmp_encode_file(240,320,byte_per_pixel,rotate_ptr,(PS8)PHNSET_DEFAULT_TEMP_WALLPAPER_PATH_SHOW);
 mmi_frm_scrmem_free(rotate_ptr);
 rotate_ptr=NULL;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值