libdcp
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
dcp Namespace Reference

Namespace for everything in libdcp. More...

Namespaces

 data
 

Classes

class  ArrayData
 Class to hold an arbitrary block of data. More...
 
class  Asset
 Parent class for DCP assets, i.e. picture, sound, subtitles, closed captions, CPLs, fonts. More...
 
class  AssetReader
 
class  AssetWriter
 Parent class for classes which can write MXF-based assets. More...
 
class  AtmosAsset
 An asset of Dolby ATMOS sound data. More...
 
class  AtmosAssetWriter
 A helper class for writing to AtmosAssets. More...
 
class  Bitstream
 
class  Certificate
 A wrapper for an X509 certificate. More...
 
class  CertificateChain
 A chain of any number of certificates, from root to leaf. More...
 
class  Chromaticity
 A representation of a x,y,z chromaticity, where z = 1 - x - y. More...
 
class  ColourConversion
 A representation of all the parameters involved the colourspace conversion of a YUV image to XYZ (via RGB) More...
 
class  CPL
 A Composition Playlist. More...
 
class  CryptoContext
 
class  Data
 
class  DCP
 A class to create or read a DCP. More...
 
class  Time
 A representation of time within a DCP. More...
 
class  DecryptedKDM
 A decrypted KDM. More...
 
class  DecryptedKDMKey
 An un- or de-crypted key from a KDM. More...
 
class  EncryptedKDM
 An encrypted KDM. More...
 
class  FileError
 An exception related to a file. More...
 
class  MXFFileError
 An exception related to an MXF file. More...
 
class  MiscError
 A miscellaneous exception. More...
 
class  ReadError
 Any error that occurs when reading data from a DCP. More...
 
class  J2KDecompressionError
 An error that occurs during decompression of JPEG2000 data. More...
 
class  BadContentKindError
 
class  MissingAssetmapError
 Thrown when no ASSETMAP was found when trying to read a DCP. More...
 
class  XMLError
 An XML error. More...
 
class  UnresolvedRefError
 An exception caused by a reference (by UUID) to something which is not known. More...
 
class  TimeFormatError
 A an error with a string passed to LocalTime. More...
 
class  NotEncryptedError
 An error raised when creating a DecryptedKDM object for assets that are not encrypted. More...
 
class  ProgrammingError
 An exception thrown when a DCP_ASSERT fails; something that should not happen. More...
 
class  KDMDecryptionError
 
class  KDMFormatError
 
class  CertificateChainError
 
class  MissingSubtitleImageError
 
class  BadKDMDateError
 
class  StartCompressionError
 
class  CombineError
 
class  LanguageTagError
 
class  BadSettingError
 
class  DuplicateIdError
 
class  MainSoundConfigurationError
 
class  UnknownChannelIdError
 
class  NoReelsError
 
class  FontAsset
 A (truetype) font asset for subtitles in an Interop DCP. More...
 
class  Frame
 
class  FSK
 Create frequency-shift-keyed samples for encoding synchronization signals. More...
 
class  GammaTransferFunction
 A description of a gamma function of the f(x) = x^g where g is the gamma. More...
 
class  IdentityTransferFunction
 
class  InteropLoadFontNode
 
class  InteropSubtitleAsset
 A set of subtitles to be read and/or written in the Inter-Op format. More...
 
class  Key
 A key for decrypting/encrypting assets. More...
 
class  LanguageTag
 
class  LoadFontNode
 Parser for LoadFont nodes from subtitle XML. More...
 
class  LocalTime
 A representation of a local time (down to the second), including its offset from GMT (equivalent to xs:dateTime). More...
 
class  MXFMetadata
 Metadata that is written to a MXF file's header. More...
 
class  ModifiedGammaTransferFunction
 
class  MonoPictureAsset
 A 2D (monoscopic) picture asset. More...
 
class  MonoPictureAssetWriter
 A helper class for writing to MonoPictureAssets. More...
 
class  MonoPictureFrame
 A single frame of a 2D (monoscopic) picture asset. More...
 
class  MXF
 Parent for classes which represent MXF files. More...
 
class  NameFormat
 
class  Object
 Some part of a DCP that has a UUID. More...
 
class  OpenJPEGImage
 A wrapper of libopenjpeg's opj_image_t. More...
 
