I suggest that we eliminate vil_image_view_sptr from vil. This will
allow the following simple rule:
1. Typed images in memory: use vil_image_view<Type>
2. Untyped images in memory: use vil_memory_image
3. Untyped images potentially on disk: use vil_image_resource.
Here, "in memory" means somewhere accessible via a pointer. It could
be a pointer to a framebuffer, a memory mapped file, or other
externally allocated memory. It doesn't have to be "vil-allocated" memory.
Change vil_load to be the same as vil_load_resource.
Change the assignment and copy constructors of vil_image_view to have
the following two signatures:
vil_image_view< typename vil_pixel_format_of<T>::component_type > const& other )
vil_image_view<T>::operator=( vil_memory_image )
// do type checking and such, and make this view point to the
// memory image
vil_image_resource get_view and put_view will communicate with
vil_image_view<T> via vil_memory_image.
So, vil_memory_image will essentially serve the purpose that
vil_image_view_base used to serve. The advantages are
- there is no C++ dependency between the typed and untyped classes
(which are quite different beasts).
- The typed classes won't have any virtual functions, enabling some
- There won't be any temptation to use vil_image_view_base (_sptr)
- More compile time type checks can be done for vil_image_view<T>.