Skip to content

File ImageUtility.h

File List > include > ImageUtility.h

Go to the documentation of this file

//=============================================================================
// Copyright (c) 2026 FLIR Integrated Imaging Solutions, Inc. All Rights Reserved.
//
// This software is the confidential and proprietary information of FLIR
// Integrated Imaging Solutions, Inc. ("Confidential Information"). You
// shall not disclose such Confidential Information and shall use it only in
// accordance with the terms of the license agreement you entered into
// with FLIR Integrated Imaging Solutions, Inc. (FLIR).
//
// FLIR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE, OR NON-INFRINGEMENT. FLIR SHALL NOT BE LIABLE FOR ANY DAMAGES
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
// THIS SOFTWARE OR ITS DERIVATIVES.
//=============================================================================

#ifndef FLIR_SPINNAKER_IMAGE_UTILITY_H
#define FLIR_SPINNAKER_IMAGE_UTILITY_H

#include "SpinnakerPlatform.h"
#include "SpinnakerDefs.h"
#include "CameraDefs.h"

namespace Spinnaker
{
    class ImagePtr;

    class SPINNAKER_API ImageUtility
    {
      public:
        static ImagePtr CreateScaled(const ImagePtr& srcImage, ImageScalingAlgorithm scalingAlg, double scalingFactor);

        static void CreateScaled(
            const ImagePtr& srcImage,
            ImagePtr& destImage,
            ImageScalingAlgorithm scalingAlg,
            double scalingFactor);

        static ImagePtr CreateNormalized(
            const ImagePtr& srcImage,
            const PixelFormatEnums destPixelFormat,
            SourceDataRange srcDataRange = SPINNAKER_SOURCE_DATA_RANGE_IMAGE_DATA_RANGE);

        static ImagePtr CreateNormalized(
            const ImagePtr& srcImage,
            const double min,
            const double max,
            SourceDataRange srcDataRange = SPINNAKER_SOURCE_DATA_RANGE_IMAGE_DATA_RANGE);

        static ImagePtr CreateNormalized(
            const ImagePtr& srcImage,
            const double min,
            const double max,
            const PixelFormatEnums destPixelFormat,
            SourceDataRange srcDataRange = SPINNAKER_SOURCE_DATA_RANGE_IMAGE_DATA_RANGE);

        static void CreateNormalized(
            const ImagePtr& srcImage,
            ImagePtr& destImage,
            SourceDataRange srcDataRange = SPINNAKER_SOURCE_DATA_RANGE_IMAGE_DATA_RANGE);

        static void CreateNormalized(
            const ImagePtr& srcImage,
            ImagePtr& destImage,
            const double min,
            const double max,
            SourceDataRange srcDataRange = SPINNAKER_SOURCE_DATA_RANGE_IMAGE_DATA_RANGE);

        static unsigned int GetNumThreads();

        static void SetNumThreads(const unsigned int numThreads);
    };

} // namespace Spinnaker

#endif // FLIR_SPINNAKER_IMAGE_UTILITY_H