class  PictureAsset
 An asset made up of JPEG2000 data. More...
 
class  FrameInfo
 Information about a single frame (either a monoscopic frame or a left or right eye stereoscopic frame) More...
 
class  PictureAssetWriter
 Parent class for classes which write picture assets. More...
 
struct  ASDCPStateBase
 
class  PKL
 
class  Rating
 
class  RatingSystem
 
class  Reel
 A reel within a DCP; the part which actually refers to picture, sound, subtitle, marker and Atmos data. More...
 
class  ReelAsset
 An entry in a <Reel> which refers to a use of a piece of content. More...
 
class  ReelAtmosAsset
 Part of a Reel's description which refers to a Atmos MXF. More...
 
class  ReelClosedCaptionAsset
 Part of a Reel's description which refers to a closed caption XML/MXF file. More...
 
class  ReelFileAsset
 
class  ReelInteropClosedCaptionAsset
 
class  ReelInteropSubtitleAsset
 Part of a Reel's description which refers to an Interop subtitle XML file. More...
 
class  ReelMarkersAsset
 
class  ReelMonoPictureAsset
 Part of a Reel's description which refers to a monoscopic picture asset. More...
 
class  ReelPictureAsset
 Part of a Reel's description which refers to a picture asset. More...
 
class  ReelSMPTEClosedCaptionAsset
 
class  ReelSMPTESubtitleAsset
 Part of a Reel's description which refers to an SMPTE subtitle MXF file. More...
 
class  ReelSoundAsset
 Part of a Reel's description which refers to a sound asset. More...
 
class  ReelStereoPictureAsset
 Part of a Reel's description which refers to a stereoscopic picture asset. More...
 
class  ReelSubtitleAsset
 Part of a Reel's description which refers to a subtitle XML/MXF file. More...
 
class  Ref
 A reference to an asset which is identified by a universally-unique identifier (UUID) More...
 
class  SGamut3TransferFunction
 
class  SMPTELoadFontNode
 Parser for LoadFont nodes from SMPTE subtitle XML. More...
 
class  SMPTESubtitleAsset
 A set of subtitles to be read and/or written in the SMPTE format. More...
 
class  SoundAsset
 Representation of a sound asset. More...
 
class  SoundAssetWriter
 A helper class for writing to SoundAssets. More...
 
class  SoundFrame
 
class  StereoPictureAsset
 A 3D (stereoscopic) picture asset. More...
 
class  StereoPictureAssetWriter
 A helper class for writing to StereoPictureAssets. More...
 
class  StereoPictureFrame
 A single frame of a 3D (stereoscopic) picture asset. More...
 
class  Subtitle
 
class  SubtitleAsset
 A parent for classes representing a file containing subtitles. More...
 
class  SubtitleImage
 A bitmap subtitle with all the associated attributes. More...
 
class  SubtitleString
 A single line of subtitle text with all the associated attributes. More...
 
class  TransferFunction
 A transfer function represented by a lookup table. More...
 
struct  Size
 The integer, two-dimensional size of something. More...
 
class  Fraction
 A fraction (i.e. a thing with an integer numerator and an integer denominator). More...
 
struct  EqualityOptions
 A class to describe what "equality" means for a particular test. More...
 
class  Colour
 An RGB colour. More...
 
class  ContentVersion
 
class  Luminance
 
class  MainSoundConfiguration
 
class  ASDCPErrorSuspender
 
class  VerificationNote
 

Typedefs

typedef AssetReader< ASDCP::ATMOS::MXFReader, AtmosFrameAtmosAssetReader
 
typedef Frame< ASDCP::ATMOS::MXFReader, ASDCP::DCData::FrameBuffer > AtmosFrame
 
typedef CryptoContext< ASDCP::AESEncContext > EncryptionContext
 
typedef CryptoContext< ASDCP::AESDecContext > DecryptionContext
 
typedef AssetReader< ASDCP::JP2K::MXFReader, MonoPictureFrameMonoPictureAssetReader
 
typedef AssetReader< ASDCP::PCM::MXFReader, SoundFrameSoundAssetReader
 
typedef AssetReader< ASDCP::JP2K::MXFSReader, StereoPictureFrameStereoPictureAssetReader
 
