contrib/brl/bbas/vidl2/vidl2_convert.h

Go to the documentation of this file.
00001 // This is brl/bbas/vidl2/vidl2_convert.h
00002 #ifndef vidl2_convert_h_
00003 #define vidl2_convert_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Convert frames to vil_image_views
00010 //
00011 // \author Matt Leotta
00012 // \date 16 Jan 2006
00013 //
00014 // This file contains functions used to convert a vidl2_frame_sptr
00015 // into a vil_image_view.
00016 
00017 
00018 #include "vidl2_frame_sptr.h"
00019 #include "vidl2_frame.h"
00020 #include <vil/vil_image_view_base.h>
00021 
00022 
00023 //: Convert the frame into an image view
00024 // possibly converts the pixel data type
00025 // always create a deep copy of the data
00026 // \param require_color restricts the color mode of the output
00027 //         if set to UNKNOWN (default) the input color mode is used
00028 bool vidl2_convert_to_view(const vidl2_frame& frame,
00029                            vil_image_view_base& image,
00030                            vidl2_pixel_color require_color = VIDL2_PIXEL_COLOR_UNKNOWN);
00031 
00032 
00033 //: Wrap the frame buffer in an image view if supported
00034 // Returns a null pointer if not possible
00035 vil_image_view_base_sptr vidl2_convert_wrap_in_view(const vidl2_frame& frame);
00036 
00037 
00038 //: Convert the pixel format of a frame
00039 // The \p in_frame.data() is converted from \p in_frame.pixel_format()
00040 // to \p out_frame.pixel_format() and stored in \p out_frame.data()
00041 // \returns false if the output frame data is not the correct size.
00042 bool vidl2_convert_frame(const vidl2_frame& in_frame,
00043                                vidl2_frame& out_frame);
00044 
00045 
00046 //: Convert the pixel format of a frame
00047 // Convert \p in_frame to a \p format by allocating a new frame buffer
00048 vidl2_frame_sptr vidl2_convert_frame(const vidl2_frame_sptr& in_frame,
00049                                      vidl2_pixel_format format);
00050 
00051 //: Convert the image view to a frame
00052 // Will wrap the memory if possible, if not the image is converted to
00053 // the closest vidl2_pixel_format
00054 vidl2_frame_sptr vidl2_convert_to_frame(const vil_image_view_base_sptr& image);
00055 
00056 #endif // vidl2_convert_h_

Generated on Wed Dec 3 05:21:02 2008 for contrib/brl/bbas/vidl2 by  doxygen 1.5.1