Blame include/exiv2/mrwimage.hpp

Packit Service 21b5d1
// ***************************************************************** -*- C++ -*-
Packit Service 21b5d1
/*
Packit Service 21b5d1
 * Copyright (C) 2004-2018 Exiv2 authors
Packit Service 21b5d1
 * This program is part of the Exiv2 distribution.
Packit Service 21b5d1
 *
Packit Service 21b5d1
 * This program is free software; you can redistribute it and/or
Packit Service 21b5d1
 * modify it under the terms of the GNU General Public License
Packit Service 21b5d1
 * as published by the Free Software Foundation; either version 2
Packit Service 21b5d1
 * of the License, or (at your option) any later version.
Packit Service 21b5d1
 *
Packit Service 21b5d1
 * This program is distributed in the hope that it will be useful,
Packit Service 21b5d1
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 21b5d1
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 21b5d1
 * GNU General Public License for more details.
Packit Service 21b5d1
 *
Packit Service 21b5d1
 * You should have received a copy of the GNU General Public License
Packit Service 21b5d1
 * along with this program; if not, write to the Free Software
Packit Service 21b5d1
 * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
Packit Service 21b5d1
 */
Packit Service 21b5d1
/*!
Packit Service 21b5d1
  @file    mrwimage.hpp
Packit Service 21b5d1
  @brief   Minolta RAW image, implemented using the following references:
Packit Service 21b5d1
           Minolta Raw file format by Dalibor Jelinek
Packit Service 21b5d1
  @author  Andreas Huggel (ahu)
Packit Service 21b5d1
           ahuggel@gmx.net
Packit Service 21b5d1
  @date    13-May-06, ahu: created
Packit Service 21b5d1
 */
