Skip to content

pylon/Image.h#

Contains an interface for an image.

Namespaces#

Name
Pylon
Contains definitions of pylon types.

Classes#

Name
interface Pylon::IImage
Usable to access image properties and image buffer.

Source code#

//------------------------------------------------------------------------------
//  Basler pylon SDK
//  Copyright (c) 2010-2022 Basler AG
//  http://www.baslerweb.com
//  Author:  Andreas Gau
//------------------------------------------------------------------------------
#ifndef INCLUDED_IMAGE_H_9730799
#define INCLUDED_IMAGE_H_9730799

#include <pylon/Platform.h>

#ifdef _MSC_VER
#   pragma pack(push, PYLON_PACKING)
#endif /* _MSC_VER */

#include <pylon/PylonBase.h>
#include <pylon/PixelType.h>

namespace Pylon
{
    enum EImageOrientation
    {
        ImageOrientation_TopDown, 
        ImageOrientation_BottomUp 
    };

    interface IImage
    {
    public:
        // Do not add implemenation here in class as older compilers doesn't accept in-class definitions (see definition below)
        virtual ~IImage() = 0;

        //
        virtual bool IsValid() const = 0;


        virtual EPixelType GetPixelType() const = 0;


        virtual uint32_t GetWidth() const = 0;


        virtual uint32_t GetHeight() const = 0;


        virtual size_t GetPaddingX() const = 0;


        virtual EImageOrientation GetOrientation() const = 0;


        virtual void* GetBuffer() = 0;


        virtual const void* GetBuffer() const = 0;


        virtual size_t GetImageSize() const = 0;


        virtual bool IsUnique() const = 0;


        virtual bool GetStride( size_t& strideBytes ) const = 0;
    };

    // Implementation required for Windows only.
    // Note: the C++ standard >= 11 prohibit pure virtual destructors with a function body
    // in the declaration. Consequently gcc 4.0 and newer reject an inline implementation
    // in the class.
    inline IImage::~IImage()
    {
    }
}

#ifdef _MSC_VER
#   pragma pack(pop)
#endif /* _MSC_VER */

#endif /* INCLUDED_IMAGE_H_9730799 */

Updated on 5 July 2022 at 15:30:01