MeVisLab Toolbox Reference
macVideoFoundation.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2014, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef MAC_VIDEO_FOUNDATION_H
14 #define MAC_VIDEO_FOUNDATION_H
15 
17 
18 #if defined(__APPLE__)
19 
21 #include <string>
22 #include <set>
23 
24 namespace macos {
25 
26  // Forward declaration
27  class VideoFoundationMoviePrivate;
28 
31  {
32  public:
33 
35  enum VFFileType {
38  };
39 
44 
46  static std::string defaultVideoCodecType();
47 
49  static bool isVideoCodecTypeAvailable(const std::string &videoCodecType);
50 
52  static VFFileType fileTypeFromFilename(const std::string &filename);
53 
55 
58  bool create(const VFFileType fileType = VFFileTypeQuickTimeMovie, const std::string &videoCodecType = std::string());
59 
61  bool canAddImages();
62 
64  bool addImageFile(const std::string &filename, double durationInMilliSecs = 1000./30.);
66  bool addMLImage(void * /* ml::PagedImage * */ pagedImage, double durationInMilliSecs = 1000./30.);
68  bool addRGB8Image(void *data, bool flipVertically, unsigned int width, unsigned int height, double durationInMilliSecs = 1000./30.);
69 
71 
74  bool save(const std::string &filename, const std::string &exportPresetName = std::string());
75 
77  static std::set<std::string> availableVideoCodecTypes();
79  static std::string videoCodecDisplayName(const std::string &videoCodecType);
80 
82  std::string temporaryMovieFilename();
83 
84  private:
85 
86  OSXSUPPORT_PRIVATE_API VideoFoundationMoviePrivate *_p;
87  };
88 
89 }
90 
91 #endif // __APPLE__
92 #endif // __macVideoFoundation_H
Movie related functions.
static std::set< std::string > availableVideoCodecTypes()
Returns the code names of all video codecs of the current system.
static std::string videoCodecDisplayName(const std::string &videoCodecType)
Return the human readable name of the given video codec code name.
static std::string defaultVideoCodecType()
Returns the default video codec type.
bool save(const std::string &filename, const std::string &exportPresetName=std::string())
Saves the movie (UTF8) (with the given, optional export preset, e.g. AVAssetExportPreset1920x1080)
bool addMLImage(void *pagedImage, double durationInMilliSecs=1000./30.)
Add an ML paged image to the movie (the default duration for a frame will result in 30fps)
bool canAddImages()
Returns 'true' if the movie container allows images to be added.
bool create(const VFFileType fileType=VFFileTypeQuickTimeMovie, const std::string &videoCodecType=std::string())
Create an empty movie container (with the given, optional codec type)
bool addRGB8Image(void *data, bool flipVertically, unsigned int width, unsigned int height, double durationInMilliSecs=1000./30.)
Add an RGB8 memory image (8-bit RGB interleaved) to the movie (the default duration for a frame will ...
bool addImageFile(const std::string &filename, double durationInMilliSecs=1000./30.)
Add the given image file to the movie (UTF8) (the default duration for a frame will result in 30fps)
VFFileType
Specifies the different folder types.
@ VFFileTypeQuickTimeMovie
QuickTime movie file format, files are identified with the .mov and .qt extensions.
@ VFFileTypeMPEG4
MPEG-4 file format, files are identified with the .mp4 extension.
std::string temporaryMovieFilename()
Returns the file name of the temporary movie file (used for interface tests)
static VFFileType fileTypeFromFilename(const std::string &filename)
Derives and returns the file type from the given file name.
static bool isVideoCodecTypeAvailable(const std::string &videoCodecType)
Returns 'true' if the specified video codec type is available.
#define OSXSUPPORT_PUBLIC_API
Symbol visibility macros.
#define OSXSUPPORT_PRIVATE_API
AppleScript support.