SqueezeBrains SDK 1.13
sb_cs::SbRoi Class Reference
C# » ROI

ROI Class that wraps the sb_t_roi structure.
You must call the Dispose() method to free all the resources of the returned instance. More...

#include <cs_roi.h>

Inheritance diagram for sb_cs::SbRoi:
Collaboration diagram for sb_cs::SbRoi:

Public Member Functions

SbRect BoundingBox ()
 Bounding box of the roi.
 
SbRgba Color ()
 Color RGBA of the roi (Not used for defects roi)
 
SbError SetData (IntPtr data)
 Sets the pointer of the ROI data into the ROI. More...
 
SbRoi Clone ()
 Clone a ROI More...
 
SbError Compress ()
 Compresses the ROI More...
 
SbError Reset ()
 Resets the ROI. The function does the following operation : More...
 
SbError SetRect (int gl, SbRect^ rect, bool reset_roi)
 Sets a rectangular ROI. More...
 
SbError SetCircle (int gl, int center_x, int center_y, int radius, bool reset_roi)
 Sets a circular ROI. More...
 
SbError SetEllipse (int gl, int center_x, int center_y, int radius_x, int radius_y, bool reset_roi)
 Sets an elliptical ROI. More...
 
SbError SetCircularCrown (int gl, int center_x, int center_y, int radius_min, int radius_max, int start_angle, int end_angle, bool reset_roi)
 Sets an angular circular crown ROI. More...
 
SbError Plot (SbImage ^img, array< unsigned char >^ lut, SbRgba color)
 Draws the roi on the image More...
 
SbError ApplyLut (array< unsigned char >^ lut)
 Apply the gray level lut to the roi image More...
 
SbImage img ()
 Image associated to the roi More...
 
- Public Member Functions inherited from sb_cs::SbCommon
SbError Error ()
 Returns the error code of the last operation. If no error SbError.SB_ERR_NONE is returned. More...
 
String ErrorMsg ()
 Returns the error message of the last operation. More...
 

Static Public Member Functions

static SbRoi Create (int width, int height)
 Creates a ROI. More...
 
static SbRoi CreateHeader (int width, int height, int width_step)
 Creates a ROI but doesn't allocate memory for the data. More...
 
- Static Public Member Functions inherited from sb_cs::SbCommon
static String FormatError (SbError error)
 Returns the error message. More...
 

Detailed Description

ROI Class that wraps the sb_t_roi structure.
You must call the Dispose() method to free all the resources of the returned instance.

Definition at line 17 of file cs_roi.h.

Member Function Documentation

◆ ApplyLut()

SbError sb_cs::SbRoi::ApplyLut ( array< unsigned char >^  lut)

Apply the gray level lut to the roi image

Parameters
lut
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_roi_apply_lut

◆ Clone()

SbRoi sb_cs::SbRoi::Clone ( )

Clone a ROI

Returns
An instance to the SbRoi class or null in case of memory error.
The instance returned is valid only if the SbRoi.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_roi_clone

◆ Compress()

SbError sb_cs::SbRoi::Compress ( )

Compresses the ROI

Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_roi_compress

◆ Create()

static SbRoi sb_cs::SbRoi::Create ( int  width,
int  height 
)
static

Creates a ROI.

Parameters
widthWidth, in pixel of the ROI.
heightHeight, in pixel of the ROI.
Returns
An instance to the SbRoi class or null in case of memory error.
The instance returned is valid only if the SbRoi.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_roi_create

◆ CreateHeader()

static SbRoi sb_cs::SbRoi::CreateHeader ( int  width,
int  height,
int  width_step 
)
static

Creates a ROI but doesn't allocate memory for the data.

Parameters
widthWidth, in pixel of the ROI.
heightHeight, in pixel of the ROI.
width_stepNumber of bytes to move the pointer to one row to the next one of the ROI
Returns
An instance to the SbRoi class or null in case of memory error.
The instance returned is valid only if the SbRoi.Error() is equal to SbError::SB_ERR_NONE, otherwise an error occurred.
You must call the Dispose() method to free all the resources of the returned instance.
See also
sb_roi_create_header

◆ img()

SbImage sb_cs::SbRoi::img ( )

Image associated to the roi

Returns

◆ Plot()

SbError sb_cs::SbRoi::Plot ( SbImage img,
array< unsigned char >^  lut,
SbRgba  color 
)

Draws the roi on the image

Parameters
img
lut
color
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_roi_plot

◆ Reset()

SbError sb_cs::SbRoi::Reset ( )

Resets the ROI. The function does the following operation :

  • resets each pixel of the roi
  • resets the bounding box to a rectangle with null dimension
  • rresets the lut
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_roi_reset

◆ SetCircle()

SbError sb_cs::SbRoi::SetCircle ( int  gl,
int  center_x,
int  center_y,
int  radius,
bool  reset_roi 
)

Sets a circular ROI.

Parameters
gl
center_x
center_y
radius
reset_roi
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_roi_set_circle

◆ SetCircularCrown()

SbError sb_cs::SbRoi::SetCircularCrown ( int  gl,
int  center_x,
int  center_y,
int  radius_min,
int  radius_max,
int  start_angle,
int  end_angle,
bool  reset_roi 
)

Sets an angular circular crown ROI.

Parameters
gl
center_x
center_y
radius_min
radius_max
start_angle
end_angle
reset_roi
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_roi_set_circular_crown

◆ SetData()

SbError sb_cs::SbRoi::SetData ( IntPtr  data)

Sets the pointer of the ROI data into the ROI.

Parameters
data
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_roi_set_data

◆ SetEllipse()

SbError sb_cs::SbRoi::SetEllipse ( int  gl,
int  center_x,
int  center_y,
int  radius_x,
int  radius_y,
bool  reset_roi 
)

Sets an elliptical ROI.

Parameters
gl
center_x
center_y
radius_x
radius_y
reset_roi
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_roi_set_ellipse

◆ SetRect()

SbError sb_cs::SbRoi::SetRect ( int  gl,
SbRect rect,
bool  reset_roi 
)

Sets a rectangular ROI.

Parameters
gl
rect
reset_roi
Returns
If successful, returns SbError.SB_ERR_NONE. Otherwise, it returns an error code SbError.
See also
sb_roi_set_rect

The documentation for this class was generated from the following file: