nx_server_plugin_sdk 1.0 Server Plugin SDK

motion_data_picture.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <stdint.h>
6
7 #include <camera/camera_plugin.h>
8 #include <plugins/plugin_tools.h>
9
10 class MotionDataPicture
11 :
12 public nxcip::Picture
13 {
14 public:
15 MotionDataPicture();
16 virtual ~MotionDataPicture();
17
19 virtual void* queryInterface( const nxpl::NX_GUID& interfaceID ) override;
21 virtual int addRef() const override;
23 virtual int releaseRef() const override;
24
26 virtual nxcip::PixelFormat pixelFormat() const override;
27 virtual int planeCount() const override;
29 virtual int width() const override;
31 virtual int height() const override;
33 virtual int xStride( int planeNumber ) const override;
35 virtual const void* scanLine( int planeNumber, int lineNumber ) const override;
36 virtual void* scanLine( int planeNumber, int lineNumber ) override;
41 virtual void* data() override;
42 virtual const void* data() const override;
43
44 void setPixel( int x, int y, int val );
45 void fillRect( int x, int y, int width, int height, int val );
46
47 private:
48 nxpt::CommonRefManager m_refManager;
49 uint8_t* m_data;
50 size_t m_width;
51 size_t m_height;
52 size_t m_stride;
53 };
MotionDataPicture::width
virtual int width() const override
Width (pixels)
Definition: motion_data_picture.cpp:68
MotionDataPicture
Definition: motion_data_picture.h:10
MotionDataPicture::pixelFormat
virtual nxcip::PixelFormat pixelFormat() const override
Returns pixel format.
Definition: motion_data_picture.cpp:57
MotionDataPicture::planeCount
virtual int planeCount() const override
Returns number of planes in picture (this depends on format)
Definition: motion_data_picture.cpp:62
MotionDataPicture::releaseRef
virtual int releaseRef() const override
Implementation of nxpl::PluginInterface::releaseRef.
Definition: motion_data_picture.cpp:51
nxpl::NX_GUID
GUID of plugin interface.
Definition: plugin_api.h:26
nxcip::Picture
Picture.
Definition: camera_plugin.h:654
nxpt::CommonRefManager
Definition: plugin_tools.h:67
MotionDataPicture::xStride
virtual int xStride(int planeNumber) const override
Length of horizontal line in bytes.
Definition: motion_data_picture.cpp:80
plugin_tools.h
MotionDataPicture::queryInterface
virtual void * queryInterface(const nxpl::NX_GUID &interfaceID) override
Implementation of nxpl::PluginInterface::queryInterface.
Definition: motion_data_picture.cpp:29
MotionDataPicture::scanLine
virtual const void * scanLine(int planeNumber, int lineNumber) const override
Returns pointer to horizontal line lineNumber (starting with 0)
Definition: motion_data_picture.cpp:86
MotionDataPicture::addRef
virtual int addRef() const override
Implementation of nxpl::PluginInterface::addRef.
Definition: motion_data_picture.cpp:45
MotionDataPicture::data
virtual void * data() override
Definition: motion_data_picture.cpp:105
nxcip::PixelFormat
PixelFormat
Definition: camera_plugin_types.h:39
MotionDataPicture::height
virtual int height() const override
Height (pixels)
Definition: motion_data_picture.cpp:74