void Dither32Bit::ditherImageColor32(unsigned char* lum, 
				     unsigned char* cr, 
				     unsigned char* cb,
				     unsigned char* out,
				     int rows,
				     int cols,
				     int mod) {
  
  int L;
  int n;
  int rowWork;
  int colWork;
  
  unsigned int *row1, *row2;
  unsigned char *lum2;
  PIXVAL* local_r_2_pix;
  PIXVAL* local_g_2_pix;
  PIXVAL* local_b_2_pix;
  
  row1 = (unsigned int *)out;
  
  row2 = row1+cols+mod;
  lum2 = lum+cols;
  
  // because the width/height are a multiply of a macroblocksize
  // cols/rows always are even
  colWork=cols>>1;
  rowWork=rows>>1;
  mod=cols+2*mod;
  
  while(rowWork--) {
    n=colWork;
    while(n--) {
      
      local_r_2_pix=r_2_pix+Cr_r_tab[*cr];
      local_g_2_pix=g_2_pix+Cr_g_tab[*cr++] + Cb_g_tab[*cb];
      local_b_2_pix=b_2_pix+Cb_b_tab[*cb++];
      
      L = L_tab[*lum++];
      doRow(row1,L);
	
      L = L_tab[*lum++];
      doRow(row1,L);
	
      L = L_tab [*lum2++];
      doRow(row2,L);
	
      L = L_tab [*lum2++];
      doRow(row2,L);
	
      
    }
    row2 += mod;
    lum += cols;
    lum2 += cols;
    row1 += mod;
    
  }

}
Exemple #2
0
void* RenderThread::run()
{
    while (1)
    {
        std::auto_ptr<WorkItem> wi(img->wq.waitForItem());

        RowWorkItem* rwi = NULL;
        QuitWorkItem* qwi = NULL;

        if ((rwi = dynamic_cast<RowWorkItem*>(wi.get())))
        {
            doRow(rwi->row);
        }
        else if ((qwi = dynamic_cast<QuitWorkItem*>(wi.get())))
        {
            break;
        }
        else
        {
            gf_a(0);
        }
    }

    return NULL;
}
Exemple #3
0
void Fixture::doRows(Parse *rows)
{
    while (rows) {
        Parse *more = rows->more;
        doRow(rows);
        rows = more;
    }
}