TMetaPicture

primo::avblocks::modern::TMetaPicture

class TMetaPicture

Fluent wrapper for primo::codecs::MetaPicture.

Owns the raw object through a primo::ref<MetaPicture>. Non-copyable, movable.

Unnamed Group

TMetaPicture(TMetaPicture&&) = default
TMetaPicture &operator=(TMetaPicture&&) = default

Move construction/assignment transfers ownership of the underlying object. The moved-from object no longer wraps anything.

Public Functions

inline TMetaPicture()

Creates an empty meta picture.

inline explicit TMetaPicture(primo::ref<primo::codecs::MetaPicture> pic)

Takes ownership of an existing MetaPicture reference.

inline explicit TMetaPicture(primo::codecs::MetaPicture *pic)

Wraps a non-owned MetaPicture pointer, retaining it.

TMetaPicture(const TMetaPicture&) = delete
TMetaPicture &operator=(const TMetaPicture&) = delete
inline const char *mimeType() const

Returns the MIME type as an ANSI string (see primo::codecs::MimeType constants).

inline primo::codecs::MetaPictureType::Enum pictureType() const

Returns the picture type (front cover, back cover, artist, etc.).

inline std::string description() const

Returns the picture description as a UTF-8 std::string (empty if none).

inline const uint8_t *data() const

Returns a pointer to the image data (jpeg, png, etc., as given by mimeType()).

The size is dataSize().

inline int32_t dataSize() const

Returns the number of image bytes.

inline bool immutable() const

Returns true if the picture is immutable.

inline TMetaPicture &mimeType(const char *mt)

Sets the MIME type (see primo::codecs::MimeType constants).

Returns:

This object, for chaining.

inline TMetaPicture &pictureType(primo::codecs::MetaPictureType::Enum pt)

Sets the picture type (front cover, back cover, artist, etc.).

Returns:

This object, for chaining.

inline TMetaPicture &description(const char *desc)

Sets the picture description (desc is a UTF-8 C-string).

Pass nullptr to clear it.

Returns:

This object, for chaining.

inline TMetaPicture &data(const void *d, int32_t size)

Sets the image data.

The data is copied.

Parameters:
  • d – Pointer to the image data.

  • size – Size of the image in bytes.

Returns:

This object, for chaining.

inline TMetaPicture clone() const

Creates a full independent clone. The returned object is always mutable.

inline bool valid() const

Returns true when this handle wraps a non-null underlying object.

inline primo::codecs::MetaPicture *get() const

Returns the raw underlying pointer. For interop with the core API only.