Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::MM::ExifData Class Reference

Class for reading exif data from images. More...

#include </home/clem/local/src/opie/libopie2/opiemm/opieexif.h>

Collaboration diagram for Opie::MM::ExifData:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ReadMode_t { READ_EXIF = 1, READ_IMAGE = 2, READ_ALL = 3 }

Public Member Functions

 ExifData ()
 Contructor for initialising.
virtual ~ExifData ()
 destructor
bool scan (const QString &aFile)
 scan a given file
QString getCameraMake ()
QString getCameraModel ()
QString getDateTime ()
int getOrientation ()
int getHeight ()
int getWidth ()
int getIsColor ()
int getProcess ()
int getFlashUsed ()
float getFocalLength ()
float getExposureTime ()
float getApertureFNumber ()
float getDistance ()
int getWhitebalance ()
int getMeteringMode ()
float getCCDWidth ()
float getExposureBias ()
int getExposureProgram ()
int getISOequivalent ()
int getCompressionLevel ()
QString getUserComment ()
QString getComment ()
QImage getThumbnail ()
bool isThumbnailSane ()
bool isNullThumbnail ()

Static Public Member Functions

static QString color_mode_to_string (bool b)
static QString compression_to_string (int level)
static QString white_balance_string (int i)
static QString metering_mode (int i)
static QString exposure_program (int i)

Private Member Functions

int ReadJpegSections (QFile &infile, ReadMode_t ReadMode)
void DiscardData (void)
int Get16u (void *Short)
int Get32s (void *Long)
unsigned Get32u (void *Long)
double ConvertAnyFormat (void *ValuePtr, int Format)
void ProcessExifDir (unsigned char *DirStart, unsigned char *OffsetBase, unsigned ExifLength)
void process_COM (const uchar *Data, int length)
void process_SOFn (const uchar *Data, int marker)
int Get16m (const void *Short)
void process_EXIF (unsigned char *CharBuf, unsigned int length)
int Exif2tm (struct::tm *timeptr, char *ExifTime)

Private Attributes

Section_t Sections [MAX_SECTIONS]
QString CameraMake
QString CameraModel
QString DateTime
int Orientation
int Height
int Width
int ExifImageLength
int ExifImageWidth
int IsColor
int Process
int FlashUsed
float FocalLength
float ExposureTime
float ApertureFNumber
float Distance
int Whitebalance
int MeteringMode
float CCDWidth
float ExposureBias
int ExposureProgram
int ISOequivalent
int CompressionLevel
QString UserComment
QString Comment
QImage Thumbnail
unsigned char * LastExifRefd
int ExifSettingsLength
double FocalplaneXRes
double FocalplaneUnits
int MotorolaOrder
int SectionsRead

Static Private Attributes

static const int MAX_SECTIONS = 20
static const unsigned int PSEUDO_IMAGE_MARKER = 0x123

Classes

struct  Section_t
struct  TagTable_t

Detailed Description

Class for reading exif data from images.

This class is mostly used inside OImageScrollView for testing jpegs headers for a faster loading and scaling. It is taken from libexif and converted into an C++ structure.

See also:
OImageScrollView
Since:
1.2

Definition at line 28 of file opieexif.h.


Member Enumeration Documentation

enum Opie::MM::ExifData::ReadMode_t
 

Enumeration values:
READ_EXIF 
READ_IMAGE 
READ_ALL 

Definition at line 30 of file opieexif.h.


Constructor & Destructor Documentation

Opie::MM::ExifData::ExifData  ) 
 

Contructor for initialising.

Definition at line 778 of file opieexif.cpp.

References ApertureFNumber, CCDWidth, CompressionLevel, Distance, ExposureBias, ExposureProgram, ExposureTime, FlashUsed, FocalLength, Height, IsColor, ISOequivalent, MeteringMode, MotorolaOrder, Orientation, Whitebalance, and Width.

Opie::MM::ExifData::~ExifData  )  [virtual]
 

destructor

Definition at line 800 of file opieexif.cpp.


Member Function Documentation

QString Opie::MM::ExifData::color_mode_to_string bool  b  )  [static]
 

Definition at line 1011 of file opieexif.cpp.

References tr.

Referenced by JpegSlave::fullImageInfo(), and JpegSlave::iconViewName().

QString Opie::MM::ExifData::compression_to_string int  level  )  [static]
 

Definition at line 1015 of file opieexif.cpp.

References str, and tr.

Referenced by JpegSlave::fullImageInfo(), and JpegSlave::iconViewName().

double Opie::MM::ExifData::ConvertAnyFormat void *  ValuePtr,
int  Format
[private]
 

