This website is being translated through machine translation by a third-party service. Basler does not warrant the accuracy, reliability or timeliness of any information translated by this system and will not accept liability for loss or damage incurred as a result. Content that has not yet been translated appears in English. Switch to English version
GetAoi(uint32_t topLeftX, uint32_t topLeftY, uint32_t width, uint32_t height) const Creates a new pylon image for an image area of interest (Image AOI) derived from the image.
The buffer that is automatically created by the CPylonImage class or a hosted grab result buffer are replaced by a larger buffer if required. The size of the allocated buffer is never decreased. Referenced user buffers are never automatically replaced by a larger buffer. Referenced grab result buffers are never reused. See the Reset() method for more details. The Release() method can be used to detach a user buffer, release a hosted grab result buffer or to free an allocated buffer.
Precondition: The preconditions of the Reset() method must be met.
Postcondition:
The image contains a copy of the image data contained by the source image.
Creates an invalid image if the source image is invalid.
Error Safety:
Throws an exception when no buffer with the required size could be allocated. Throws an exception when the preconditions of the Reset() method are not met.
This method is used for making a full copy of an image. Calls the Reset() method to set the same image properties as the source image and copies the image data.
newPaddingX The number of extra data bytes at the end of each row.
Precondition:
The preconditions of the Reset() method must be met.
The rows of the source image must be byte aligned. This may not be the case for packed pixel types. See Pylon::IsPacked().
The rows of the newly created image must be byte aligned. This may not be the case for packed pixel types. See Pylon::IsPacked().
Postcondition:
The image contains a copy of the image data contained by the source image.
The line padding is adjusted.
The byte aligned row padding area is set to zero.
Creates an invalid image if the source image is invalid.
Error Safety:
Throws an exception when no buffer with the required size could be allocated. Throws an exception when the preconditions of the Reset() method are not met.
This method is used for making a full copy of an image except for changing the padding. Calls the Reset() method to set the same image properties as the source image and copies the image data. This method is useful in combination with the GetAoi() method.
pBuffer The pointer to the buffer of the source image.
bufferSizeBytes The size of the buffer of the source image.
pixelType The pixel type of the source image.
width The number of pixels in a row in the source image.
height The number of rows in the source image.
paddingX The number of extra data bytes at the end of each row.
orientation The vertical orientation of the image in the image buffer.
Precondition:
The pixel type must be valid.
The width value must be >= 0 and < _I32_MAX.
The height value must be >= 0 and < _I32_MAX.
The pointer to the source buffer must not be NULL.
The source buffer must be large enough to hold the image described by the parameters.
The preconditions of the Reset() method must be met.
Postcondition: A copy of the image contained by the source image buffer is made.
Error Safety:
Throws an exception when no buffer with the required size could be allocated. Throws an exception when the preconditions of the Reset() method are not met.
This method is used for making a full copy of an image. Calls the Reset() method to set the same image properties as the source image and copies the image data.
Attaches a grab result buffer using additional hints.
Parameters:
grabResult The source buffer.
pixelType The pixel type of the source image.
width The number of pixels in a row in the source image.
height The number of rows in the source image.
paddingX The number of extra data bytes at the end of each row.
orientation The vertical orientation of the image in the image buffer.
Precondition:
The grabResult must be valid.
The pixelType must be valid.
The width value must be >= 0 and < _I32_MAX.
The height value must be >= 0 and < _I32_MAX.
Postcondition:
The image properties are taken from the width, height, pixelType, paddingX and orientation parameters.
The grab result buffer is used by the image class.
Another reference to the grab result buffer is created. This prevents the buffer's reuse for grabbing.
Error Safety:
Throws an exception if the preconditions are not met. Throws an exception if the buffer size of the grabresult is too small for an image with the given parameters.
This allows to display grabbed data in a user-defined way.
Throws an exception when no buffer with the required size could be allocated. Throws an exception when the preconditions of the Reset() method are not met.
pBuffer The pointer to the buffer of the source image. CPylonImage will never free any user buffers.
bufferSizeBytes The size of the buffer of the source image.
pixelType The pixel type of the source image.
width The number of pixels in a row in the source image.
height The number of rows in the source image.
paddingX The number of extra data bytes at the end of each row.
orientation The vertical orientation of the image in the image buffer.
pEventHandler A pointer to an optional CPylonImageUserBufferEventHandler-derived object called when the user-supplied buffer is not used anymore. You can use this to free the user-supplied buffer. In case the function throws an exception, the handler will not be called.
Precondition:
The pixel type must be valid.
The width value must be >= 0 and < _I32_MAX.
The height value must be >= 0 and < _I32_MAX.
The pointer to the source buffer must not be NULL.
The source buffer must be large enough to hold the image described by the parameters.
The buffer passed in pBuffer must not be currently attached.
Postcondition:
The image properties are taken from the parameters passed.
The user buffer is used by the image class.
The user buffer must not be freed while being attached.
Error Safety:
Throws an exception if the preconditions are not met. In this case the an optional handler passed in pEventHandler will not be called.
The stride in bytes can not be computed for packed image format when the stride is not byte aligned. See also Pylon::IsPacked(). The stride in bytes can not be computed if the image is invalid.
If required, the image is automatically converted into a new image and saved afterwards. See CImagePersistence::CanSaveWithoutConversion() for more information. An image with a bit depth higher than 8 bit is stored with 16 bit bit depth, if supported by the image file format. In this case the pixel data is MSB aligned.
If more control over the conversion is required, the CImageFormatConverter class can be used to convert the input image before saving it.
posX Horizontal position of the pixel. The first column has position 0.
posY Vertical position of the pixel. The first row has position 0.
Return: Returns the data of a pixel for supported pixel types. For unsupported pixel types pixel data of the SPixelData::PixelDataType_Unknown type is returned.
Note This method is relativly slow. Do not use it for image processing tasks.
Precondition:
The image must be valid.
The pixel position defined by posX and posY must be located inside the image area.
Error Safety:
Throws an exception, if the preconditions are not met.