typedef boost::function< void(NoteType, std::string)> NoteHandler
 

Enumerations

enum class  YUVToRGB { REC601 , REC709 , COUNT }
 
enum class  Channel {
  LEFT = 0 , RIGHT = 1 , CENTRE = 2 , LFE = 3 ,
  LS = 4 , RS = 5 , HI = 6 , VI = 7 ,
  BSL = 10 , BSR = 11 , MOTION_DATA = 12 , SYNC_SIGNAL = 13 ,
  SIGN_LANGUAGE = 14 , CHANNEL_COUNT = 16
}
 
enum class  MCASoundField { FIVE_POINT_ONE , SEVEN_POINT_ONE }
 
enum class  ContentKind {
  FEATURE , SHORT , TRAILER , TEST ,
  TRANSITIONAL , RATING , TEASER , POLICY ,
  PUBLIC_SERVICE_ANNOUNCEMENT , ADVERTISEMENT , EPISODE , PROMO
}
 
enum class  Effect { NONE , BORDER , SHADOW }
 
enum class  HAlign { LEFT , CENTER , RIGHT }
 
enum class  VAlign { TOP , CENTER , BOTTOM }
 
enum class  Direction { LTR , RTL , TTB , BTT }
 
enum class  Eye { LEFT , RIGHT }
 
enum class  NoteType { PROGRESS , ERROR , NOTE }
 
enum class  Standard { INTEROP , SMPTE }
 
enum class  Formulation {
  MODIFIED_TRANSITIONAL_1 , MULTIPLE_MODIFIED_TRANSITIONAL_1 , DCI_ANY , DCI_SPECIFIC ,
  MODIFIED_TRANSITIONAL_TEST
}
 
enum class  Marker {
  FFOC , LFOC , FFTC , LFTC ,
  FFOI , LFOI , FFEC , LFEC ,
  FFMC , LFMC
}
 
enum class  Status { FINAL , TEMP , PRE }
 

Functions

std::shared_ptr< Assetasset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_mxf_type, bool *found_threed_marked_as_twod=nullptr)
 
bool operator== (Certificate const &a, Certificate const &b)
 
bool operator< (Certificate const &a, Certificate const &b)
 
std::ostream & operator<< (std::ostream &s, Certificate const &c)
 
void combine (std::vector< boost::filesystem::path > inputs, boost::filesystem::path output, std::string issuer=String::compose("libdcp %1", dcp::version), std::string creator=String::compose("libdcp %1", dcp::version), std::string issue_date=LocalTime().as_string(), std::string annotation_text=String::compose("Created by libdcp %1", dcp::version), std::shared_ptr< const CertificateChain > signer=std::shared_ptr< CertificateChain >())
 
bool operator== (Data const &a, Data const &b)
 
bool operator!= (Data const &a, Data const &b)
 
bool operator== (Time const &a, Time const &b)
 
bool operator!= (Time const &a, Time const &b)
 
bool operator<= (Time const &a, Time const &b)
 
bool operator< (Time const &a, Time const &b)
 
bool operator> (Time const &a, Time const &b)
 
bool operator>= (Time const &a, Time const &b)
 
std::ostream & operator<< (std::ostream &s, Time const &t)
 
Time operator+ (Time a, Time b)
 
Time operator- (Time a, Time b)
 
float operator/ (Time a, Time const &b)
 
bool operator== (DecryptedKDMKey const &, DecryptedKDMKey const &)
 
bool operator== (EncryptedKDM const &a, EncryptedKDM const &b)
 
bool operator== (InteropLoadFontNode const &a, InteropLoadFontNode const &b)
 
bool operator!= (InteropLoadFontNode const &a, InteropLoadFontNode const &b)
 
std::shared_ptr< OpenJPEGImagedecompress_j2k (uint8_t const *data, int64_t size, int reduce)
 
std::shared_ptr< OpenJPEGImagedecompress_j2k (Data const &data, int reduce)
 
std::shared_ptr< OpenJPEGImagedecompress_j2k (std::shared_ptr< const Data > data, int reduce)
 
ArrayData compress_j2k (std::shared_ptr< const OpenJPEGImage >, int bandwith, int frames_per_second, bool threed, bool fourk, std::string comment="libdcp")
 