Definition at line 327 of file opieexif.cpp.

References FMT_BYTE, FMT_DOUBLE, FMT_SBYTE, FMT_SINGLE, FMT_SLONG, FMT_SRATIONAL, FMT_SSHORT, FMT_ULONG, FMT_URATIONAL, FMT_USHORT, Get16u(), Get32s(), and Get32u().

Referenced by ProcessExifDir().

void Opie::MM::ExifData::DiscardData void   )  [private]
 

Definition at line 283 of file opieexif.cpp.

References Sections, and SectionsRead.

Referenced by scan().

int Opie::MM::ExifData::Exif2tm struct::tm *  timeptr,
char *  ExifTime
[private]
 

Definition at line 754 of file opieexif.cpp.

QString Opie::MM::ExifData::exposure_program int  i  )  [static]
 

Definition at line 1113 of file opieexif.cpp.

References tr.

Referenced by JpegSlave::fullImageInfo().

int Opie::MM::ExifData::Get16m const void *  Short  )  [private]
 

Definition at line 693 of file opieexif.cpp.

Referenced by process_SOFn().

int Opie::MM::ExifData::Get16u void *  Short  )  [private]
 

Definition at line 293 of file opieexif.cpp.

References MotorolaOrder.

Referenced by ConvertAnyFormat(), process_EXIF(), and ProcessExifDir().

int Opie::MM::ExifData::Get32s void *  Long  )  [private]
 

Definition at line 305 of file opieexif.cpp.

References MotorolaOrder.

Referenced by ConvertAnyFormat(), and Get32u().

unsigned Opie::MM::ExifData::Get32u void *  Long  )  [private]
 

Definition at line 319 of file opieexif.cpp.

References Get32s().

Referenced by ConvertAnyFormat(), process_EXIF(), and ProcessExifDir().

float Opie::MM::ExifData::getApertureFNumber  )  [inline]
 

Definition at line 121 of file opieexif.h.

References ApertureFNumber.

Referenced by JpegSlave::fullImageInfo().

QString Opie::MM::ExifData::getCameraMake  )  [inline]
 

Definition at line 110 of file opieexif.h.

References CameraMake.

Referenced by JpegSlave::fullImageInfo().

QString Opie::MM::ExifData::getCameraModel  )  [inline]
 

Definition at line 111 of file opieexif.h.

References CameraModel.

Referenced by JpegSlave::fullImageInfo().

float Opie::MM::ExifData::getCCDWidth  )  [inline]
 

Definition at line 125 of file opieexif.h.

References CCDWidth.

Referenced by JpegSlave::fullImageInfo().

QString Opie::MM::ExifData::getComment  )  [inline]
 

Definition at line 131 of file opieexif.h.

References Comment.

Referenced by JpegSlave::fullImageInfo(), and JpegSlave::iconViewName().

int Opie::MM::ExifData::getCompressionLevel  )  [inline]
 

Definition at line 129 of file opieexif.h.

References CompressionLevel.

Referenced by JpegSlave::fullImageInfo(), and JpegSlave::iconViewName().

QString Opie::MM::ExifData::getDateTime  )  [inline]
 

Definition at line 112 of file opieexif.h.

References DateTime.

Referenced by JpegSlave::fullImageInfo(), and JpegSlave::iconViewName().

float Opie::MM::ExifData::getDistance  )  [inline]
 

Definition at line 122 of file opieexif.h.

References Distance.

Referenced by JpegSlave::fullImageInfo().

float Opie::MM::ExifData::getExposureBias  )  [inline]
 

Definition at line 126 of file opieexif.h.

References ExposureBias.

Referenced by JpegSlave::fullImageInfo().

int Opie::MM::ExifData::getExposureProgram  )  [inline]
 

Definition at line 127 of file opieexif.h.

References ExposureProgram.

Referenced by JpegSlave::fullImageInfo().

float Opie::MM::ExifData::getExposureTime  )  [inline]
 

Definition at line 120 of file opieexif.h.

References ExposureTime.

Referenced by JpegSlave::fullImageInfo().

int Opie::MM::ExifData::getFlashUsed  )  [inline]
 

Definition at line 118 of file opieexif.h.

References FlashUsed.

Referenced by JpegSlave::fullImageInfo().

float Opie::MM::ExifData::getFocalLength  )  [inline]
 

Definition at line 119 of file opieexif.h.

References FocalLength.

Referenced by JpegSlave::fullImageInfo().

int Opie::MM::ExifData::getHeight  )  [inline]
 

Definition at line 114 of file opieexif.h.

References Height.

