Source

libtaginfo / libtaginfo / taginfo_image.h

/*
 * Copyright (C) 2013 Jörn Magens
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This Program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; see the file LICENSE.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth 
 * Floor, Boston, MA  02110-1301  USA
 * https://www.gnu.org/licenses/lgpl-2.1.txt
 *
 * Author:
 * 	Jörn Magens <shuerhaaken@googlemail.com>
 */


#ifndef TAGINFO_IMAGE_H
#define TAGINFO_IMAGE_H

#include "taginfo.h"


/** @file */


namespace TagInfo {
    
    //! \enum ImageFileType The enumeration type for the image encoding
    /*!
    * Binary formats of embedded images (jpeg, png, ...)
    */
    enum ImageFileType {
        //! Unknown image file type
        IMAGE_FILE_TYPE_UNKNOWN,
        //! Jpg file type
        IMAGE_FILE_TYPE_JPEG,
        //! Png file type
        IMAGE_FILE_TYPE_PNG,
        //! Gif file type
        IMAGE_FILE_TYPE_GIF,
        //! Bitmap file type
        IMAGE_FILE_TYPE_BMP
    };
    
    
    //! \enum ImageType The enumeration type for the image content
    /*!
    * Enumerated classification of image content
    */
    enum ImageType {
        //! An image type not listed here
        IMAGE_TYPE_OTHER,
        //! 32x32 PNG image that should be used as the file icon
        IMAGE_TYPE_FILE_ICON,
        //! File icon of a different size or format
        IMAGE_TYPE_OTHER_FILE_ICON,
        //! Front cover image of the album
        IMAGE_TYPE_COVER_FRONT,
        //! Back cover image of the album
        IMAGE_TYPE_COVER_BACK,
        //! Inside leaflet page of the album
        IMAGE_TYPE_LEAFLET_PAGE,
        //! Image from the album itself
        IMAGE_TYPE_MEDIA,
        //! Picture of the lead artist or soloist
        IMAGE_TYPE_LEAD_ARTIST,
        //! Picture of the artist or performer
        IMAGE_TYPE_ARTIST,
        //! Picture of the conductor
        IMAGE_TYPE_CONDUCTOR,
        //! Picture of the band or orchestra
        IMAGE_TYPE_BAND,
        //! Picture of the composer
        IMAGE_TYPE_COMPOSER,
        //! Picture of the lyricist or text writer
        IMAGE_TYPE_LYRICIST,
        //! Picture of the recording location or studio
        IMAGE_TYPE_RECORDING_LOCATION,
        //! Picture of the artists during recording
        IMAGE_TYPE_DURING_RECORDING,
        //! Picture of the artists during performance
        IMAGE_TYPE_DURING_PERFORMANCE,
        //! Picture from a movie or video related to the track
        IMAGE_TYPE_MOVIESCREENCAPTURE,
        //! Picture of a large, coloured fish.
        IMAGE_TYPE_COLOURED_FISH,
        //! Illustration related to the track
        IMAGE_TYPE_ILLUSTRATION,
        //! Logo of the band or performer
        IMAGE_TYPE_ARTIST_LOGO,
        //! Logo of the publisher (record company)
        IMAGE_TYPE_PUBLISHER_LOGO
    };
    
    
    //! Image is an wrapper for image data
    /*!
    * This class holds image data and information on loads and writes
    * Internal memory is freed automatically.
    */
    class Image {
        public:
            
            //! Image constructor.
            /*!
              Sets up an Image object
            */
            Image();
            
            //! Image destructor.
            /*!
              Removes Image object and frees all internal data
            */
            ~Image();
            
            //! \a data is a pointer to the image data. NULL if not set
            char *        data;
            
            //! \a data_length is the length of the image data
            long         data_length;
            
            //! \a image_type is the ImageType enum, giving information 
            //! on the content of the picture 
            ImageType     image_type;
            
            //! \a image_file_type is the ImageFileType enum, giving 
            //! information on the file type of the embedded picture
            ImageFileType image_file_type;
            
            //! The \a description gives extra information on the image
            //! (Not supported by all media tags). NULL if not set
            char *        description;
    };
}

#endif
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.