bool operator== (Key const &a, Key const &b)
 
bool operator!= (Key const &a, Key const &b)
 
bool operator== (dcp::LanguageTag const &a, dcp::LanguageTag const &b)
 
bool operator!= (dcp::LanguageTag const &a, dcp::LanguageTag const &b)
 
bool operator< (dcp::LanguageTag const &a, dcp::LanguageTag const &b)
 
std::ostream & operator<< (std::ostream &os, dcp::LanguageTag const &tag)
 
void load_language_tag_lists (boost::filesystem::path tags_directory)
 
std::vector< std::pair< std::string, std::string > > dcnc_tags ()
 
std::ostream & operator<< (std::ostream &s, LocalTime const &t)
 
template<typename P , typename Q >
locale_convert (Q, int precision=16, bool fixed=false)
 
template<>
std::string locale_convert (unsigned char x, int, bool)
 
template<>
std::string locale_convert (unsigned short int x, int, bool)
 
template<>
std::string locale_convert (int x, int, bool)
 
template<>
std::string locale_convert (unsigned int x, int, bool)
 
template<>
std::string locale_convert (long int x, int, bool)
 
template<>
std::string locale_convert (unsigned long int x, int, bool)
 
template<>
std::string locale_convert (long long int x, int, bool)
 
template<>
std::string locale_convert (unsigned long long int x, int, bool)
 
template<>
std::string locale_convert (float x, int precision, bool fixed)
 
template<>
std::string locale_convert (double x, int precision, bool fixed)
 
template<>
std::string locale_convert (std::string x, int, bool)
 
template<>
std::string locale_convert (char *x, int, bool)
 
template<>
std::string locale_convert (char const *x, int, bool)
 
template<>
std::string locale_convert (wchar_t const *x, int, bool)
 
template<>
std::string locale_convert (char x, int, bool)
 
template<>
std::string locale_convert (boost::filesystem::path x, int, bool)
 
bool operator== (NameFormat const &a, NameFormat const &b)
 
bool operator== (Rating const &a, Rating const &b)
 
std::vector< RatingSystemrating_systems ()
 
void load_rating_list (boost::filesystem::path ratings_file)
 
template<typename P , typename Q >
raw_convert (Q, int precision=16, bool fixed=false)
 
template<>
std::string raw_convert (unsigned char v, int, bool)
 
template<>
std::string raw_convert (unsigned short int v, int, bool)
 
template<>
std::string raw_convert (int v, int, bool)
 
template<>
std::string raw_convert (unsigned int v, int, bool)
 
template<>
std::string raw_convert (long v, int, bool)
 
template<>
std::string raw_convert (unsigned long v, int, bool)
 
template<>
std::string raw_convert (long long v, int, bool)
 
template<>
std::string raw_convert (unsigned long long v, int, bool)
 
template<>
std::string raw_convert (float v, int, bool)
 
template<>
std::string raw_convert (double v, int, bool)
 
template<>
std::string raw_convert (char const *v, int, bool)
 
template<>
std::string raw_convert (char *v, int, bool)
 
template<>
std::string raw_convert (std::string v, int, bool)
 
template<>
std::string raw_convert (wchar_t const *v, int, bool)
 
template<>
std::string raw_convert (char v, int, bool)
 
void xyz_to_rgba (std::shared_ptr< const OpenJPEGImage >, ColourConversion const &conversion, uint8_t *rgba, int stride)
 
void xyz_to_rgb (std::shared_ptr< const OpenJPEGImage >, ColourConversion const &conversion, uint8_t *rgb, int stride, boost::optional< NoteHandler > note=boost::optional< NoteHandler >())
 
std::shared_ptr< OpenJPEGImagergb_to_xyz (uint8_t const *rgb, dcp::Size size, int stride, ColourConversion const &conversion, boost::optional< NoteHandler > note=boost::optional< NoteHandler >())
 
void combined_rgb_to_xyz (ColourConversion const &conversion, double *matrix)
 
bool operator== (SMPTELoadFontNode const &a, SMPTELoadFontNode const &b)
 
bool operator!= (SMPTELoadFontNode const &a, SMPTELoadFontNode const &b)
 
