//照片象IPHONE的机子一样移动的效果代码(左往右移)
U8 temp_row_buffer2[LCD_WIDTH*2*2];
static U8 temp_col_buffer2[LCD_HEIGHT*2*2];
void test_draw_move_l2r(int offset)
{
PU8 pBaseLayerPtr; //OSD layer pointer;
PU8 pCacheLayerPtr; //Back Image layer pointer;
PU8 pThumbLayerPtr;
PU8 pBasePos;
PU8 pCachePos;
PU8 pThumbPos;
PU8 pCopyPtr;
PU8 pTempPtr;
int row,col;
gdi_layer_get_buffer_ptr(&pBaseLayerPtr);
gdi_layer_push_and_set_active(g_imgadv_cntx.cache_layer_handle);
gdi_layer_get_buffer_ptr(&pCacheLayerPtr);
gdi_layer_pop_and_restore_active();
gdi_layer_push_and_set_active(g_imgadv_cntx.thumbnail_layer_handle);
gdi_layer_get_buffer_ptr(&pThumbLayerPtr);
gdi_layer_pop_and_restore_active();
memset(temp_row_buffer2,0,sizeof(temp_row_buffer2));
memset(temp_col_buffer2,0,sizeof(temp_col_buffer2));
if (offset>0)
{
if(g_imgadv_cntx.imgview_rotate==0 || g_imgadv_cntx.imgview_rotate==2)
{/*OK*/
for (row=0;row<LCD_HEIGHT;row++)
{
pCachePos = pCacheLayerPtr+row*LCD_WIDTH*2;
pBasePos = pBaseLayerPtr+row*LCD_WIDTH*2;
pThumbPos = pThumbLayerPtr+row*LCD_WIDTH*2;
pTempPtr = temp_row_buffer2;
memcpy(pTempPtr,pCachePos,LCD_WIDTH*2);
pTempPtr+=LCD_WIDTH*2;
memcpy(pTempPtr,pThumbPos,LCD_WIDTH*2);
memcpy(pBasePos,(temp_row_buffer2+(LCD_WIDTH-offset)*2),LCD_WIDTH*2);
}
}
else
{
if(g_imgadv_cntx.imgview_rotate ==1) ///90 degree
{/* r2l*/
Trace_out("img 90 degree lllllll 2 rrrrrr\n");
for (row=0;row<LCD_WIDTH;row++)
{
pCachePos = pCacheLayerPtr+row*LCD_HEIGHT*2;
pBasePos = pBaseLayerPtr+row*LCD_HEIGHT*2;
pThumbPos = pThumbLayerPtr+row*LCD_HEIGHT*2;
pTempPtr = temp_col_buffer2;
memcpy(pTempPtr,pCachePos,LCD_HEIGHT*2);
pTempPtr+=LCD_HEIGHT*2;
memcpy(pTempPtr,pThumbPos,LCD_HEIGHT*2);
memcpy(pBasePos,(temp_col_buffer2+(LCD_HEIGHT-offset)*2),LCD_HEIGHT*2);
}
}
else ///270 degree
{
for (row=0;row<LCD_WIDTH;row++)
{
pCachePos = pCacheLayerPtr+row*LCD_HEIGHT*2;
pBasePos = pBaseLayerPtr+row*LCD_HEIGHT*2;
pThumbPos = pThumbLayerPtr+row*LCD_HEIGHT*2;
pTempPtr = temp_col_buffer2;
memcpy(pTempPtr,pCachePos,LCD_HEIGHT*2);
pTempPtr+=LCD_HEIGHT*2;
memcpy(pTempPtr,pThumbPos,LCD_HEIGHT*2);
memcpy(pBasePos,(temp_col_buffer2+(LCD_HEIGHT-offset)*2),LCD_HEIGHT*2);
}
}
}
}
}