vil_iris.cxx
Go to the documentation of this file.
1 // This is core/vil/file_formats/vil_iris.cxx
2 //:
3 // \file
4 // \author Joris Schouteden
5 // \date 17 Feb 2000
6 //
7 // \verbatim
8 // Modifications
9 // Ported from vil1 by Peter Vanroose, 16 June 2003.
10 // 12-Oct-2003 - PVr - being more careful with unsigned (bug fix for Alpha)
11 // \endverbatim
12 //
13 //-----------------------------------------------------------------------------
14 
15 #include <cstring>
16 #include <iostream>
17 #include "vil_iris.h"
18 
19 #include <cassert>
20 #ifdef _MSC_VER
21 # include <vcl_msvc_warnings.h>
22 #endif
23 
24 #include <vil/vil_stream.h>
25 #include <vil/vil_image_view.h>
26 #include <vil/vil_exception.h>
27 
28 #include <vxl_config.h> // for vxl_byte, vxl_uint_32, ...
29 
30 static vxl_sint_16 get_short(vil_stream* file, int location = -1); // default -1 means: read at current position
31 static vxl_uint_16 get_ushort(vil_stream* file, int location = -1);
32 static char get_char(vil_stream* file, int location = -1);
33 static vxl_sint_32 get_long(vil_stream* file, int location = -1);
34 static void send_char(vil_stream* data, char s);
35 static void send_short(vil_stream* data, vxl_sint_16 s);
36 static void send_ushort(vil_stream* data, vxl_uint_16 s);
37 static void send_long(vil_stream* data, vxl_sint_32 s);
38 static void expandrow(unsigned char *optr, unsigned char *iptr, int z);
39 
40 char const* vil_iris_format_tag = "iris";
41 
43 {
44  is->seek(0L);
45  if (is->file_size() < 84L) return nullptr;
46  int colormap_;
47 
48  vxl_sint_16 magic_ = get_short(is);
49  int storage_ = get_char(is);
50  int bytes_per_component = get_char(is);
51  int dimension_ = get_ushort(is);
52  /*int ni_ =*/ get_ushort(is);
53  /*int nj_ =*/ get_ushort(is);
54  /*int nplanes_=*/ get_ushort(is);
55  /*int pixmin_ =*/ get_long(is);
56  /*int pixmax_ =*/ get_long(is);
57 
58  is->seek(24L);
59  char imagename[81];
60  if (is->read(imagename, 80L) != 80) return nullptr;
61 
62  colormap_ = get_long(is);
63 
64  if (magic_ != 474) return nullptr;
65  if (storage_ != 0 && storage_ != 1) return nullptr;
66  if (colormap_ == 3) return nullptr;
67  if (dimension_ == 3 && colormap_ != 0) return nullptr;
68  if (dimension_ > 3 || dimension_ < 1) return nullptr;
69  if (bytes_per_component < 1 || bytes_per_component > 2) return nullptr;
70 
71  return new vil_iris_generic_image(is,imagename);
72 }
73 
75  unsigned int ni, unsigned int nj, unsigned int nplanes,
76  vil_pixel_format format)
77 {
78  return new vil_iris_generic_image(is, ni, nj, nplanes, format);
79 }
80 
81 char const* vil_iris_file_format::tag() const
82 {
83  return vil_iris_format_tag;
84 }
85 
86 /////////////////////////////////////////////////////////////////////////////
87 
89  starttab_(nullptr), lengthtab_(nullptr), is_(is)
90 {
91  is_->ref();
92  read_header();
93  std::strncpy(imagename_, imagename, 80);
94 }
95 
96 bool vil_iris_generic_image::get_property(char const* /*tag*/, void* /*prop*/) const
97 {
98  // This is not an in-memory image type, nor is it read-only:
99  return false;
100 }
102 char const* vil_iris_generic_image::file_format() const
103 {
104  return vil_iris_format_tag;
105 }
108  unsigned int ni, unsigned int nj, unsigned int nplanes,
109  vil_pixel_format format)
110  : starttab_(nullptr), lengthtab_(nullptr), is_(is), magic_(474), ni_(ni), nj_(nj),
111  nplanes_(nplanes), format_(format), pixmin_(0),
112  pixmax_(vil_pixel_format_sizeof_components(format)==1 ? 255 : 65535),
113  storage_(0), dimension_(nplanes_==1 ? 2 : 3), colormap_(0)
114 {
115  is_->ref();
116 
117  if (vil_pixel_format_sizeof_components(format) <= 2)
118  {
119  std::strcpy(imagename_, "written by vil_iris_generic_image");
120 
121  if (nplanes_ != 1 && nplanes_ != 3 && nplanes_ != 4)
122  std::cerr << __FILE__ ": Cannot write iris image, can only do grayscale or RGB(A)\n";
123  write_header();
124  }
125  else std::cerr << __FILE__ ": Cannot write iris image, which needs 8 or 16 bits per component\n";
126 }
129 {
130  is_->unref();
131  delete [] starttab_;
132  delete [] lengthtab_;
133 }
136 {
137  is_->seek(0L);
138 
139  magic_ = get_short(is_, 0);
140  if (magic_ != 474)
141  {
142  std::cerr << __FILE__ ": This is not an Iris RGB file: magic number is incorrect: "
143  << magic_ << std::endl;
144  return false;
145  }
146 
147  storage_ = get_char(is_);
148  if (storage_ != 0 && storage_ != 1)
149  {
150  std::cerr << __FILE__ ": This is not an Iris RGB file: storage must be RLE or VERBATIM\n";
151  return false;
152  }
153 
154  int bytes_per_component = get_char(is_);
155  dimension_ = get_ushort(is_);
156  ni_ = get_ushort(is_);
157  nj_ = get_ushort(is_);
158  nplanes_ = get_ushort(is_);
159  pixmin_ = get_long(is_);
160  pixmax_ = get_long(is_);
161  format_ = bytes_per_component==1 ? VIL_PIXEL_FORMAT_BYTE :
162  bytes_per_component==2 ? VIL_PIXEL_FORMAT_UINT_16 :
164 
165  // DUMMY1 starts at 20
166  // image name starts at 24
167 
168  is_->seek(24L);
169  is_->read(imagename_, 80L);
170 
171  // COLORMAP starts at 104
172  colormap_ = get_long(is_);
173 
174  // _DUMMY2 starts at 108, ends at 512
175 
176  if (colormap_ == 3)
177  {
178  std::cerr << __FILE__ ": This is not an ordinary Iris RGB image but a colormap file which I cannot handle\n";
179  return false;
180  }
181 
182  if (dimension_ == 3 && colormap_ != 0)
183  {
184  std::cerr << __FILE__ ": Cannot handle Iris RGB file with colormap other than NORMAL\n";
185  return false;
186  }
187 
188  if (storage_) // we got a RLE image
190 
191  return true;
192 }
193 
196 {
197 #ifdef DEBUG
198  std::cerr << __FILE__ ": vil_iris_generic_image::write_header()\n"
199  << "Here we go :\n"
200  << "magic_ = " << magic_ << std::endl
201  << "storage_ = " << storage_ << std::endl
202  << "format_ = " << format_ << std::endl
203  << "dimension_ = " << dimension_ << std::endl
204  << "ni_ = " << ni_ << std::endl
205  << "nj_ = " << nj_ << std::endl
206  << "nplanes_ = " << nplanes_ << std::endl
207  << "pixmin_ = " << pixmin_ << std::endl
208  << "pixmax_ = " << pixmax_ << std::endl
209  << "colormap_ = " << colormap_ << std::endl
210  << "imagename_ = " << imagename_ << std::endl
211  << std::endl;
212 #endif
213 
214  char dummy[410];
215 
216  send_short(is_, static_cast<vxl_sint_16>(magic_));
217  send_char(is_, (char)storage_); // either VERBATIM (0) or RLE (1)
218  send_char(is_, (char)vil_pixel_format_sizeof_components(format_)); // bytes per pixel per channel
219  send_ushort(is_, static_cast<vxl_uint_16>(dimension_)); // either 1 (1 scanline), 2 (grey image), or 3 (colour)
220  send_ushort(is_, static_cast<vxl_uint_16>(ni_)); // width
221  send_ushort(is_, static_cast<vxl_uint_16>(nj_)); // height
222  send_ushort(is_, static_cast<vxl_uint_16>(nplanes_));// nr of colour bands; typically 3 (RGB) or 4 (RGBA)
223  send_long(is_, pixmin_); // minimum pixel value; typically 0
224  send_long(is_, pixmax_); // maximum pixel value; typically 255 if _PBC is 1
225  is_->write(dummy, 4L);
226  is_->write(imagename_, 80L); // null-terminated string
227  send_long(is_, colormap_); // either NORMAL (0) (RGB), DITHERED (1) (R=3,G=3,B=2 bits),
228  // SCREEN (2) (obsolete) or COLORMAP (3) (hardware-specific).
229 
230  start_of_data_ = is_->tell();
231 
232  return is_->write(dummy, 404L) == 404L;
233 }
234 
235 
236 static inline void swap(void* p,int length)
237 {
238  char* t = (char*)p;
239 #ifdef DEBUG
240  if (length == sizeof(vxl_uint_32) && *(vxl_uint_32*)p != 0) {
241  std::cerr << "Swapping " << *(vxl_uint_32*)p;
242  if (length == sizeof(float))
243  std::cerr << " (or " << *(float*)p << ')';
244  }
245 #endif
246  for (int j=0;2*j<length;++j) { char c = t[j]; t[j] = t[length-j-1]; t[length-j-1] = c; }
247 #ifdef DEBUG
248  if (length == sizeof(vxl_uint_32) && *(vxl_uint_32*)p != 0) {
249  std::cerr << " to " << *(vxl_uint_32*)p;
250  if (length == sizeof(float))
251  std::cerr << " (or " << *(float*)p << ')';
252  std::cerr << '\n';
253  }
254 #endif
255 }
257 vil_image_view_base_sptr vil_iris_generic_image::get_copy_view( unsigned int x0, unsigned int xs,
258  unsigned int y0, unsigned int ys) const
259 {
260  // I am not dealing with requests for memory outside the image
261  // so just abort when getting any such request:
262  assert(x0+xs<=ni_);
263  assert(y0+ys<=nj_);
264 
265  if (storage_)
266  return get_section_rle(x0,xs,y0,ys);
267  else
268  return get_section_verbatim(x0,xs,y0,ys);
269 }
270 
273  unsigned int y0, unsigned int ys) const
274 {
275  unsigned int pix_size = vil_pixel_format_sizeof_components(format_);
276  unsigned int row_len = xs * pix_size;
277 
279  auto* ib = reinterpret_cast<vxl_byte*>(buf->data());
280  auto* ob = reinterpret_cast<vxl_uint_16*>(buf->data());
281  vxl_byte* cbi = ib;
282 
283  // for each channel
284  for (unsigned int channel=0; channel<nplanes_; ++channel)
285  {
286  // for each row; storage is bottom row first!
287  for (unsigned int row = nj_-y0-ys; row < nj_-y0; ++row,cbi+=row_len)
288  {
289  is_->seek(512L + (channel * ni_*nj_ + row * ni_ + x0) * pix_size);
290  is_->read(cbi, row_len);
291  }
292  }
293  if (VXL_LITTLE_ENDIAN && pix_size > 1) // IRIS image data is big-endian
294  for (unsigned int i=0;i<xs*ys*nplanes_;++i)
295  swap(ob+i,pix_size);
296 
297  // Note that jstep is negative! Hence data ref pt is not ib but ib+xs*(ys-1)
299  return new vil_image_view<vxl_byte>(buf,ib+xs*(ys-1),xs,ys,nplanes_,1,-int(xs),xs*ys);
300  else if (format_ == VIL_PIXEL_FORMAT_UINT_16)
301  return new vil_image_view<vxl_uint_16>(buf,ob+xs*(ys-1),xs,ys,nplanes_,1,-int(xs),xs*ys);
302  else
303  return nullptr;
304 }
305 
308  unsigned int y0, unsigned int ys) const
309 {
310  unsigned int pix_size = vil_pixel_format_sizeof_components(format_);
311  unsigned int row_len = xs * pix_size;
312 
314  auto* ib = reinterpret_cast<vxl_byte*>(buf->data());
315  auto* ob = reinterpret_cast<vxl_uint_16*>(buf->data());
316  vxl_byte* cbi = ib;
317  auto* exrow = new unsigned char[ni_];
318 
319  // for each channel
320  for (unsigned int channel=0; channel<nplanes_; ++channel)
321  {
322  // for each row
323  for (unsigned int rowno=nj_-y0-ys; rowno<nj_-y0; ++rowno,cbi+=row_len)
324  {
325  // find length and start position
326  unsigned long rleoffset = starttab_[rowno+channel*nj_];
327  unsigned long rlelength = lengthtab_[rowno+channel*nj_];
328 
329  // read rle row into array
330  auto* rlerow = new unsigned char[rlelength];
331  is_->seek(rleoffset);
332  is_->read((void*)rlerow, rlelength);
333 
334  // decode rle row
335  expandrow(exrow,rlerow,0);
336  delete[] rlerow;
337 
338  // write expanded row in store
339  std::memcpy(cbi,exrow+x0,xs);
340  }
341  }
342  delete[] exrow;
344  return new vil_image_view<vxl_byte>(buf,ib+xs*(ys-1),xs,ys,nplanes_,1,-int(xs),xs*ys);
345  else if (format_ == VIL_PIXEL_FORMAT_UINT_16)
346  return new vil_image_view<vxl_uint_16>(buf,ob+xs*(ys-1),xs,ys,nplanes_,1,-int(xs),xs*ys);
347  else
348  return nullptr;
349 }
350 
352 bool vil_iris_generic_image::put_view( vil_image_view_base const& buf, unsigned int x0, unsigned int y0)
353 {
354  assert(buf.pixel_format() == format_); // pixel formats of image and buffer must match
355  if (!view_fits(buf, x0, y0))
356  {
357  vil_exception_warning(vil_exception_out_of_bounds("vil_iris_generic_image::put_view"));
358  return false;
359  }
360 #ifdef DEBUG
361  std::cerr << "vil_iris_image::put_view() : buf="
362  << buf.ni()<<'x'<<buf.nj()<<'x'<< buf.nplanes()<<'p'
363  << " at ("<<x0<<','<<y0<<")\n";
364 #endif
365  const auto& buff = static_cast<vil_image_view<unsigned char> const&>(buf);
366  const unsigned char* ob = buff.top_left_ptr();
367  unsigned int pix_size = vil_pixel_format_sizeof_components(format_);
368 
369  std::size_t rowsize = pix_size*buf.ni();
370  std::ptrdiff_t rowskip = pix_size*buff.jstep();
371  std::size_t planeskip = pix_size*buff.planestep();
372 
373  if (VXL_LITTLE_ENDIAN && pix_size > 1) // IRIS image data is big-endian
374  {
375  // buffer for swapping bytes
376  auto* tempbuf = new vxl_byte[rowsize];
377  // for each channel
378  for (unsigned int channel = 0; channel<nplanes_; ++channel) {
379  ob += rowskip*buff.nj();
380  // number of rows to write
381  for (unsigned int y = nj_-y0-buf.nj(); y < nj_-y0; ++y) {
382  ob -= rowskip;
383  // skip to start of section
384  is_->seek(512L + (channel * ni_*nj_ + y * ni_ + x0) * pix_size);
385  // swap bytes before writing
386  std::memcpy(tempbuf,ob,rowsize);
387  for (unsigned int i=0;i<buf.ni();++i)
388  swap(tempbuf+i*pix_size,pix_size);
389  // write swapped bytes
390  if ((vil_streampos)rowsize != is_->write(tempbuf, rowsize))
391  std::cerr << "WARNING: " << __FILE__ << ":\n"
392  << " could not write "<<rowsize<<" bytes to stream;\n"
393  << " channel="<<channel<<", y="<<y<<'\n';
394 #ifdef DEBUG
395  else
396  std::cerr << "written "<<rowsize<<" bytes to stream; channel="<<channel<<", y="<<y<<'\n';
397 #endif
398  }
399  ob += planeskip;
400  }
401  delete[] tempbuf;
402  }
403  else // (VXL_BIG_ENDIAN || pix_size == 1)
404  {
405  // for each channel
406  for (unsigned int channel = 0; channel<nplanes_; ++channel) {
407  ob += rowskip*buff.nj();
408  // number of rows to write
409  for (unsigned int y = nj_-y0-buf.nj(); y < nj_-y0; ++y) {
410  ob -= rowskip;
411  // skip to start of section
412  is_->seek(512L + (channel * ni_*nj_ + y * ni_ + x0) * pix_size);
413  if ((vil_streampos)rowsize != is_->write(ob, rowsize))
414  std::cerr << "WARNING: " << __FILE__ << ":\n"
415  << " could not write "<<rowsize<<" bytes to stream;\n"
416  << " channel="<<channel<<", y="<<y<<'\n';
417 #ifdef DEBUG
418  else
419  std::cerr << "written "<<rowsize<<" bytes to stream; channel="<<channel<<", y="<<y<<'\n';
420 #endif
421  }
422  ob += planeskip;
423  }
424  }
425  return true;
426 }
429 {
430  unsigned int tablen = nj_ * nplanes_;
431 
432  starttab_ = new unsigned long[tablen];
433  lengthtab_ = new unsigned long[tablen];
434 
435  for (unsigned int i=0; i<tablen; ++i) {
436  starttab_[i] = get_long(is_,512+(i*4));
437  }
438 
439  unsigned int lengthtab_offset = 512 + tablen*4;
440 
441  for (unsigned int i=0; i<tablen; ++i) {
442  lengthtab_[i] = get_long(is_,lengthtab_offset+(i*4));
443  }
444 
445  return true;
446 }
447 
448 
449 vxl_sint_16 get_short(vil_stream* file, int location)
450 {
451  if (location >= 0) file->seek(location);
452 
453  vxl_byte buff[2];
454  file->read(buff, 2L);
455 
456  // Decode from two's complement to machine format
457  auto bits = static_cast<vxl_uint_16>(( buff[0] << 8 ) + buff[1]);
458 
459  if ( ( bits & 0x8000 ) != 0 )
460  return static_cast<vxl_sint_16>(-( ~bits + 1 ));
461  else
462  return static_cast<vxl_sint_16>( bits );
463 }
464 
465 
466 char get_char(vil_stream* file, int location)
467 {
468  if (location >= 0) file->seek(location);
469 
470  char buff[1];
471  file->read((void*)buff, 1L);
472  return buff[0];
473 }
474 
475 vxl_uint_16 get_ushort(vil_stream* file, int location)
476 {
477  if (location >= 0) file->seek(location);
478 
479  unsigned char buff[2];
480  file->read((void*)buff, 2L);
481  return static_cast<vxl_uint_16>((buff[0]<<8)+(buff[1]<<0));
482 }
483 
484 vxl_sint_32 get_long(vil_stream* file, int location)
485 {
486  if (location >= 0) file->seek(location);
487 
488  vxl_byte buff[4];
489  if (file->read((void*)buff, 4L) != 4L) return 0;
490 
491  // Decode from two's complement to machine format
492  vxl_uint_32 bits = ( vxl_uint_32(buff[0]) << 24 ) |
493  ( vxl_uint_32(buff[1]) << 16 ) |
494  ( vxl_uint_32(buff[2]) << 8 ) |
495  buff[3];
496 
497  if ( ( bits & 0x80000000L ) != 0 )
498  return -vxl_sint_32( ~bits + 1 );
499  else
500  return vxl_sint_32( bits );
501 }
502 
503 
504 void send_char(vil_stream* data, char s)
505 {
506  data->write(&s ,1L);
507 }
508 
509 void send_short(vil_stream* data, vxl_sint_16 s)
510 {
511  vxl_uint_16 bits;
512  if ( s < 0 ) {
513  bits = static_cast<vxl_uint_16>(-s);
514  bits = static_cast<vxl_uint_16>(~bits + 1);
515  }
516  else {
517  bits = static_cast<vxl_uint_16>(s);
518  }
519 
520  vxl_byte buff[2];
521  buff[0] = static_cast<vxl_byte>((bits >> 8) & 0xff);
522  buff[1] = static_cast<vxl_byte>( bits & 0xff);
523  data->write(buff, 2L);
524 }
525 
526 void send_ushort(vil_stream* data, vxl_uint_16 s)
527 {
528  unsigned char buff[2];
529  buff[0] = static_cast<unsigned char>((s >> 8) & 0xff);
530  buff[1] = static_cast<unsigned char>( s & 0xff);
531  data->write(buff, 2L);
532 }
533 
534 void send_long(vil_stream* data, vxl_sint_32 s)
535 {
536  // The write out the value as a two's complement number in MSB order
537 
538  vxl_uint_32 bits;
539  if ( s < 0 ) {
540  bits = -s;
541  bits = ~bits + 1;
542  }
543  else {
544  bits = s;
545  }
546 
547  vxl_byte buff[4];
548  buff[0] = static_cast<unsigned char>( (bits >> 24) & 0xff );
549  buff[1] = static_cast<unsigned char>( (bits >> 16) & 0xff );
550  buff[2] = static_cast<unsigned char>( (bits >> 8) & 0xff );
551  buff[3] = static_cast<unsigned char>( bits & 0xff );
552  data->write(buff, 4L);
553 }
554 
555 void expandrow(unsigned char *optr, unsigned char *iptr, int z)
556 {
557  unsigned char pixel, count;
558 
559  optr += z;
560  while (true)
561  {
562  pixel = *iptr++;
563  if ( !(count = static_cast<unsigned char>(pixel & 0x7f)) )
564  return;
565  if (pixel & 0x80)
566  {
567  while (count--) { *optr = *iptr++; ++optr; }
568  }
569  else
570  {
571  pixel = *iptr++;
572  while (count--) { *optr = pixel; ++optr; }
573  }
574  }
575 }
Stream interface for VIL image loaders.
An abstract base class of smart pointers to actual image data in memory.
vil_pixel_format
Describes the type of the concrete data.
virtual bool view_fits(const vil_image_view_base &im, unsigned i0, unsigned j0)
Check that a view will fit into the data at the given offset.
unsigned int nj_
Definition: vil_iris.h:71
bool get_property(char const *tag, void *prop=nullptr) const override
Extra property information.
Definition: vil_iris.cxx:95
virtual vil_streampos tell() const =0
Return file pointer.
unsigned int nplanes_
Definition: vil_iris.h:72
void swap(double &a, double &b)
virtual vil_streampos write(void const *buf, vil_streampos n)=0
Write n bytes from buf. Returns number of bytes written.
Concrete view of image data of type T held in memory.
Definition: vil_fwd.h:13
virtual void seek(vil_streampos position)=0
Goto file pointer.
virtual vil_streampos read(void *buf, vil_streampos n)=0
Read n bytes into buf. Returns number of bytes read.
Exceptions thrown by vil, and a mechanism for turning them off.
unsigned vil_pixel_format_sizeof_components(enum vil_pixel_format f)
Return the number of bytes used by each component of pixel format f.
vil_image_view_base_sptr get_section_verbatim(unsigned int x0, unsigned int ni, unsigned int y0, unsigned int nj) const
Definition: vil_iris.cxx:271
unsigned ni() const
Width.
Stream interface for VIL image loaders.
Definition: vil_stream.h:21
unsigned nj() const
Height.
~vil_iris_generic_image() override
Definition: vil_iris.cxx:127
Generic image implementation for iris (SGI) RGB files.
Definition: vil_iris.h:35
virtual enum vil_pixel_format pixel_format() const =0
Return a description of the concrete data pixel type.
vil_streampos start_of_data_
Definition: vil_iris.h:81
Indicates that some reference was made to pixels beyond the bounds of an image.
Definition: vil_exception.h:81
bool put_view(vil_image_view_base const &buf, unsigned int x0, unsigned int y0) override
Definition: vil_iris.cxx:351
unsigned long * starttab_
Definition: vil_iris.h:37
enum vil_pixel_format format_
Definition: vil_iris.h:73
vil_image_view_base_sptr get_section_rle(unsigned int x0, unsigned int ni, unsigned int y0, unsigned int nj) const
Definition: vil_iris.cxx:306
char const * file_format() const override
Return a string describing the file format.
Definition: vil_iris.cxx:101
void ref()
up/down the reference count.
Definition: vil_stream.h:45
char const * vil_iris_format_tag
Definition: vil_iris.cxx:39
vil_image_view_base_sptr get_copy_view() const
Create a read/write view of a copy of all the data.
A base class reference-counting view of some image data.
Ref. counted block of data on the heap.
void unref()
Definition: vil_stream.cxx:31
T * top_left_ptr()
Pointer to the first (top left in plane 0) pixel.
vil_image_resource_sptr make_input_image(vil_stream *vs) override
Attempt to make a generic_image which will read from vil_stream vs.
Definition: vil_iris.cxx:41
unsigned nplanes() const
Number of planes.
vil_image_resource_sptr make_output_image(vil_stream *vs, unsigned int ni, unsigned int nj, unsigned int planes, vil_pixel_format format) override
Definition: vil_iris.cxx:73
vxl_int_32 vil_streampos
Definition: vil_stream.h:16
virtual vil_streampos file_size() const =0
Amount of data in the stream.
void vil_exception_warning(T exception)
Throw an exception indicating a potential problem.
Definition: vil_exception.h:37
vil_iris_generic_image(vil_stream *is, char const *imagename="")
Definition: vil_iris.cxx:87
unsigned int ni_
Definition: vil_iris.h:70
vil_stream * is_
Definition: vil_iris.h:66
unsigned long * lengthtab_
Definition: vil_iris.h:38
char const * tag() const override
Return a character string which uniquely identifies this format.
Definition: vil_iris.cxx:80