<commit_before>/*=========================================================================

  Program:   ORFEO Toolbox
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
  See OTBCopyright.txt for details.


     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __otbGDALImageIO_h
#define __otbGDALImageIO_h


/* C++ Libraries */
#include <string>

/* ITK Libraries */
#include "otbImageIOBase.h"

namespace otb
{
class GDALDatasetWrapper;
class GDALDataTypeWrapper;

/** \class GDALImageIO
 *
 * \brief ImageIO object for reading and writing images with GDAL
 *
 * This ImageIO uses GDAL interface to read/write images. The
 * origin and spacing are translated from/to GDAL geotransform
 * matrix (even in the case of a sensor image). It means that
 * extracts from sensor images are well supported. Typical
 * sensor images in OTB have a spacing of [1,1] and an origin
 * at [0.5,0.5] (when there is no GDAL geotransform, GDAL
 * physical space is identical to GDAL index space).
 *
 * Note that the geotransform matrix supports any rotated physical
 * space whereas OTB doesn't.
 *
 * \em Warning : the index coordinate system used in GDAL is attached
 * to the corner of the top left pixel, whereas in OTB, the index
 * coordinate system is attached to the centre of the top-left
 * pixel. It means that the origin coefficents read from the
 * GDAL geotransform are the location of the top-left pixel
 * corner. This is why this location has to be shifted by
 * half a pixel to be used as an OTB origin. In a nutshell,
 * OTB images read/written by this ImageIO have the \em same
 * physical space as GDAL physical space : a given point of
 * image has the same physical location in OTB and in GDAL.
 *
 * The streaming read is implemented.
 *
 * \ingroup IOFilters
 *
 *
 * \ingroup OTBIOGDAL
 */
class ITK_EXPORT GDALImageIO : public otb::ImageIOBase
{
public:

  typedef unsigned char InputPixelType;

  /** Standard class typedefs. */
  typedef GDALImageIO             Self;
  typedef otb::ImageIOBase        Superclass;
  typedef itk::SmartPointer<Self> Pointer;

  typedef std::vector<std::string> GDALCreationOptionsType;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(GDALImageIO, otb::ImageIOBase);

  /** Set/Get the level of compression for the output images.
   *  0-9; 0 = none, 9 = maximum. */
  itkSetMacro(CompressionLevel, int);
  itkGetMacro(CompressionLevel, int);

  /** Set/Get whether the pixel type (otb side) is complex */
  itkSetMacro(IsComplex, bool);
  itkGetMacro(IsComplex, bool);

  /** Set/Get whether the pixel type (otb side) is Vector or Scalar */
  itkSetMacro(IsVectorImage, bool);
  itkGetMacro(IsVectorImage, bool);

  /** Set/Get the dataset index to extract (starting at 0)*/
  itkSetMacro(DatasetNumber, unsigned int);
  itkGetMacro(DatasetNumber, unsigned int);


  /** Set/Get the overview count of the file (0 = one full resolution)*/
  itkGetMacro(NumberOfOverviews, unsigned int);

  /** Set/Get the options */
  void SetOptions(const GDALCreationOptionsType& opts)
  {
    m_CreationOptions = opts;
  }

  GDALCreationOptionsType GetOptions(void)
  {
    return m_CreationOptions;<commit_msg>ENH: remove useless methods since use of GetOverviewCount method<commit_after>/*=========================================================================

  Program:   ORFEO Toolbox
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
  See OTBCopyright.txt for details.


     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __otbGDALImageIO_h
#define __otbGDALImageIO_h


/* C++ Libraries */
#include <string>

/* ITK Libraries */
#include "otbImageIOBase.h"

namespace otb
{
class GDALDatasetWrapper;
class GDALDataTypeWrapper;

/** \class GDALImageIO
 *
 * \brief ImageIO object for reading and writing images with GDAL
 *
 * This ImageIO uses GDAL interface to read/write images. The
 * origin and spacing are translated from/to GDAL geotransform
 * matrix (even in the case of a sensor image). It means that
 * extracts from sensor images are well supported. Typical
 * sensor images in OTB have a spacing of [1,1] and an origin
 * at [0.5,0.5] (when there is no GDAL geotransform, GDAL
 * physical space is identical to GDAL index space).
 *
 * Note that the geotransform matrix supports any rotated physical
 * space whereas OTB doesn't.
 *
 * \em Warning : the index coordinate system used in GDAL is attached
 * to the corner of the top left pixel, whereas in OTB, the index
 * coordinate system is attached to the centre of the top-left
 * pixel. It means that the origin coefficents read from the
 * GDAL geotransform are the location of the top-left pixel
 * corner. This is why this location has to be shifted by
 * half a pixel to be used as an OTB origin. In a nutshell,
 * OTB images read/written by this ImageIO have the \em same
 * physical space as GDAL physical space : a given point of
 * image has the same physical location in OTB and in GDAL.
 *
 * The streaming read is implemented.
 *
 * \ingroup IOFilters
 *
 *
 * \ingroup OTBIOGDAL
 */
class ITK_EXPORT GDALImageIO : public otb::ImageIOBase
{
public:

  typedef unsigned char InputPixelType;

  /** Standard class typedefs. */
  typedef GDALImageIO             Self;
  typedef otb::ImageIOBase        Superclass;
  typedef itk::SmartPointer<Self> Pointer;

  typedef std::vector<std::string> GDALCreationOptionsType;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(GDALImageIO, otb::ImageIOBase);

  /** Set/Get the level of compression for the output images.
   *  0-9; 0 = none, 9 = maximum. */
  itkSetMacro(CompressionLevel, int);
  itkGetMacro(CompressionLevel, int);

  /** Set/Get whether the pixel type (otb side) is complex */
  itkSetMacro(IsComplex, bool);
  itkGetMacro(IsComplex, bool);

  /** Set/Get whether the pixel type (otb side) is Vector or Scalar */
  itkSetMacro(IsVectorImage, bool);
  itkGetMacro(IsVectorImage, bool);

  /** Set/Get the dataset index to extract (starting at 0)*/
  itkSetMacro(DatasetNumber, unsigned int);
  itkGetMacro(DatasetNumber, unsigned int);

  /** Set/Get the options */
  void SetOptions(const GDALCreationOptionsType& opts)
  {
    m_CreationOptions = opts;
  }

  GDALCreationOptionsType GetOptions(void)
  {
    return m_CreationOptions;
{'fraction_non_alphanumeric': 0.11776334368822367, 'fraction_numerical': 0.003247670149675233, 'mean_word_length': 3.932451253481894, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1548795', 'n_tokens_mistral': 2104, 'n_tokens_neox': 1999, 'n_words': 805}