Packit Service 21b5d1
#ifndef MRWIMAGE_HPP_
Packit Service 21b5d1
#define MRWIMAGE_HPP_
Packit Service 21b5d1
Packit Service 21b5d1
// *****************************************************************************
Packit Service 21b5d1
#include "exiv2lib_export.h"
Packit Service 21b5d1
Packit Service 21b5d1
// included header files
Packit Service 21b5d1
#include "image.hpp"
Packit Service 21b5d1
Packit Service 21b5d1
// *****************************************************************************
Packit Service 21b5d1
// namespace extensions
Packit Service 21b5d1
namespace Exiv2 {
Packit Service 21b5d1
Packit Service 21b5d1
// *****************************************************************************
Packit Service 21b5d1
// class definitions
Packit Service 21b5d1
Packit Service 21b5d1
    // Add MRW to the supported image formats
Packit Service 21b5d1
    namespace ImageType {
Packit Service 21b5d1
        const int mrw = 5;          //!< MRW image type (see class MrwImage)
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    /*!
Packit Service 21b5d1
      @brief Class to access raw Minolta MRW images. Exif metadata is supported
Packit Service 21b5d1
             directly, IPTC is read from the Exif data, if present.
Packit Service 21b5d1
     */
Packit Service 21b5d1
    class EXIV2API MrwImage : public Image {
Packit Service 21b5d1
    public:
Packit Service 21b5d1
        //! @name Creators
Packit Service 21b5d1
        //@{
Packit Service 21b5d1
        /*!
Packit Service 21b5d1
          @brief Constructor that can either open an existing MRW image or create
Packit Service 21b5d1
              a new image from scratch. If a new image is to be created, any
Packit Service 21b5d1
              existing data is overwritten. Since the constructor can not return
Packit Service 21b5d1
              a result, callers should check the good() method after object
Packit Service 21b5d1
              construction to determine success or failure.
Packit Service 21b5d1
          @param io An auto-pointer that owns a BasicIo instance used for
Packit Service 21b5d1
              reading and writing image metadata. \b Important: The constructor
Packit Service 21b5d1
              takes ownership of the passed in BasicIo instance through the
Packit Service 21b5d1
              auto-pointer. Callers should not continue to use the BasicIo
Packit Service 21b5d1
              instance after it is passed to this method.  Use the Image::io()
Packit Service 21b5d1
              method to get a temporary reference.
Packit Service 21b5d1
          @param create Specifies if an existing image should be read (false)
Packit Service 21b5d1
              or if a new file should be created (true).
Packit Service 21b5d1
         */
Packit Service 21b5d1
        MrwImage(BasicIo::AutoPtr io, bool create);
Packit Service 21b5d1
        //@}
Packit Service 21b5d1
Packit Service 21b5d1
        //! @name Manipulators
Packit Service 21b5d1
        //@{
Packit Service 21b5d1
        void readMetadata();
Packit Service 21b5d1
        /*!
Packit Service 21b5d1
          @brief Todo: Write metadata back to the image. This method is not
Packit Service 21b5d1
              yet implemented. Calling it will throw an Error(kerWritingImageFormatUnsupported).
Packit Service 21b5d1
         */
Packit Service 21b5d1
        void writeMetadata();
Packit Service 21b5d1
        /*!
Packit Service 21b5d1
          @brief Todo: Not supported yet, requires writeMetadata(). Calling
Packit Service 21b5d1
              this function will throw an Error(kerInvalidSettingForImage).
Packit Service 21b5d1
         */
Packit Service 21b5d1
        void setExifData(const ExifData& exifData);
Packit Service 21b5d1
        /*!
Packit Service 21b5d1
          @brief Todo: Not supported yet, requires writeMetadata(). Calling
Packit Service 21b5d1
              this function will throw an Error(kerInvalidSettingForImage).
Packit Service 21b5d1
         */
Packit Service 21b5d1
        void setIptcData(const IptcData& iptcData);
Packit Service 21b5d1
        /*!
Packit Service 21b5d1
          @brief Not supported. MRW format does not contain a comment.
Packit Service 21b5d1
              Calling this function will throw an Error(kerInvalidSettingForImage).
Packit Service 21b5d1
         */
Packit Service 21b5d1
        void setComment(const std::string& comment);
Packit Service 21b5d1
        //@}
Packit Service 21b5d1
Packit Service 21b5d1
        //! @name Accessors
Packit Service 21b5d1
        //@{
Packit Service 21b5d1
        std::string mimeType() const;
Packit Service 21b5d1
        int pixelWidth() const;
Packit Service 21b5d1
        int pixelHeight() const;
Packit Service 21b5d1
        //@}
Packit Service 21b5d1
Packit Service 21b5d1
    private:
Packit Service 21b5d1
        //! @name NOT Implemented
Packit Service 21b5d1
        //@{
Packit Service 21b5d1
        //! Copy constructor
Packit Service 21b5d1
        MrwImage(const MrwImage& rhs);
Packit Service 21b5d1
        //! Assignment operator
Packit Service 21b5d1
        MrwImage& operator=(const MrwImage& rhs);
Packit Service 21b5d1
        //@}
Packit Service 21b5d1
Packit Service 21b5d1
    }; // class MrwImage
Packit Service 21b5d1
Packit Service 21b5d1
// *****************************************************************************
Packit Service 21b5d1
// template, inline and free functions
Packit Service 21b5d1
Packit Service 21b5d1
    // These could be static private functions on Image subclasses but then
Packit Service 21b5d1
    // ImageFactory needs to be made a friend.
Packit Service 21b5d1
    /*!
Packit Service 21b5d1
      @brief Create a new MrwImage instance and return an auto-pointer to it.
Packit Service 21b5d1
             Caller owns the returned object and the auto-pointer ensures that
Packit Service 21b5d1
             it will be deleted.
Packit Service 21b5d1
     */
Packit Service 21b5d1
    EXIV2API Image::AutoPtr newMrwInstance(BasicIo::AutoPtr io, bool create);
Packit Service 21b5d1
Packit Service 21b5d1
    //! Check if the file iIo is a MRW image.
Packit Service 21b5d1
    EXIV2API bool isMrwType(BasicIo& iIo, bool advance);
Packit Service 21b5d1
Packit Service 21b5d1
}                                       // namespace Exiv2
Packit Service 21b5d1
Packit Service 21b5d1
#endif                                  // #ifndef MRWIMAGE_HPP_