Changed documentation

v0.27.3
Andreas Huggel 22 years ago
parent 7f3ac68256
commit 9f53c453ee

@ -21,7 +21,7 @@
/*! /*!
@file image.hpp @file image.hpp
@brief Class JpegImage to access JPEG images @brief Class JpegImage to access JPEG images
@version $Name: $ $Revision: 1.1 $ @version $Name: $ $Revision: 1.2 $
@author Andreas Huggel (ahu) @author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a> <a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 09-Jan-04, ahu: created @date 09-Jan-04, ahu: created
@ -49,32 +49,27 @@ namespace Exif {
@brief Helper class to access JPEG images @brief Helper class to access JPEG images
*/ */
class JpegImage { class JpegImage {
// Copying not allowed //! @name Not implemented
//@{
//! Copying not allowed
JpegImage(const JpegImage& rhs); JpegImage(const JpegImage& rhs);
// Assignment not allowed //! Assignment not allowed
JpegImage& operator=(const JpegImage& rhs); JpegImage& operator=(const JpegImage& rhs);
//@}
public: public:
//! @name Creators
//@{
//! Default constructor //! Default constructor
JpegImage(); JpegImage();
//! Default destructor //! Destructor
~JpegImage(); ~JpegImage();
//@}
//! @name Manipulators
//@{
/*! /*!
@brief Checks if the stream is the beginning of a JPEG image @brief Read the %Exif data from the file path into the internal
@param is Input stream to test
@return true if the input stream starts the JPEG SOI marker.
The stream is advanced by two characters in this case.<br>
false if the input stream does not begin with the JPEG SOI
marker. The stream is not advanced in this case.<br>
false if reading the first two bytes from the stream fails.
Consult the stream state for more information. In this case,
the stream may or may not have been advanced by 1 or 2
characters.
*/
static bool isJpeg(std::istream& is);
/*!
@brief Reads the %Exif data from the file path into the internal
data buffer. data buffer.
@param path Path to the file. @param path Path to the file.
@return 0 if successful;<BR> @return 0 if successful;<BR>
@ -84,7 +79,7 @@ namespace Exif {
*/ */
int readExifData(const std::string& path); int readExifData(const std::string& path);
/*! /*!
@brief Reads the %Exif data from the stream into the internal @brief Read the %Exif data from the stream into the internal
data buffer. data buffer.
@param is Input stream to read from. @param is Input stream to read from.
@return 0 if successful;<BR> @return 0 if successful;<BR>
@ -95,6 +90,17 @@ namespace Exif {
beginning of the input stream. beginning of the input stream.
*/ */
int readExifData(std::istream& is); int readExifData(std::istream& is);
/*!
@brief Set the %Exif data. The data is copied into the internal
data buffer.
@param buf Pointer to the data buffer.
@param size Number of characters in the data buffer.
*/
void setExifData(const char* buf, long size);
//@}
//! @name Accessors
//@{
/*! /*!
@brief Write the %Exif data to file path, which must contain a JPEG @brief Write the %Exif data to file path, which must contain a JPEG
image. If an %Exif APP1 section exists in the file, it is image. If an %Exif APP1 section exists in the file, it is
@ -128,22 +134,26 @@ namespace Exif {
state for more information). state for more information).
*/ */
int writeExifData(std::ostream& os, std::istream& is) const; int writeExifData(std::ostream& os, std::istream& is) const;
/*! //! Return the size of the %Exif data buffer
@brief Set the %Exif data. The data is copied into the internal
data buffer.
@param buf Pointer to the data buffer.
@param size Number of characters in the data buffer.
*/
void setExifData(const char* buf, long size);
//! @name Accessors
//@{
//! Returns the size of the %Exif data buffer
long sizeExifData() const { return sizeExifData_; } long sizeExifData() const { return sizeExifData_; }
//! Returns a read-only pointer to the %Exif data buffer //! Return a read-only pointer to the %Exif data buffer
const char* exifData() const { return exifData_; } const char* exifData() const { return exifData_; }
//@} //@}
/*!
@brief Check if the stream is the beginning of a JPEG image.
@param is Input stream to test.
@return true if the input stream starts the JPEG SOI marker.
The stream is advanced by two characters in this case.<br>
false if the input stream does not begin with the JPEG SOI
marker. The stream is not advanced in this case.<br>
false if reading the first two bytes from the stream fails.
Consult the stream state for more information. In this case,
the stream may or may not have been advanced by 1 or 2
characters.
*/
static bool isJpeg(std::istream& is);
private: private:
static const uint16 soi_; // SOI marker static const uint16 soi_; // SOI marker
static const uint16 app0_; // APP0 marker static const uint16 app0_; // APP0 marker
@ -159,13 +169,23 @@ namespace Exif {
//! Helper class modelling the TIFF header structure. //! Helper class modelling the TIFF header structure.
class TiffHeader { class TiffHeader {
public: public:
//! @name Creators
//@{
/*! /*!
@brief Default constructor. Optionally sets the byte order @brief Default constructor. Optionally sets the byte order
(default: little endian). (default: little endian).
*/ */
explicit TiffHeader(ByteOrder byteOrder =littleEndian); explicit TiffHeader(ByteOrder byteOrder =littleEndian);
//@}
//! @name Manipulators
//@{
//! Read the TIFF header from a data buffer. Returns 0 if successful. //! Read the TIFF header from a data buffer. Returns 0 if successful.
int read(const char* buf); int read(const char* buf);
//@}
//! @name Accessors
//@{
/*! /*!
@brief Write a standard TIFF header into buf as a data string, return @brief Write a standard TIFF header into buf as a data string, return
number of bytes copied. number of bytes copied.
@ -181,9 +201,7 @@ namespace Exif {
long copy(char* buf) const; long copy(char* buf) const;
//! Return the size of the TIFF header in bytes. //! Return the size of the TIFF header in bytes.
long size() const { return 8; } long size() const { return 8; }
//! @name Accessors //! Return the byte order (little or big endian).
//@{
//! Return the byte order (little or big endian).
ByteOrder byteOrder() const { return byteOrder_; } ByteOrder byteOrder() const { return byteOrder_; }
//! Return the tag value. //! Return the tag value.
uint16 tag() const { return tag_; } uint16 tag() const { return tag_; }

Loading…
Cancel
Save