MUAN
imglist.h File Reference

This file represents an ImageNode and ImageList interface. More...

Go to the source code of this file.

Classes

struct  ImgNode
 The ImageNode structure. More...
struct  ImgList
 The ImageList structure. More...

Typedefs

typedef struct ImgNode ImgNode
 The ImageNode structure.
typedef struct ImgList ImgList
 The ImageList structure.

Functions

void setMessage (const char *m)
ImgNodeimgnode_alloc (Frame *f, int delay, int frame_duration)
 Creates a new ImageNode.
void imgnode_dispose (ImgNode *i)
 Disposes an ImageNode.
ImgNodeimgnode_copy (ImgNode *i)
 Copies an ImageNode.
ImgListimglist_alloc (int w, int h)
 Creates a new ImageList.
void imglist_clear (ImgList *q)
 Clears an ImageList.
void imglist_dispose (ImgList *q)
 Disposes an ImageList.
int imglist_isempty (ImgList *q)
 Returns true if the ImageList is empty, false otherwise.
Frame * imglist_peek_current_frame (ImgList *q)
 Gets the current image in the ImageList.
void imglist_insert (ImgList *q, ImgNode *i)
 Inserts an ImageNode in the ImageList.
void imglist_insert (ImgList *q, ImgList *c, bool invert)
 Merges two ImageList.
void imglist_removeInRange (ImgList *q, int begin, int end)
 Removes the current ImageNode in the ImageList.
void imglist_step (ImgList *q, int step)
 Forwards/Backwards the current ImageNode in the ImageList using step.
void imglist_step_foward (ImgList *q)
 Forwards the current ImageNode in the ImageList.
void imglist_step_backward (ImgList *q)
 Backwards the current ImageNode in the ImageList.
void imglist_rew (ImgList *q)
 Rewinds an ImageList.
void imglist_go_to_end (ImgList *q)
 Goes to the end of the ImageList.
void imglist_update_frames (ImgList *q)
 Updates all the ImageNodes frame number, frame_pos and time_stamp in the ImageList.
void imglist_go_to_frame (ImgList *q, int frameNumber)
 Shows a desired frame.
int imglist_getTotalFrames (ImgList *q)
 Gets the total of frames in an ImageList.
int imglist_getTotalRealFrames (ImgList *q)
 Calculate the total of real frames (frame*duration) in an ImageList.
void imglist_setFrameDuration (ImgList *q, int begin, int end, int duration)
 Sets the current frame duration.
int imglist_getCurrentFnum (ImgList *q)
 Get the current frame number.
void insert_frame_from_imagefile (ImgList *imgl, char *fname)
 Inserts a frame from image file (RAS or JPG).
void insert_frame_from_jpgfile (ImgList *imgl, char *fname)
 Inserts a frame from JPG image file.

Detailed Description

This file represents an ImageNode and ImageList interface.


Typedef Documentation

typedef struct ImgList ImgList

The ImageList structure.

typedef struct ImgNode ImgNode

The ImageNode structure.


Function Documentation

ImgList* imglist_alloc ( int  w,
int  h 
)

Creates a new ImageList.

Returns:
The ImageList.

References ImgList::current, ImgList::head, ImgList::img_h, ImgList::img_w, ImgList::totFrames, and ImgList::totRealFrames.

Referenced by ImageViewer::initialize().

void imglist_clear ( ImgList q)

Clears an ImageList.

Parameters:
qthe ImageList.

References ImgList::current, ImgList::head, imgnode_dispose(), ImgNode::next, t, ImgList::totFrames, and ImgList::totRealFrames.

Referenced by ImageViewer::copy_frame(), and imglist_dispose().

void imglist_dispose ( ImgList q)

Disposes an ImageList.

Parameters:
qthe ImageList.

References imglist_clear().

int imglist_getCurrentFnum ( ImgList q)

Get the current frame number.

References ImgList::current, and ImgNode::frame_number.

int imglist_getTotalFrames ( ImgList q)

Gets the total of frames in an ImageList.

Parameters:
qthe ImageList
Returns:
The number of frames in an ImageList.

References ImgList::totFrames.

int imglist_getTotalRealFrames ( ImgList q)

Calculate the total of real frames (frame*duration) in an ImageList.

Parameters:
qthe ImageList
Returns:
The number of frames in an ImageList.

References ImgList::totRealFrames.

void imglist_go_to_end ( ImgList q)

Goes to the end of the ImageList.

Parameters:
qthe ImageList.

References ImgList::current, and ImgNode::next.

void imglist_go_to_frame ( ImgList q,
int  frameNumber 
)

Shows a desired frame.

Parameters:
qthe image list.
frameNumberthe desired frame number.

References ImgList::current, ImgNode::frame_number, ImgList::head, and ImgNode::next.

Referenced by ImageViewer::copy_frame(), ImageViewer::goToFrame(), and ImageViewer::playInRange().

void imglist_insert ( ImgList q,
ImgNode i 
)

Inserts an ImageNode in the ImageList.

