MFSM || image module
Alexandre R.J. François
Module version: 2.0
FSF code version: 0.8
ARJF © 2003-2007
contents
Description
Reference guide
Index
The Image module contains a generic image node class (CImage), and a set of type cell derived cells that provide
access to its various data members (CWidth, CHeight, CNbChannels, CPixelDepth).
One solution when designing the image node was to encapsulate an existing
image structure. Unfortunately, each image processing library comes with its
own image structure. Committing to a given library might prevent access to
other libraries, and prove restrictive in the long term. The image node
defined in the Image Module provides a minimum representation to ensure its
compatibility with existing image structures (in particular that used in the
Intel OpenCV). However the image node does contain any field specific of
particular image formats, to ensure the widest compatibility. When needed,
more specific image nodes may be derived from this base image node for
leveraging specific library features. Because of inheritance properties, these
specialized image nodes will be usable with all processes defined for the base
image node.
Image module elements are defined in the image namespace. This
section lists all the elements defined in the Image module, in alphabetical
order.
CHeight (fsf::CTypeCellBase) "IMAGE_HEIGHT"
| Active filter | [IMAGE_IMAGE "*"]* |
| Passive filter | [IMAGE_IMAGE "*"] |
| Output | (x (FSF_INT32_NODE "Output")) -- GET only |
Image height access cell.
Member functions
Constructors, destructor and other functions that are part of any derived cell class
- CHeight() : default constructor
- virtual void GetTypeID(std::string &str) : factory mapping key; must be overloaded in any derived cell
Active stream processing
- virtual void Process(fsf::CPassiveHandle *pPassiveHandle, fsf::CActiveHandle *pActiveHandle, fsf::CActivePulse *pActivePulse): specialized processing function
CImage (fsf::CCharBuffer) "IMAGE_IMAGE"
Image node.
Data members
- int m_nNbChannels : number of channels
- int m_nDepth : pixel depth, one of IMAGE_DEPTH_??? . Also indicates if image is floating point.
- int m_nWidth : image width
- int m_nHeight : image height
- int m_nWidthStep : aligned width (in bytes)
Member functions
Constructors, destructor and other functions that are part of any derived node class
- CImage() : default constructor
- CImage(CNode *pParent, fsf::Time tTime=0) : initialization constructor
- CImage(const std::string &strName, CNode *pParent=NULL, fsf::Time tTime=0) : initialization constructor
- CImage(int nWidth, int nHeight, int nNbChannels=3, int nDepth=IMAGE_DEPTH_8U, fsf::CNode *pParent=NULL, fsf::Time tTime=0) : initialization constructor
- CImage(const std::string &strName, int nWidth, int nHeight, int nNbChannels=3, int nDepth=IMAGE_DEPTH_8U, fsf::CNode *pParent=NULL, fsf::Time tTime=0) : initialization constructor
- CImage(const CImage&) : copy constructor
- CImage& operator=(const CImage&) : assignment operator
- virtual CNode* Clone() : virtual cloning member function (necessary for run-time polymorphism)
- virtual void GetTypeID(std::string &str) : factory mapping key
Memory allocation
- int ComputeWidthStep(bool bNoAlign=false) : utility private member used to compute aligned width length (m_nWidthStep) from non aligned width value
- virtual void Allocate(bool bNoAlign=false) : allocate data buffer, with or without word alignment; buffer values are not set
Data copy
- void CopyParameters(const CImage&) : copy parameter values from argument
- void CopyImageData(const CImage&) : copy image buffer values from argument
Image parameters access
- int Width() : return image width
- int Height() : return image height
- int NbChannels() : return image number of channels
- int PixelDepth() : return image pixel depth
- int WidthStep() : return image width step
Image parameters setting
- void SetWidth(int nWidth) : set image width (does not affect buffer)
- void SetHeight(int nHeight) : set image height (does not affect buffer)
- void SetNbChannels(int nNbChannels) : set image number of channels (does not affect buffer)
- void SetPixelDepth(int nDepth) : set image pixel depth (does not affect buffer)
- void SetWidthStep(int nWidthStep) : set image aligned width (does not affect buffer)
Drawing utilities
- void DrawPoint(int x, int y, const unsigned char *col) : set pixel value
- void DrawLine(int xo, int yo, int xd, int yd, const unsigned char *col) :
draw straight line
- void DrawRectangle(int x, int y, int w, int h, const unsigned char *col) :
draw rectangle (contours)
- void FillRectangle(int x, int y, int w, int h, const unsigned char *col) :
draw a filled rectangle
CNbChannels (fsf::CTypeCellBase) "IMAGE_NB_CHANNELS"
| Active filter | [IMAGE_IMAGE "*"]* |
| Passive filter | [IMAGE_IMAGE "*"] |
| Output | (x (FSF_INT32_NODE "Output")) -- GET only |
Image number of channels access cell.
Member functions
Constructors, destructor and other functions that are part of any derived cell class
- CNbChannels() : default constructor
- virtual void GetTypeID(std::string &str) : factory mapping key; must be overloaded in any derived cell
Active stream processing
- virtual void Process(fsf::CPassiveHandle *pPassiveHandle, fsf::CActiveHandle *pActiveHandle, fsf::CActivePulse *pActivePulse): specialized processing function
CPixelDepth (fsf::CTypeCellBase) "IMAGE_PIXEL_DEPTH"
| Active filter | [IMAGE_IMAGE "*"]* |
| Passive filter | [IMAGE_IMAGE "*"] |
| Output | (x (FSF_INT32_NODE "Output")) -- GET only |
Image pixel depth access cell.
Member functions
Constructors, destructor and other functions that are part of any derived cell class
- CPixelDepth() : default constructor
- virtual void GetTypeID(std::string &str) : factory mapping key; must be overloaded in any derived cell
Active stream processing
- virtual void Process(fsf::CPassiveHandle *pPassiveHandle, fsf::CActiveHandle *pActiveHandle, fsf::CActivePulse *pActivePulse): specialized processing function
CWidth (fsf::CTypeCellBase) "IMAGE_WIDTH"
| Active filter | [IMAGE_IMAGE "*"]* |
| Passive filter | [IMAGE_IMAGE "*"] |
| Output | (x (FSF_INT32_NODE "Output")) -- GET only |
Image width access cell.
Member functions
Constructors, destructor and other functions that are part of any derived cell class
- CWidth() : default constructor
- virtual void GetTypeID(std::string &str) : factory mapping key; must be overloaded in any derived cell
Active stream processing
- virtual void Process(fsf::CPassiveHandle *pPassiveHandle, fsf::CActiveHandle *pActiveHandle, fsf::CActivePulse *pActivePulse): specialized processing function
Registers the factories for the nodes and cells defined in the module, with the unique system instance.
C
R