bool operator== (SubtitleImage const &a, SubtitleImage const &b)
 
bool operator!= (SubtitleImage const &a, SubtitleImage const &b)
 
std::ostream & operator<< (std::ostream &s, SubtitleImage const &sub)
 
bool operator== (SubtitleString const &a, SubtitleString const &b)
 
bool operator!= (SubtitleString const &a, SubtitleString const &b)
 
std::ostream & operator<< (std::ostream &s, SubtitleString const &sub)
 
bool operator== (Size const &a, Size const &b)
 
bool operator!= (Size const &a, Size const &b)
 
std::vector< dcp::Channelused_audio_channels ()
 
std::string channel_to_mca_id (Channel c, MCASoundField field)
 
Channel mca_id_to_channel (std::string)
 
std::string channel_to_mca_name (Channel c, MCASoundField field)
 
ASDCP::UL channel_to_mca_universal_label (Channel c, MCASoundField field, ASDCP::Dictionary const *dict)
 
std::string content_kind_to_string (ContentKind kind)
 
ContentKind content_kind_from_string (std::string kind)
 
std::string effect_to_string (Effect e)
 
Effect string_to_effect (std::string s)
 
std::string halign_to_string (HAlign a)
 
HAlign string_to_halign (std::string s)
 
std::string valign_to_string (VAlign a)
 
VAlign string_to_valign (std::string s)
 
std::string direction_to_string (Direction a)
 
Direction string_to_direction (std::string s)
 
bool operator== (Fraction const &a, Fraction const &b)
 
bool operator!= (Fraction const &a, Fraction const &b)
 
bool operator== (Colour const &a, Colour const &b)
 
bool operator!= (Colour const &a, Colour const &b)
 
std::string marker_to_string (Marker)
 
Marker marker_from_string (std::string)
 
std::string status_to_string (Status s)
 
Status string_to_status (std::string s)
 
bool operator== (Luminance const &a, Luminance const &b)
 
std::string make_uuid ()
 
std::string make_digest (boost::filesystem::path filename, boost::function< void(float)>)
 
std::string make_digest (ArrayData data)
 
bool empty_or_white_space (std::string s)
 
bool ids_equal (std::string a, std::string b)
 
std::string remove_urn_uuid (std::string raw)
 
void init (boost::optional< boost::filesystem::path > resources_directory=boost::optional< boost::filesystem::path >())
 
int base64_decode (std::string const &in, unsigned char *out, int out_length)
 
boost::optional< boost::filesystem::path > relative_to_root (boost::filesystem::path root, boost::filesystem::path file)
 
FILE * fopen_boost (boost::filesystem::path, std::string)
 
std::string file_to_string (boost::filesystem::path, uintmax_t max_length=1048576)
 
std::string private_key_fingerprint (std::string key)
 
xmlpp::Node * find_child (xmlpp::Node const *node, std::string name)
 
std::string openjpeg_version ()
 
std::string spaces (int n)
 
void indent (xmlpp::Element *element, int initial)
 
bool day_less_than_or_equal (LocalTime a, LocalTime b)
 
bool day_greater_than_or_equal (LocalTime a, LocalTime b)
 
std::string unique_string (std::vector< std::string > existing, std::string base)
 
boost::filesystem::path directory_containing_executable ()
 
boost::filesystem::path resources_directory ()
 
std::vector< VerificationNoteverify (std::vector< boost::filesystem::path > directories, boost::function< void(std::string, boost::optional< boost::filesystem::path >)> stage, boost::function< void(float)> progress, boost::optional< boost::filesystem::path > xsd_dtd_directory=boost::optional< boost::filesystem::path >())
 
std::string note_to_string (dcp::VerificationNote note)
 
bool operator== (dcp::VerificationNote const &a, dcp::VerificationNote const &b)
 
bool operator< (dcp::VerificationNote const &a, dcp::VerificationNote const &b)
 
std::ostream & operator<< (std::ostream &s, dcp::VerificationNote const &note)
 
void verify_j2k (std::shared_ptr< const Data > data, std::vector< VerificationNote > &notes)
 
template<class T >
std::shared_ptr< T > optional_type_child (cxml::Node const &node, std::string name)
 
template<class T >
std::shared_ptr< T > type_child (std::shared_ptr< const cxml::Node > node, std::string name)
 