Parameters:
qthe ImageList.
ithe ImageNode to be inserted.

References ImgList::current, ImgNode::frame_duration, ImgList::head, imglist_update_frames(), ImgNode::next, ImgNode::prev, ImgList::totFrames, and ImgList::totRealFrames.

Referenced by insert_frame_from_jpgfile().

void imglist_insert ( ImgList q,
ImgList c,
bool  invert 
)

Merges two ImageList.

Parameters:
qthe main ImageList.
cthe ImageList to be merged.

References ImgList::current, ImgNode::frame_duration, ImgList::head, imglist_update_frames(), imgnode_copy(), ImgNode::next, ImgNode::prev, ImgList::totFrames, and ImgList::totRealFrames.

int imglist_isempty ( ImgList q)

Returns true if the ImageList is empty, false otherwise.

Parameters:
qthe ImageList.
Returns:
true if the ImageList is empty, false otherwise.

References ImgList::head.

Frame* imglist_peek_current_frame ( ImgList q)

Gets the current image in the ImageList.

Parameters:
qthe ImageList.
Returns:
The current image.

References ImgList::current, ImgNode::frame, ImgList::img_h, and ImgList::img_w.

Referenced by ImageViewer::draw().

void imglist_removeInRange ( ImgList q,
int  begin,
int  end 
)
void imglist_rew ( ImgList q)

Rewinds an ImageList.

Parameters:
qthe ImageList.

References ImgList::current, and ImgList::head.

Referenced by ImageViewer::play().

void imglist_setFrameDuration ( ImgList q,
int  begin,
int  end,
int  duration 
)

Sets the current frame duration.

Parameters:
beginthe begin of the range where to set the new duration.
endthe end of the range where to set the new duration.
durationthe new duration.
qthe ImageList

References ImgNode::delay, ImgNode::frame_duration, ImgNode::frame_number, ImgNode::frame_pos, ImgList::head, ImgNode::next, ImgNode::time_stamp, and ImgList::totRealFrames.

void imglist_step ( ImgList q,
int  step 
)

Forwards/Backwards the current ImageNode in the ImageList using step.

Parameters:
qthe ImageList.
stepthe number to increment/decrement current ImageNode position.

References ImgList::current, ImgNode::next, and ImgNode::prev.

void imglist_step_backward ( ImgList q)

Backwards the current ImageNode in the ImageList.

Parameters:
qthe ImageList.

References ImgList::current, and ImgNode::prev.

void imglist_step_foward ( ImgList q)

Forwards the current ImageNode in the ImageList.

Parameters:
qthe ImageList.

References ImgList::current, and ImgNode::next.

Referenced by ImageViewer::play(), and ImageViewer::playInRange().

void imglist_update_frames ( ImgList q)

Updates all the ImageNodes frame number, frame_pos and time_stamp in the ImageList.

Parameters:
qthe ImageList.

References ImgNode::delay, ImgNode::frame_duration, ImgNode::frame_number, ImgNode::frame_pos, ImgList::head, ImgNode::next, and ImgNode::time_stamp.

Referenced by imglist_insert().

ImgNode* imgnode_alloc ( Frame *  f,
int  delay,
int  frame_duration 
)

Creates a new ImageNode.

Parameters:
fan ImageNode Frame attribute.
delayan ImageNode delay attribute.
Returns:
The ImageNode.

References ImgNode::delay, ImgNode::frame, ImgNode::frame_duration, ImgNode::frame_number, ImgNode::frame_pos, ImgNode::next, ImgNode::prev, and ImgNode::time_stamp.

Referenced by VideoEncoder::avffmpeg_read(), ImageViewer::draw(), imgnode_copy(), ImageViewer::insert_frame(), insert_frame_from_jpgfile(), and VideoEncoder::jpg_read().

ImgNode* imgnode_copy ( ImgNode i)

Copies an ImageNode.

Parameters:
ithe ImageNode to be copied.

References ImgNode::delay, ImgNode::frame, ImgNode::frame_duration, and imgnode_alloc().

Referenced by ImageViewer::copy_frame(), and imglist_insert().

void imgnode_dispose ( ImgNode i)

Disposes an ImageNode.

Parameters:
ithe ImageNode to be deleted..

References ImgNode::frame.

Referenced by imglist_clear(), and imglist_removeInRange().

void insert_frame_from_imagefile ( ImgList imgl,
char *  fname 
)

Inserts a frame from image file (RAS or JPG).

Parameters:
imglimageList where the frame will be inserted.
fnameimage file name.

References insert_frame_from_jpgfile(), and setMessage().

void insert_frame_from_jpgfile ( ImgList imgl,
char *  fname 
)

Inserts a frame from JPG image file.

Parameters:
imglimageList where the frame will be inserted.
fnameimage file name.

References ImgList::img_h, ImgList::img_w, imglist_insert(), imgnode_alloc(), and read_JPEG_file().

Referenced by insert_frame_from_imagefile().

void setMessage ( const char *  m)