//------------------------------------------------------------------------------ // Basler pylon SDK // Copyright (c) 2010-2021 Basler AG // http://www.baslerweb.com // Author: Andreas Gau //------------------------------------------------------------------------------ /*! \file \brief Contains the pylon image base class. */ #ifndef INCLUDED_PYLONIMAGEBASE_H_6835095 #define INCLUDED_PYLONIMAGEBASE_H_6835095 #include #ifdef _MSC_VER # pragma pack(push, PYLON_PACKING) #endif /* _MSC_VER */ #include #include #include #include #include namespace Pylon { /** \addtogroup Pylon_ImageHandlingSupport * @{ */ /*! \class CPylonImageBase \brief Provides basic functionality for pylon image classes. */ class PYLONUTILITY_API CPylonImageBase : public IReusableImage { public: /*! \brief Saves the image to disk. Converts the image to a format that can be saved if required. This is a convenience method that calls CImagePersistence::Save(). 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. \param[in] imageFileFormat File format to save the image in. \param[in] filename Name and path of the image. \param[in] pOptions Additional options. \pre The pixel type of the image to be saved must be a supported input format of the Pylon::CImageFormatConverter. \error Throws an exception if the saving of the image fails. */ virtual void Save( EImageFileFormat imageFileFormat, const String_t& filename, CImagePersistenceOptions* pOptions = NULL ) const; /*! \brief Loads an image from a disk. This is a convenience method that calls CImagePersistence::Load() \param[in] filename Name and path of the image. \pre The image object must be able to hold the image format of the loaded image. \error Throws an exception if the image cannot be loaded. The image buffer content is undefined when the loading of the image fails. */ virtual void Load( const String_t& filename ); /*! \brief Can be used to check whether the image can be saved without prior conversion. This is a convenience method that calls CImagePersistence::CanSaveWithoutConversion(). \param[in] imageFileFormat Target file format for the image to be saved. \return Returns true, if the image can be saved without prior conversion. \error Does not throw C++ exceptions. */ virtual bool CanSaveWithoutConversion( EImageFileFormat imageFileFormat ) const; /*! \brief Retrieves the data of a pixel. \note This method is relativly slow. Do not use it for image processing tasks. \param[in] posX Horizontal position of the pixel. The first column has position 0. \param[in] 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. \pre
  • The image must be valid.
  • The pixel position defined by \c posX and \c posY must be located inside the image area.
Supported pixel types:
  • PixelType_Mono1packed
  • PixelType_Mono2packed
  • PixelType_Mono4packed
  • PixelType_Mono8
  • PixelType_Mono8signed
  • PixelType_Mono10
  • PixelType_Mono10packed
  • PixelType_Mono10p
  • PixelType_Mono12
  • PixelType_Mono12packed
  • PixelType_Mono12p
  • PixelType_Mono16
  • PixelType_BayerGR8
  • PixelType_BayerRG8
  • PixelType_BayerGB8
  • PixelType_BayerBG8
  • PixelType_BayerGR10
  • PixelType_BayerRG10
  • PixelType_BayerGB10
  • PixelType_BayerBG10
  • PixelType_BayerGR12
  • PixelType_BayerRG12
  • PixelType_BayerGB12
  • PixelType_BayerBG12
  • PixelType_BayerGR12Packed
  • PixelType_BayerRG12Packed
  • PixelType_BayerGB12Packed
  • PixelType_BayerBG12Packed
  • PixelType_BayerGR10p
  • PixelType_BayerRG10p
  • PixelType_BayerGB10p
  • PixelType_BayerBG10p
  • PixelType_BayerGR12p
  • PixelType_BayerRG12p
  • PixelType_BayerGB12p
  • PixelType_BayerBG12p
  • PixelType_BayerGR16
  • PixelType_BayerRG16
  • PixelType_BayerGB16
  • PixelType_BayerBG16
  • PixelType_RGB8packed
  • PixelType_BGR8packed
  • PixelType_RGBA8packed
  • PixelType_BGRA8packed
  • PixelType_RGB10packed
  • PixelType_BGR10packed
  • PixelType_RGB12packed
  • PixelType_BGR12packed
  • PixelType_RGB12V1packed
  • PixelType_RGB16packed
  • PixelType_RGB8planar
  • PixelType_RGB10planar
  • PixelType_RGB12planar
  • PixelType_RGB16planar
  • PixelType_YUV422packed
  • PixelType_YUV422_YUYV_Packed
\error Throws an exception, if the preconditions are not met. */ virtual SPixelData GetPixelData( uint32_t posX, uint32_t posY ) const; }; /** * @} */ } #ifdef _MSC_VER # pragma pack(pop) #endif /* _MSC_VER */ #endif /* INCLUDED_PYLONIMAGEBASE_H_6835095 */