
#include <Raster/GenericFrame.H>
Collaboration diagram for GenericFrame:

This class allows frame sources (raster files, movie clips, frame-grabbers, etc.) to return frames in their optimal native representation, while deferring to the caller the ability to subsequently convert the frame to any convenient type. Similarly, GenericFrame objects can be passed to frame destinations (raster files, movie files, onscreen windows) in their native format, incurring as few conversions as possible.
Definition at line 60 of file GenericFrame.H.
Public Types | |
| enum | NativeType { NONE = 0, RGB_U8 = 1, RGB_F32 = 5, GRAY_U8 = 2, GRAY_F32 = 3, VIDEO = 4, GRAY_U16 = 6, RGB_U16 = 7 } |
Public Member Functions | |
| GenericFrame () | |
| Construct an empty frame. | |
| GenericFrame (const Image< PixRGB< byte > > &rgbimg) | |
| Construct an 8-bit integer rgb-native frame. | |
| GenericFrame (const Image< PixRGB< uint16 > > &rgbimg) | |
| Construct an 16-bit integer rgb-native frame. | |
| GenericFrame (const Layout< PixRGB< byte > > &rgbimg) | |
| Construct an 8-bit integer rgb-native frame from a layout. | |
| GenericFrame (const Image< PixRGB< float > > &rgbimg, const int flags) | |
| Construct a 32-bit floating point rgb-native frame. | |
| GenericFrame (const Image< byte > &grayimg) | |
| Construct an 8-bit integer grayscale-native frame. | |
| GenericFrame (const Image< uint16 > &grayimg) | |
| Construct an 16-bit integer grayscale-native frame. | |
| GenericFrame (const Layout< byte > &grayimg) | |
| Construct an 8-bit integer grayscale-native frame from a layout. | |
| GenericFrame (const Image< float > &floatimg, const int flags) | |
| Construct a 32-bit floating point grayscale-native frame. | |
| GenericFrame (const VideoFrame &vidframe) | |
| Construct an video-native frame. | |
| bool | initialized () const |
| Check if we have a valid non-empty image, regardless of format. | |
| GenericFrameSpec | frameSpec () const |
| Get the frame's specifications. | |
| NativeType | nativeType () const |
| Get the frame's native image type. | |
| std::string | nativeTypeName () const |
| Get the frame's native image typename. | |
| Dims | getDims () const |
| Get the dimensions of the native image. | |
| int | getWidth () const |
| Get the width of the native image. | |
| int | getHeight () const |
| Get the height of the native image. | |
| int | floatFlags () const |
| Get the float-normalization flags. | |
| void | setFloatFlags (int v) |
| Change the float-normalization flags. | |
| Image< PixRGB< byte > > | asRgbU8 () const |
| Get an 8-bit integer rgb version of the frame, converting as necessary. | |
| Image< PixRGB< byte > > | asRgb () const |
| Image< PixRGB< uint16 > > | asRgbU16 () const |
| const Layout< PixRGB< byte > > & | asRgbU8Layout () const |
| Get an 8-bit integer rgb layout version of the frame, converting as necessary. | |
| Image< PixRGB< float > > | asRgbF32 () const |
| Get a 32-bit float rgb version of the frame, converting as necessary. | |
| Image< byte > | asGrayU8 () const |
| Get an 8-bit integer grayscale version of the frame, converting as necessary. | |
| Image< byte > | asGray () const |
| Image< uint16 > | asGrayU16 () const |
| const Layout< byte > & | asGrayU8Layout () const |
| Get an 8-bit integer grayscale layout version of the frame, converting as necessary. | |
| const Layout< byte > & | asGrayU8NTSCLayout () const |
| Get an 8-bit integer grayscale NTSC layout version of the frame, converting as necessary. | |
| Image< float > | asGrayF32 () const |
| Get a 32-bit float grayscale version of the frame, converting as necessary. | |
| Image< float > | asFloat () const |
| Image< byte > | asGrayNTSC () const |
| Convert the image from rgb to luminance in NTSC coordinates. | |
| VideoFrame | asVideo () const |
| Get a video version of the frame, converting as necessary. | |
| bool | hasMetaData (const std::string &tag) const |
| Check whether we have a given piece of metadata. | |
| rutz::shared_ptr< MetaData > | getMetaData (const std::string &tag) |
| Get a given piece of metadata or throw an exception if it doesn't exist. | |
| void | addMetaData (const std::string &tag, rutz::shared_ptr< MetaData > d) |
| Insert a given piece of metadata, overwriting any previous metadata associated with that tag. | |
Static Public Member Functions | |
| static GenericFrame | deepCopyOf (const GenericFrame &f) |
| Make a new GenericFrame object with an internal private copy of any transient data. | |
Classes | |
| class | MetaData |
| MetaData for storing frame spacific information. More... | |
|
|
Definition at line 63 of file GenericFrame.H. |
|
|
Construct an empty frame.
Definition at line 59 of file GenericFrame.C. |
|
|
Construct an 8-bit integer rgb-native frame.
Definition at line 66 of file GenericFrame.C. |
|
|
Construct an 16-bit integer rgb-native frame.
Definition at line 76 of file GenericFrame.C. |
|
|
Construct an 8-bit integer rgb-native frame from a layout.
Definition at line 86 of file GenericFrame.C. |
|
||||||||||||
|
Construct a 32-bit floating point rgb-native frame.
Definition at line 96 of file GenericFrame.C. |
|
|
Construct an 8-bit integer grayscale-native frame.
Definition at line 107 of file GenericFrame.C. |
|
|
Construct an 16-bit integer grayscale-native frame.
Definition at line 117 of file GenericFrame.C. |
|
|
Construct an 8-bit integer grayscale-native frame from a layout.
Definition at line 127 of file GenericFrame.C. |
|
||||||||||||
|
Construct a 32-bit floating point grayscale-native frame.
Definition at line 137 of file GenericFrame.C. |
|
|
Construct an video-native frame.
Definition at line 148 of file GenericFrame.C. |
|
||||||||||||
|
Insert a given piece of metadata, overwriting any previous metadata associated with that tag.
Definition at line 612 of file GenericFrame.C. References rutz::shared_ptr< T >::get(), and rutz::shared_ptr< T >::reset(). Referenced by XMLInput::readFrame(). |
|
|
Get a 32-bit float grayscale version of the frame, converting as necessary.
Definition at line 508 of file GenericFrame.C. References asGray(), GRAY_F32, GRAY_U16, GRAY_U8, Image< T >::initialized(), luminance(), NONE, Layout< T >::render(), RGB_F32, RGB_U16, and RGB_U8. Referenced by asFloat(), doResizeFrame(), ColorizeOfilt::filterFrame(), main(), operator==(), HashOutputSeries::writeFrame(), RawWriter::writeFrame(), PnmWriter::writeFrame(), PngWriter::writeFrame(), PlaintextWriter::writeFrame(), and CcodeWriter::writeFrame(). |
|
|
Convert the image from rgb to luminance in NTSC coordinates.
Definition at line 185 of file GenericFrame.H. References asGrayU8NTSCLayout(), and Layout< T >::render(). Referenced by Raster::ReadGrayNTSC(). |
|
|
Get an 8-bit integer grayscale version of the frame, converting as necessary.
Definition at line 168 of file GenericFrame.H. References asGrayU8Layout(), and Layout< T >::render(). Referenced by doRescale(), doResizeFrame(), ColorizeOfilt::filterFrame(), operator==(), HashOutputSeries::writeFrame(), RawWriter::writeFrame(), PnmWriter::writeFrame(), PngWriter::writeFrame(), PlaintextWriter::writeFrame(), CcodeWriter::writeFrame(), and ImageDisplayStream::writeFrame(). |
|
|
Get an 8-bit integer grayscale layout version of the frame, converting as necessary.
Definition at line 356 of file GenericFrame.C. References VideoFrame::getBuffer(), VideoFrame::getDims(), VideoFrame::getMode(), GRAY_F32, GRAY_U16, GRAY_U8, Layout< T >::initialized(), luminance(), NONE, normalizeFloat(), Layout< T >::render(), RGB_F32, RGB_U16, and RGB_U8. Referenced by asGray(), asGrayU8(), and ImageDisplayStream::writeFrame(). |
|
|
Get an 8-bit integer grayscale NTSC layout version of the frame, converting as necessary.
Definition at line 414 of file GenericFrame.C. References VideoFrame::getBuffer(), VideoFrame::getDims(), VideoFrame::getMode(), GRAY_F32, GRAY_U16, GRAY_U8, Layout< T >::initialized(), luminanceNTSC(), NONE, normalizeFloat(), Layout< T >::render(), RGB_F32, RGB_U16, and RGB_U8. Referenced by asGrayNTSC(). |
|
|
Get a 32-bit float rgb version of the frame, converting as necessary.
Definition at line 315 of file GenericFrame.C. References asRgbU8(), GRAY_F32, GRAY_U16, GRAY_U8, Image< T >::initialized(), luminance(), NONE, Layout< T >::render(), RGB_F32, RGB_U16, and RGB_U8. Referenced by buildTitle(), doResizeFrame(), LuminanceOfilt::filterFrame(), main(), mexFunction(), operator==(), HashOutputSeries::writeFrame(), PlaintextWriter::writeFrame(), CcodeWriter::writeFrame(), and MgzEncoder::writeFrame(). |
|
|
Get an 8-bit integer rgb version of the frame, converting as necessary.
Definition at line 155 of file GenericFrame.H. References asRgbU8Layout(), and Layout< T >::render(). Referenced by asRgbF32(), doRescale(), doResizeFrame(), operator==(), StatsOutputSeries::writeFrame(), HashOutputSeries::writeFrame(), RawWriter::writeFrame(), PnmWriter::writeFrame(), PngWriter::writeFrame(), PlaintextWriter::writeFrame(), CcodeWriter::writeFrame(), and ImageDisplayStream::writeFrame(). |
|
|
Get an 8-bit integer rgb layout version of the frame, converting as necessary.
Definition at line 238 of file GenericFrame.C. References GRAY_F32, GRAY_U16, GRAY_U8, Layout< T >::initialized(), NONE, normalizeFloat(), normalizeFloatRgb(), Layout< T >::render(), RGB_F32, RGB_U16, RGB_U8, and VideoFrame::toRgb(). Referenced by asRgb(), asRgbU8(), and ImageDisplayStream::writeFrame(). |
|
|
Get a video version of the frame, converting as necessary.
Definition at line 548 of file GenericFrame.C. References GRAY_F32, GRAY_U16, GRAY_U8, VideoFrame::initialized(), NONE, Layout< T >::render(), RGB_F32, RGB_U16, and RGB_U8. Referenced by IntegerInput::decode(), doRescale(), LuminanceOfilt::filterFrame(), ColorizeOfilt::filterFrame(), CoerceVideoFormatOfilt::filterFrame(), operator==(), HalfFieldDeinterlacer< BottomField >::readFrame(), BobDeinterlacer::readFrame(), Raster::ReadVideo(), QuartzQuickTimeDecoder::readVideoFrame(), dummy_namespace_to_avoid_gcc411_bug_DiskDataStream_C::DiskDumpJob::run(), DisplayController::setBackground(), submain(), HashOutputSeries::writeFrame(), YuvWriter::writeFrame(), UcbMpegEncoder::writeFrame(), MrawvEncoder::writeFrame(), MgzEncoder::writeFrame(), FfmpegEncoder::writeFrame(), and SDLdisplayStream::writeFrame(). |
|
|
Make a new GenericFrame object with an internal private copy of any transient data.
Definition at line 169 of file GenericFrame.C. References VideoFrame::deepCopyOf(), itsFloatFlags, itsGrayF32, itsGrayU8, itsNativeType, itsRgbF32, itsRgbU8, and itsVideo. Referenced by DiskDataStream::writeFrame(). |
|
|
Get the float-normalization flags.
Definition at line 149 of file GenericFrame.H. Referenced by doResizeFrame(), LuminanceOfilt::filterFrame(), ColorizeOfilt::filterFrame(), QtImageFrame::setFrame(), PnmWriter::writeFrame(), PngWriter::writeFrame(), MrawvEncoder::writeFrame(), and MgzEncoder::writeFrame(). |
|
|
|
Get the dimensions of the native image.
Definition at line 201 of file GenericFrame.C. References ASSERT, VideoFrame::getDims(), Image< T >::getDims(), Layout< T >::getDims(), GRAY_F32, GRAY_U16, GRAY_U8, NONE, RGB_F32, RGB_U16, and RGB_U8. Referenced by buildTitle(), doResizeFrame(), frameSpec(), getHeight(), getWidth(), main(), QtImageFrame::Impl::rawDims(), submain(), SimEventInputFrame::toString(), MgzEncoder::writeFrame(), SDLdisplayStream::writeFrame(), and ImageDisplayStream::writeFrame(). |
|
|
Get the height of the native image.
Definition at line 146 of file GenericFrame.H. References getDims(), and Dims::h(). Referenced by DisplayController::setBackground(). |
|
|
Get a given piece of metadata or throw an exception if it doesn't exist.
Definition at line 597 of file GenericFrame.C. References rutz::shared_ptr< T >::get(), and LFATAL. Referenced by InferoTemporalSalBayes::attentionShift(). |
|
|
Get the width of the native image.
Definition at line 143 of file GenericFrame.H. References getDims(), and Dims::w(). Referenced by DisplayController::setBackground(). |
|
|
Check whether we have a given piece of metadata.
Definition at line 589 of file GenericFrame.C. References rutz::shared_ptr< T >::get(). Referenced by InferoTemporalSalBayes::attentionShift(). |
|
|
Check if we have a valid non-empty image, regardless of format.
Definition at line 157 of file GenericFrame.C. Referenced by CT2WSRegionTrainerForm::ChangeFrame(), CT2WSRegionTrainerForm::fileOpen(), RetinaI::getFrame(), SubController::getImage(), main(), SequenceFileStream::peekFrameSpec(), MrawvInputStream::peekFrameSpec(), MgzInputStream::peekFrameSpec(), FrameIstream::readAndDiscardFrame(), SequenceFileStream::readFrame(), QuartzQuickTimeDecoder::readFrame(), MrawvInputStream::readFrame(), MgzInputStream::readFrame(), InputFrameSeries::Impl::readFrame(), submain(), BeoHeadBrain::updateEyesImage(), and Raster::WriteFrame(). |
|
|
|
Get the frame's native image typename.
Definition at line 195 of file GenericFrame.C. References frameSpec(), and GenericFrameSpec::nativeTypeName(). Referenced by buildTitle(), SimEventInputFrame::toString(), StatsOutputSeries::writeFrame(), HashOutputSeries::writeFrame(), and MgzEncoder::writeFrame(). |
|
|
Change the float-normalization flags.
Definition at line 219 of file GenericFrame.C. References GRAY_F32, and RGB_F32. Referenced by QtImageFrame::setFrame(), and MrawvEncoder::writeFrame(). |
1.4.4