Logo Search packages:      
Sourcecode: blender version File versions

struct ImBuf* IMB_anim_absolute ( struct anim *  anim,
int  position 
) [read]

Attention:
Defined in anim.c

Definition at line 535 of file anim.c.

References IMB_anim_absolute(), IMB_convert_rgba_to_abgr(), IMB_flipy(), IMB_freecmapImBuf(), IMB_freeImBuf(), IMB_loadiffname(), ImBuf::name, ImBuf::rect, ImBuf::x, and ImBuf::y.

Referenced by IMB_anim_absolute(), and IMB_anim_nextpic().

                                                                   {
      struct ImBuf * ibuf = 0;
      char head[256], tail[256];
      unsigned short digits;
      int pic;

      if (anim == NULL) return(0);

      if (anim->curtype == 0) {
            ibuf = anim_getnew(anim);
            if (ibuf == NULL) {
                  return (0);
            }
            IMB_freeImBuf(ibuf); /* ???? */
      }

      if (position < 0) return(0);
      if (position >= anim->duration) return(0);

      switch(anim->curtype) {
      case ANIM_ANIM5:
            if (anim->curposition > position) rewindanim5(anim);
            while (anim->curposition < position) {
                  if (nextanim5(anim)) return (0);
            }
            ibuf = anim5_fetchibuf(anim);
            break;
      case ANIM_SEQUENCE:
            pic = an_stringdec(anim->first, head, tail, &digits);
            pic += position;
            an_stringenc(anim->name, head, tail, digits, pic);
            ibuf = IMB_loadiffname(anim->name, LI_rect);
            if (ibuf) {
                  anim->curposition = position;
                  /* patch... by freeing the cmap you prevent a double apply cmap... */
                  /* probably the IB_CMAP option isn't working proper
                   * after the abgr->rgba reconstruction
                   */
                  IMB_freecmapImBuf(ibuf);
            }
            break;
      case ANIM_MOVIE:
            ibuf = movie_fetchibuf(anim, position);
            if (ibuf) {
                  anim->curposition = position;
                  IMB_convert_rgba_to_abgr(ibuf->x*ibuf->y, ibuf->rect);
            }
            break;
      case ANIM_AVI:
            ibuf = avi_fetchibuf(anim, position);
            if (ibuf) anim->curposition = position;
            break;
#ifdef WITH_QUICKTIME
      case ANIM_QTIME:
        ibuf = qtime_fetchibuf(anim, position);
        if (ibuf) anim->curposition = position;
        break;
#endif
    }

      if (ibuf) {
            if (anim->ib_flags & IB_ttob) IMB_flipy(ibuf);
            sprintf(ibuf->name, "%s.%04d", anim->name, anim->curposition + 1);
            
      }
      return(ibuf);
}


Generated by  Doxygen 1.6.0   Back to index