RGBFrame.h
Go to the documentation of this file.
1 // Copyright (c) 2016 Digital Barriers
4 
31 #pragma once
32 
33 #include "VideoData.h"
34 #include "RGBFormats.h"
35 #include "EdgeVisSDK.h"
36 #include "AspectRatios.h"
37 #include "YCbCrFrame.h"
38 #include "Pimpl.h"
39 
40 namespace EdgeVisDecoderSDK
41 {
42  class RGBFrameImpl;
43 
44  class RGBFrame : public VideoData
45  {
46  public:
47 
51  DB_EDGEVIS_SDK RGBFrame();
52  RGBFrame(std::weak_ptr<RGBFrameImpl> pimpl);
53  DB_EDGEVIS_SDK RGBFrame(StreamData data);
54 
55  DB_EDGEVIS_SDK virtual ~RGBFrame();
56 
72  DB_EDGEVIS_SDK bool Convert(YCbCrFrame & yCbCrFrame, RGBFormat format, bool correctAspect);
73 
79  DB_EDGEVIS_SDK int32_t GetBytesPerPel() const;
80 
86  DB_EDGEVIS_SDK RGBFormat GetFormat() const;
87 
95  void SetHeaderSize(int32_t header_size);
96 
103  DB_EDGEVIS_SDK int32_t GetHeaderSize() const;
104 
105  void SetFlipVertical(bool flip);
106  DB_EDGEVIS_SDK bool GetFlipVertical() const;
107 
108  void SetFlipHorizontal(bool flip);
109  DB_EDGEVIS_SDK bool GetFlipHorizontal() const;
110 
119  DB_EDGEVIS_SDK int64_t GetTimeStamp() const;
120 
121  void SetTimeStamp(int64_t ts);
122 
129  DB_EDGEVIS_SDK byte_array GetBytes() const;
130 
136  DB_EDGEVIS_SDK byte_array GetPixelBytes() const;
137 
143  DB_EDGEVIS_SDK void Save(const std::string &path) const;
144  };
145 }
DB_EDGEVIS_SDK bool Convert(YCbCrFrame &yCbCrFrame, RGBFormat format, bool correctAspect)
Converts the supplied planar YCbCr frame to an RGBFrame which will be stored in this object...
DB_EDGEVIS_SDK int32_t GetBytesPerPel() const
Get the number of bytes per pixel.
DB_EDGEVIS_SDK void Save(const std::string &path) const
Save the RGB image to a bmp file location.
An YCbCrFrame is delivered for every frame of video decoded from a media stream.
Definition: YCbCrFrame.h:39
DB_EDGEVIS_SDK RGBFrame()
Creates an empty RGBFrame.
An RGBFrame is designed for transforming YCbCr colour space frames into RGB colour space frames...
Definition: RGBFrame.h:44
RGBFormat
RGB formats supported by the RGBFrame Convert method.
Definition: RGBFormats.h:22
DB_EDGEVIS_SDK byte_array GetPixelBytes() const
Get a pointer to the byte array representing the RGBFrame pixels.
DB_EDGEVIS_SDK RGBFormat GetFormat() const
Get the RGB format for this RGB frame.
The VideoData class extends the StreamData class and is a base class for all types of video data prov...
Definition: VideoData.h:35
This is the base class for the StreamData objects.
Definition: StreamData.h:27
DB_EDGEVIS_SDK byte_array GetBytes() const
Get a pointer to the byte array representing the entire RGBFrame, including the header.
DB_EDGEVIS_SDK int64_t GetTimeStamp() const
Gets the frame&#39;s time stamp.
The EdgeVis Decoder SDK namespace.
DB_EDGEVIS_SDK int32_t GetHeaderSize() const
Get the value that has been set for this frame&#39;s header size, the default value is 0...
void SetHeaderSize(int32_t header_size)
Set the header size that will be allocated before the rgb frame, this allows platform specific users ...