
Raster works with PGM files (for grayscale images) and PPM files (for RGB images). Selection between PGM and PPM given the RASFMT_PNM RasterFileFormat is automatic based on whether the image is greyscale or color. In addition, it offers PNG read capability (grayscale, RGB, or color-palette, at any bit-depth), and write capability (8-bit grayscale and RGB). Similarly, it offers write capability for RASFMT_RAW_IMAGE data (straight pixel data with no header information), but no such read capability. Both the raw and ASCII variants of PGM/PPM files are supported. Display of images uses the program "xv" to output images to the screen. The filename argument is passed to the various methods of this class in the same way as in printf().
Functions | |
| bool | fileExists (std::string fname, const RasterFileFormat ftype=RASFMT_AUTO, const bool chkFormat=false) |
| Return true if file exists on disk. | |
| std::string | getImageComments (std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Get image comments without fully reading the image (PPM only). | |
| Dims | getImageDims (std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Get image dimensions without fully reading the image. | |
| GenericFrameSpec | getFrameSpec (std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Get image specifications without fully reading the image. | |
| GenericFrame | ReadFrame (std::string fname, RasterFileFormat ftype=RASFMT_AUTO) |
| Read a GenericFrame from a raster file. | |
| Image< PixRGB< byte > > | ReadRGB (std::string fname, RasterFileFormat ftype=RASFMT_AUTO) |
| Read an RGB byte image from a raster file. | |
| Image< byte > | ReadGray (std::string fname, RasterFileFormat ftype=RASFMT_AUTO) |
| Read a greyscale byte image from a greyscale raster file. | |
| Image< byte > | ReadGrayNTSC (std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Read a greyscale byte image, converting to NTSC coordinates if necessary. | |
| Image< float > | ReadFloat (std::string fname, RasterFileFormat ftype=RASFMT_AUTO) |
| Read a greyscale float image from a greyscale raster file. | |
| VideoFrame | ReadVideo (std::string fname, RasterFileFormat ftype=RASFMT_AUTO) |
| Read a VideoFrame from a raster file. | |
| std::string | WriteFrame (const GenericFrame &image, std::string fname, RasterFileFormat ftype=RASFMT_AUTO) |
| Write a GenericFrame to a raster file. | |
| std::string | WriteRGB (const Image< PixRGB< byte > > &image, std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Write an RGB byte image to a raster file. | |
| std::string | WriteGray (const Image< byte > &image, std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Write a grayscale byte image to a raster file. | |
| std::string | WriteFloat (const Image< float > &image, const int flags, std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Write a float image to a raster file. | |
| void | NoXV () |
| Turn off the use of xv. | |
| void | Display (const char *file) |
| calls xv to display an image that is on disk | |
| void | waitForKey () |
| wait for the [return] key | |
| void | VisuRGB (const Image< PixRGB< byte > > &image, std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Save image of type Image< PixRGB<byte> > to disk then display it using xv. | |
| void | VisuGray (const Image< byte > &image, std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Save image of type Image<byte> to disk then display it using xv. | |
| void | VisuFloat (const Image< float > &image, const int flags, std::string fname, const RasterFileFormat ftype=RASFMT_AUTO) |
| Save image of type Image<float> to disk then display it using xv. | |
|
|
calls xv to display an image that is on disk
Definition at line 539 of file Raster.C. References GVX_TRACE, LERROR, and USING_XV. Referenced by main(), VisuFloat(), VisuGray(), VisuRGB(), waitXKeyPress(), OutputMbariFrameSeries::writeMbariFloat(), OutputMbariFrameSeries::writeMbariGray(), and OutputMbariFrameSeries::writeMbariRGB(). |
|
||||||||||||||||
|
Return true if file exists on disk. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 378 of file Raster.C. References addFileExtension(), GVX_TRACE, MODE_R, and PLERROR. Referenced by VisualObject::deleteImageFile(), LeastSquaresLearner::getBiasMap(), FeatureExtractor::load(), main(), operator<<(), RasterlistInputSeries::readFrame(), RasterInputSeries::readFrame(), HmaxFL::readInC1Patches(), TrainingSet::save(), FeatureExtractor::save(), and submain(). |
|
||||||||||||
|
Get image specifications without fully reading the image. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 418 of file Raster.C. References addFileExtension(), GVX_TRACE, makeParser(), MODE_R, and pp. Referenced by getImageDims(), RasterInputSeries::peekFrameSpec(), and RasterlistInputSeries::setListFile(). |
|
||||||||||||
|
Get image comments without fully reading the image (PPM only). If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 398 of file Raster.C. References addFileExtension(), GVX_TRACE, makeParser(), MODE_R, and pp. Referenced by main(). |
|
||||||||||||
|
Get image dimensions without fully reading the image. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 409 of file Raster.C. References GenericFrameSpec::dims, getFrameSpec(), and GVX_TRACE. Referenced by InputMbariFrameSeries::peekDims(). |
|
|
Turn off the use of xv. Turn off xv, so that calls to Display() do nothing, and calls to Visu() just save the image to disk without displaying it onscreen. |
|
||||||||||||
|
Read a greyscale float image from a greyscale raster file. Just calls ReadFrame() internally. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 466 of file Raster.C. References GenericFrame::asFloat(), GVX_TRACE, and ReadFrame(). Referenced by LeastSquaresLearner::getBiasMap(), TrainingSet::load(), FeatureExtractor::load(), TrainingSet::loadRebalanced(), main(), mexFunction(), Raster_xx_img_float_write_float_read_float_xx_1(), readFloat(), ScaleRemoveSurprise< FLOAT >::SRSopenBayesFeatureBias(), ScaleRemoveSurprise< FLOAT >::SRSprocessFrame(), ScaleRemoveSurprise< FLOAT >::SRSsetAntiWeights(), and ScaleRemoveSurprise< FLOAT >::SRSsetAntiWeightsInteract(). |
|
||||||||||||
|
Read a GenericFrame from a raster file. This can subsequently be converted to rgb, grayscale, floating-point, or video-yuv. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 429 of file Raster.C. References addFileExtension(), GVX_TRACE, LDEBUG, makeParser(), MODE_R, and pp. Referenced by main(), mexFunction(), ReadFloat(), RasterlistInputSeries::readFrame(), RasterInputSeries::readFrame(), ReadGray(), ReadGrayNTSC(), ReadRGB(), and ReadVideo(). |
|
||||||||||||
|
||||||||||||
|
Read a greyscale byte image, converting to NTSC coordinates if necessary. Just calls ReadFrame() internally. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 457 of file Raster.C. References GenericFrame::asGrayNTSC(), GVX_TRACE, and ReadFrame(). |
|
||||||||||||
|
||||||||||||
|
Read a VideoFrame from a raster file. Just calls ReadFrame() internally. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 474 of file Raster.C. References GenericFrame::asVideo(), GVX_TRACE, and ReadFrame(). |
|
||||||||||||||||||||
|
Save image of type Image<float> to disk then display it using xv. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 593 of file Raster.C. References Display(), FLOAT_NORM_0_255, getMinMax(), GVX_TRACE, LINFO, and WriteFloat(). Referenced by featureClusterVision< FLOAT >::fCVrunStandAloneMSBatchTest(), and main(). |
|
||||||||||||||||
|
Save image of type Image<byte> to disk then display it using xv. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 579 of file Raster.C. References Display(), getMinMax(), GVX_TRACE, LINFO, and WriteGray(). |
|
||||||||||||||||
|
Save image of type Image< PixRGB<byte> > to disk then display it using xv. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 565 of file Raster.C. References Display(), getMinMaxC(), GVX_TRACE, image, LINFO, and WriteRGB(). Referenced by main(), Omni< T >::run(), and CINNIC::viewNeuronTemplate(). |
|
|
wait for the [return] key
Definition at line 553 of file Raster.C. References GVX_TRACE. Referenced by GistEstimatorStd::diffGist(), GistEstimatorGen::diffGist(), LandmarkDB::display(), displayPartImage(), Environment::finishBuild(), getPartImage(), Beobot2_GistSalLocalizerMasterI::initParticles(), GSlocalizer::initParticles(), main(), ParticleFilterI::ParticleFilterI(), processSalCue(), submain(), SeaBee::test(), train(), and ColorSegmenterI::updateFrame(). |
|
||||||||||||||||||||
|
Write a float image to a raster file. Just calls WriteFrame() internally. Returns the full name of the image file that was actually written; this may differ slightly from fname if a filename extension was added to match ftype. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 517 of file Raster.C. References GVX_TRACE, and WriteFrame(). Referenced by LeastSquaresLearner::getBiasMap(), main(), mexFunction(), Raster_xx_img_float_write_float_read_float_xx_1(), TrainingSet::save(), FeatureExtractor::save(), ScaleRemoveSurprise< FLOAT >::SRScomputeBayesFeatureBias(), VisuFloat(), writeFloat(), OutputMbariFrameSeries::writeMbariFloat(), and HmaxFL::writeOutC1Patches(). |
|
||||||||||||||||
|
Write a GenericFrame to a raster file. The GenericFrame could be constructed from rgb, grayscale, floating-point, or video-yuv. Returns the full name of the image file that was actually written; this may differ slightly from fname if a filename extension was added to match ftype. If ftype is RASFMT_AUTO, then the raster file type is inferred from the filename. Definition at line 482 of file Raster.C. References addFileExtension(), GVX_TRACE, GenericFrame::initialized(), LDEBUG, LFATAL, makeWriter(), and MODE_W. Referenced by main(), QtImageFrame::saveImage(), WriteFloat(), RasterOutputSeries::writeFrame(), WriteGray(), and WriteRGB(). |
|
||||||||||||||||
|
||||||||||||||||
1.4.4