Defines
contrib/mul/vimt3d/vimt3d_vil3d_v3m.cxx File Reference

Reader/Writer for v3m format images. More...

#include "vimt3d_vil3d_v3m.h"
#include <vcl_cstdlib.h>
#include <vcl_cstring.h>
#include <vcl_sstream.h>
#include <vcl_cassert.h>
#include <vcl_ios.h>
#include <vcl_algorithm.h>
#include <vsl/vsl_binary_loader.h>
#include <vsl/vsl_block_binary_rle.h>
#include <vgl/vgl_point_3d.h>
#include <vgl/vgl_vector_3d.h>
#include <vil3d/vil3d_image_view.h>
#include <vil3d/vil3d_copy.h>
#include <vil3d/vil3d_property.h>
#include <vimt3d/vimt3d_image_3d_of.h>
#include <vil/vil_exception.h>

Go to the source code of this file.

Defines

#define macro(F, T)
#define macro(F, T)
#define macro(F, T)
#define macro(F, T)
#define macro(F, T)
#define macro(F, T)

Detailed Description

Reader/Writer for v3m format images.

Author:
Ian Scott - Manchester

Definition in file vimt3d_vil3d_v3m.cxx.


Define Documentation

#define macro (   F,
 
)
Value:
case F : \
        { \
          vcl_ptrdiff_t istep=0, jstep=0, kstep=0, pstep=0; \
          T* origin_ptr=static_cast<T*>(chunk_ptr->data()); \
          if (size) \
          { \
            vsl_block_binary_rle_read(is, static_cast<T *>(chunk_ptr->data()), size); \
            vsl_b_read(is, istep); \
            vsl_b_read(is, jstep); \
            vsl_b_read(is, kstep); \
            vsl_b_read(is, pstep); \
            vcl_ptrdiff_t offset; \
            vsl_b_read(is, offset); \
            origin_ptr += offset; \
          } \
          im_ = new vimt3d_image_3d_of<T>( \
                      vil3d_image_view<T>(chunk_ptr, origin_ptr, \
                                          header_.ni, header_.nj, header_.nk, header_.nplanes, \
                                          istep, jstep, kstep, pstep), header_.w2i ); \
         } \
        break;
#define macro (   F,
 
)
Value:
case F : \
    im_ = new vimt3d_image_3d_of< T > (ni, nj, nk, nplanes); \
    break;
#define macro (   F,
 
)
Value:
case F : \
      { \
        const vil3d_image_view<T> &image = static_cast<vil3d_image_view<T> >(im_->image_base()); \
        if (image.size()) \
        { \
          /* Data should be stored compactly, since this class controls im_ */ \
          assert(!image || image.size()*sizeof(T) == image.memory_chunk()->size()); \
          /* Data should be stored with non-compound type, since this class controls im_ */ \
          assert(!image || image.pixel_format() == image.memory_chunk()->pixel_format()); \
          vsl_block_binary_rle_write(os, static_cast<const T *>(image.memory_chunk()->const_data()), \
                                     image.size()); \
          vsl_b_write(os, image.istep()); \
          vsl_b_write(os, image.jstep()); \
          vsl_b_write(os, image.kstep()); \
          vsl_b_write(os, image.planestep()); \
          vcl_ptrdiff_t offset = (image.origin_ptr() - \
                                  reinterpret_cast<const T*>(image.memory_chunk()->data())); \
          vsl_b_write(os, offset); \
        } \
       } \
      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)?0:&v(i0,j0,k0), \
                                       ni, nj, nk, v.nplanes(), \
                                       v.istep(), v.jstep(), v.kstep(), \
                                       v.planestep()); }
#define macro (   F,
 
)
Value:
case F : \
    vil3d_copy_to_window(static_cast<vil3d_image_view<T >const&>(vv), \
                         static_cast<vimt3d_image_3d_of<T >&>(*im_).image(), \
                         i0, j0, k0); \
    return true;