Logo Search packages:      
Sourcecode: blender version File versions

void IMB_clever_double ( struct ImBuf ibuf  ) 

Attention:
Defined in antialias.c

Definition at line 421 of file antialias.c.

References IMB_clever_double(), ImBuf::rect, ImBuf::x, and ImBuf::y.

Referenced by IMB_clever_double().

{
      ListBase * listarray, * curlist;
      Edge * new;
      int size;
      int i;
      
      if (ibuf == 0) return;
      
      size = ibuf->x;
      listarray = scanimage(ibuf, 'v');
      if (listarray) {
            for (i = 0; i < size; i++) {
                  curlist = listarray + i;
                  new = (Edge*)MEM_callocN(sizeof(Edge),"Edge");
                  new->col2 = ibuf->rect[i]; /* upper pixel */
                  new->col1 = new->col2 - 1;
                  BLI_addhead(curlist, new);
                  new = (Edge*)MEM_callocN(sizeof(Edge),"Edge");
                  new->position = ibuf->y - 1;
                  new->col1 = ibuf->rect[i + ((ibuf->y -1) * ibuf->x)]; /* bottom pixel */
                  new->col2 = new->col1 - 1;
                  BLI_addtail(curlist, new);
            }
            _intel_scale(ibuf, listarray, 'v');
            anti_free_listarray(size, listarray);

            size = ibuf->y;
            listarray = scanimage(ibuf, 'h');
            if (listarray) {
                  for (i = 0; i < size; i++) {
                        curlist = listarray + i;
                        new =  (Edge*)MEM_callocN(sizeof(Edge),"Edge");
                        new->col2 = ibuf->rect[i * ibuf->x]; /* left pixel */
                        new->col1 = new->col2 - 1;
                        BLI_addhead(curlist, new);
                        new =  (Edge*)MEM_callocN(sizeof(Edge),"Edge");
                        new->position = ibuf->x - 1;
                        new->col1 = ibuf->rect[((i + 1) * ibuf->x) - 1]; /* right pixel */
                        new->col2 = new->col1 - 1;
                        BLI_addtail(curlist, new);
                  }
                  _intel_scale(ibuf, listarray, 'h');
                  anti_free_listarray(size, listarray);
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index