template<class T >
std::shared_ptr< T > optional_type_child (std::shared_ptr< const cxml::Node > node, std::string name)
 
template<class T >
std::vector< std::shared_ptr< T > > type_children (cxml::Node const &node, std::string name)
 
template<class T >
std::vector< std::shared_ptr< T > > type_children (std::shared_ptr< const cxml::Node > node, std::string name)
 
template<class T >
std::vector< std::shared_ptr< T > > type_grand_children (cxml::Node const &node, std::string name, std::string sub)
 
template<class T >
std::vector< std::shared_ptr< T > > type_grand_children (std::shared_ptr< const cxml::Node > node, std::string name, std::string sub)
 

Variables

constexpr float ASPECT_ADJUST_EPSILON = 1e-3
 
constexpr float ALIGN_EPSILON = 1e-3
 
constexpr float SPACE_BEFORE_EPSILON = 1e-3
 
ASDCP::Dictionary const * asdcp_smpte_dict = nullptr
 
char const * version
 
char const * git_commit
 
bool const built_with_debug
 

Detailed Description

Namespace for everything in libdcp.

Enumeration Type Documentation

◆ Channel

enum dcp::Channel
strong

Identifier for a sound channel

Enumerator
LEFT 

left

RIGHT 

right

CENTRE 

centre

LFE 

low-frequency effects (sub)

LS 

left surround

RS 

right surround

Definition at line 96 of file types.h.

◆ Direction

enum dcp::Direction
strong

Direction for subtitle test

Enumerator
LTR 

left-to-right

RTL 

right-to-left

TTB 

top-to-bottom

BTT 

bottom-to-top

Definition at line 190 of file types.h.

◆ Formulation

enum dcp::Formulation
strong
Enumerator
MODIFIED_TRANSITIONAL_TEST 

For testing: adds no AuthorizedDeviceInfo tag

Definition at line 287 of file types.h.

◆ HAlign

enum dcp::HAlign
strong
Enumerator
LEFT 

horizontal position is distance from left of screen to left of subtitle

CENTER 

horizontal position is distance from centre of screen to centre of subtitle

RIGHT 

horizontal position is distance from right of screen to right of subtitle

Definition at line 165 of file types.h.

◆ Marker

enum dcp::Marker
strong
Enumerator
FFOC 

first frame of composition

LFOC 

last frame of composition

FFTC 

first frame of title credits

LFTC 

last frame of title credits

FFOI 

first frame of intermission

LFOI 

last frame of intermission

FFEC 

first frame of end credits

LFEC 

last frame of end credits

FFMC 

first frame of moving credits

LFMC 

last frame of moving credits

Definition at line 358 of file types.h.

◆ Status

enum dcp::Status
strong
Enumerator
FINAL 

final version

TEMP 

temporary version (picture/sound unfinished)

PRE 

pre-release (picture/sound finished)

Definition at line 376 of file types.h.

◆ VAlign

enum dcp::VAlign
strong
Enumerator
TOP 

vertical position is distance from top of screen to top of subtitle

CENTER 

vertical position is distance from centre of screen to centre of subtitle

BOTTOM 

vertical position is distance from bottom of screen to bottom of subtitle

Definition at line 177 of file types.h.

Function Documentation

◆ asset_factory()

shared_ptr< Asset > dcp::asset_factory ( boost::filesystem::path  path,
bool  ignore_incorrect_picture_mxf_type,
bool *  found_threed_marked_as_twod = nullptr 
)

Create an Asset from a file.

Parameters
ignore_incorrect_picture_mxf_typetrue to ignore cases where a stereo picture asset is marked as 2D; if this is false an exception will be thrown in that case.
ignored_incorrect_picture_mxf_typeif this is non-null it will be set to true if a 3D asset was marked as 2D, otherwise it will be left alone.

Definition at line 57 of file asset_factory.cc.

◆ base64_decode()

int dcp::base64_decode ( std::string const &  in,
unsigned char *  out,
int  out_length 
)

Decode a base64 string. The base64 decode routine in KM_util.cpp gives different values to both this and the command-line base64 for some inputs. Not sure why.

Parameters
inbase64-encoded string
outOutput buffer
out_lengthLength of output buffer
Returns
Number of characters written to the output buffer

