PCL
PixelInterpolation.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.7.0
6 // ----------------------------------------------------------------------------
7 // pcl/PixelInterpolation.h - Released 2024-06-18T15:48:54Z
8 // ----------------------------------------------------------------------------
9 // This file is part of the PixInsight Class Library (PCL).
10 // PCL is a multiplatform C++ framework for development of PixInsight modules.
11 //
12 // Copyright (c) 2003-2024 Pleiades Astrophoto S.L. All Rights Reserved.
13 //
14 // Redistribution and use in both source and binary forms, with or without
15 // modification, is permitted provided that the following conditions are met:
16 //
17 // 1. All redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //
20 // 2. All redistributions in binary form must reproduce the above copyright
21 // notice, this list of conditions and the following disclaimer in the
22 // documentation and/or other materials provided with the distribution.
23 //
24 // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25 // of their contributors, may be used to endorse or promote products derived
26 // from this software without specific prior written permission. For written
27 // permission, please contact info@pixinsight.com.
28 //
29 // 4. All products derived from this software, in any form whatsoever, must
30 // reproduce the following acknowledgment in the end-user documentation
31 // and/or other materials provided with the product:
32 //
33 // "This product is based on software from the PixInsight project, developed
34 // by Pleiades Astrophoto and its contributors (https://pixinsight.com/)."
35 //
36 // Alternatively, if that is where third-party acknowledgments normally
37 // appear, this acknowledgment must be reproduced in the product itself.
38 //
39 // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45 // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46 // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 // POSSIBILITY OF SUCH DAMAGE.
50 // ----------------------------------------------------------------------------
51 
52 #ifndef __PCL_PixelInterpolation_h
53 #define __PCL_PixelInterpolation_h
54 
56 
57 #include <pcl/Defs.h>
58 #include <pcl/Diagnostics.h>
59 
60 #include <pcl/AutoPointer.h>
64 #include <pcl/Exception.h>
67 #include <pcl/PixelTraits.h>
68 #include <pcl/Point.h>
69 #include <pcl/String.h>
70 
71 #ifdef _MSC_VER
72 # pragma warning( push )
73 # pragma warning( disable : 4267 ) // conversion from 'size_t' to ...
74 #endif
75 
76 namespace pcl
77 {
78 
79 // ----------------------------------------------------------------------------
80 
97 class PCL_CLASS PixelInterpolation
98 {
99 public:
100 
108  template <class P>
109  class PCL_CLASS Interpolator
110  {
111  public:
112 
116  using sample = typename P::sample;
117 
147  const sample* data, int width, int height, bool unclipped = false )
148  : m_interpolation( interpolation )
149  , m_unclipped( unclipped )
150  {
151  if ( !m_interpolation.IsNull() )
152  m_interpolation->Initialize( data, width, height );
153  }
154 
158  Interpolator( const Interpolator& ) = delete;
159 
163  Interpolator( Interpolator&& ) = default;
164 
169  virtual ~Interpolator()
170  {
171  }
172 
178  {
179  PCL_PRECONDITION( !m_interpolation.IsNull() )
180  return *m_interpolation;
181  }
182 
188  {
189  PCL_PRECONDITION( !m_interpolation.IsNull() )
190  return *m_interpolation;
191  }
192 
204  sample operator()( double x, double y ) const
205  {
206  PCL_PRECONDITION( !m_interpolation.IsNull() )
207  double r = (*m_interpolation)( x, y );
208  if ( !m_unclipped )
209  {
210  if ( r > P::MaxSampleValue() )
211  return P::MaxSampleValue();
212  if ( r < P::MinSampleValue() )
213  return P::MinSampleValue();
214  }
215  return P::FloatToSample( r );
216  }
217 
224  template <typename T>
226  {
227  return operator()( p.x, p.y );
228  }
229 
230  private:
231 
233  bool m_unclipped;
234  };
235 
236  // -------------------------------------------------------------------------
237 
241  PixelInterpolation() = default;
242 
247 
252  {
253  }
254 
258  virtual String Description() const = 0;
259 
270  virtual bool IsThreadSafe() const
271  {
272  return true;
273  }
274 
287  template <class P, class T>
288  Interpolator<P>* NewInterpolator( const T* data, int width, int height, bool unclipped = false ) const
289  {
290  return new Interpolator<P>( NewInterpolation( data ), data, width, height, unclipped );
291  }
292 
293 protected:
294 
296  NewInterpolation( const FloatPixelTraits::sample* ) const
297  {
298  throw NotImplemented( *this, "Interpolate 32-bit floating point images" );
299  }
300 
301  virtual BidimensionalInterpolation<DoublePixelTraits::sample>*
302  NewInterpolation( const DoublePixelTraits::sample* ) const
303  {
304  throw NotImplemented( *this, "Interpolate 64-bit floating point images" );
305  }
306 
307  virtual BidimensionalInterpolation<ComplexPixelTraits::sample>*
308  NewInterpolation( const ComplexPixelTraits::sample* ) const
309  {
310  throw NotImplemented( *this, "Interpolate 32-bit complex images" );
311  }
312 
313  virtual BidimensionalInterpolation<DComplexPixelTraits::sample>*
314  NewInterpolation( const DComplexPixelTraits::sample* ) const
315  {
316  throw NotImplemented( *this, "Interpolate 64-bit complex images" );
317  }
318 
319  virtual BidimensionalInterpolation<UInt8PixelTraits::sample>*
320  NewInterpolation( const UInt8PixelTraits::sample* ) const
321  {
322  throw NotImplemented( *this, "Interpolate 8-bit integer images" );
323  }
324 
325  virtual BidimensionalInterpolation<UInt16PixelTraits::sample>*
326  NewInterpolation( const UInt16PixelTraits::sample* ) const
327  {
328  throw NotImplemented( *this, "Interpolate 16-bit integer images" );
329  }
330 
331  virtual BidimensionalInterpolation<UInt32PixelTraits::sample>*
332  NewInterpolation( const UInt32PixelTraits::sample* ) const
333  {
334  throw NotImplemented( *this, "Interpolate 32-bit integer images" );
335  }
336 };
337 
338 // ----------------------------------------------------------------------------
339 
353 {
354 public:
355 
360 
365 
368  String Description() const override
369  {
370  return "Nearest neighbor interpolation";
371  }
372 
373 private:
374 
376  NewInterpolation( const FloatPixelTraits::sample* ) const override
377  {
379  }
380 
381  BidimensionalInterpolation<DoublePixelTraits::sample>*
382  NewInterpolation( const DoublePixelTraits::sample* ) const override
383  {
384  return new NearestNeighborInterpolation<DoublePixelTraits::sample>;
385  }
386 
387  BidimensionalInterpolation<UInt8PixelTraits::sample>*
388  NewInterpolation( const UInt8PixelTraits::sample* ) const override
389  {
390  return new NearestNeighborInterpolation<UInt8PixelTraits::sample>;
391  }
392 
393  BidimensionalInterpolation<UInt16PixelTraits::sample>*
394  NewInterpolation( const UInt16PixelTraits::sample* ) const override
395  {
396  return new NearestNeighborInterpolation<UInt16PixelTraits::sample>;
397  }
398 
399  BidimensionalInterpolation<UInt32PixelTraits::sample>*
400  NewInterpolation( const UInt32PixelTraits::sample* ) const override
401  {
402  return new NearestNeighborInterpolation<UInt32PixelTraits::sample>;
403  }
404 };
405 
406 // ----------------------------------------------------------------------------
407 
421 {
422 public:
423 
428 
433 
436  String Description() const override
437  {
438  return "Bilinear interpolation";
439  }
440 
441 private:
442 
444  NewInterpolation( const FloatPixelTraits::sample* ) const override
445  {
447  }
448 
449  BidimensionalInterpolation<DoublePixelTraits::sample>*
450  NewInterpolation( const DoublePixelTraits::sample* ) const override
451  {
452  return new BilinearInterpolation<DoublePixelTraits::sample>;
453  }
454 
455  BidimensionalInterpolation<UInt8PixelTraits::sample>*
456  NewInterpolation( const UInt8PixelTraits::sample* ) const override
457  {
458  return new BilinearInterpolation<UInt8PixelTraits::sample>;
459  }
460 
461  BidimensionalInterpolation<UInt16PixelTraits::sample>*
462  NewInterpolation( const UInt16PixelTraits::sample* ) const override
463  {
464  return new BilinearInterpolation<UInt16PixelTraits::sample>;
465  }
466 
467  BidimensionalInterpolation<UInt32PixelTraits::sample>*
468  NewInterpolation( const UInt32PixelTraits::sample* ) const override
469  {
470  return new BilinearInterpolation<UInt32PixelTraits::sample>;
471  }
472 };
473 
474 // ----------------------------------------------------------------------------
475 
489 {
490 public:
491 
500  BicubicSplinePixelInterpolation( double clamp = __PCL_BICUBIC_SPLINE_CLAMPING_THRESHOLD )
501  : m_clamp( clamp )
502  {
503  }
504 
509 
512  String Description() const override
513  {
514  return String().Format( "Bicubic spline interpolation, c=%.2f", m_clamp );
515  }
516 
517 private:
518 
519  float m_clamp;
520 
522  NewInterpolation( const FloatPixelTraits::sample* ) const override
523  {
525  }
526 
527  BidimensionalInterpolation<DoublePixelTraits::sample>*
528  NewInterpolation( const DoublePixelTraits::sample* ) const override
529  {
530  return new BicubicSplineInterpolation<DoublePixelTraits::sample>( m_clamp );
531  }
532 
533  BidimensionalInterpolation<UInt8PixelTraits::sample>*
534  NewInterpolation( const UInt8PixelTraits::sample* ) const override
535  {
536  return new BicubicSplineInterpolation<UInt8PixelTraits::sample>( m_clamp );
537  }
538 
539  BidimensionalInterpolation<UInt16PixelTraits::sample>*
540  NewInterpolation( const UInt16PixelTraits::sample* ) const override
541  {
542  return new BicubicSplineInterpolation<UInt16PixelTraits::sample>( m_clamp );
543  }
544 
545  BidimensionalInterpolation<UInt32PixelTraits::sample>*
546  NewInterpolation( const UInt32PixelTraits::sample* ) const override
547  {
548  return new BicubicSplineInterpolation<UInt32PixelTraits::sample>( m_clamp );
549  }
550 };
551 
562 {
563 public:
564 
573  BicubicPixelInterpolation( double c = __PCL_BICUBIC_SPLINE_CLAMPING_THRESHOLD )
575  {
576  }
577 
582 };
583 
584 // ----------------------------------------------------------------------------
585 
599 {
600 public:
601 
606 
611 
614  String Description() const override
615  {
616  return "Bicubic B-spline interpolation";
617  }
618 
619 private:
620 
622  NewInterpolation( const FloatPixelTraits::sample* ) const override
623  {
625  }
626 
627  BidimensionalInterpolation<DoublePixelTraits::sample>*
628  NewInterpolation( const DoublePixelTraits::sample* ) const override
629  {
630  return new BicubicBSplineInterpolation<DoublePixelTraits::sample>;
631  }
632 
633  BidimensionalInterpolation<UInt8PixelTraits::sample>*
634  NewInterpolation( const UInt8PixelTraits::sample* ) const override
635  {
636  return new BicubicBSplineInterpolation<UInt8PixelTraits::sample>;
637  }
638 
639  BidimensionalInterpolation<UInt16PixelTraits::sample>*
640  NewInterpolation( const UInt16PixelTraits::sample* ) const override
641  {
642  return new BicubicBSplineInterpolation<UInt16PixelTraits::sample>;
643  }
644 
645  BidimensionalInterpolation<UInt32PixelTraits::sample>*
646  NewInterpolation( const UInt32PixelTraits::sample* ) const override
647  {
648  return new BicubicBSplineInterpolation<UInt32PixelTraits::sample>;
649  }
650 };
651 
652 // ----------------------------------------------------------------------------
653 
668 {
669 public:
670 
683  BicubicFilterPixelInterpolation( int rh, int rv, const CubicFilter& filter )
684  : m_rh( Max( 1, rh ) )
685  , m_rv( Max( 1, rv ) )
686  {
687  PCL_PRECONDITION( rh >= 1 )
688  PCL_PRECONDITION( rv >= 1 )
689  m_filter = filter.Clone();
690  }
691 
696  : m_rh( x.m_rh )
697  , m_rv( x.m_rv )
698  {
699  m_filter = x.m_filter->Clone();
700  }
701 
706 
711  {
712  }
713 
716  String Description() const override
717  {
718  return "Bicubic interpolation, " + m_filter->Description().AppendFormat( " (%dx%d)", 2*m_rh + 1, 2*m_rv + 1 );
719  }
720 
725  const CubicFilter& Filter() const
726  {
727  return *m_filter;
728  }
729 
730 private:
731 
732  int m_rh, m_rv;
733  AutoPointer<CubicFilter> m_filter;
734 
736  NewInterpolation( const FloatPixelTraits::sample* ) const override
737  {
738  return new BicubicFilterInterpolation<FloatPixelTraits::sample>( m_rh, m_rv, *m_filter );
739  }
740 
741  BidimensionalInterpolation<DoublePixelTraits::sample>*
742  NewInterpolation( const DoublePixelTraits::sample* ) const override
743  {
744  return new BicubicFilterInterpolation<DoublePixelTraits::sample>( m_rh, m_rv, *m_filter );
745  }
746 
747  BidimensionalInterpolation<UInt8PixelTraits::sample>*
748  NewInterpolation( const UInt8PixelTraits::sample* ) const override
749  {
750  return new BicubicFilterInterpolation<UInt8PixelTraits::sample>( m_rh, m_rv, *m_filter );
751  }
752 
753  BidimensionalInterpolation<UInt16PixelTraits::sample>*
754  NewInterpolation( const UInt16PixelTraits::sample* ) const override
755  {
756  return new BicubicFilterInterpolation<UInt16PixelTraits::sample>( m_rh, m_rv, *m_filter );
757  }
758 
759  BidimensionalInterpolation<UInt32PixelTraits::sample>*
760  NewInterpolation( const UInt32PixelTraits::sample* ) const override
761  {
762  return new BicubicFilterInterpolation<UInt32PixelTraits::sample>( m_rh, m_rv, *m_filter );
763  }
764 };
765 
766 // ----------------------------------------------------------------------------
767 
783 {
784 public:
785 
802  LanczosPixelInterpolation( int n = 3, float clamp = 0.3 )
803  : m_n( Max( 1, n ) )
804  , m_clamp( clamp )
805  {
806  PCL_PRECONDITION( n >= 1 )
807  PCL_PRECONDITION( clamp < 0 || 0 <= clamp && clamp <= 1 )
808  }
809 
814 
817  String Description() const override
818  {
819  String desc = String().Format( "Lanczos-%d interpolation", m_n );
820  if ( m_clamp >= 0 )
821  desc.AppendFormat( ", c=%.2f", m_clamp );
822  return desc;
823  }
824 
825 private:
826 
827  int m_n; // filter order
828  float m_clamp; // clamping threshold (enabled if >= 0)
829 
831  NewInterpolation( const FloatPixelTraits::sample* ) const override
832  {
833  return new LanczosInterpolation<FloatPixelTraits::sample>( m_n, m_clamp );
834  }
835 
836  BidimensionalInterpolation<DoublePixelTraits::sample>*
837  NewInterpolation( const DoublePixelTraits::sample* ) const override
838  {
839  return new LanczosInterpolation<DoublePixelTraits::sample>( m_n, m_clamp );
840  }
841 
842  BidimensionalInterpolation<UInt8PixelTraits::sample>*
843  NewInterpolation( const UInt8PixelTraits::sample* ) const override
844  {
845  return new LanczosInterpolation<UInt8PixelTraits::sample>( m_n, m_clamp );
846  }
847 
848  BidimensionalInterpolation<UInt16PixelTraits::sample>*
849  NewInterpolation( const UInt16PixelTraits::sample* ) const override
850  {
851  return new LanczosInterpolation<UInt16PixelTraits::sample>( m_n, m_clamp );
852  }
853 
854  BidimensionalInterpolation<UInt32PixelTraits::sample>*
855  NewInterpolation( const UInt32PixelTraits::sample* ) const override
856  {
857  return new LanczosInterpolation<UInt32PixelTraits::sample>( m_n, m_clamp );
858  }
859 };
860 
861 // ----------------------------------------------------------------------------
862 
879 {
880 public:
881 
892  Lanczos3LUTPixelInterpolation( float clamp = 0.3F )
893  : m_clamp( clamp )
894  {
895  PCL_PRECONDITION( clamp < 0 || 0 <= clamp && clamp <= 1 )
896  }
897 
902 
905  String Description() const override
906  {
907  String desc( "Lanczos-3 LUT interpolation" );
908  if ( m_clamp >= 0 )
909  desc.AppendFormat( ", c=%.2f", m_clamp );
910  return desc;
911  }
912 
913 private:
914 
915  float m_clamp; // clamping threshold (enabled if >= 0)
916 
918  NewInterpolation( const FloatPixelTraits::sample* ) const override
919  {
921  }
922 
923  BidimensionalInterpolation<DoublePixelTraits::sample>*
924  NewInterpolation( const DoublePixelTraits::sample* ) const override
925  {
926  return new Lanczos3LUTInterpolation<DoublePixelTraits::sample>( m_clamp );
927  }
928 
929  BidimensionalInterpolation<UInt8PixelTraits::sample>*
930  NewInterpolation( const UInt8PixelTraits::sample* ) const override
931  {
932  return new Lanczos3LUTInterpolation<UInt8PixelTraits::sample>( m_clamp );
933  }
934 
935  BidimensionalInterpolation<UInt16PixelTraits::sample>*
936  NewInterpolation( const UInt16PixelTraits::sample* ) const override
937  {
938  return new Lanczos3LUTInterpolation<UInt16PixelTraits::sample>( m_clamp );
939  }
940 
941  BidimensionalInterpolation<UInt32PixelTraits::sample>*
942  NewInterpolation( const UInt32PixelTraits::sample* ) const override
943  {
944  return new Lanczos3LUTInterpolation<UInt32PixelTraits::sample>( m_clamp );
945  }
946 };
947 
948 // ----------------------------------------------------------------------------
949 
966 {
967 public:
968 
979  Lanczos4LUTPixelInterpolation( float clamp = 0.3F )
980  : m_clamp( Range( clamp, 0.0F, 1.0F ) )
981  {
982  PCL_PRECONDITION( clamp < 0 || 0 <= clamp && clamp <= 1 )
983  }
984 
989 
992  String Description() const override
993  {
994  String desc( "Lanczos-4 LUT interpolation" );
995  if ( m_clamp >= 0 )
996  desc.AppendFormat( ", c=%.2f", m_clamp );
997  return desc;
998  }
999 
1000 private:
1001 
1002  float m_clamp; // clamping threshold (enabled if >= 0)
1003 
1005  NewInterpolation( const FloatPixelTraits::sample* ) const override
1006  {
1008  }
1009 
1010  BidimensionalInterpolation<DoublePixelTraits::sample>*
1011  NewInterpolation( const DoublePixelTraits::sample* ) const override
1012  {
1013  return new Lanczos4LUTInterpolation<DoublePixelTraits::sample>( m_clamp );
1014  }
1015 
1016  BidimensionalInterpolation<UInt8PixelTraits::sample>*
1017  NewInterpolation( const UInt8PixelTraits::sample* ) const override
1018  {
1019  return new Lanczos4LUTInterpolation<UInt8PixelTraits::sample>( m_clamp );
1020  }
1021 
1022  BidimensionalInterpolation<UInt16PixelTraits::sample>*
1023  NewInterpolation( const UInt16PixelTraits::sample* ) const override
1024  {
1025  return new Lanczos4LUTInterpolation<UInt16PixelTraits::sample>( m_clamp );
1026  }
1027 
1028  BidimensionalInterpolation<UInt32PixelTraits::sample>*
1029  NewInterpolation( const UInt32PixelTraits::sample* ) const override
1030  {
1031  return new Lanczos4LUTInterpolation<UInt32PixelTraits::sample>( m_clamp );
1032  }
1033 };
1034 
1035 // ----------------------------------------------------------------------------
1036 
1053 {
1054 public:
1055 
1066  Lanczos5LUTPixelInterpolation( float clamp = 0.3F )
1067  : m_clamp( Range( clamp, 0.0F, 1.0F ) )
1068  {
1069  PCL_PRECONDITION( clamp < 0 || 0 <= clamp && clamp <= 1 )
1070  }
1071 
1076 
1079  String Description() const override
1080  {
1081  String desc( "Lanczos-5 LUT interpolation" );
1082  if ( m_clamp >= 0 )
1083  desc.AppendFormat( ", c=%.2f", m_clamp );
1084  return desc;
1085  }
1086 
1087 private:
1088 
1089  float m_clamp; // clamping threshold (enabled if >= 0)
1090 
1092  NewInterpolation( const FloatPixelTraits::sample* ) const override
1093  {
1095  }
1096 
1097  BidimensionalInterpolation<DoublePixelTraits::sample>*
1098  NewInterpolation( const DoublePixelTraits::sample* ) const override
1099  {
1100  return new Lanczos5LUTInterpolation<DoublePixelTraits::sample>( m_clamp );
1101  }
1102 
1103  BidimensionalInterpolation<UInt8PixelTraits::sample>*
1104  NewInterpolation( const UInt8PixelTraits::sample* ) const override
1105  {
1106  return new Lanczos5LUTInterpolation<UInt8PixelTraits::sample>( m_clamp );
1107  }
1108 
1109  BidimensionalInterpolation<UInt16PixelTraits::sample>*
1110  NewInterpolation( const UInt16PixelTraits::sample* ) const override
1111  {
1112  return new Lanczos5LUTInterpolation<UInt16PixelTraits::sample>( m_clamp );
1113  }
1114 
1115  BidimensionalInterpolation<UInt32PixelTraits::sample>*
1116  NewInterpolation( const UInt32PixelTraits::sample* ) const override
1117  {
1118  return new Lanczos5LUTInterpolation<UInt32PixelTraits::sample>( m_clamp );
1119  }
1120 };
1121 
1122 // ----------------------------------------------------------------------------
1123 
1124 } // pcl
1125 
1126 #ifdef _MSC_VER
1127 # pragma warning( pop )
1128 #endif
1129 
1130 #endif // __PCL_PixelInterpolation_h
1131 
1132 // ----------------------------------------------------------------------------
1133 // EOF pcl/PixelInterpolation.h - Released 2024-06-18T15:48:54Z
A smart pointer with exclusive object ownership and optional automatic object destruction.
Definition: AutoPointer.h:241
Bicubic B-Spline Interpolation Algorithm.
Bicubic B-spline pixel interpolation.
BicubicBSplinePixelInterpolation(const BicubicBSplinePixelInterpolation &)=default
Bicubic filter interpolation algorithms.
Pixel interpolation based on Mitchell-Netravali parameterized bicubic filters.
BicubicFilterPixelInterpolation(BicubicFilterPixelInterpolation &&)=default
BicubicFilterPixelInterpolation(const BicubicFilterPixelInterpolation &x)
BicubicFilterPixelInterpolation(int rh, int rv, const CubicFilter &filter)
const CubicFilter & Filter() const
Bicubic pixel interpolation - an alias for BicubicSplinePixelInterpolation.
BicubicPixelInterpolation(const BicubicPixelInterpolation &)=default
BicubicPixelInterpolation(double c=__PCL_BICUBIC_SPLINE_CLAMPING_THRESHOLD)
Bicubic spline interpolation algorithm.
Bicubic spline pixel interpolation.
BicubicSplinePixelInterpolation(const BicubicSplinePixelInterpolation &)=default
BicubicSplinePixelInterpolation(double clamp=__PCL_BICUBIC_SPLINE_CLAMPING_THRESHOLD)
A generic interface to two-dimensional interpolation algorithms.
Bilinear interpolation algorithm.
Bilinear pixel interpolation.
String Description() const override
BilinearPixelInterpolation(const BilinearPixelInterpolation &)=default
traits_type::sample sample
Definition: PixelTraits.h:1568
Mitchell-Netravali parameterized cubic filters.
virtual CubicFilter * Clone() const
traits_type::sample sample
Definition: PixelTraits.h:2321
traits_type::sample sample
Definition: PixelTraits.h:974
traits_type::sample sample
Definition: PixelTraits.h:380
A generic point in the two-dimensional space.
Definition: Point.h:100
component x
Abscissa (horizontal, or X-axis coordinate).
Definition: Point.h:111
component y
Ordinate (vertical, or Y-axis coordinate).
Definition: Point.h:112
Two dimensional LUT-based 3rd-order Lanczos interpolation algorithm.
Lanczos 3rd-order LUT-based pixel interpolation.
Lanczos3LUTPixelInterpolation(const Lanczos3LUTPixelInterpolation &)=default
Two dimensional LUT-based 4th-order Lanczos interpolation algorithm.
Lanczos 3rd-order LUT-based pixel interpolation.
Lanczos4LUTPixelInterpolation(const Lanczos4LUTPixelInterpolation &)=default
Two dimensional LUT-based 5th-order Lanczos interpolation algorithm.
Lanczos 5th-order LUT-based pixel interpolation.
Lanczos5LUTPixelInterpolation(const Lanczos5LUTPixelInterpolation &)=default
Two dimensional Lanczos interpolation algorithm.
Lanczos pixel interpolation.
LanczosPixelInterpolation(const LanczosPixelInterpolation &)=default
String Description() const override
LanczosPixelInterpolation(int n=3, float clamp=0.3)
Two-dimensional nearest neighbor interpolation algorithm.
NearestNeighbor pixel interpolation.
NearestNeighborPixelInterpolation(const NearestNeighborPixelInterpolation &)=default
An exception that indicates an unsupported feature.
Definition: Exception.h:344
Generic two-dimensional pixel interpolator.
sample operator()(double x, double y) const
Interpolator(BidimensionalInterpolation< sample > *interpolation, const sample *data, int width, int height, bool unclipped=false)
const BidimensionalInterpolation< sample > & Interpolation() const
BidimensionalInterpolation< sample > & Interpolation()
sample operator()(const GenericPoint< T > &p) const
Interpolator(const Interpolator &)=delete
Interpolator(Interpolator &&)=default
Abstract root base class for all pixel interpolation algorithms.
PixelInterpolation(const PixelInterpolation &)=default
virtual String Description() const =0
virtual bool IsThreadSafe() const
Interpolator< P > * NewInterpolator(const T *data, int width, int height, bool unclipped=false) const
Unicode (UTF-16) string.
Definition: String.h:8113
String & AppendFormat(const_c_string8 fmt,...)
Definition: String.h:11103
String & Format(const_c_string8 fmt,...)
Definition: String.h:11081
traits_type::sample sample
Definition: PixelTraits.h:3945
traits_type::sample sample
Definition: PixelTraits.h:4809
traits_type::sample sample
Definition: PixelTraits.h:3081
constexpr const T & Range(const T &x, const T &a, const T &b) noexcept
Definition: Utility.h:190
constexpr const T & Max(const T &a, const T &b) noexcept
Definition: Utility.h:119
PCL root namespace.
Definition: AbstractImage.h:77