📄 qccimgimagesequence.3
字号:
.TH QCCIMGIMAGESEQUENCE 3 "QCCPACK" "".SH NAMEQccIMGImageSequence \- data structure .B QccIMGImageSequencefor a sequence of images.SH SYNOPSIS.B #include "libQccPack.h".sp.BR "int QccIMGImageSequenceInitialize(QccIMGImageSequence *" image_sequence );.br.BR "int QccIMGImageSequenceAlloc(QccIMGImageSequence *" image_sequence );.br.BR "void QccIMGImageSequenceFree(QccIMGImageSequence *" image_sequence );.br.BR "int QccIMGImageSequenceLength(const QccIMGImageSequence *" image_sequence );.br.BR "int QccIMGImageSequenceSetCurrentFilename(QccIMGImageSequence *" image_sequence );.br.BR "int QccIMGImageSequenceIncrementFrameNum(QccIMGImageSequence *" image_sequence );.br.BR "int QccIMGImageSequenceFindFrameNums(QccIMGImageSequence *" image_sequence );.br.BR "int QccIMGImageSequenceReadFrame(QccIMGImageSequence *" image_sequence );.br.BR "int QccIMGImageSequenceWriteFrame(QccIMGImageSequence *" image_sequence );.br.BR "int QccIMGImageSequenceStartRead(QccIMGImageSequence *" image_sequence );.br.SH DESCRIPTIONQccPack provides data structure.B QccIMGImageSequencefor representing a sequence of images.It is generally assumed that all images of the sequencehave the same size and color depth.The frames of the image sequence are indexed by a"frame number" which runs consecutively from somestarting frame number to an ending frame number..LPThe main component of a.B QccIMGImageSequencestructure is a.BR QccIMGImage (3)structure that holds the current frame of the imagesequence..SH "DATA STRUCTURE"The.B QccIMGImageSequencedata structure is defined as:.RS.nftypedef struct{ QccString filename; int start_frame_num; int end_frame_num; int current_frame_num; QccString current_filename; QccIMGImage current_frame;} QccIMGImageSequence;.fi.RE.LPThe fields of.B QccIMGImageSequenceare as follows:.TP.I filenameThe filename template for the image sequence..TP.IR start_frame_num ", " end_frame_numThe numbers of the first and last frames of the image sequence..TP.IR current_frame_numThe number of the current frame..TP.IR current_filenameThe filename for the current frame..TP.IR current_frameThe current frame..SH "FILE ACCESS"A.BR QccIMGImageSequencestructure holds only a single frame of the image sequence,and most routines that process image sequenceswill process a single frame at a time.Consequently, image sequences arenormally read and written by specifying a filename template that is"filled in" with the current frame number to access thecurrent frame.The.IR filenamefield of the.BR QccIMGImageSequencestructure is the filename template, and it is a .BR printf (3)format string that contains exactly one numerical descriptor(i.e., %d, %x, etc.).For example, if .IR filenameis given as.IR imagefile.%03d.pgm ,then the image sequence will be accessed as.IR imagefile.000.pgm ", " imagefile.001.pgm ", " imagefile.002.pgm ", ...,"assuming that the first frame of the sequence is frame number 0.The filenames, as well as the numerical descriptor in the filename template,must use zero padding on the left so that the files are processed inthe correct numerical order..SH "ROUTINES".B QccIMGImageSequenceInitialize()should be called before any use of a.B QccIMGImageSequencestructure..B QccIMGImageSequenceInitialize()initializes the fields of.I image_sequenceto the following values:.RS.IR filename :.B NULLstring.br.IR start_frame_num :0.br.IR end_frame_num :0.br.IR current_frame_num :0.br.IR current_filename :.B NULLstring.RE.LP.B QccIMGImageSequenceAlloc()allocates storage space for .IR image_sequence->current_frameby calling.BR QccIMGImageAlloc (3).The size of.IR image_sequence->current_framemust be set via a call to.BR QccIMGImageSetSize (3)or.BR QccIMGImageSetSizeYUV (3)prior to calling.BR QccIMGImageSequenceAlloc() ..LP.B QccIMGImageSequenceFree()frees.I image_sequence->current_framevia a call to.BR QccIMGImageFree (3)..LP.BR QccIMGImageSequenceLength()calculates the number of frames of.IR image_sequence .It is assumed that no frames are skipped between the starting frameand the ending frame, so the number of frames isa.IR image_sequence->end_frame_num " - " image_sequence->start_frame_num " + 1.".LP.BR QccIMGImageSequenceSetCurrentFilename()updates.IR image_sequence->current_filenameby placing the current frame number,.IR image_sequence->current_frame_num ,into the filename template,.IR image_sequence->filename .This is done by having.IR image_sequence->current_filenamebe the output of a call to.BR QccStringSprintf (3)wherein.IR image_sequence->filenameis the format string..LP.BR QccIMGImageSequenceIncrementFrameNum()increments.IR image_sequence->current_frame_numand then calls.BR QccIMGImageSequenceSetCurrentFilename()to update the current filename..LP.BR QccIMGImageSequenceFindFrameNums()determines the starting and ending frame numbers for the specifiedimage sequence. Using the filename template,.IR image_sequence->filename ,.BR QccIMGImageSequenceFindFrameNums()scans all the frame numbers matching the template, checking forthe existence of a file with that frame number..IR image_sequence->start_frame_numis set to the first frame number for which a file exists..IR image_sequence->end_frame_numis set to the last frame number for which a file exists, suchthat all frame numbers between.IR image_sequence->start_frame_numand.IR image_sequence->end_frame_numcorrespond to existing files; i.e., the sequence offrames from the starting frame number to the ending framenumber is consecutive with no skipped frames..LP.BR QccIMGImageSequenceReadFrame()calls.BR QccIMGImageSequenceSetCurrentFilename()to update the current filename, and then.BR QccIMGImageRead (3)to read the current frame, with the current frame being returned in.IR image_sequence->current_frame ..LP.BR QccIMGImageSequenceWriteFrame()calls.BR QccIMGImageSequenceSetCurrentFilename()to update the current filename, and then.BR QccIMGImageWrite (3)to write.IR image_sequence->current_frameto the current filename..LP.BR QccIMGImageSequenceStartRead()calls.BR QccIMGImageSequenceReadFrame()to read the first frame of the sequence, i.e.,the one with frame number.IR image_sequence->start_frame_num ..SH "RETURN VALUE"These routines return 0 on success, and 1 on failure, except.BR QccIMGImageSequenceLength() ,which returns the length of the image sequence..SH "SEE ALSO".BR QccStringSprintf (3),.BR QccFileWriteDouble (3),.BR QccIMGImage (3),.BR QccPackIMG (3),.BR QccPack (3).SH AUTHORCopyright (C) 1997-2009 James E. Fowler.\" The programs herein are free software; you can redistribute them an.or.\" modify them under the terms of the GNU General Public License.\" as published by the Free Software Foundation; either version 2.\" of the License, or (at your option) any later version..\" .\" These programs are distributed in the hope that they will be useful,.\" but WITHOUT ANY WARRANTY; without even the implied warranty of.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the.\" GNU General Public License for more details..\" .\" You should have received a copy of the GNU General Public License.\" along with these programs; if not, write to the Free Software.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -