A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/conv__image_8cpp_source.html below:

NCBI C++ ToolKit: src/util/image/demo/conv_image.cpp Source File

50  virtual void Init

(

void

);

51  virtual int Run

(

void

);

52  virtual void Exit

(

void

);

67

arg_desc->SetUsageContext(

GetArguments

().GetProgramBasename(),

68  "Image read/write test application"

);

70

arg_desc->AddKey(

"in"

,

"InputImage"

,

"Image to convert"

,

72

arg_desc->AddKey(

"out"

,

"OutputImage"

,

"Resulting image"

,

75

arg_desc->AddOptionalKey(

"fmt"

,

"OutputFormat"

,

76  "Format of the new image"

,

78

arg_desc->SetConstraint(

"fmt"

,

80  "jpeg"

,

"tiff"

,

"png"

,

"bmp"

,

81  "sgi"

,

"raw"

,

"gif"

));

93  string

in_file = args[

"in"

].AsString();

94  string

out_file = args[

"out"

].AsString();

102  ERR_POST

(

Error

<<

"error: can't read image from "

<< in_file);

108

<<

") in "

<< read_time <<

" seconds"

);

112  string str

= args[

"fmt"

].AsString();

113  if

(

str

==

"jpeg"

) {

115

}

else if

(

str

==

"png"

) {

117

}

else if

(

str

==

"tiff"

) {

119

}

else if

(

str

==

"bmp"

) {

121

}

else if

(

str

==

"raw"

) {

123

}

else if

(

str

==

"sgi"

) {

125

}

else if

(

str

==

"gif"

) {

132  LOG_POST

(

Info

<<

"wrote image in "

<< write_time - read_time

154 int main

(

int

argc,

const char

* argv[])

virtual void Init(void)

Initialize the application.

virtual void Exit(void)

Cleanup on application exit.

virtual int Run(void)

Run the application.

static bool WriteImage(const CImage &image, CNcbiOstream &ostr, EType type, ECompress compress=eCompress_Default)

static EType GetTypeFromFileName(const string &file)

static CImage * ReadImage(const string &file, EType type=CImageIO::eUnknown)

size_t GetWidth(void) const

size_t GetHeight(void) const

int main(int argc, const char *argv[])

static const char * str(char *buf, int n)

virtual const CArgs & GetArgs(void) const

Get parsed command line arguments.

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)

Setup the command line argument descriptions.

const CNcbiArguments & GetArguments(void) const

Get the application's cached unprocessed command-line arguments.

@ eString

An arbitrary string.

#define ERR_POST(message)

Error posting with file, line number information but without error codes.

#define LOG_POST(message)

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...

void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")

Set diagnostic stream.

void Error(CExceptionArgs_Base &args)

void Info(CExceptionArgs_Base &args)

double Elapsed(void) const

Return time elapsed since first Start() or last Restart() call (in seconds).

void Start(void)

Start the timer.

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

Defines command line argument related classes.

Defines unified interface to application:

Process information in the NCBI Registry, including working with configuration files.

Defines: CTimeFormat - storage class for time format.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4