Referenced by JpegSlave::fullImageInfo(), JpegSlave::iconViewName(), Opie::MM::OImageScrollView::loadJpeg(), and JpegSlave::pixmap().

int Opie::MM::ExifData::getIsColor  )  [inline]
 

Definition at line 116 of file opieexif.h.

References IsColor.

Referenced by JpegSlave::fullImageInfo(), and JpegSlave::iconViewName().

int Opie::MM::ExifData::getISOequivalent  )  [inline]
 

Definition at line 128 of file opieexif.h.

References ISOequivalent.

Referenced by JpegSlave::fullImageInfo().

int Opie::MM::ExifData::getMeteringMode  )  [inline]
 

Definition at line 124 of file opieexif.h.

References MeteringMode.

Referenced by JpegSlave::fullImageInfo().

int Opie::MM::ExifData::getOrientation  )  [inline]
 

Definition at line 113 of file opieexif.h.

References Orientation.

Referenced by JpegSlave::fullImageInfo().

int Opie::MM::ExifData::getProcess  )  [inline]
 

Definition at line 117 of file opieexif.h.

QImage Opie::MM::ExifData::getThumbnail  ) 
 

Definition at line 865 of file opieexif.cpp.

References Opie::MM::dest, Opie::MM::flip_image(), isThumbnailSane(), NULL, Orientation, Opie::MM::rotate_180(), Opie::MM::rotate_270(), Opie::MM::rotate_90(), and Thumbnail.

Referenced by JpegSlave::pixmap().

QString Opie::MM::ExifData::getUserComment  )  [inline]
 

Definition at line 130 of file opieexif.h.

References UserComment.

Referenced by JpegSlave::fullImageInfo().

int Opie::MM::ExifData::getWhitebalance  )  [inline]
 

Definition at line 123 of file opieexif.h.

References Whitebalance.

Referenced by JpegSlave::fullImageInfo().

int Opie::MM::ExifData::getWidth  )  [inline]
 

Definition at line 115 of file opieexif.h.

References Width.

Referenced by JpegSlave::fullImageInfo(), JpegSlave::iconViewName(), Opie::MM::OImageScrollView::loadJpeg(), and JpegSlave::pixmap().

bool Opie::MM::ExifData::isNullThumbnail  )  [inline]
 

Definition at line 134 of file opieexif.h.

References isThumbnailSane().

Referenced by JpegSlave::pixmap().

bool Opie::MM::ExifData::isThumbnailSane  ) 
 

Definition at line 841 of file opieexif.cpp.

References d, ExifImageLength, ExifImageWidth, Height, JPEG_TOL, Thumbnail, and Width.

Referenced by getThumbnail(), and isNullThumbnail().

QString Opie::MM::ExifData::metering_mode int  i  )  [static]
 

Definition at line 1078 of file opieexif.cpp.

References tr.

Referenced by JpegSlave::fullImageInfo().

void Opie::MM::ExifData::process_COM const uchar Data,
int  length
[private]
 

Definition at line 655 of file opieexif.cpp.

References QString::append(), and Comment.

Referenced by ReadJpegSections().

void Opie::MM::ExifData::process_EXIF unsigned char *  CharBuf,
unsigned int  length
[private]
 

Definition at line 703 of file opieexif.cpp.

References CCDWidth, ExifImageLength, ExifImageWidth, ExifSettingsLength, FlashUsed, FocalplaneUnits, FocalplaneXRes, Get16u(), Get32u(), LastExifRefd, MotorolaOrder, and ProcessExifDir().

Referenced by ReadJpegSections().

void Opie::MM::ExifData::process_SOFn const uchar Data,
int  marker
[private]
 

Definition at line 671 of file opieexif.cpp.

References Get16m(), Height, IsColor, Process, and Width.

Referenced by ReadJpegSections().

void Opie::MM::ExifData::ProcessExifDir unsigned char *  DirStart,
unsigned char *  OffsetBase,
unsigned  ExifLength
[private]
 

Definition at line 367 of file opieexif.cpp.

