|
void | AddAudio (bool replaceSamples, int destChannel, int destStartSample, const float *source, int numSamples, float gainToApplyToSource) |
| Add audio samples to a specific channel. More...
|
|
void | AddAudioSilence (int numSamples) |
| Add audio silence. More...
|
|
void | AddColor (int new_width, int new_height, string color) |
| Add (or replace) pixel data to the frame (based on a solid color) More...
|
|
void | AddImage (int new_width, int new_height, int bytes_per_pixel, QImage::Format type, const unsigned char *pixels_) |
| Add (or replace) pixel data to the frame. More...
|
|
void | AddImage (std::shared_ptr< QImage > new_image) |
| Add (or replace) pixel data to the frame. More...
|
|
void | AddImage (std::shared_ptr< QImage > new_image, bool only_odd_lines) |
| Add (or replace) pixel data to the frame (for only the odd or even lines) More...
|
|
void | ApplyGainRamp (int destChannel, int destStartSample, int numSamples, float initial_gain, float final_gain) |
| Apply gain ramp (i.e. fading volume) More...
|
|
ChannelLayout | ChannelsLayout () |
|
void | ChannelsLayout (ChannelLayout new_channel_layout) |
|
void | ClearWaveform () |
| Clear the waveform image (and deallocate it's memory) More...
|
|
void | DeepCopy (const Frame &other) |
| Copy data and pointers from another Frame instance. More...
|
|
void | Display () |
| Display the frame image to the screen (primarily used for debugging reasons) More...
|
|
void | DisplayWaveform () |
| Display the wave form. More...
|
|
| Frame () |
| Constructor - blank frame (300x200 blank image, 48kHz audio silence) More...
|
|
| Frame (int64_t number, int width, int height, string color) |
| Constructor - image only (48kHz audio silence) More...
|
|
| Frame (int64_t number, int samples, int channels) |
| Constructor - audio only (300x200 blank image) More...
|
|
| Frame (int64_t number, int width, int height, string color, int samples, int channels) |
| Constructor - image & audio. More...
|
|
| Frame (const Frame &other) |
| Copy constructor. More...
|
|
int | GetAudioChannelsCount () |
| Get number of audio channels. More...
|
|
float | GetAudioSample (int channel, int sample, int magnitude_range) |
| Get magnitude of range of samples (if channel is -1, return average of all channels for that sample) More...
|
|
juce::AudioSampleBuffer * | GetAudioSampleBuffer () |
|
float * | GetAudioSamples (int channel) |
| Get an array of sample data. More...
|
|
int | GetAudioSamplesCount () |
| Get number of audio samples. More...
|
|
int64_t | GetBytes () |
| Get the size in bytes of this frame (rough estimate) More...
|
|
int | GetHeight () |
| Get height of image. More...
|
|
std::shared_ptr< QImage > | GetImage () |
| Get pointer to Qt QImage image object. More...
|
|
float * | GetInterleavedAudioSamples (int new_sample_rate, AudioResampler *resampler, int *sample_count) |
| Get an array of sample data (all channels interleaved together), using any sample rate. More...
|
|
Fraction | GetPixelRatio () |
| Set Pixel Aspect Ratio. More...
|
|
const unsigned char * | GetPixels () |
| Get pixel data (as packets) More...
|
|
const unsigned char * | GetPixels (int row) |
| Get pixel data (for only a single scan-line) More...
|
|
float * | GetPlanarAudioSamples (int new_sample_rate, AudioResampler *resampler, int *sample_count) |
|
int | GetSamplesPerFrame (Fraction fps, int sample_rate, int channels) |
| Calculate the # of samples per video frame (for the current frame number) More...
|
|
std::shared_ptr< QImage > | GetWaveform (int width, int height, int Red, int Green, int Blue, int Alpha) |
| Get an audio waveform image. More...
|
|
const unsigned char * | GetWaveformPixels (int width, int height, int Red, int Green, int Blue, int Alpha) |
| Get an audio waveform image pixels. More...
|
|
int | GetWidth () |
| Get height of image. More...
|
|
void | Play () |
| Play audio samples for this frame. More...
|
|
void | ResizeAudio (int channels, int length, int sample_rate, ChannelLayout channel_layout) |
| Resize audio container to hold more (or less) samples and channels. More...
|
|
int | SampleRate () |
| Get the original sample rate of this frame's audio data. More...
|
|
void | SampleRate (int orig_sample_rate) |
| Set the original sample rate of this frame's audio data. More...
|
|
void | Save (string path, float scale, string format="PNG", int quality=100) |
| Save the frame image to the specified path. The image format can be BMP, JPG, JPEG, PNG, PPM, XBM, XPM. More...
|
|
void | SetFrameNumber (int64_t number) |
| Set frame number. More...
|
|
void | SetPixelRatio (int num, int den) |
| Set Pixel Aspect Ratio. More...
|
|
void | Thumbnail (string path, int new_width, int new_height, string mask_path, string overlay_path, string background_color, bool ignore_aspect, string format="png", int quality=100) |
|
| ~Frame () |
| Assignment operator. More...
|
|
This class represents a single frame of video (i.e. image & audio data)
FileReaders (such as FFmpegReader) use instances of this class to store the individual frames of video, which include both the image data (i.e. pixels) and audio samples. An openshot::Frame also has many debug methods, such as the ability to display the image (using X11), play the audio samples (using JUCE), or display the audio waveform as an image.
FileWriters (such as FFmpegWriter) use instances of this class to create new video files, image files, or video streams. So, think of these openshot::Frame instances as the smallest unit of work in a video editor.
There are many ways to create an instance of an openshot::Frame:
720,
480,
"#000000"
);
44100,
2
);
720,
480,
"#000000"
44100,
2
);
std::shared_ptr<Frame> f(
new Frame(1, 720, 480,
"#000000", 44100, 2));
Definition at line 115 of file Frame.h.