Defines
contrib/mul/vil3d/vil3d_memory_image.cxx File Reference
#include "vil3d_memory_image.h"
#include <vcl_cassert.h>
#include <vcl_cstdlib.h>
#include <vxl_config.h>
#include <vil3d/vil3d_image_view.h>
#include <vil3d/vil3d_copy.h>
#include <vil/vil_pixel_format.h>

Go to the source code of this file.

Defines

#define macro(F, T)   case F : view_ = new vil3d_image_view<T >(ni, nj, nk, nplanes); break;
#define macro(F, T)
#define macro(F, T)
#define macro(F, T)

Detailed Description

Author:
Ian Scott

Definition in file vil3d_memory_image.cxx.


Define Documentation

#define macro (   F,
 
)    case F : view_ = new vil3d_image_view<T >(ni, nj, nk, nplanes); break;
#define macro (   F,
 
)
Value:
case  F : { \
      const vil3d_image_view< T > &v = \
        static_cast<const vil3d_image_view< T > &>(*view_); \
      vil3d_image_view< T > w(v.memory_chunk(), &v(i0,j0,k0), \
                             ni, nj, nk, v.nplanes(), \
                             v.istep(), v.jstep(), v.kstep(), v.planestep()); \
      return new vil3d_image_view< T >(vil3d_copy_deep(w)); }
#define macro (   F,
 
)
Value:
case  F : { \
      const vil3d_image_view< T > &v = \
        static_cast<const vil3d_image_view< T > &>(*view_); \
      return new vil3d_image_view< T >(v.memory_chunk(), &v(i0,j0,k0), \
                                      ni, nj, nk, v.nplanes(), \
                                      v.istep(), v.jstep(), v.kstep(), \
                                      v.planestep()); }
#define macro (   F,
 
)
Value:
case  F : { \
      vil3d_image_view< T > &v = \
        static_cast<vil3d_image_view< T > &>(*view_); \
      const vil3d_image_view< T > &w = \
        static_cast<const vil3d_image_view< T > &>(im); \
      if (v.memory_chunk() == w.memory_chunk()) \
      { \
        if (&v(i0,j0,k0) != w.origin_ptr()) { \
          vcl_cerr << "ERROR: vil_memory_image::put_view()\n" \
            "different window from that used in get_view()" << vcl_endl; \
          vcl_abort(); } \
        else return true; /* The user has already modified the data in place. */ \
      } \
      vil3d_copy_to_window(w, v, i0, j0, k0); \
      return true; }