?? image_package.c
字號(hào):
/*..........................................................................*//* *//* L a s t W a v e P a c k a g e 'image' 2.1 *//* *//* Copyright (C) 1998-2003 Emmanuel Bacry, Jerome Fraleu. *//* emails : fraleu@cmap.polytechnique.fr *//* lastwave@cmap.polytechnique.fr *//* *//*..........................................................................*//* *//* This program is a free software, you can redistribute it and/or *//* modify it 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 *//* *//* This program is distributed in the hope that it 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 this program (in a file named COPYRIGHT); *//* if not, write to the Free Software Foundation, Inc., *//* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *//* *//*..........................................................................*/#include "lastwave.h"#include "images.h"/* * The file that contains CProcs for Image * *//* In Image Alloc */extern void C_Image(char **), C_InfoImage(char **), C_StatsImage(char **), C_CopyImage(char **), C_SetImage(char **); extern void C_ReadImage(char **), C_WriteImage(char **),C_Matrix(char **);extern void C_ThreshImage(char **);static CProc imageCommands[] = { "image",C_Image,"{{{invert <image>} {Inverts the values of all the pixels of an image (i.e., the min becomes the max and vice versa).}}}", "istats",C_StatsImage,"{{{mean <imageIn>} {Computes the mean of an image.}} \{{var <imageIn>} {Computes the variance of an image.}} \{{skew <imageIn>} {Computes the skewness of an image.}} \{{kurt <imageIn>} {Computes the kurtosis of an image.}} \{{nth <imageIn> <n> [-Ca]} {Computes the (NON centered) <n>th moment of an image. If '-C' then the moment is centered. If '-a' the absolute moment is computed (<n> can be a float).}} \{{minmax <imageIn> [-c]} {Computes the minimum and the maximum values of an image and returns, in a listv, the corresponding indexes <iMin> <jMin> and <iMax> <jMax>.}} \{{lp <imageIn> <p> [-c]} {Computes the Lp norm of an image.}} \{{print <imageIn>} {Prints some statistical information about an image.}}}", "ithresh", C_ThreshImage, "{{{Not to be used} {Old LastWave Command}}}", /* I/O image */ "iread",C_ReadImage,"{{{<image> (<filename> | <stream>) [-a <nrow> <ncol>] [-c <nrow> <ncol>] [-r [('little' | 'big')] [<floatSize>]]} \{Reads an image from disk. By default, the file should have a LastWave or PGM P5 header. If '-a' (resp. -c) then\there is no header and the image is supposed to have the size <nrow> <ncol> and values are stored using ascii (resp. characters between 0 and 255). \If -r, the data are in raw format (binary floats) with no header. In that case you can specify whether you want to read them as little endian \data or big endian data. If nothing is specified the endianness of the computer is used. One can specify also the <floatSize>, i.e., the number of bytes for each float.}}}", "iwrite",C_WriteImage,"{{{<image> (<filename> | <stream>) [-h] [-c [<min> <max>]] [-a] [-f [<%format> <separator>]] [-p]} \{Write an image on the disk. By default, it will write a LastWave header and binary coded floats (option -a is for ascii multicolumn coding). \If '-c' then characters are \written (each value is in between 0 and 255) and if <min> and <max> are specified rescaling is performed before writing. \If '-h' then no header is written (i.e., raw format). If '-p' then P5 pgm format is used. In this case by default the image \is rescaled between 0 and 255 and characters are written. If -f then ascii numbers are written using formlat <%format> (which can be '' fir default format) \and column separator string <separator> (default is tab character '\t').}}}", /* matrix */ "matrix",C_Matrix,"{{{trace <imageIn>} {Computes the trace of a matrix.}} \{{det <imageIn>} {Computes the determinat of a matrix.}} \{{diagsym <imageIn>} {Diagonalizes a symetric matrix. Returns a listv made of a matrix (corresponding to the eigen vectors) \and a signal (corresponding to the eigen values).}}}", NULL,NULL,NULL};static CProcTable imageTable = {imageCommands, "image", "Commands related to images"};/*********************************** * * Loading/Adding the imagel package * ***********************************/int tIMAGE, tIMAGE_;int tIMAGEI, tIMAGEI_;extern TypeStruct tsImage;static void LoadImagePackage(void) { /* * The &imagei type MUST be defined before the &image type, so that when looking for * matching a type to a variable, we first try to match &imagei */ tIMAGEI = AddVariableTypeValue(imageiType, &tsImage, (char (*) (LEVEL, char *, void *, void **)) ParseImageILevel_); tIMAGEI_ = tIMAGEI+1; tIMAGE = AddVariableTypeValue(imageType, &tsImage, (char (*) (LEVEL, char *, void *, void **)) ParseImageLevel_); tIMAGE_ = tIMAGE+1; AddCProcTable(&imageTable); DefineGraphImage();} void DeclareImagePackage(void){ DeclarePackage("image",LoadImagePackage,1998,"2.1","E.Bacry and J.Fraleu","Package allowing to deal with images/matrices."); }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -