📄 qccimgimagecomponent.3
字号:
.TH QCCIMGIMAGECOMPONENT 3 "QCCPACK" "".SH NAMEQccIMGImageComponent \- data structure .B QccIMGImageComponentand corresponding.B ICPfile format for a single-band image component.SH SYNOPSIS.B #include "libQccPack.h".sp.BI "int QccIMGImageComponentInitialize(QccIMGImageComponent *" image_component );.br.BI "int QccIMGImageComponentAlloc(QccIMGImageComponent *" image_component );.br.BI "void QccIMGImageComponentFree(QccIMGImageComponent *" image_component );.br.BI "int QccIMGImageComponentPrint(const QccIMGImageComponent *" image_component );.br.sp.BI "int QccIMGImageComponentSetMin(QccIMGImageComponent *" image_component );.br.BI "int QccIMGImageComponentSetMax(QccIMGImageComponent *" image_component );.br.BI "int QccIMGImageComponentSetMaxMin(QccIMGImageComponent *" image_component );.br.sp.BI "int QccIMGImageComponentResize(QccIMGImageComponent *" image_component ", int " num_rows ", int " num_cols );.SH DESCRIPTIONQccPack provides data structure.B QccIMGImageComponentfor representing a single-band image component.This image-component structure can be read from and written to .BR ICP -formatfiles, or a.B QccIMGImageComponentstructure can be used without file input or output.Notably, the three-band.BR QccIMGImage (3)structure uses three.BR QccIMGImageComponentstructures to represent the luminance/chrominance bands of afull-color image..LPThe main component of a.B QccIMGImageComponentstructure is a two-dimensional array of floating-point valuesrepresenting the component's pixels..SH "DATA STRUCTURE"The.B QccIMGImageComponentdata structure is defined as:.RS.nftypedef QccMatrix QccIMGImageArray;typedef struct{ QccString filename; QccString magic_num; int major_version; int minor_version; int num_rows; int num_cols; double min_val; double max_val; QccIMGImageArray image;} QccIMGImageComponent;.fi.RE.LPThe fields of.B QccIMGImageComponentare as follows:.TP.I filenameThe name of the file..TP.IR magic_num ", " major_version ", " minor_versionThe magic number and version of the file..TP.IR num_rows ", " num_colsThe number of rows and columns of the image component..TP.IR min_val ", " max_valThe minimum and maximum pixel values in the image component..TP.IR imageThe array of pixels..SH "FILE FORMAT"For reading and writing structuresof type.BR QccIMGImageComponent ,QccPack provides the.B ICPfile format.This file format starts with an ASCII header followed bybinary data.The ASCII header starts with a magic number, and can befollowed with any amount of white space (blanks, `\\t' (tab),`\\n' (newline), `\\r' (carriage return)) and/orcomments lines (lines starting with "#"). Following this white space,additional ASCIIheader information is given, separated by blanks and newlines.Binary data follows this ASCII header information.Note: one (and only one) newline .B mustimmediately follow the last component of ASCII header information before thestart of the binary data..LPThe.B ICPfile format consists of the following information:.RS.sp.BI ICP X.X.br.I "<white space>".br.I "C R".br.IR "min max".br.IR "i11 i12" \|.\|.\|..br.IR "i21 i22" \|.\|.\|..br\|..br\|..br\|..br.sp.REwhere.B ICPis the magic number,.I X.Xis the version number,.I "<white space>"is white space and/or comment lines, .I Cis the number of columns of the image component,.I Ris the number of rows, and.I minand.I maxgive the range of the values of the image component..I imnis the pixel for the mth row, nth column of the image..IR C ", " R ", " min ", and ".I maxare stored in ASCII. The image component itself,.IR imn ,is stored as binary floating-point numbers (4 bytes each, MSB first,see.BR QccFileWriteDouble (3))..SH "ROUTINES".B QccIMGImageComponentInitialize()should be called before any use of a.B QccIMGImageComponentstructure..B QccIMGImageComponentInitialize()initializes the fields of.I image_componentto the following values:.RS.IR filename :.B NULLstring.br.IR magic_num :.B QCCIMGIMAGECOMPONENT_MAGICNUM.br.IR major_version ", " minor_version :initialized to output of .BR QccGetQccPackVersion (3).br.IR num_rows :0.br.IR num_cols :0.br.IR min_val :0.br.IR max_val :0.br.IR image :.B NULL.RE.LP.B QccIMGImageComponentAlloc()allocates storage space for .IR image_component->image .If .I image_component->imageis not.BR NULL ,.B QccIMGImageComponentAlloc()returns immediately without changing the state of any memory allocation.Otherwise,the .I image_component->imagearray is allocated.The fields.IR image_component->num_rows and.IR image_component->num_cols must be set prior to calling.BR QccIMGImageComponentAlloc() ..LP.B QccIMGImageComponentFree()frees the.I image_component->imagearray previously allocated by.BR QccIMGImageComponentAlloc() ..LP.B QccIMGImageComponentPrint()prints the contents of.I image_componentto stdout..LP.BR QccIMGImageComponentSetMin()determines the smallest pixel value in.IR image_component->imageand sets.IR image_component->min_valto that minimum value..LP.BR QccIMGImageComponentSetMax()determines the largest pixel value in.IR image_component->imageand sets.IR image_component->max_valto that maximum value..LP.BR QccIMGImageComponentSetMaxMin()sets both.IR image_component->max_valand.IR image_component->min_valby calling.BR QccIMGImageComponentSetMax()and.BR QccIMGImageComponentSetMin()in succession..LP.BR QccIMGImageComponentResize()calls.BR QccMatrixResize (3)to change the size of.IR image_componentto.IR num_rows " x " num_cols ..SH "RETURN VALUE"These routines return 0 on success, and 1 on failure..SH "SEE ALSO".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 + -