libtaginfo  0.2.1
Public Types | Public Member Functions | List of all members
TagInfo::Image Class Reference

Wrapper for image data and related information. More...

#include <taginfo_image.h>

Public Types

enum  FileType {
  TYPE_UNKNOWN, TYPE_JPEG, TYPE_PNG, TYPE_GIF,
  TYPE_BMP
}
 
enum  ContentType {
  CONTENT_OTHER, CONTENT_FILE_ICON, CONTENT_OTHER_FILE_ICON, CONTENT_COVER_FRONT,
  CONTENT_COVER_BACK, CONTENT_LEAFLET_PAGE, CONTENT_MEDIA, CONTENT_LEAD_ARTIST,
  CONTENT_ARTIST, CONTENT_CONDUCTOR, CONTENT_BAND, CONTENT_COMPOSER,
  CONTENT_LYRICIST, CONTENT_RECORDING_LOCATION, CONTENT_DURING_RECORDING, CONTENT_DURING_PERFORMANCE,
  CONTENT_MOVIESCREENCAPTURE, CONTENT_COLOURED_FISH, CONTENT_ILLUSTRATION, CONTENT_ARTIST_LOGO,
  CONTENT_PUBLISHER_LOGO
}
 The enumeration type for the image content. More...
 

Public Member Functions

 Image ()
 Image constructor. More...
 
 ~Image ()
 Image destructor. More...
 
const ByteVector get_data () const
 
char * get_data (uint &image_data_length) const
 
void set_data (const char *image_data, const uint image_data_length)
 
void set_data (const ByteVector &image_data)
 
Image::ContentType get_content_type (void) const
 
void set_content_type (const Image::ContentType it)
 
Image::FileType get_file_type (void) const
 
void set_file_type (const Image::FileType ft)
 
const String get_description (void) const
 
void set_description (const String &description)
 

Detailed Description

Wrapper for image data and related information.

This class holds image data and information on loads and writes Internal memory is freed automatically.

Member Enumeration Documentation

◆ ContentType

The enumeration type for the image content.

Enumerated classification of image content

Enumerator
CONTENT_OTHER 

An image type not listed here.

CONTENT_FILE_ICON 

32x32 PNG image that should be used as the file icon

CONTENT_OTHER_FILE_ICON 

File icon of a different size or format.

CONTENT_COVER_FRONT 

Front cover image of the album.

CONTENT_COVER_BACK 

Back cover image of the album.

CONTENT_LEAFLET_PAGE 

Inside leaflet page of the album.

CONTENT_MEDIA 

Image from the album itself.

CONTENT_LEAD_ARTIST 

Picture of the lead artist or soloist.

CONTENT_ARTIST 

Picture of the artist or performer.

CONTENT_CONDUCTOR 

Picture of the conductor.

CONTENT_BAND 

Picture of the band or orchestra.

CONTENT_COMPOSER 

Picture of the composer.

CONTENT_LYRICIST 

Picture of the lyricist or text writer.

CONTENT_RECORDING_LOCATION 

Picture of the recording location or studio.

CONTENT_DURING_RECORDING 

Picture of the artists during recording.

CONTENT_DURING_PERFORMANCE 

Picture of the artists during performance.

CONTENT_MOVIESCREENCAPTURE 

Picture from a movie or video related to the track.

CONTENT_COLOURED_FISH 

Picture of a large, coloured fish.

CONTENT_ILLUSTRATION 

Illustration related to the track.

CONTENT_ARTIST_LOGO 

Logo of the band or performer.

CONTENT_PUBLISHER_LOGO 

Logo of the publisher (record company)

◆ FileType

Binary formats of embedded images (jpeg, png, ...)

Enumerator
TYPE_UNKNOWN 

Unknown image file type.

TYPE_JPEG 

Jpg file type.

TYPE_PNG 

Png file type.

TYPE_GIF 

Gif file type.

TYPE_BMP 

Bitmap file type.

Constructor & Destructor Documentation

◆ Image()

Image::Image ( )

Image constructor.

Constructor.

Sets up an Image object

◆ ~Image()

Image::~Image ( )

Image destructor.

Destructor.

Removes Image object and frees all internal data

Member Function Documentation

◆ get_content_type()

Image::ContentType Image::get_content_type ( void  ) const

Get the image content's type from the Image object.

Returns
type as ImageType

◆ get_data() [1/2]

const ByteVector Image::get_data ( ) const

Get image binary data

Returns
ByteVector with binary data

Get the image binary data from the Image object.

Returns
ByteVector with image data

◆ get_data() [2/2]

char * Image::get_data ( uint &  image_data_length) const

Get image binary data

Parameters
image_data_lengthis the return location for the length of the binary data array
Returns
Byte array with binary data

Get the image binary data from the Image object.

Parameters
image_data_lengthReturn locatio for the length of the returned data array
Returns
char * with image data

◆ get_description()

const String Image::get_description ( void  ) const

Get the image file's description from the Image object.

Returns
Description as String

◆ get_file_type()

Image::FileType Image::get_file_type ( void  ) const

Get the image file's type from the Image object.

Returns
type as ImageFileType

◆ set_content_type()

void Image::set_content_type ( const Image::ContentType  it)

Set the image content's type in the Image object.

Parameters
itas ImageType

◆ set_data() [1/2]

void Image::set_data ( const char *  image_data,
const uint  image_data_length 
)

Set image binary data

Parameters
image_dataThe Byte array with binary image data
image_data_lengthis the length of the binary image data array

Set the image binary data in the Image object.

Parameters
image_data_lengthlength of the data array
image_dataImage binary data

◆ set_data() [2/2]

void Image::set_data ( const ByteVector &  image_data)

Set image binary data

Parameters
image_dataByteVector with binary image data

Set the image binary data in the Image object.

Parameters
image_dataByteVector with image data

◆ set_description()

void Image::set_description ( const String &  new_description)

Set the image file's description in the Image object.

Parameters
new_descriptionas String

◆ set_file_type()

void Image::set_file_type ( const Image::FileType  ft)

Set the image file's type in the Image object.

Parameters
ftas ImageFileType

The documentation for this class was generated from the following files: