HALCON Class Reference
Contains functions for using data ic4::ImageBuffer objects in MVTec HALCON. More...
Static Public Member Functions
| static HalconCpp::HImage |
Wraps the passed image buffer in an HALCON |
| static bool |
Checks whether wrap can work on the passed image buffer. |
| static HalconCpp::HImage |
Creates a copy of the image buffer and stores it in a HALCON |
| static std::shared_ptr< ic4::ImageBuffer > |
Copies the contents of a HALCON |
| static std::shared_ptr< ic4::ImageBuffer > |
Copies the contents of a HALCON |
| static bool |
Copies the contents of a HALCON |
Detailed Description
Contains functions for using data ic4::ImageBuffer objects in MVTec HALCON.
The HALCON interop support functions are declared in ic4interop/interop-HALCON.h.
Member Function Documentation
◆ canWrap()
|
inlinestatic |
Checks whether wrap can work on the passed image buffer.
- Parameters
-
[in] buffer An image buffer
- Returns
true, if the contents of the image buffer can be wrapped in a HALCONHImage, otherwisefalse.
- Remarks
- Wrapping image buffer data is only supported for
Mono8andMono16image buffers that do not have horizontal padding.
◆ copy() [1/4]
|
inlinestatic |
Copies the contents of a HALCON HImage into a new ic4::ImageBuffer.
- Parameters
-
[in] src A HALCON HImage[out] err Reference to an error handler. See Error Handling for details.
- Returns
- A new image buffer. If the function fails,
nullptris returned.
- Remarks
- The resulting image buffer's pixel format depends on the type of src:
- If src is a 1-channel image of type
byte, the pixel format for the returned image buffer is ic4::PixelFormat::Mono8. - If src is a 1-channel image of type
uint2, the pixel format for the returned image buffer is ic4::PixelFormat::Mono16. - If src is a 3-channel image of type
byte, the pixel format for the returned image buffer is ic4::PixelFormat::BGRa8. - If src is a 3-channel image of type
uint2, the pixel format for the returned image buffer is ic4::PixelFormat::BGRa16. - Other image types are not supported.
- If src is a 1-channel image of type
◆ copy() [2/4]
|
inlinestatic |
Copies the contents of a HALCON HImage into an ic4::ImageBuffer.
- Parameters
-
[in] src A HALCON HImage[out] dest A destination buffer to receive the image data [out] err Reference to an error handler. See Error Handling for details.
- Returns
trueon success, otherwisefalse.
- Remarks
- The image type of dest needs to match the dimensions and type of src.
- If src is a 1-channel image of type
byte, dest must be ic4::PixelFormat::Mono8 of the same size. - If src is a 1-channel image of type
uint2, dest must be ic4::PixelFormat::Mono16 of the same size. - If src is a 3-channel image of type
byte, dest must be ic4::PixelFormat::BGRa8 of the same size. - If src is a 3-channel image of type
uint2, dest must be ic4::PixelFormat::BGRa16 of the same size. - Other image types are not supported.
- If src is a 1-channel image of type
◆ copy() [3/4]
|
inlinestatic |
Copies the contents of a HALCON HImage into a new ic4::ImageBuffer.
- Parameters
-
[in] src A HALCON HImage[in] pool A buffer pool to query the new image buffer from [out] err Reference to an error handler. See Error Handling for details.
- Returns
- A new image buffer. If the function fails,
nullptris returned.
- Remarks
- The resulting image buffer's pixel format depends on the type of src:
- If src is a 1-channel image of type
byte, the pixel format for the returned image buffer is ic4::PixelFormat::Mono8. - If src is a 1-channel image of type
uint2, the pixel format for the returned image buffer is ic4::PixelFormat::Mono16. - If src is a 3-channel image of type
byte, the pixel format for the returned image buffer is ic4::PixelFormat::BGRa8. - If src is a 3-channel image of type
uint2, the pixel format for the returned image buffer is ic4::PixelFormat::BGRa16. - Other image types are not supported.
- If src is a 1-channel image of type
◆ copy() [4/4]
|
inlinestatic |
Creates a copy of the image buffer and stores it in a HALCON HImage.
- Parameters
-
[in] buffer An image buffer [out] err Reference to an error handler. See Error Handling for details.
- Returns
- A HALCON
HImagecontaining a copy of the image data from the passed image buffer.
◆ wrap()
|
inlinestatic |
Wraps the passed image buffer in an HALCON HImage.
- Parameters
-
[in] buffer An image buffer [out] err Reference to an error handler. See Error Handling for details.
- Returns
- A HALCON
HImageusing the image buffer's memory as pixel storage
- Remarks
- Wrapping image buffer data is only supported for
Mono8andMono16image buffers that do not have horizontal padding.
The program has to make sure that the image buffer is not released/requeued while the returned HImage is in use.


