00001 
00002 #ifndef vil_new_h_
00003 #define vil_new_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 #include <vil/vil_fwd.h>
00027 #include <vil/vil_image_resource.h>
00028 #include <vil/vil_blocked_image_resource.h>
00029 #include <vil/vil_pyramid_image_resource.h>
00030 #include <vil/vil_image_view.h>
00031 #include <vxl_config.h>
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 vil_image_resource_sptr vil_new_image_resource(unsigned ni, unsigned nj, unsigned nplanes,
00040                                                vil_pixel_format format);
00041 
00042 
00043 
00044 
00045 vil_image_resource_sptr vil_new_image_resource_interleaved(unsigned ni, unsigned nj,
00046                                                            unsigned nplanes,
00047                                                            vil_pixel_format format);
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 vil_image_resource_sptr vil_new_image_resource_of_view(vil_image_view_base const& view);
00058 
00059 
00060 
00061 
00062 vil_image_resource_sptr vil_new_image_resource(unsigned ni, unsigned nj,
00063                                                vil_image_resource_sptr const& prototype);
00064 
00065 
00066 
00067 vil_image_resource_sptr vil_new_image_resource(vil_stream* os,
00068                                                unsigned ni, unsigned nj,
00069                                                unsigned nplanes,
00070                                                vil_pixel_format format,
00071                                                char const* file_format = 0);
00072 
00073 
00074 
00075 vil_image_resource_sptr vil_new_image_resource(char const* filename,
00076                                                unsigned ni, unsigned nj,
00077                                                unsigned nplanes,
00078                                                vil_pixel_format format,
00079                                                char const* file_format = 0);
00080 
00081 
00082 
00083 vil_image_resource_sptr vil_new_image_resource(char const* filename,
00084                                                unsigned ni, unsigned nj,
00085                                                unsigned nplanes,
00086                                                vil_image_resource_sptr const &prototype,
00087                                                char const* format = 0);
00088 
00089 
00090 
00091 vil_image_resource_sptr vil_new_image_resource(vil_stream* os,
00092                                                unsigned ni, unsigned nj,
00093                                                unsigned nplanes,
00094                                                vil_image_resource_sptr const& prototype,
00095                                                char const* file_format = 0);
00096 
00097 vil_blocked_image_resource_sptr
00098 vil_new_blocked_image_resource(vil_stream* os, unsigned ni, unsigned nj,
00099                                unsigned nplanes, vil_pixel_format format,
00100                                unsigned size_block_i, unsigned size_block_j,
00101                                char const* file_format = 0);
00102 
00103 
00104 vil_blocked_image_resource_sptr
00105 vil_new_blocked_image_resource(char const* filename, unsigned ni, unsigned nj,
00106                                unsigned nplanes, vil_pixel_format format,
00107                                unsigned size_block_i, unsigned size_block_j,
00108                                char const* file_format = 0);
00109 
00110 
00111 
00112 vil_blocked_image_resource_sptr
00113 vil_new_blocked_image_facade(const vil_image_resource_sptr& src,
00114                              const unsigned size_block_i=0,
00115                              const unsigned size_block_j=0);
00116 
00117 vil_blocked_image_resource_sptr
00118 vil_new_cached_image_resource(const vil_blocked_image_resource_sptr& bir,
00119                               const unsigned cache_size = 100);
00120 
00121 
00122 
00123 
00124 
00125 vil_pyramid_image_resource_sptr
00126 vil_new_pyramid_image_resource(char const* file_or_directory,
00127                                char const* file_format);
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 vil_pyramid_image_resource_sptr
00138 vil_new_pyramid_image_from_base(char const* filename,
00139                                 vil_image_resource_sptr const& base_image,
00140                                 unsigned nlevels,
00141                                 char const* file_format,
00142                                 char const* temp_dir);
00143 
00144 
00145 
00146 
00147 
00148 
00149 
00150 
00151 
00152 vil_pyramid_image_resource_sptr
00153 vil_new_pyramid_image_list_from_base(char const* directory,
00154                                      vil_image_resource_sptr const& base_image,
00155                                      unsigned nlevels,
00156                                      bool copy_base,
00157                                      char const* level_file_format,
00158                                      char const* filename);
00159 
00160 #if 0 // deprecated
00161 
00162 
00163 
00164 
00165 
00166 template <class T>
00167 vil_image_view<T> vil_new_image_view_j_i_plane(unsigned ni, unsigned nj, unsigned nplanes, T )
00168 {
00169   VXL_DEPRECATED("vil_new_image_view_j_i_plane");
00170   vil_pixel_format fmt = vil_pixel_format_of(T());
00171   vil_memory_chunk_sptr chunk = new vil_memory_chunk(ni*nj*nplanes*sizeof(T),
00172                                                      vil_pixel_format_component_format(fmt));
00173   return vil_image_view<T>(chunk, reinterpret_cast<T*>(chunk->data()), ni, nj, nplanes, nplanes, nplanes*ni, 1);
00174 }
00175 #endif // 0
00176 
00177 
00178 
00179 
00180 
00181 template <class T>
00182 vil_image_view<T> vil_new_image_view_plane_i_j(unsigned ni, unsigned nj, unsigned nplanes, T )
00183 {
00184   vil_pixel_format fmt = vil_pixel_format_of(T());
00185   vil_memory_chunk_sptr chunk = new vil_memory_chunk(ni*nj*nplanes*sizeof(T),
00186                                                      vil_pixel_format_component_format(fmt));
00187   return vil_image_view<T>(chunk, reinterpret_cast<T*>(chunk->data()), ni, nj, nplanes, nj, 1, nj*ni);
00188 }
00189 
00190 
00191 
00192 
00193 
00194 template <class T>
00195 vil_image_view<T> vil_new_image_view_i_j_plane(unsigned ni, unsigned nj, unsigned nplanes, T )
00196 {
00197   vil_pixel_format fmt = vil_pixel_format_of(T());
00198   vil_memory_chunk_sptr chunk = new vil_memory_chunk(ni*nj*nplanes*sizeof(T),
00199                                                      vil_pixel_format_component_format(fmt));
00200   return vil_image_view<T>(chunk, reinterpret_cast<T*>(chunk->data()), ni, nj, nplanes, nplanes*nj, nplanes, 1);
00201 }
00202 
00203 
00204 
00205 
00206 
00207 vil_image_view_base_sptr vil_new_image_view_base_sptr(const vil_image_view_base&);
00208 
00209 
00210 #if defined(VCL_WIN32) && VXL_USE_WIN_WCHAR_T
00211 
00212 
00213 vil_image_resource_sptr vil_new_image_resource(vil_stream* os,
00214                                                unsigned ni, unsigned nj,
00215                                                unsigned nplanes,
00216                                                vil_pixel_format format,
00217                                                wchar_t const* file_format = 0);
00218 
00219 
00220 vil_image_resource_sptr vil_new_image_resource(wchar_t const* filename,
00221                                                unsigned ni, unsigned nj,
00222                                                unsigned nplanes,
00223                                                vil_pixel_format format,
00224                                                wchar_t const* file_format = 0);
00225 
00226 
00227 
00228 vil_image_resource_sptr vil_new_image_resource(wchar_t const* filename,
00229                                                unsigned ni, unsigned nj,
00230                                                unsigned nplanes,
00231                                                vil_image_resource_sptr const &prototype,
00232                                                wchar_t const* format = 0);
00233 
00234 #endif //defined(VCL_WIN32) && VXL_USE_WIN_WCHAR_T
00235 
00236 
00237 #endif // vil_new_h_