Definition at line 206 of file util.cc.

◆ combined_rgb_to_xyz()

void dcp::combined_rgb_to_xyz ( ColourConversion const &  conversion,
double *  matrix 
)
Parameters
conversionColour conversion.
matrixFilled in with the product of the RGB to XYZ matrix, the Bradford transform and the DCI companding.

Definition at line 234 of file rgb_xyz.cc.

◆ compress_j2k()

ArrayData dcp::compress_j2k ( std::shared_ptr< const OpenJPEGImage ,
int  bandwith,
int  frames_per_second,
bool  threed,
bool  fourk,
std::string  comment = "libdcp" 
)

@xyz Picture to compress. Parts of xyz's data WILL BE OVERWRITTEN by libopenjpeg so xyz cannot be re-used after this call; see opj_j2k_encode where if l_reuse_data is false it will set l_tilec->data = l_img_comp->data.

◆ content_kind_from_string()

dcp::ContentKind dcp::content_kind_from_string ( std::string  kind)

Convert a string from a <ContentKind> node to a libdcp ContentKind. Reasonably tolerant about varying case

Parameters
kindContent kind string
Returns
libdcp ContentKind

Definition at line 341 of file types.cc.

◆ content_kind_to_string()

string dcp::content_kind_to_string ( ContentKind  kind)

Convert a content kind to a string which can be used in a <ContentKind> node

Parameters
kindContentKind
Returns
string

Definition at line 302 of file types.cc.

◆ day_greater_than_or_equal()

bool dcp::day_greater_than_or_equal ( LocalTime  a,
LocalTime  b 
)
Returns
true if the day represented by a is greater than or equal to the one represented by b, ignoring the time parts

Definition at line 398 of file util.cc.

◆ day_less_than_or_equal()

bool dcp::day_less_than_or_equal ( LocalTime  a,
LocalTime  b 
)
Returns
true if the day represented by a is less than or equal to the one represented by b, ignoring the time parts

Definition at line 383 of file util.cc.

◆ decompress_j2k()

std::shared_ptr<OpenJPEGImage> dcp::decompress_j2k ( uint8_t const *  data,
int64_t  size,
int  reduce 
)

Decompress a JPEG2000 image to a bitmap

Parameters
dataJPEG2000 data
sizeSize of data in bytes
reduceA power of 2 by which to reduce the size of the decoded image; e.g. 0 reduces by (2^0 == 1), ie keeping the same size. 1 reduces by (2^1 == 2), ie halving the size of the image. This is useful for scaling 4K DCP images down to 2K.
Returns
OpenJPEGImage

◆ empty_or_white_space()

bool dcp::empty_or_white_space ( std::string  s)
Parameters
sA string
Returns
true if the string contains only space, newline or tab characters, or is empty

Definition at line 161 of file util.cc.

◆ fopen_boost()

FILE * dcp::fopen_boost ( boost::filesystem::path  p,
std::string  t 
)
Parameters
pPath to open
tmode flags, as for fopen(3)
Returns
FILE pointer or 0 on error

Apparently there is no way to create an ofstream using a UTF-8 filename under Windows. We are hence reduced to using fopen with this wrapper.

Definition at line 232 of file util.cc.

◆ init()

void dcp::init ( boost::optional< boost::filesystem::path >  resources_directory = boost::optional< boost::filesystem::path >())

Set up various bits that the library needs. Should be called once by client applications.

Parameters
resources_directoryPath to a directory containing the tags and xsd directories from the source code; if none is specified libdcp will look in the directory given by LIBDCP_RESOURCES or based on where the current executable is.

◆ make_digest()

std::string dcp::make_digest ( boost::filesystem::path  filename,
boost::function< void(float)>   
)

Create a digest for a file

Parameters
filenameFile name
progressOptional progress reporting function. The function will be called with a progress value between 0 and 1
Returns
Digest

◆ note_to_string()

string dcp::note_to_string ( dcp::VerificationNote  note)

These strings should say what is wrong, incorporating any extra details (ID, filenames etc.).

e.g. "ClosedCaption asset has no <EntryPoint> tag.", not "ClosedCaption assets must have an <EntryPoint> tag."

