MUAN
imglist.cpp File Reference

This file represents an image list and has the control methods of the captured images. More...

Typedefs

typedef unsigned char uint8_t

Functions

ImgListimglist_alloc (int w, int h)
 Creates a new ImageList.
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.
Frame * imglist_peek_current_frame (ImgList *q)
 Gets the current image in the ImageList.
int imglist_isempty (ImgList *q)
 Returns true if the ImageList is empty, false otherwise.
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_clear (ImgList *q)
 Clears an ImageList.
void imglist_dispose (ImgList *q)
 Disposes an 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.

Detailed Description

This file represents an image list and has the control methods of the captured images.


Typedef Documentation

typedef unsigned char uint8_t

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().

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().