ARGBFrame (Size size);
~ARGBFrame ();
+ /** @return pointer to the image data */
uint8_t* data () const {
return _data;
}
- /** Length of one picture row in bytes */
+ /** @return length of one picture row in bytes */
int stride () const;
+ /** @return size of the picture in pixels */
Size size () const {
return _size;
}
Asset (boost::filesystem::path file);
Asset (std::string id);
- virtual std::string pkl_type () const = 0;
virtual bool equals (
boost::shared_ptr<const Asset> other,
EqualityOptions opt,
std::string hash () const;
protected:
+ virtual std::string pkl_type () const = 0;
+
/** The disk file that represents this asset, if one exists */
mutable boost::filesystem::path _file;
/** Hash of _file, or empty if the hash has not yet been computed */
_reels.push_back (reel);
}
+/** Write an CompositonPlaylist XML file.
+ * @param file Filename to write.
+ * @param standard INTEROP or SMPTE.
+ * @param metadata Metadata to use.
+ * @param signer Signer to sign the CPL, or 0 to add no signature.
+ */
void
CPL::write_xml (boost::filesystem::path file, Standard standard, XMLMetadata metadata, shared_ptr<const Signer> signer) const
{
return false;
}
+/** Add a KDM to this CPL. If the KDM is for any of this CPLs assets it will be used
+ * to decrypt those assets.
+ * @param kdm KDM.
+ */
void
CPL::add (KDM const & kdm)
{
CPL (std::string annotation_text, ContentKind content_kind);
CPL (boost::filesystem::path file);
- std::string pkl_type () const {
- return "text/xml";
- }
-
bool equals (
CPL const & other,
EqualityOptions options,
void add (boost::shared_ptr<Reel> reel);
void add (KDM const &);
-
+
+ /** @return contents of the <AnnotationText> node */
std::string annotation_text () const {
return _annotation_text;
}
+ /** @return contents of the <ContentTitleText> node */
std::string content_title_text () const {
return _content_title_text;
}
+ /** @return contents of the <Id> node within <ContentVersion> */
void set_content_version_id (std::string id) {
_content_version_id = id;
}
+ /** @return contents of the <LabelText> node within <ContentVersion> */
void set_content_version_label_text (std::string text) {
_content_version_label_text = text;
}
return _content_kind;
}
+ /** @return the reels in this CPL */
std::list<boost::shared_ptr<Reel> > reels () const {
return _reels;
}
+ /** @return the Content in this CPL across all its reels
+ * (Content is picture, sound and subtitles)
+ */
std::list<boost::shared_ptr<const Content> > content () const;
bool encrypted () const;
) const;
void resolve_refs (std::list<boost::shared_ptr<Object> >);
-
+
+protected:
+ /** @return type string for PKLs for this asset */
+ std::string pkl_type () const {
+ return "text/xml";
+ }
+
private:
std::string _annotation_text; ///< <AnnotationText>
std::string _issue_date; ///< <IssueDate>
namespace dcp
{
-/** @brief An exception related to a file */
+/** @class FileError
+ * @brief An exception related to a file
+ */
class FileError : public std::exception
{
public:
int _number;
};
-/** @brief An exception related to an MXF file */
+/** @class MXFFileError
+ * @brief An exception related to an MXF file
+ */
class MXFFileError : public FileError
{
public:
{}
};
-/** @brief A miscellaneous exception */
+/** @class MiscError
+ * @brief A miscellaneous exception
+ */
class MiscError : public std::exception
{
public:
std::string _message;
};
-/** @brief A DCP read exception */
+/** @class DCPReadError
+ * @brief A DCP read exception
+ */
class DCPReadError : public std::exception
{
public:
std::string _message;
};
-/** @brief An XML error */
+/** @class XMLError
+ * @brief An XML error
+ */
class XMLError : public std::exception
{
public:
std::string _message;
};
+/** @class UnresolvedRefError
+ * @brief An exception caused by a reference (by UUID) to something which is not known
+ */
class UnresolvedRefError : public std::exception
{
public:
namespace dcp
{
+/** @class MXFMetadata
+ * @brief Metadata that is written to a MXF file's header
+ */
class MXFMetadata
{
public:
std::string product_version;
};
+/** @class XMLMetadata
+ * @brief Common metadata that is written to a few different XML files
+ */
class XMLMetadata
{
public:
virtual std::string key_type () const = 0;
- std::string pkl_type () const {
- return "application/x-smpte-mxf";
- }
-
bool equals (
boost::shared_ptr<const Content> other,
EqualityOptions opt,
}
protected:
+ std::string pkl_type () const {
+ return "application/x-smpte-mxf";
+ }
+
void read_writer_info (ASDCP::WriterInfo const &);
/** Signal to emit to report progress, or 0 */
SubtitleContent (boost::filesystem::path file);
SubtitleContent (Fraction edit_rate, std::string movie_title, std::string language);
- std::string pkl_type () const {
- return "text/xml";
- }
-
bool equals (
boost::shared_ptr<const Content>,
EqualityOptions,
void write_xml () const;
Glib::ustring xml_as_string () const;
+protected:
+ std::string pkl_type () const {
+ return "text/xml";
+ }
+
private:
std::string font_id_to_name (std::string id) const;
extern bool operator== (Fraction const & a, Fraction const & b);
extern bool operator!= (Fraction const & a, Fraction const & b);
-
-struct EqualityOptions {
+
+/** @struct EqualityOptions
+ * @brief A class to describe what "equality" means for a particular test.
+ *
+ * When comparing things, we want to be able to ignore some differences;
+ * this class expresses those differences.
+ */
+struct EqualityOptions
+{
+ /** Construct an EqualityOptions where nothing at all can differ */
EqualityOptions ()
: max_mean_pixel_error (0)
, max_std_dev_pixel_error (0)
, mxf_names_can_differ (false)
{}
+ /** The maximum allowable mean difference in pixel value between two images */
double max_mean_pixel_error;
+ /** The maximum standard deviation of the differences in pixel value between two images */
double max_std_dev_pixel_error;
+ /** The maximum difference in audio sample value between two soundtracks */
int max_audio_sample_error;
+ /** true if the <AnnotationText> nodes of CPLs are allowed to differ */
bool cpl_annotation_texts_can_differ;
+ /** true if MXF filenames are allowed to differ */
bool mxf_names_can_differ;
};
/* @class XYZFrame
* @brief An image in XYZ colour.
+ *
+ * This class is a thin wrapper of libopenjpeg's opj_image_t.
*/
class XYZFrame : public boost::noncopyable
{
int* data (int) const;
dcp::Size size () const;
+ /** @return Pointer to opj_image_t struct. The caller
+ * must not delete this.
+ */
opj_image_t* opj_image () const {
return _opj_image;
}
private:
- opj_image_t* _opj_image;
+ opj_image_t* _opj_image; ///< opj_image_t that we are managing
};
}