imglist.h

Go to the documentation of this file.
00001 
00006 /*
00007  * Copyright (C) 2006  Lab. Visgraf/IMPA and AnimaMundi
00008  * 
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU General Public License
00011  * as published by the Free Software Foundation; either version 2
00012  * of the License, or (at your option) any later version.
00013  * 
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  * 
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00022  * 
00023 */
00024 
00025  
00026  
00027 #ifndef IMGLIST_H
00028 #define IMGLIST_H
00029 
00030 extern "C"{
00031 #include "image.h"
00032 #include "jpeg.h"
00033 }
00034 #include "frame.h"
00035 
00036 void setMessage(char* m);
00037 
00041 typedef struct ImgNode{
00042   struct ImgNode *next, *prev;
00043   int delay;
00044   int time_stamp;
00045   int frame_number;     //posicao (na lista) do frame capturado 
00046   int frame_pos;        //posicao (na animacao) do frame considerando a duracao
00047   int frame_duration;
00048   Frame *frame;
00049 } ImgNode;
00050 
00054 typedef struct ImgList{
00055   char *first_frame_image_file;
00056   ImgNode *head, *current;
00057   Boolean insert_on;    
00058   int totFrames /*total de capturas (frames sem considerar duracao)*/,
00059     totRealFrames; /*total de frames da lista considerando duracao*/;
00060 } ImgList;
00061 
00062 
00063 // The ImageNode methods signature.
00064 ImgNode *imgnode_alloc( Frame *f, int delay, int frame_duration );
00065 void imgnode_dispose( ImgNode *i );
00066 
00067 
00068 //The ImageList methods signature.
00069 ImgList *imglist_alloc( void );
00070 
00071 void insert_first_frame(ImgList *imgl);
00072 void insert_frame_from_imagefile(ImgList *imgl, char *fname);
00073 void insert_frame_from_jpgfile(ImgList *imgl, char *fname);
00074 Frame* get_empty_frame();
00075 Frame* get_frame_from_rasfile(char* image_path);
00076 
00077 Image *imglist_peek_current_img( ImgList *q );
00078 
00079 int  imglist_isempty( ImgList *q );
00080 void imglist_insert( ImgList *q, ImgNode *i );
00081 void imglist_overwrite( ImgList *q, ImgNode *i );
00082 void imglist_addimg( ImgList *q,ImgNode *i );
00083 //void imglist_remove( ImgList *q );
00084 void imglist_removeInRange( ImgList *q, int begin, int end );
00085 void imglist_clear( ImgList *q );
00086 //void imglist_clear_withoutFirstFrame( ImgList *q );  //see comments in .cc
00087 void imglist_dispose( ImgList *q );
00088 void imglist_step( ImgList *q, int step);
00089 void imglist_step_foward( ImgList *q );
00090 void imglist_step_backward( ImgList *q );
00091 void imglist_rew( ImgList *q );
00092 void imglist_go_to_end( ImgList *q );
00093 void imglist_update_frames( ImgList *q );
00094 void imglist_go_to_frame( ImgList *q, int frameNumber );
00095 void imglist_insert_at(ImgList *q, ImgNode *i);
00096 int imglist_getTotalFrames(ImgList *q);
00097 int imglist_getTotalRealFrames(ImgList *q);
00098 void imglist_setFrameDuration(ImgList *q, int begin, int end, int duration);
00099 
00100 
00101 #endif

Generated on Tue Jan 22 17:07:29 2008 for MUAN by  doxygen 1.4.7