core/vil1/file_formats/vil1_bmp_info_header.cxx

Go to the documentation of this file.
00001 // This is core/vil1/file_formats/vil1_bmp_info_header.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 //:
00006 // \file
00007 // \author fsm
00008 
00009 #include "vil1_bmp_info_header.h"
00010 
00011 #include <vcl_iostream.h>
00012 
00013 #include <vil1/vil1_stream.h>
00014 #include <vil1/vil1_32bit.h>
00015 
00016 vil1_bmp_info_header::vil1_bmp_info_header()
00017 {
00018   compression = 0;
00019   bitmap_size = 0;
00020   horiz_res = 0;
00021   verti_res = 0;
00022   colormapsize = 0;
00023   colorcount = 0;
00024 }
00025 
00026 void vil1_bmp_info_header::read(vil1_stream *s)
00027 {
00028   compression = vil1_32bit_read_little_endian(s);
00029   bitmap_size = vil1_32bit_read_little_endian(s);
00030   horiz_res   = vil1_32bit_read_little_endian(s);
00031   verti_res   = vil1_32bit_read_little_endian(s);
00032   colormapsize= vil1_32bit_read_little_endian(s);
00033   colorcount  = vil1_32bit_read_little_endian(s);
00034 }
00035 
00036 void vil1_bmp_info_header::write(vil1_stream *s) const
00037 {
00038   vil1_32bit_write_little_endian(s, compression);
00039   vil1_32bit_write_little_endian(s, bitmap_size);
00040   vil1_32bit_write_little_endian(s, horiz_res);
00041   vil1_32bit_write_little_endian(s, verti_res);
00042   vil1_32bit_write_little_endian(s, colormapsize);
00043   vil1_32bit_write_little_endian(s, colorcount);
00044 }
00045 
00046 void vil1_bmp_info_header::print(vcl_ostream &s) const
00047 {
00048   s << "vil1_bmp_info_header:\n"
00049     << "  compression  : " << compression << vcl_endl
00050     << "  bitmap_size  : " << bitmap_size << vcl_endl
00051     << "  horiz_res    : " << horiz_res << vcl_endl
00052     << "  verti_res    : " << verti_res << vcl_endl
00053     << "  colormapsize : " << colormapsize << vcl_endl
00054     << "  colorcount   : " << colorcount << vcl_endl << vcl_endl;
00055 }

Generated on Sat Nov 22 05:08:28 2008 for core/vil1 by  doxygen 1.5.1