References ApertureFNumber, BytesPerFormat, CameraMake, CameraModel, CompressionLevel, ConvertAnyFormat(), DateTime, DIR_ENTRY_ADDR, Distance, ExifImageLength, ExifImageWidth, ExposureBias, ExposureProgram, ExposureTime, FlashUsed, FocalLength, FocalplaneUnits, FocalplaneXRes, Get16u(), Get32u(), ISOequivalent, LastExifRefd, MeteringMode, NUM_FORMATS, oendl, Orientation, owarn, QString::sprintf(), TAG_APERTURE, TAG_COMPRESSION_LEVEL, TAG_DATETIME_ORIGINAL, TAG_EXIF_IMAGELENGTH, TAG_EXIF_IMAGEWIDTH, TAG_EXIF_OFFSET, TAG_EXPOSURE_BIAS, TAG_EXPOSURE_PROGRAM, TAG_EXPOSURETIME, TAG_FLASH, TAG_FNUMBER, TAG_FOCALLENGTH, TAG_FOCALPLANEUNITS, TAG_FOCALPLANEXRES, TAG_INTEROP_OFFSET, TAG_ISO_EQUIVALENT, TAG_MAKE, TAG_MAXAPERTURE, TAG_METERING_MODE, TAG_MODEL, TAG_ORIENTATION, TAG_SHUTTERSPEED, TAG_SUBJECT_DISTANCE, TAG_THUMBNAIL_LENGTH, TAG_THUMBNAIL_OFFSET, TAG_USERCOMMENT, TAG_WHITEBALANCE, Thumbnail, UserComment, and Whitebalance.

Referenced by process_EXIF().

int Opie::MM::ExifData::ReadJpegSections QFile infile,
ReadMode_t  ReadMode
[private]
 

Definition at line 140 of file opieexif.cpp.

References QFile::at(), Opie::MM::ExifData::Section_t::Data, QFile::getch(), M_COM, M_EOI, M_EXIF, M_JFIF, M_SOF0, M_SOF1, M_SOF10, M_SOF11, M_SOF13, M_SOF14, M_SOF15, M_SOF2, M_SOF3, M_SOF5, M_SOF6, M_SOF7, M_SOF9, M_SOI, M_SOS, marker, MAX_SECTIONS, NULL, oendl, owarn, process_COM(), process_EXIF(), process_SOFn(), PSEUDO_IMAGE_MARKER, READ_EXIF, READ_IMAGE, QFile::readBlock(), Sections, SectionsRead, QFile::size(), size, Opie::MM::ExifData::Section_t::Size, and Opie::MM::ExifData::Section_t::Type.

Referenced by scan().

bool Opie::MM::ExifData::scan const QString aFile  ) 
 

scan a given file

try to scan the EXIF data of a image file

Parameters:
aFile the file to scan
Returns:
true if success, otherwise false

Definition at line 807 of file opieexif.cpp.

References CameraMake, CameraModel, Comment, DiscardData(), f, IO_ReadOnly, oendl, QFile::open(), owarn, READ_EXIF, ReadJpegSections(), QString::stripWhiteSpace(), and UserComment.

Referenced by JpegSlave::fullImageInfo(), JpegSlave::iconViewName(), Opie::MM::OImageScrollView::loadJpeg(), and JpegSlave::pixmap().

QString Opie::MM::ExifData::white_balance_string int  i  )  [static]
 

Definition at line 1034 of file opieexif.cpp.

References tr.

Referenced by JpegSlave::fullImageInfo().


Member Data Documentation

float Opie::MM::ExifData::ApertureFNumber [private]
 

Definition at line 65 of file opieexif.h.

Referenced by ExifData(), getApertureFNumber(), and ProcessExifDir().

QString Opie::MM::ExifData::CameraMake [private]
 

Definition at line 54 of file opieexif.h.

Referenced by getCameraMake(), ProcessExifDir(), and scan().

QString Opie::MM::ExifData::CameraModel [private]
 

Definition at line 55 of file opieexif.h.

Referenced by getCameraModel(), ProcessExifDir(), and scan().

float Opie::MM::ExifData::CCDWidth [private]
 

Definition at line 69 of file opieexif.h.

Referenced by ExifData(), getCCDWidth(), and process_EXIF().

QString Opie::MM::ExifData::Comment [private]
 

Definition at line 75 of file opieexif.h.

Referenced by getComment(), process_COM(), and scan().

int Opie::MM::ExifData::CompressionLevel [private]
 

Definition at line 73 of file opieexif.h.

Referenced by ExifData(), getCompressionLevel(), and ProcessExifDir().

QString Opie::MM::ExifData::DateTime [private]
 

Definition at line 56 of file opieexif.h.

Referenced by getDateTime(), and ProcessExifDir().

float Opie::MM::ExifData::Distance [private]
 

Definition at line 66 of file opieexif.h.

Referenced by ExifData(), getDistance(), and ProcessExifDir().

int Opie::MM::ExifData::ExifImageLength [private]
 

Definition at line 59 of file opieexif.h.

Referenced by isThumbnailSane(), process_EXIF(), and ProcessExifDir().

int Opie::MM::ExifData::ExifImageWidth [private]
 

