Defines
core/vgui/vgui_section_buffer.cxx File Reference

See vgui_section_buffer.h for a description of this file. More...

#include "vgui_section_buffer.h"
#include <vcl_cassert.h>
#include <vcl_iostream.h>
#include <vbl/vbl_array_1d.h>
#include <vil1/vil1_image.h>
#include <vil1/vil1_pixel.h>
#include <vil/vil_image_view.h>
#include <vil/vil_image_resource.h>
#include <vil/vil_pixel_format.h>
#include "vgui_macro.h"
#include "vgui_pixel.h"
#include "vgui_section_render.h"
#include "vgui_range_map_params.h"
#include "vgui_range_map.h"
#include "internals/vgui_gl_selection_macros.h"
#include "internals/vgui_accelerate.h"

Go to the source code of this file.

Defines

#define Code(BufferType)   result=convert_buffer(in,rmp,(BufferType*)out,hstep);
#define Code(BufferType)   buffer_=new BufferType[allocw_*alloch_];
#define Code(BufferType)   delete[] static_cast<BufferType*>(buffer_);
#define DoCase(T)
#define DoCase(PixelFormat, DataType, NComp)

Detailed Description

See vgui_section_buffer.h for a description of this file.

Author:
fsm
    Modifications
     16-AUG-2000 Marko Bacic, Oxford RRG -- Added support for multiple textures
                 Many cheap graphics cards do not support texture maps
                 bigger than 256x256. To support images greater than 256x256
                 it was necessary to add support for multiple textures.
                 Hence an image is rendered by tiling together several textures
                 containing different parts of it.
     16-AUG-2000 fsm -- Imposed my rigid ways on Marko's changes.
                 Fixes for SolarisGL.
     05-AUG-2003 Amitha Perera --
                 Added support for rendering vil_image_views, and cleaned up
                 the macros for selecting the pixel types and doing the data
                 conversion.
   

Definition in file vgui_section_buffer.cxx.


Define Documentation

#define Code (   BufferType)    result=convert_buffer(in,rmp,(BufferType*)out,hstep);
#define Code (   BufferType)    buffer_=new BufferType[allocw_*alloch_];
#define Code (   BufferType)    delete[] static_cast<BufferType*>(buffer_);
#define DoCase (   T)
Value:
case T:                                                                   \
    {                                                                         \
      typedef vil_pixel_format_type_of<T>::type Type;                         \
      vil_image_view<Type> img = image_in->get_view( x_, w_, y_, h_ );        \
      assert( img );                                                          \
      conversion_okay = convert_image(img,rmp,buffer_,allocw_,format_,type_); \
      break;                                                                  \
    }
#define DoCase (   PixelFormat,
  DataType,
  NComp 
)
Value:
case PixelFormat:                                                         \
    {                                                                         \
      DataType* temp_buffer = new DataType[ w_ * h_ * NComp ];                \
      section_ok = image.get_section( temp_buffer, x_, y_, w_, h_ );          \
      if ( section_ok ) {                                                     \
        vil_image_view<DataType> view( temp_buffer, w_, h_, NComp,            \
                                       NComp, NComp*w_, 1 );                  \
        conversion_ok = convert_image(view,rmp,buffer_,allocw_,format_,type_);\
      }                                                                       \
      delete[] temp_buffer;                                                   \
      break;                                                                  \
    }