Skip to content

pylon/AviWriter.h#

Contains support for writing files in the Audio Video Interleave (AVI) format.

Namespaces#

Name
Pylon
Contains definitions of pylon types.

Classes#

Name
class Pylon::AviWriterFatalException
Exception thrown if a fatal error occurs (e.g. access violations, …) when accessing an AVI video file.
class Pylon::CAviWriter
Supports writing AVI files.

Source code#

//------------------------------------------------------------------------------
//  Basler pylon SDK
//  Copyright (c) 2011-2022 Basler AG
//  http://www.baslerweb.com
//  Author:  AG
//------------------------------------------------------------------------------
#ifndef INCLUDED_AVIWRITER_H_9434931
#define INCLUDED_AVIWRITER_H_9434931

#include <pylon/Platform.h>

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

#include <pylon/stdinclude.h>
#include <pylon/PylonUtility.h>
#include <pylon/Image.h>

namespace Pylon
{
    class AviWriterFatalException : public GenericException
    {
    public:
        AviWriterFatalException( const char* pDescription, const char* pSourceFileName, int SourceLine );
        AviWriterFatalException( const char* pDescription, const char* pSourceFileName, int SourceLine, const char* pExceptionType );
        AviWriterFatalException( const char* pDescription, const char* pSourceFileName, int SourceLine, const char* pEntryPoint, const char* pErrorNodeName, const char* pExceptionType );
    };

    struct SAviCompressionOptions;

    enum EKeyFrameSelection
    {
        KeyFrameSelection_NoKeyFrame, 
        KeyFrameSelection_KeyFrame,   
        KeyFrameSelection_Auto        
    };

    class PYLONUTILITY_API CAviWriter
    {
    public:
        CAviWriter();

        virtual ~CAviWriter();


        virtual void Open(
            const String_t& filename,
            double framesPerSecondPlayback,
            EPixelType pixelType,
            uint32_t width, uint32_t height,
            EImageOrientation orientation = ImageOrientation_BottomUp,
            SAviCompressionOptions* pCompressionOptions = NULL
            );

        virtual bool IsOpen();


        virtual void Close();


        virtual void Add( const IImage& image, EKeyFrameSelection keyFrameSelection = KeyFrameSelection_Auto );


        virtual void Add( const void* pBuffer, size_t bufferSize, EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX, EImageOrientation orientation, EKeyFrameSelection keyFrameSelection = KeyFrameSelection_Auto );


        virtual bool CanAddWithoutConversion( EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX, EImageOrientation orientation );


        virtual bool CanAddWithoutConversion( const IImage& image );

        virtual size_t GetCountOfAddedImages() const;

        virtual size_t GetImageDataBytesWritten() const;

    protected:

        CLock& GetLock();


    private:
        // The object can not be copied.
        CAviWriter( const CAviWriter& );
        // The object can not be copied.
        void operator = ( const CAviWriter& );

        // Internal use only.
        class CAviWriterImpl;
        CAviWriterImpl* m_pImpl;
    };

}

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

#endif /* INCLUDED_AVIWRITER_H_9434931 */

Updated on 5 July 2022 at 15:30:01