//! file="amma/Image/ImageIO/ImgPNMi.hh" //! lib=Mimage //! userlevel=Obsolete //! author="Radek Marik" //! docentry="Obsolete" //! rcsid="$Id: ImgPNMi.hh,v 1.7 1999/11/04 13:51:43 ees1cg Exp $" //! date="06/08/95" // IAPS - Image analysis program system - include file // // File name : ImgPNMi.hh // Description: basic general information about image without a file // Last change: 26.4.1994 // Author : Radek Marik // Libraries : iaps // ------------------------------------------------------------------ // // Modifications: // // // #ifndef ImgPNMi_HH #define ImgPNMi_HH #include "amma/StdType.hh" #include "amma/Pixel.hh" #include "amma/GreyVal.hh" #include "amma/ImFormat.hh" #include "amma/ImgFileI.hh" class ImageIStreamC; // ------------------------------------------------------------------------ // *** ImagePNMFileInfoC ********************************************** // ------------------------------------------------------------------------ static const IntT MAX_COMMENT_NUMBER = 20; class ImagePNMFileInfoC : public ImageFileInfoC { public: ImagePNMFileInfoC(ImageIStreamC & s); // The image is created from the input image stream 's'. ImagePNMFileInfoC(const ImagePNMFileInfoC & info); // Copy constructor. inline ImageFileInfoC * ACopy() const; // Create an abstract copy of this object. inline GreyLevelsT Levels() const; // get number of grey levels in the image inline PixelIndexT Rnum() const; // get number of rows inline PixelIndexT Cnum() const; // get number of columns inline PixelC LUCorner() const; // left upper corner of the image inline PixelC RDCorner() const; // right down corner of the image inline ImageRectangleC Rectangle() const; // Return the image rectangle ImageFileFormatT Format() const; // get image file format ImageFileDataFormatT DataFormat() const; // get format of data stored in the image file inline void SetSize(const ImageRectangleC & rect); // Set the new size of the image. void WriteHead(ImageOStreamC & outS) const; // Write the header of file according the information stored // in this object. void PrintInfo(ostream & os) const; // print the header information into the stream 'os' private: PixelC luPxl; // left upper corner of the image PixelC rdPxl; // right down corner of the image ImageFileFormatT fFormat; // the image file format IntT maxLevel; // the maximum level in the image char * comment[MAX_COMMENT_NUMBER]; // rows of comment lines // the last comment is NULL }; extern BooleanT P6asYUV; #include "amma/ImageRec.hh" // --------------------------------------------------------------------- // **************** ImagePNMFileInfoC ********************************** // --------------------------------------------------------------------- inline ImageFileInfoC * ImagePNMFileInfoC::ACopy() const { return(new ImagePNMFileInfoC(*this)); } inline GreyLevelsT ImagePNMFileInfoC::Levels() const { return(maxLevel+1); } inline PixelIndexT ImagePNMFileInfoC::Rnum() const { return(rdPxl.Row()-luPxl.Row()+1); } inline PixelIndexT ImagePNMFileInfoC::Cnum() const { return(rdPxl.Col()-luPxl.Col()+1); } inline PixelC ImagePNMFileInfoC::LUCorner() const { return(luPxl); } inline PixelC ImagePNMFileInfoC::RDCorner() const { return(rdPxl); } inline ImageRectangleC ImagePNMFileInfoC::Rectangle() const { return(ImageRectangleC(luPxl, rdPxl)); } inline void ImagePNMFileInfoC::SetSize(const ImageRectangleC & rect) { luPxl = rect.Origin(); rdPxl = rect.End(); } #endif // IAPS - Image analysis program system. // End of include file ImgPNMi.hh