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
00032
00033
00034
00035
00036
00037
00038 vil_image_resource_sptr vil_new_image_resource(unsigned ni, unsigned nj, unsigned nplanes,
00039 vil_pixel_format format);
00040
00041
00042
00043
00044 vil_image_resource_sptr vil_new_image_resource_interleaved(unsigned ni, unsigned nj,
00045 unsigned nplanes,
00046 vil_pixel_format format);
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 vil_image_resource_sptr vil_new_image_resource_of_view(vil_image_view_base const& view);
00057
00058
00059
00060
00061 vil_image_resource_sptr vil_new_image_resource(unsigned ni, unsigned nj,
00062 vil_image_resource_sptr const& prototype);
00063
00064
00065
00066 vil_image_resource_sptr vil_new_image_resource(vil_stream* os,
00067 unsigned ni, unsigned nj,
00068 unsigned nplanes,
00069 vil_pixel_format format,
00070 char const* file_format = 0);
00071
00072
00073
00074 vil_image_resource_sptr vil_new_image_resource(char const* filename,
00075 unsigned ni, unsigned nj,
00076 unsigned nplanes,
00077 vil_pixel_format format,
00078 char const* file_format = 0);
00079
00080
00081
00082 vil_image_resource_sptr vil_new_image_resource(char const* filename,
00083 unsigned ni, unsigned nj,
00084 unsigned nplanes,
00085 vil_image_resource_sptr const &prototype,
00086 char const* format = 0);
00087
00088
00089
00090 vil_image_resource_sptr vil_new_image_resource(vil_stream* os,
00091 unsigned ni, unsigned nj,
00092 unsigned nplanes,
00093 vil_image_resource_sptr const& prototype,
00094 char const* file_format = 0);
00095
00096 vil_blocked_image_resource_sptr
00097 vil_new_blocked_image_resource(vil_stream* os, unsigned ni, unsigned nj,
00098 unsigned nplanes, vil_pixel_format format,
00099 unsigned size_block_i, unsigned size_block_j,
00100 char const* file_format = 0);
00101
00102
00103 vil_blocked_image_resource_sptr
00104 vil_new_blocked_image_resource(char const* filename, unsigned ni, unsigned nj,
00105 unsigned nplanes, vil_pixel_format format,
00106 unsigned size_block_i, unsigned size_block_j,
00107 char const* file_format = 0);
00108
00109
00110
00111 vil_blocked_image_resource_sptr
00112 vil_new_blocked_image_facade(const vil_image_resource_sptr& src,
00113 const unsigned size_block_i=0,
00114 const unsigned size_block_j=0);
00115
00116 vil_blocked_image_resource_sptr
00117 vil_new_cached_image_resource(const vil_blocked_image_resource_sptr& bir,
00118 const unsigned cache_size = 100);
00119
00120
00121
00122
00123
00124 vil_pyramid_image_resource_sptr
00125 vil_new_pyramid_image_resource(char const* file_or_directory,
00126 char const* file_format);
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 vil_pyramid_image_resource_sptr
00137 vil_new_pyramid_image_from_base(char const* filename,
00138 vil_image_resource_sptr const& base_image,
00139 unsigned nlevels,
00140 char const* file_format,
00141 char const* temp_dir);
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 vil_pyramid_image_resource_sptr
00152 vil_new_pyramid_image_list_from_base(char const* directory,
00153 vil_image_resource_sptr const& base_image,
00154 unsigned nlevels,
00155 bool copy_base,
00156 char const* level_file_format,
00157 char const* filename);
00158
00159 #if 0 // deprecated
00160
00161
00162
00163
00164 template <class T>
00165 vil_image_view<T> vil_new_image_view_j_i_plane(unsigned ni, unsigned nj, unsigned nplanes, T )
00166 {
00167 VXL_DEPRECATED("vil_new_image_view_j_i_plane");
00168 vil_pixel_format fmt = vil_pixel_format_of(T());
00169 vil_memory_chunk_sptr chunk = new vil_memory_chunk(ni*nj*nplanes*sizeof(T),
00170 vil_pixel_format_component_format(fmt));
00171 return vil_image_view<T>(chunk, reinterpret_cast<T*>(chunk->data()), ni, nj, nplanes, nplanes, nplanes*ni, 1);
00172 }
00173 #endif // 0
00174
00175
00176
00177
00178 template <class T>
00179 vil_image_view<T> vil_new_image_view_plane_i_j(unsigned ni, unsigned nj, unsigned nplanes, T )
00180 {
00181 vil_pixel_format fmt = vil_pixel_format_of(T());
00182 vil_memory_chunk_sptr chunk = new vil_memory_chunk(ni*nj*nplanes*sizeof(T),
00183 vil_pixel_format_component_format(fmt));
00184 return vil_image_view<T>(chunk, reinterpret_cast<T*>(chunk->data()), ni, nj, nplanes, nj, 1, nj*ni);
00185 }
00186
00187
00188
00189
00190 template <class T>
00191 vil_image_view<T> vil_new_image_view_i_j_plane(unsigned ni, unsigned nj, unsigned nplanes, T )
00192 {
00193 vil_pixel_format fmt = vil_pixel_format_of(T());
00194 vil_memory_chunk_sptr chunk = new vil_memory_chunk(ni*nj*nplanes*sizeof(T),
00195 vil_pixel_format_component_format(fmt));
00196 return vil_image_view<T>(chunk, reinterpret_cast<T*>(chunk->data()), ni, nj, nplanes, nplanes*nj, nplanes, 1);
00197 }
00198
00199
00200
00201
00202 vil_image_view_base_sptr vil_new_image_view_base_sptr(const vil_image_view_base&);
00203
00204 #endif // vil_new_h_