It's OK to use XML tag names where they are clear. If both ID and filename are available, use only the ID. End messages with a full stop. Messages should not mention whether or not their errors are a part of Bv2.1.

Definition at line 1578 of file verify.cc.

◆ private_key_fingerprint()

string dcp::private_key_fingerprint ( std::string  key)
Parameters
keyRSA private key in PEM format (optionally with --—BEGIN... / --—END...)
Returns
SHA1 fingerprint of key

Definition at line 305 of file util.cc.

◆ raw_convert()

template<typename P , typename Q >
P dcp::raw_convert ( ,
int  precision = 16,
bool  fixed = false 
)

A sort-of version of boost::lexical_cast that does uses the "C" locale (i.e. no thousands separators and a . for the decimal separator).

Definition at line 57 of file raw_convert.h.

◆ rgb_to_xyz()

std::shared_ptr<OpenJPEGImage> dcp::rgb_to_xyz ( uint8_t const *  rgb,
dcp::Size  size,
int  stride,
ColourConversion const &  conversion,
boost::optional< NoteHandler >  note = boost::optional< NoteHandler >() 
)
Parameters
rgbRGB data; packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, with the 2-byte value for each R/G/B component stored as little-endian; i.e. AV_PIX_FMT_RGB48LE.
sizesize of RGB image in pixels.
sizestride of RGB data in pixels.

◆ unique_string()

string dcp::unique_string ( std::vector< std::string >  existing,
std::string  base 
)

Try quite hard to find a string which starts with base and is not in existing

Definition at line 413 of file util.cc.

◆ verify_j2k()

void dcp::verify_j2k ( std::shared_ptr< const Data data,
std::vector< VerificationNote > &  notes 
)

number of POC markers in the main header

number of POC markers after the main header

Definition at line 68 of file verify_j2k.cc.

◆ xyz_to_rgb()

void dcp::xyz_to_rgb ( std::shared_ptr< const OpenJPEGImage ,
ColourConversion const &  conversion,
uint8_t *  rgb,
int  stride,
boost::optional< NoteHandler >  note = boost::optional< NoteHandler >() 
)

Convert an XYZ image to 48bpp RGB.

Parameters
xyz_imageFrame in XYZ.
conversionColour conversion to use.
rgbBuffer to fill with RGB data. Format is packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, with the 2-byte value for each R/G/B component stored as little-endian; i.e. AV_PIX_FMT_RGB48LE.
strideStride for RGB data in bytes.
noteOptional handler for any notes that may be made during the conversion (e.g. when clamping occurs).

◆ xyz_to_rgba()

void dcp::xyz_to_rgba ( std::shared_ptr< const OpenJPEGImage xyz_image,
ColourConversion const &  conversion,
uint8_t *  rgba,
int  stride 
)

Convert an XYZ image to RGBA.

Parameters
xyz_imageImage in XYZ.
conversionColour conversion to use.
argbBuffer to fill with RGBA data. The format of the data is:
Byte   /- 0 -------|- 1 --------|- 2 --------|- 3 --------|- 4 --------|- 5 --------| ...
       |(0, 0) Blue|(0, 0)Green |(0, 0) Red  |(0, 0) Alpha|(0, 1) Blue |(0, 1) Green| ...

So that the first byte is the blue component of the pixel at x=0, y=0, the second is the green component, and so on.

Lines are packed so that the second row directly follows the first.

Definition at line 62 of file rgb_xyz.cc.

Variable Documentation

◆ ALIGN_EPSILON

constexpr float dcp::ALIGN_EPSILON = 1e-3
constexpr

Maximum absolute difference between dcp::SubtitleString alignment values that are considered equal.

Definition at line 349 of file types.h.

◆ ASPECT_ADJUST_EPSILON

constexpr float dcp::ASPECT_ADJUST_EPSILON = 1e-3
constexpr

Maximum absolute difference between dcp::SubtitleString::aspect_adjust values that are considered equal

Definition at line 343 of file types.h.

◆ SPACE_BEFORE_EPSILON

constexpr float dcp::SPACE_BEFORE_EPSILON = 1e-3
constexpr

Maximum absolute difference between dcp::SubtitleString space_before values that are considered equal.

Definition at line 355 of file types.h.