Exiv2
Loading...
Searching...
No Matches
Exiv2::PreviewImage Class Reference

Class that holds preview image properties and data buffer. More...

#include <preview.hpp>

Public Member Functions

Constructors
 PreviewImage (const PreviewImage &rhs)
 Copy constructor.
Manipulators
PreviewImageoperator= (const PreviewImage &rhs)
 Assignment operator.

Friends

class PreviewManager

Accessors

DataBuf copy () const
 Return a copy of the preview image data. The caller owns this copy and DataBuf ensures that it will be deleted.
const bytepData () const
 Return a pointer to the image data for read-only access.
uint32_t size () const
 Return the size of the preview image in bytes.
size_t writeFile (const std::string &path) const
 Write the thumbnail image to a file.
std::string mimeType () const
 Return the MIME type of the preview image, usually either "image/tiff" or "image/jpeg".
std::string extension () const
 Return the file extension for the format of the preview image (".tif" or ".jpg").
size_t width () const
 Return the width of the preview image in pixels.
size_t height () const
 Return the height of the preview image in pixels.
PreviewId id () const
 Return the preview image type identifier.

Detailed Description

Class that holds preview image properties and data buffer.

Constructor & Destructor Documentation

◆ PreviewImage()

Exiv2::PreviewImage::PreviewImage ( const PreviewImage & rhs)

Copy constructor.

References pData(), PreviewImage(), and size().

Referenced by operator=(), PreviewImage(), and writeFile().

Member Function Documentation

◆ copy()

DataBuf Exiv2::PreviewImage::copy ( ) const
nodiscard

Return a copy of the preview image data. The caller owns this copy and DataBuf ensures that it will be deleted.

References pData(), and size().

◆ extension()

std::string Exiv2::PreviewImage::extension ( ) const
nodiscard

Return the file extension for the format of the preview image (".tif" or ".jpg").

Referenced by writeFile().

◆ height()

size_t Exiv2::PreviewImage::height ( ) const
nodiscard

Return the height of the preview image in pixels.

Referenced by writeFile().

◆ id()

PreviewId Exiv2::PreviewImage::id ( ) const
nodiscard

Return the preview image type identifier.

Referenced by writeFile().

◆ mimeType()

std::string Exiv2::PreviewImage::mimeType ( ) const
nodiscard

Return the MIME type of the preview image, usually either "image/tiff" or "image/jpeg".

Referenced by writeFile().

◆ operator=()

PreviewImage & Exiv2::PreviewImage::operator= ( const PreviewImage & rhs)

Assignment operator.

References Exiv2::DataBuf::DataBuf(), pData(), PreviewImage(), and size().

◆ pData()

const byte * Exiv2::PreviewImage::pData ( ) const
nodiscard

Return a pointer to the image data for read-only access.

References Exiv2::DataBuf::c_data().

Referenced by copy(), operator=(), PreviewImage(), and Exiv2::Rw2Image::readMetadata().

◆ size()

uint32_t Exiv2::PreviewImage::size ( ) const
nodiscard

Return the size of the preview image in bytes.

Referenced by copy(), operator=(), PreviewImage(), and Exiv2::Rw2Image::readMetadata().

◆ width()

size_t Exiv2::PreviewImage::width ( ) const
nodiscard

Return the width of the preview image in pixels.

Referenced by writeFile().

◆ writeFile()

size_t Exiv2::PreviewImage::writeFile ( const std::string & path) const
nodiscard

Write the thumbnail image to a file.

A filename extension is appended to path according to the image type of the preview image, so path should not include an extension. The function will overwrite an existing file of the same name.

Parameters
pathFile name of the preview image without extension.
Returns
The number of bytes written.

References extension(), height(), id(), mimeType(), PreviewImage(), and width().


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