Definition at line 59 of file opieexif.h.

Referenced by isThumbnailSane(), process_EXIF(), and ProcessExifDir().

int Opie::MM::ExifData::ExifSettingsLength [private]
 

Definition at line 79 of file opieexif.h.

Referenced by process_EXIF().

float Opie::MM::ExifData::ExposureBias [private]
 

Definition at line 70 of file opieexif.h.

Referenced by ExifData(), getExposureBias(), and ProcessExifDir().

int Opie::MM::ExifData::ExposureProgram [private]
 

Definition at line 71 of file opieexif.h.

Referenced by ExifData(), getExposureProgram(), and ProcessExifDir().

float Opie::MM::ExifData::ExposureTime [private]
 

Definition at line 64 of file opieexif.h.

Referenced by ExifData(), getExposureTime(), and ProcessExifDir().

int Opie::MM::ExifData::FlashUsed [private]
 

Definition at line 62 of file opieexif.h.

Referenced by ExifData(), getFlashUsed(), process_EXIF(), and ProcessExifDir().

float Opie::MM::ExifData::FocalLength [private]
 

Definition at line 63 of file opieexif.h.

Referenced by ExifData(), getFocalLength(), and ProcessExifDir().

double Opie::MM::ExifData::FocalplaneUnits [private]
 

Definition at line 81 of file opieexif.h.

Referenced by process_EXIF(), and ProcessExifDir().

double Opie::MM::ExifData::FocalplaneXRes [private]
 

Definition at line 80 of file opieexif.h.

Referenced by process_EXIF(), and ProcessExifDir().

int Opie::MM::ExifData::Height [private]
 

Definition at line 58 of file opieexif.h.

Referenced by ExifData(), getHeight(), isThumbnailSane(), and process_SOFn().

int Opie::MM::ExifData::IsColor [private]
 

Definition at line 60 of file opieexif.h.

Referenced by ExifData(), getIsColor(), and process_SOFn().

int Opie::MM::ExifData::ISOequivalent [private]
 

Definition at line 72 of file opieexif.h.

Referenced by ExifData(), getISOequivalent(), and ProcessExifDir().

unsigned char* Opie::MM::ExifData::LastExifRefd [private]
 

Definition at line 78 of file opieexif.h.

Referenced by process_EXIF(), and ProcessExifDir().

const int Opie::MM::ExifData::MAX_SECTIONS = 20 [static, private]
 

Definition at line 50 of file opieexif.h.

Referenced by ReadJpegSections().

int Opie::MM::ExifData::MeteringMode [private]
 

Definition at line 68 of file opieexif.h.

Referenced by ExifData(), getMeteringMode(), and ProcessExifDir().

int Opie::MM::ExifData::MotorolaOrder [private]
 

Definition at line 82 of file opieexif.h.

Referenced by ExifData(), Get16u(), Get32s(), and process_EXIF().

int Opie::MM::ExifData::Orientation [private]
 

Definition at line 57 of file opieexif.h.

Referenced by ExifData(), getOrientation(), getThumbnail(), and ProcessExifDir().

int Opie::MM::ExifData::Process [private]
 

Definition at line 61 of file opieexif.h.

Referenced by process_SOFn().

const unsigned int Opie::MM::ExifData::PSEUDO_IMAGE_MARKER = 0x123 [static, private]
 

Definition at line 51 of file opieexif.h.

Referenced by ReadJpegSections().

Section_t Opie::MM::ExifData::Sections[MAX_SECTIONS] [private]
 

Definition at line 52 of file opieexif.h.

Referenced by DiscardData(), and ReadJpegSections().

int Opie::MM::ExifData::SectionsRead [private]
 

Definition at line 83 of file opieexif.h.

Referenced by DiscardData(), and ReadJpegSections().

QImage Opie::MM::ExifData::Thumbnail [private]
 

Definition at line 76 of file opieexif.h.

Referenced by getThumbnail(), isThumbnailSane(), and ProcessExifDir().

QString Opie::MM::ExifData::UserComment [private]
 

Definition at line 74 of file opieexif.h.

Referenced by getUserComment(), ProcessExifDir(), and scan().

int Opie::MM::ExifData::Whitebalance [private]
 

Definition at line 67 of file opieexif.h.

Referenced by ExifData(), getWhitebalance(), and ProcessExifDir().

int Opie::MM::ExifData::Width [private]
 

Definition at line 58 of file opieexif.h.

Referenced by ExifData(), getWidth(), isThumbnailSane(), and process_SOFn().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:01:31 2005 for OPIE by  doxygen 1.4.2