class InferenceEngine::NV12Blob

Overview

Represents a blob that contains two planes (Y and UV) in NV12 color format. More…

#include <ie_compound_blob.h>

class NV12Blob: public InferenceEngine::CompoundBlob
{
public:
    // typedefs

    typedef std::shared_ptr<NV12Blob> Ptr;
    typedef std::shared_ptr<const NV12Blob> CPtr;

    // construction

    NV12Blob(const Blob::Ptr& y, const Blob::Ptr& uv);
    NV12Blob(Blob::Ptr&& y, Blob::Ptr&& uv);

    // methods

    virtual Blob::Ptr& y();
    virtual const Blob::Ptr& y() const;
    virtual Blob::Ptr& uv();
    virtual const Blob::Ptr& uv() const;
    virtual Blob::Ptr createROI(const ROI& roi) const;
};

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<Blob> Ptr;
    typedef std::shared_ptr<const Blob> CPtr;
    typedef std::shared_ptr<CompoundBlob> Ptr;
    typedef std::shared_ptr<const CompoundBlob> CPtr;

    // methods

    static Ptr CreateFromData(const DataPtr& data);

    template <
        typename T,
        typename std::enable_if<!std::is_pointer<T>::value&&!std::is_reference<T>::value, int>::type = 0,
        typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
        >
    bool is();

    template <
        typename T,
        typename std::enable_if<!std::is_pointer<T>::value&&!std::is_reference<T>::value, int>::type = 0,
        typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
        >
    bool is() const;

    template <
        typename T,
        typename std::enable_if<!std::is_pointer<T>::value&&!std::is_reference<T>::value, int>::type = 0,
        typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
        >
    T \* as();

    template <
        typename T,
        typename std::enable_if<!std::is_pointer<T>::value&&!std::is_reference<T>::value, int>::type = 0,
        typename std::enable_if<std::is_base_of<Blob, T>::value, int>::type = 0
        >
    const T \* as() const;

    virtual const TensorDesc& getTensorDesc() const;
    virtual TensorDesc& getTensorDesc();
    virtual size_t size() const;
    virtual size_t byteSize() const;
    virtual size_t element_size() const = 0;
    virtual void allocate() = 0;
    virtual bool deallocate() = 0;
    void setShape(const SizeVector& dims);
    virtual Blob::Ptr createROI(const ROI& roi) const;

    virtual Blob::Ptr createROI(
        const std::vector<std::size_t>& begin,
        const std::vector<std::size_t>& end
        ) const;

    virtual size_t byteSize() const;
    virtual size_t element_size() const;
    virtual void allocate();
    virtual bool deallocate();
    virtual size_t size() const;
    virtual Blob::Ptr getBlob(size_t i) const;
    virtual Blob::Ptr createROI(const ROI& roi) const;

Detailed Documentation

Represents a blob that contains two planes (Y and UV) in NV12 color format.

Typedefs

typedef std::shared_ptr<NV12Blob> Ptr

A smart pointer to the NV12Blob object.

typedef std::shared_ptr<const NV12Blob> CPtr

A smart pointer to the const NV12Blob object.

Construction

NV12Blob(const Blob::Ptr& y, const Blob::Ptr& uv)

Constructs NV12 blob from two planes Y and UV.

Parameters:

y

Blob object that represents Y plane in NV12 color format

uv

Blob object that represents UV plane in NV12 color format

NV12Blob(Blob::Ptr&& y, Blob::Ptr&& uv)

Constructs NV12 blob from two planes Y and UV.

Parameters:

y

Blob object that represents Y plane in NV12 color format

uv

Blob object that represents UV plane in NV12 color format

Methods

virtual Blob::Ptr& y()

Returns a shared pointer to Y plane.

Returns:

Y plane

virtual const Blob::Ptr& y() const

Returns a shared pointer to Y plane.

Returns:

Y plane

virtual Blob::Ptr& uv()

Returns a shared pointer to UV plane.

Returns:

UV plane

virtual const Blob::Ptr& uv() const

Returns a shared pointer to UV plane.

Returns:

UV plane

virtual Blob::Ptr createROI(const ROI& roi) const

Creates a blob describing given ROI object based on the current blob with memory sharing.

Note: default implementation throws “not implemented” exception.

Parameters:

roi

A ROI object inside of the current blob.

Returns:

A shared pointer to the newly created ROI blob.