Classes | Macros | Functions | Variables
vil_tiff.cxx File Reference

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

#include <cstring>
#include <iostream>
#include <algorithm>
#include <sstream>
#include "vil_tiff.h"
#include <cassert>
#include <vil/vil_stream.h>
#include <vil/vil_property.h>
#include <vil/vil_image_view.h>
#include <vil/vil_memory_chunk.h>
#include <vil/vil_copy.h>
#include <vil/vil_image_list.h>
#include "vil_tiff_header.h"
#include <vil/vil_exception.h>

Go to the source code of this file.

Classes

struct  tif_stream_structures
 

Macros

#define GET_BLOCK_CASE(FORMAT, T)
 
#define GET_LINE_CASE(FORMAT, T)
 
#define GET_VIEW_PTR(FORMAT, T)
 

Functions

bool vil_tiff_file_format_probe (vil_stream *is)
 
template<>
bool * tiff_byte_align_data< bool > (bool *in_data, unsigned num_samples, unsigned in_bits_per_sample, bool *out_data)
 
bool integral_type (unsigned bits_per_sample)
 
template<class T >
vil_memory_chunk_sptr tiff_maybe_byte_align_data (vil_memory_chunk_sptr in_data, unsigned num_samples, unsigned in_bits_per_sample, unsigned bytes_per_block)
 
template<>
vil_memory_chunk_sptr tiff_maybe_byte_align_data< float > (vil_memory_chunk_sptr in_data, unsigned, unsigned, unsigned)
 
template<>
vil_memory_chunk_sptr tiff_maybe_byte_align_data< double > (vil_memory_chunk_sptr in_data, unsigned, unsigned, unsigned)
 

Variables

char const * vil_tiff_format_tag = "tiff"
 

Detailed Description

See vil_tiff.h for a description of this file.

Author
awf@r.nosp@m.obot.nosp@m.s.ox..nosp@m.ac.u.nosp@m.k
  Modifications:
   2001-11-09 K.Y.McGaul  Use dflt value for orientation when it can't be read
   2005-12-xx J.L. Mundy  Essentially a complete rewrite to support blocking.
                          Cleaner struct: hdr params moved to vil_tiff_header

Definition in file vil_tiff.cxx.

Macro Definition Documentation

◆ GET_BLOCK_CASE

#define GET_BLOCK_CASE (   FORMAT,
 
)
Value:
case FORMAT: { \
vil_image_view_base_sptr view; \
buf_out = tiff_maybe_byte_align_data<T>(buf, samples_per_block, \
bits_per_sample, \
samples_per_block*vil_pixel_format_sizeof_components(fmt)); \
view = new vil_image_view<T>(buf_out, reinterpret_cast<T*>(buf_out->data()), \
size_block_i(), size_block_j(), \
spp, spp, size_block_i()*spp, 1); \
return view; }
Concrete view of image data of type T held in memory.
Definition: vil_fwd.h:13
unsigned vil_pixel_format_sizeof_components(enum vil_pixel_format f)
Return the number of bytes used by each component of pixel format f.

◆ GET_LINE_CASE

#define GET_LINE_CASE (   FORMAT,
 
)
Value:
case FORMAT:\
out_line_buf = \
tiff_maybe_byte_align_data<T>(line_buf,\
spl, h_->bits_per_sample.val,\
bytes_expanded_line); \
break

◆ GET_VIEW_PTR

#define GET_VIEW_PTR (   FORMAT,
 
)
Value:
case FORMAT: { \
vil_image_view<T> view = static_cast<const vil_image_view<T>& >(im);\
view_istep = view.istep(); view_jstep = view.jstep(); view_pstep = view.planestep(); \
view_buf = reinterpret_cast<vxl_byte*>(view.top_left_ptr());\
} break
Concrete view of image data of type T held in memory.
Definition: vil_fwd.h:13
std::ptrdiff_t istep() const
Add this to your pixel pointer to get next i pixel.

Function Documentation

◆ integral_type()

bool integral_type ( unsigned  bits_per_sample)

Definition at line 515 of file vil_tiff.cxx.

◆ tiff_byte_align_data< bool >()

template<>
bool* tiff_byte_align_data< bool > ( bool *  in_data,
unsigned  num_samples,
unsigned  in_bits_per_sample,
bool *  out_data 
)

Definition at line 495 of file vil_tiff.cxx.

◆ tiff_maybe_byte_align_data()

template<class T >
vil_memory_chunk_sptr tiff_maybe_byte_align_data ( vil_memory_chunk_sptr  in_data,
unsigned  num_samples,
unsigned  in_bits_per_sample,
unsigned  bytes_per_block 
)

Definition at line 529 of file vil_tiff.cxx.

◆ tiff_maybe_byte_align_data< double >()

template<>
vil_memory_chunk_sptr tiff_maybe_byte_align_data< double > ( vil_memory_chunk_sptr  in_data,
unsigned  ,
unsigned  ,
unsigned   
)

Definition at line 565 of file vil_tiff.cxx.

◆ tiff_maybe_byte_align_data< float >()

template<>
vil_memory_chunk_sptr tiff_maybe_byte_align_data< float > ( vil_memory_chunk_sptr  in_data,
unsigned  ,
unsigned  ,
unsigned   
)

Definition at line 558 of file vil_tiff.cxx.

◆ vil_tiff_file_format_probe()

bool vil_tiff_file_format_probe ( vil_stream is)

Definition at line 50 of file vil_tiff.cxx.

Variable Documentation

◆ vil_tiff_format_tag

char const* vil_tiff_format_tag = "tiff"

Definition at line 35 of file vil_tiff.cxx.