52 #ifndef __PCL_ImageVariant_h
53 #define __PCL_ImageVariant_h
62 #ifdef __PCL_BUILDING_PIXINSIGHT_APPLICATION
69 #define SOLVE_TEMPLATE( F ) \
70 if ( IsComplexSample() ) \
71 switch ( BitsPerSample() ) \
73 case 32: F( ComplexImage ); break; \
74 case 64: F( DComplexImage ); break; \
76 else if ( IsFloatSample() ) \
77 switch ( BitsPerSample() ) \
79 case 32: F( Image ); break; \
80 case 64: F( DImage ); break; \
83 switch ( BitsPerSample() ) \
85 case 8: F( UInt8Image ); break; \
86 case 16: F( UInt16Image ); break; \
87 case 32: F( UInt32Image ); break; \
90 #define SOLVE_TEMPLATE_2( I, F ) \
91 if ( I.IsComplexSample() ) \
92 switch ( I.BitsPerSample() ) \
94 case 32: F( ComplexImage ); break; \
95 case 64: F( DComplexImage ); break; \
97 else if ( I.IsFloatSample() ) \
98 switch ( I.BitsPerSample() ) \
100 case 32: F( Image ); break; \
101 case 64: F( DImage ); break; \
104 switch ( I.BitsPerSample() ) \
106 case 8: F( UInt8Image ); break; \
107 case 16: F( UInt16Image ); break; \
108 case 32: F( UInt32Image ); break; \
111 #define SOLVE_TEMPLATE_REAL( F ) \
112 if ( IsFloatSample() ) \
113 switch ( BitsPerSample() ) \
115 case 32: F( Image ); break; \
116 case 64: F( DImage ); break; \
119 switch ( BitsPerSample() ) \
121 case 8: F( UInt8Image ); break; \
122 case 16: F( UInt16Image ); break; \
123 case 32: F( UInt32Image ); break; \
126 #define SOLVE_TEMPLATE_REAL_2( I, F ) \
127 if ( I.IsFloatSample() ) \
128 switch ( I.BitsPerSample() ) \
130 case 32: F( Image ); break; \
131 case 64: F( DImage ); break; \
134 switch ( I.BitsPerSample() ) \
136 case 8: F( UInt8Image ); break; \
137 case 16: F( UInt16Image ); break; \
138 case 32: F( UInt32Image ); break; \
167 namespace SwapCompression
337 using image_op = ImageOp::value_type;
344 using swap_compression = SwapCompression::value_type;
366 m_data->Update( image );
379 : m_data( image.m_data )
388 : m_data( image.m_data )
390 image.m_data =
nullptr;
401 if ( m_data !=
nullptr )
414 return m_data->image;
422 return m_data->image;
434 return m_data->image == image.m_data->image;
443 return m_data->isFloatSample;
451 return m_data->isComplexSample;
460 return m_data->bitsPerSample;
469 return m_data->bitsPerSample >> 3;
478 return m_data->image ? m_data->image->Width() : 0;
487 return m_data->image ? m_data->image->Height() : 0;
498 return m_data->image ? m_data->image->NumberOfPixels() : 0;
507 return m_data->image ? m_data->image->NumberOfChannels() : 0;
519 return m_data->image ? m_data->image->LastChannel() : -1;
529 return m_data->image && m_data->image->IsValidChannelIndex( c );
542 return m_data->image ? m_data->image->NumberOfNominalChannels() : 0;
555 return m_data->image && m_data->image->HasAlphaChannels();
568 return m_data->image ? m_data->image->NumberOfAlphaChannels() : 0;
579 return m_data->image ? m_data->image->NumberOfSamples() : 0;
591 return m_data->image ? m_data->image->NumberOfNominalSamples() : 0;
603 return m_data->image ? m_data->image->NumberOfAlphaSamples() : 0;
618 return m_data->image ? m_data->image->Bounds() :
Rect( 0 );
627 template <
typename T>
630 return m_data->image && m_data->image->Includes( p );
639 template <
typename T>
642 return m_data->image && m_data->image->Includes( r );
654 template <
typename T>
655 bool Includes( T x0, T y0, T x1, T y1 )
const noexcept
657 return m_data->image && m_data->image->Includes( x0, y0, x1, y1 );
669 template <
typename T>
672 return m_data->image && m_data->image->Includes( x, y );
681 template <
typename T>
684 return m_data->image && m_data->image->Intersects( r );
696 template <
typename T>
699 return m_data->image && m_data->image->Intersects( x0, y0, x1, y1 );
709 template <
typename T>
712 return m_data->image && m_data->image->Clip( p );
727 template <
typename T>
728 bool Clip( T& x, T& y )
const noexcept
730 return m_data->image && m_data->image->Clip( x, y );
743 template <
typename T>
746 return m_data->image && m_data->image->Clip( r );
765 template <
typename T>
766 bool Clip( T& x0, T& y0, T& x1, T& y1 )
const noexcept
768 return m_data->image && m_data->image->Clip( x0, y0, x1, y1 );
780 m_data->image->SelectChannel( c );
794 return m_data->image ? m_data->image->SelectedChannel() : -1;
807 m_data->image->SelectChannelRange( c0, c1 );
817 m_data->image->SelectNominalChannels();
830 m_data->image->SelectAlphaChannels();
840 m_data->image->ResetChannelRange();
849 return m_data->image ? m_data->image->NumberOfSelectedChannels() : 0;
858 return m_data->image ? m_data->image->FirstSelectedChannel() : -1;
867 return m_data->image ? m_data->image->LastSelectedChannel() : -1;
880 m_data->image->GetSelectedChannelRange( c0, c1 );
892 m_data->image->SelectPoint( x, y );
901 m_data->image->SelectPoint( p );
910 m_data->image->ResetPoint();
919 return m_data->image ? m_data->image->SelectedPoint() :
Point( 0 );
938 m_data->image->SelectRectangle( x0, y0, x1, y1 );
952 m_data->image->SelectRectangle( p0, p1 );
962 m_data->image->SelectRectangle( r );
971 m_data->image->ResetSelection();
981 return m_data->image ? m_data->image->IsEmptySelection() :
false;
991 return m_data->image ? m_data->image->IsFullSelection() :
false;
1000 return m_data->image ? m_data->image->SelectedRectangle() :
Rect( 0 );
1013 return m_data->image ? m_data->image->IsCompletelySelected() :
false;
1023 return m_data->image ? m_data->image->NumberOfSelectedPixels() : 0;
1033 return m_data->image ? m_data->image->NumberOfSelectedSamples() : 0;
1062 return m_data->image ? m_data->image->IsRangeClippingEnabled() :
false;
1077 return m_data->image ? m_data->image->IsLowRangeClippingEnabled() :
false;
1092 return m_data->image ? m_data->image->IsHighRangeClippingEnabled() :
false;
1102 if ( m_data->image )
1103 m_data->image->EnableRangeClipping( enableLow, enableHigh );
1113 if ( m_data->image )
1114 m_data->image->DisableRangeClipping( disableLow, disableHigh );
1125 return m_data->image ? m_data->image->RangeClipLow() : 0.0;
1136 return m_data->image ? m_data->image->RangeClipHigh() : 0.0;
1146 if ( m_data->image )
1147 m_data->image->SetRangeClipLow( clipLow );
1157 if ( m_data->image )
1158 m_data->image->SetRangeClipHigh( clipHigh );
1169 if ( m_data->image )
1170 m_data->image->SetRangeClipping( clipLow, clipHigh );
1182 if ( m_data->image )
1183 m_data->image->ResetRangeClipping();
1206 if ( m_data->image )
1207 m_data->image->ResetSelections();
1219 return m_data->image->Selections();
1228 if ( m_data->image )
1229 m_data->image->PushSelections();
1242 if ( m_data->image )
1243 m_data->image->PopSelections();
1254 return m_data->image ? m_data->image->CanPopSelections() :
false;
1266 PCL_PRECONDITION( m_data->image !=
nullptr )
1267 return m_data->image->Status();
1277 return m_data->image ? m_data->image->StatusCallback() :
nullptr;
1289 if ( m_data->image )
1290 m_data->image->SetStatusCallback( callback );
1303 return m_data->image !=
nullptr && m_data->image->IsParallelProcessingEnabled();
1321 if ( m_data->image )
1322 m_data->image->EnableParallelProcessing( enable, maxProcessors );
1336 if ( m_data->image )
1337 m_data->image->DisableParallelProcessing( disable );
1355 return m_data->image ? m_data->image->MaxProcessors() : 0;
1381 if ( m_data->image )
1382 m_data->image->SetMaxProcessors( maxProcessors );
1394 return m_data->image ? BytesPerSample() *
size_type( m_data->image->Width() ) : 0;
1405 return BytesPerSample() * NumberOfPixels();
1417 return ChannelSize() *
size_type( NumberOfChannels() );
1443 return ChannelSize() *
size_type( NumberOfAlphaChannels() );
1453 return m_data->image && m_data->image->IsColor();
1466 return m_data->image ? m_data->image->ColorSpace() : ColorSpace::Unknown;
1476 return m_data->image ? m_data->image->ChannelId( c ) :
String();
1488 PCL_PRECONDITION( m_data->image !=
nullptr )
1489 return m_data->image->RGBWorkingSpace();
1505 if ( m_data->image )
1506 m_data->image->SetRGBWorkingSpace( rgbws );
1511 #define __ABSOLUTE_DIFFERENCE( I ) \
1512 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).AbsoluteDifference( scalar, rect, firstChannel, lastChannel ) ) ); \
1513 result.SetOwnership( true )
1523 template <
typename T>
1525 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
1529 SOLVE_TEMPLATE( __ABSOLUTE_DIFFERENCE )
1533 #undef __ABSOLUTE_DIFFERENCE
1537 #define __ABSOLUTE_VALUE( I ) \
1538 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).AbsoluteValue( rect, firstChannel, lastChannel ) ) ); \
1539 result.SetOwnership( true )
1552 SOLVE_TEMPLATE( __ABSOLUTE_VALUE )
1556 #undef __ABSOLUTE_VALUE
1560 #define __ADD( I ) \
1561 static_cast<pcl::I&>( **this ).Add( scalar, rect, firstChannel, lastChannel )
1569 template <
typename T>
1571 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
1574 SOLVE_TEMPLATE( __ADD )
1582 #define __ADD_1( I ) \
1583 ImageVariant::Add( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
1585 #define __ADD_2( I ) \
1586 image1.Add( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
1590 template <
class P>
static
1592 const Point& point,
int channel,
1593 const Rect& rect,
int firstChannel,
int lastChannel )
1595 SOLVE_TEMPLATE_2( image2, __ADD_2 )
1607 const Point& point =
Point( int_max ),
int channel = -1,
1608 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
1612 SOLVE_TEMPLATE( __ADD_1 )
1621 #define __ADDED( I ) \
1622 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Added( scalar, rect, firstChannel, lastChannel ) ) ); \
1623 result.SetOwnership( true )
1631 template <
typename T>
1633 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
1637 SOLVE_TEMPLATE( __ADDED )
1645 #define __ALLOCATE_DATA( I ) \
1646 static_cast<pcl::I&>( **this ).AllocateData( width, height, numberOfChannels, colorSpace )
1662 SOLVE_TEMPLATE( __ALLOCATE_DATA )
1666 #undef __ALLOCATE_DATA
1670 #define __ALLOCATE_DATA( I ) \
1671 static_cast<pcl::I&>( **this ).AllocateData( rect, numberOfChannels, colorSpace )
1687 SOLVE_TEMPLATE( __ALLOCATE_DATA )
1691 #undef __ALLOCATE_DATA
1695 #define __AND( I ) \
1696 static_cast<pcl::I&>( **this ).And( scalar, rect, firstChannel, lastChannel )
1705 template <
typename T>
1707 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
1710 SOLVE_TEMPLATE_REAL( __AND )
1718 #define __AND_1( I ) \
1719 ImageVariant::And( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
1721 #define __AND_2( I ) \
1722 image1.And( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
1726 template <
class P>
static
1728 const Point& point,
int channel,
1729 const Rect& rect,
int firstChannel,
int lastChannel )
1731 SOLVE_TEMPLATE_REAL_2( image2, __AND_2 )
1744 const Point& point =
Point( int_max ),
int channel = -1,
1745 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
1749 SOLVE_TEMPLATE_REAL( __AND_1 )
1758 #define __APPLIED( I ) \
1759 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Applied( scalar, op, rect, firstChannel, lastChannel ) ) ); \
1760 result.SetOwnership( true )
1770 template <
typename T>
1772 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
1776 SOLVE_TEMPLATE( __APPLIED )
1784 #define __APPLIED_1( I ) \
1785 result = ImageVariant::Applied( static_cast<const pcl::I&>( **this ), image, op, point, channel, rect, firstChannel, lastChannel )
1787 #define __APPLIED_2( I ) \
1788 result.SetImage( *new pcl::I( image1.Applied( static_cast<const pcl::I&>( *image2 ), op, point, channel, rect, firstChannel, lastChannel ) ) ); \
1789 result.SetOwnership( true )
1793 template <
class P>
static
1795 image_op op,
const Point& point,
int channel,
1796 const Rect& rect,
int firstChannel,
int lastChannel )
1799 SOLVE_TEMPLATE_2( image2, __APPLIED_2 )
1814 const Point& point =
Point( int_max ),
int channel = -1,
1815 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
1820 SOLVE_TEMPLATE( __APPLIED_1 )
1829 #define __APPLIED( I ) \
1830 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Applied( transformation, rect, firstChannel, lastChannel ) ) ); \
1831 result.SetOwnership( true )
1841 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
1845 SOLVE_TEMPLATE( __APPLIED )
1853 #define __APPLY( I ) \
1854 static_cast<pcl::I&>( **this ).Apply( scalar, op, rect, firstChannel, lastChannel )
1864 template <
typename T>
1866 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
1869 SOLVE_TEMPLATE( __APPLY )
1877 #define __APPLY_1( I ) \
1878 ImageVariant::Apply( static_cast<pcl::I&>( **this ), image, op, point, channel, rect, firstChannel, lastChannel )
1880 #define __APPLY_2( I ) \
1881 image1.Apply( static_cast<const pcl::I&>( *image2 ), op, point, channel, rect, firstChannel, lastChannel )
1885 template <
class P>
static
1887 image_op op,
const Point& point,
int channel,
1888 const Rect& rect,
int firstChannel,
int lastChannel )
1890 SOLVE_TEMPLATE_2( image2, __APPLY_2 )
1904 const Point& point =
Point( int_max ),
int channel = -1,
1905 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
1909 SOLVE_TEMPLATE( __APPLY_1 )
1918 #define __APPLY( I ) \
1919 static_cast<pcl::I&>( **this ).Apply( transformation, rect, firstChannel, lastChannel )
1929 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
1932 SOLVE_TEMPLATE( __APPLY )
1940 #define __ASSIGN_IMAGE_1( I ) \
1941 ImageVariant::AssignImage( static_cast<pcl::I&>( **this ), image, rect, firstChannel, lastChannel )
1943 #define __ASSIGN_IMAGE_2( I ) \
1944 image1.Assign( static_cast<const pcl::I&>( *image2 ), rect, firstChannel, lastChannel )
1948 template <
class P>
static
1950 const Rect& rect,
int firstChannel,
int lastChannel )
1952 SOLVE_TEMPLATE_2( image2, __ASSIGN_IMAGE_2 )
1964 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
1968 SOLVE_TEMPLATE( __ASSIGN_IMAGE_1 )
1972 #undef __ASSIGN_IMAGE_1
1973 #undef __ASSIGN_IMAGE_2
1977 #define __AVG_DEV( I ) \
1978 result = static_cast<const pcl::I&>( **this ).AvgDev( center, rect, firstChannel, lastChannel, maxProcessors )
1987 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
1988 int maxProcessors = 0 )
const
1992 SOLVE_TEMPLATE( __AVG_DEV )
2000 #define __2SIDED_AVG_DEV( I ) \
2001 result = static_cast<const pcl::I&>( **this ).TwoSidedAvgDev( center, rect, firstChannel, lastChannel, maxProcessors )
2011 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
2012 int maxProcessors = 0 )
const
2016 SOLVE_TEMPLATE( __2SIDED_AVG_DEV )
2020 #undef __2SIDED_AVG_DEV
2024 #define __BINARIZE( I ) \
2025 static_cast<pcl::I&>( **this ).Binarize( threshold, rect, firstChannel, lastChannel )
2034 template <
typename T>
2038 SOLVE_TEMPLATE_REAL( __BINARIZE )
2046 #define __BINARIZE( I ) \
2047 static_cast<pcl::I&>( **this ).Binarize( rect, firstChannel, lastChannel )
2059 SOLVE_TEMPLATE_REAL( __BINARIZE )
2067 #define __BINARIZED( I ) \
2068 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Binarized( threshold, rect, firstChannel, lastChannel ) ) ); \
2069 result.SetOwnership( true )
2078 template <
typename T>
2083 SOLVE_TEMPLATE_REAL( __BINARIZED )
2091 #define __BINARIZED( I ) \
2092 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Binarized( rect, firstChannel, lastChannel ) ) ); \
2093 result.SetOwnership( true )
2106 SOLVE_TEMPLATE_REAL( __BINARIZED )
2114 #define __PBMV( I ) \
2115 result = static_cast<const pcl::I&>( **this ).BendMidvariance( center, beta, rect, firstChannel, lastChannel, maxProcessors )
2126 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
2127 int maxProcessors = 0 )
const
2131 SOLVE_TEMPLATE( __PBMV )
2139 #define __BWMV( I ) \
2140 result = static_cast<const pcl::I&>( **this ).BiweightMidvariance( center, sigma, k, reducedLength, rect, firstChannel, lastChannel, maxProcessors )
2151 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
2152 int maxProcessors = 0 )
const
2156 SOLVE_TEMPLATE( __BWMV )
2164 #define __2SIDED_BWMV( I ) \
2165 result = static_cast<const pcl::I&>( **this ).TwoSidedBiweightMidvariance( center, sigma, k, reducedLength, rect, firstChannel, lastChannel, maxProcessors )
2176 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
2177 int maxProcessors = 0 )
const
2181 SOLVE_TEMPLATE( __2SIDED_BWMV )
2185 #undef __2SIDED_BWMV
2189 #define __BLACK( I ) \
2190 static_cast<pcl::I&>( **this ).Black( rect, firstChannel, lastChannel )
2201 SOLVE_TEMPLATE( __BLACK )
2209 #define __BLEND( I ) \
2210 static_cast<pcl::I&>( **this ).Blend( bitmap, point, rect )
2222 SOLVE_TEMPLATE_REAL( __BLEND )
2230 #define __BLENDED( I ) \
2231 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Blended( bitmap, point, rect ) ) ); \
2232 result.SetOwnership( true )
2244 SOLVE_TEMPLATE_REAL( __BLENDED )
2252 #define __COUNT( I ) \
2253 result = static_cast<const pcl::I&>( **this ).Count( rect, firstChannel, lastChannel, maxProcessors )
2261 uint64 Count(
const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
int maxProcessors = 0 )
const
2265 SOLVE_TEMPLATE( __COUNT )
2273 #define __CREATE_ALPHA_CHANNELS( I ) \
2274 static_cast<pcl::I&>( **this ).CreateAlphaChannels( n )
2291 SOLVE_TEMPLATE( __CREATE_ALPHA_CHANNELS )
2294 #undef __CREATE_ALPHA_CHANNELS
2298 #define __CROP( I ) \
2299 static_cast<pcl::I&>( **this ).Crop( fillValues )
2307 template <
typename T>
2311 SOLVE_TEMPLATE( __CROP )
2319 #define __CROP( I ) \
2320 static_cast<pcl::I&>( **this ).Crop()
2332 SOLVE_TEMPLATE( __CROP )
2340 #define __CROP_BY( I ) \
2341 static_cast<pcl::I&>( **this ).CropBy( left, top, right, bottom, fillValues )
2349 template <
typename T>
2353 SOLVE_TEMPLATE( __CROP_BY )
2361 #define __CROP_BY( I ) \
2362 static_cast<pcl::I&>( **this ).CropBy( left, top, right, bottom )
2373 SOLVE_TEMPLATE( __CROP_BY )
2381 #define __CROP_TO( I ) \
2382 static_cast<pcl::I&>( **this ).CropTo( rect, fillValues )
2390 template <
typename T>
2394 SOLVE_TEMPLATE( __CROP_TO )
2402 #define __CROP_TO( I ) \
2403 static_cast<pcl::I&>( **this ).CropTo( rect )
2415 SOLVE_TEMPLATE( __CROP_TO )
2423 #define __CROP_TO( I ) \
2424 static_cast<pcl::I&>( **this ).CropTo( x0, y0, x1, y1, fillValues )
2432 template <
typename T>
2436 SOLVE_TEMPLATE( __CROP_TO )
2444 #define __CROP_TO( I ) \
2445 static_cast<pcl::I&>( **this ).CropTo( x0, y0, x1, y1 )
2457 SOLVE_TEMPLATE( __CROP_TO )
2465 #define __DELETE_ALPHA_CHANNEL( I ) \
2466 static_cast<pcl::I&>( **this ).DeleteAlphaChannel( channel )
2477 SOLVE_TEMPLATE( __DELETE_ALPHA_CHANNEL )
2480 #undef __DELETE_ALPHA_CHANNEL
2484 #define __DELETE_ALPHA_CHANNELS( I ) \
2485 static_cast<pcl::I&>( **this ).DeleteAlphaChannels()
2497 SOLVE_TEMPLATE( __DELETE_ALPHA_CHANNELS )
2500 #undef __DELETE_ALPHA_CHANNELS
2504 #define __DIVIDE( I ) \
2505 static_cast<pcl::I&>( **this ).Divide( scalar, rect, firstChannel, lastChannel )
2513 template <
typename T>
2517 SOLVE_TEMPLATE( __DIVIDE )
2526 template <
typename T>
2529 return Divide( scalar, rect, firstChannel, lastChannel );
2534 #define __DIVIDE_1( I ) \
2535 ImageVariant::Divide( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
2537 #define __DIVIDE_2( I ) \
2538 image1.Divide( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
2542 template <
class P>
static
2544 const Point& point,
int channel,
2545 const Rect& rect,
int firstChannel,
int lastChannel )
2547 SOLVE_TEMPLATE_2( image2, __DIVIDE_2 )
2559 const Point& point =
Point( int_max ),
int channel = -1,
2560 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
2564 SOLVE_TEMPLATE( __DIVIDE_1 )
2575 const Point& point =
Point( int_max ),
int channel = -1,
2576 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
2578 return Divide( image, point, channel, rect, firstChannel, lastChannel );
2583 #define __DIVIDED( I ) \
2584 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Divided( scalar, rect, firstChannel, lastChannel ) ) ); \
2585 result.SetOwnership( true )
2593 template <
typename T>
2595 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
2599 SOLVE_TEMPLATE( __DIVIDED )
2607 #define __EXCHANGE_1( I ) \
2608 ImageVariant::Exchange( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
2610 #define __EXCHANGE_2( I ) \
2611 image1.Exchange( static_cast<pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
2615 template <
class P>
static
2617 const Point& point,
int channel,
2618 const Rect& rect,
int firstChannel,
int lastChannel )
2620 SOLVE_TEMPLATE_2( image2, __EXCHANGE_2 )
2633 const Point& point =
Point( int_max ),
int channel = -1,
2634 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
2638 SOLVE_TEMPLATE( __EXCHANGE_1 )
2649 const Point& point =
Point( int_max ),
int channel = -1,
2650 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
2652 return Exchange( image, point, channel, rect, firstChannel, lastChannel );
2657 #define __FILL( I ) \
2658 static_cast<pcl::I&>( **this ).Fill( scalar, rect, firstChannel, lastChannel )
2666 template <
typename T>
2668 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
2671 SOLVE_TEMPLATE( __FILL )
2679 #define __FILL( I ) \
2680 static_cast<pcl::I&>( **this ).Fill( values, rect, firstChannel, lastChannel )
2689 template <
typename T>
2691 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
2694 SOLVE_TEMPLATE( __FILL )
2702 #define __FILLED( I ) \
2703 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Filled( scalar, rect, firstChannel, lastChannel ) ) ); \
2704 result.SetOwnership( true )
2712 template <
typename T>
2714 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
2718 SOLVE_TEMPLATE( __FILLED )
2726 #define __FILLED( I ) \
2727 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Filled( values, rect, firstChannel, lastChannel ) ) ); \
2728 result.SetOwnership( true )
2737 template <
typename T>
2739 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
2743 SOLVE_TEMPLATE( __FILLED )
2751 #define __FORGET_ALPHA_CHANNEL( I ) \
2752 static_cast<pcl::I&>( **this ).ForgetAlphaChannel( channel )
2764 SOLVE_TEMPLATE( __FORGET_ALPHA_CHANNEL )
2767 #undef __FORGET_ALPHA_CHANNEL
2771 #define __FORGET_ALPHA_CHANNELS( I ) \
2772 static_cast<pcl::I&>( **this ).ForgetAlphaChannels()
2784 SOLVE_TEMPLATE( __FORGET_ALPHA_CHANNELS )
2787 #undef __FORGET_ALPHA_CHANNELS
2791 #define __GET_COLUMN( I ) \
2792 static_cast<const pcl::I&>( **this ).GetColumn( buffer, x, channel )
2801 template <
typename T>
2804 PCL_PRECONDITION( buffer != 0 )
2806 SOLVE_TEMPLATE( __GET_COLUMN )
2813 #define __GET_EXTREME_SAMPLE_VALUES( I ) \
2814 static_cast<const pcl::I&>( **this ).GetExtremeSampleValues( min, max, rect, firstChannel, lastChannel, maxProcessors )
2822 template <
typename T>
2824 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
2825 int maxProcessors = 0 )
const
2827 PCL_PRECONDITION( buffer != 0 )
2829 SOLVE_TEMPLATE( __GET_EXTREME_SAMPLE_VALUES )
2832 #undef __GET_EXTREME_SAMPLE_VALUES
2836 #define __GET_INTENSITY_1( I ) \
2837 ImageVariant::GetIntensity( Y, static_cast<const pcl::I&>( **this ), rect, maxProcessors )
2839 #define __GET_INTENSITY_2( I ) \
2840 image.GetIntensity( static_cast<pcl::I&>( *Y ), rect, maxProcessors )
2844 template <
class P>
static
2847 if ( !Y.IsComplexSample() )
2848 SOLVE_TEMPLATE_REAL_2( Y, __GET_INTENSITY_2 )
2868 if ( !IsComplexSample() )
2871 Y.CreateFloatImage( 32 );
2873 SOLVE_TEMPLATE_REAL( __GET_INTENSITY_1 )
2877 #undef __GET_INTENSITY_1
2878 #undef __GET_INTENSITY_2
2882 #define __GET_LIGHTNESS_1( I ) \
2883 ImageVariant::GetLightness( L, static_cast<const pcl::I&>( **this ), rect, maxProcessors )
2885 #define __GET_LIGHTNESS_2( I ) \
2886 image.GetLightness( static_cast<pcl::I&>( *L ), rect, maxProcessors )
2890 template <
class P>
static
2893 if ( !L.IsComplexSample() )
2894 SOLVE_TEMPLATE_REAL_2( L, __GET_LIGHTNESS_2 )
2916 if ( !IsComplexSample() )
2919 L.CreateFloatImage( ( BitsPerSample() < 32 ) ? 32 : ( IsFloatSample() ? BitsPerSample() : 64 ) );
2921 SOLVE_TEMPLATE_REAL( __GET_LIGHTNESS_1 )
2925 #undef __GET_LIGHTNESS_1
2926 #undef __GET_LIGHTNESS_2
2930 #define __GET_LUMINANCE_1( I ) \
2931 ImageVariant::GetLuminance( Y, static_cast<const pcl::I&>( **this ), rect, maxProcessors )
2933 #define __GET_LUMINANCE_2( I ) \
2934 image.GetLuminance( static_cast<pcl::I&>( *Y ), rect, maxProcessors )
2938 template <
class P>
static
2941 if ( !Y.IsComplexSample() )
2942 SOLVE_TEMPLATE_REAL_2( Y, __GET_LUMINANCE_2 )
2964 if ( !IsComplexSample() )
2967 Y.CreateFloatImage( ( BitsPerSample() < 32 ) ? 32 : ( IsFloatSample() ? BitsPerSample() : 64 ) );
2969 SOLVE_TEMPLATE_REAL( __GET_LUMINANCE_1 )
2973 #undef __GET_LUMINANCE_1
2974 #undef __GET_LUMINANCE_2
2978 #define __GET_ROW( I ) \
2979 static_cast<const pcl::I&>( **this ).GetRow( buffer, y, channel )
2987 template <
typename T>
2988 void GetRow( T* buffer,
int y,
int channel = -1 )
const
2990 PCL_PRECONDITION( buffer != 0 )
2992 SOLVE_TEMPLATE( __GET_ROW )
2999 #define __INVERT( I ) \
3000 static_cast<pcl::I&>( **this ).Invert( scalar, rect, firstChannel, lastChannel )
3008 template <
typename T>
3012 SOLVE_TEMPLATE_REAL( __INVERT )
3020 #define __INVERT( I ) \
3021 static_cast<pcl::I&>( **this ).Invert( rect, firstChannel, lastChannel )
3033 SOLVE_TEMPLATE_REAL( __INVERT )
3041 #define __INVERTED( I ) \
3042 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Inverted( scalar, rect, firstChannel, lastChannel ) ) ); \
3043 result.SetOwnership( true )
3052 template <
typename T>
3054 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
3058 SOLVE_TEMPLATE( __INVERTED )
3066 #define __INVERTED( I ) \
3067 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Inverted( rect, firstChannel, lastChannel ) ) ); \
3068 result.SetOwnership( true )
3082 SOLVE_TEMPLATE( __INVERTED )
3090 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
3092 #define __IS_SHARED_IMAGE( I ) \
3093 result = static_cast<const pcl::I&>( **this ).IsShared()
3105 bool result =
false;
3107 SOLVE_TEMPLATE( __IS_SHARED_IMAGE )
3111 #undef __IS_SHARED_IMAGE
3117 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
3119 #define __SHARED_IMAGE_HANDLE( I ) \
3120 handle = static_cast<const pcl::I&>( **this ).Allocator().Handle()
3129 void* handle =
nullptr;
3131 SOLVE_TEMPLATE( __SHARED_IMAGE_HANDLE )
3135 #undef __SHARED_IMAGE_HANDLE
3141 #define __IS_UNIQUE_IMAGE( I ) \
3142 result = static_cast<const pcl::I&>( **this ).IsUnique()
3155 bool result =
false;
3157 SOLVE_TEMPLATE( __IS_UNIQUE_IMAGE )
3161 #undef __IS_UNIQUE_IMAGE
3165 #define __LOCATE_EXTREME_SAMPLE_VALUES( I ) \
3166 static_cast<const pcl::I&>( **this ).LocateExtremeSampleValues( xmin, ymin, min, xmax, ymax, max, rect, firstChannel, lastChannel, maxProcessors )
3175 template <
typename T>
3177 int& xmax,
int& ymax, T& max,
3178 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3179 int maxProcessors = 0 )
const
3182 SOLVE_TEMPLATE_REAL( __LOCATE_EXTREME_SAMPLE_VALUES )
3185 #undef __LOCATE_EXTREME_SAMPLE_VALUES
3189 #define __LOCATE_EXTREME_SAMPLE_VALUES( I ) \
3190 static_cast<const pcl::I&>( **this ).LocateExtremeSampleValues( pmin, min, pmax, max, rect, firstChannel, lastChannel, maxProcessors )
3199 template <
typename T>
3201 Point& pmax, T& max,
3202 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3203 int maxProcessors = 0 )
const
3206 SOLVE_TEMPLATE_REAL( __LOCATE_EXTREME_SAMPLE_VALUES )
3209 #undef __LOCATE_EXTREME_SAMPLE_VALUES
3213 #define __LOCATE_MAXIMUM_SAMPLE_VALUE( I ) \
3214 pcl::I::pixel_traits::FromSample( result, static_cast<const pcl::I&>( **this ).LocateMaximumSampleValue( xmax, ymax, rect, firstChannel, lastChannel, maxProcessors ) )
3224 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3225 int maxProcessors = 0 )
const
3229 SOLVE_TEMPLATE( __LOCATE_MAXIMUM_SAMPLE_VALUE )
3233 #undef __LOCATE_MAXIMUM_SAMPLE_VALUE
3237 #define __LOCATE_MAXIMUM_SAMPLE_VALUE( I ) \
3238 pcl::I::pixel_traits::FromSample( result, static_cast<const pcl::I&>( **this ).LocateMaximumSampleValue( pmax, rect, firstChannel, lastChannel, maxProcessors ) )
3248 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3249 int maxProcessors = 0 )
const
3253 SOLVE_TEMPLATE( __LOCATE_MAXIMUM_SAMPLE_VALUE )
3257 #undef __LOCATE_MAXIMUM_SAMPLE_VALUE
3261 #define __LOCATE_MINIMUM_SAMPLE_VALUE( I ) \
3262 pcl::I::pixel_traits::FromSample( result, static_cast<const pcl::I&>( **this ).LocateMinimumSampleValue( xmin, ymin, rect, firstChannel, lastChannel, maxProcessors ) )
3272 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3273 int maxProcessors = 0 )
const
3277 SOLVE_TEMPLATE( __LOCATE_MINIMUM_SAMPLE_VALUE )
3281 #undef __LOCATE_MINIMUM_SAMPLE_VALUE
3285 #define __LOCATE_MINIMUM_SAMPLE_VALUE( I ) \
3286 pcl::I::pixel_traits::FromSample( result, static_cast<const pcl::I&>( **this ).LocateMinimumSampleValue( pmin, rect, firstChannel, lastChannel, maxProcessors ) )
3296 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3297 int maxProcessors = 0 )
const
3301 SOLVE_TEMPLATE( __LOCATE_MINIMUM_SAMPLE_VALUE )
3305 #undef __LOCATE_MINIMUM_SAMPLE_VALUE
3309 #define __MAD( I ) \
3310 result = static_cast<const pcl::I&>( **this ).MAD( center, rect, firstChannel, lastChannel, maxProcessors )
3319 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3320 int maxProcessors = 0 )
const
3324 SOLVE_TEMPLATE( __MAD )
3332 #define __2SIDED_MAD( I ) \
3333 result = static_cast<const pcl::I&>( **this ).TwoSidedMAD( center, rect, firstChannel, lastChannel, maxProcessors )
3343 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3344 int maxProcessors = 0 )
const
3348 SOLVE_TEMPLATE( __2SIDED_MAD )
3356 #define __MAXIMUM( I ) \
3357 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Maximum( scalar, rect, firstChannel, lastChannel ) ) ); \
3358 result.SetOwnership( true )
3367 template <
typename T>
3369 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
3373 SOLVE_TEMPLATE( __MAXIMUM )
3381 #define __MAXIMUM_SAMPLE_VALUE( I ) \
3382 pcl::I::pixel_traits::FromSample( result, static_cast<const pcl::I&>( **this ).MaximumSampleValue( rect, firstChannel, lastChannel, maxProcessors ) )
3391 int maxProcessors = 0 )
const
3395 SOLVE_TEMPLATE( __MAXIMUM_SAMPLE_VALUE )
3399 #undef __MAXIMUM_SAMPLE_VALUE
3403 #define __MEAN( I ) \
3404 result = static_cast<const pcl::I&>( **this ).Mean( rect, firstChannel, lastChannel, maxProcessors )
3411 double Mean(
const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3412 int maxProcessors = 0 )
const
3416 SOLVE_TEMPLATE( __MEAN )
3424 #define __MEAN_OF_SQUARES( I ) \
3425 result = static_cast<const pcl::I&>( **this ).MeanOfSquares( rect, firstChannel, lastChannel, maxProcessors )
3434 int maxProcessors = 0 )
const
3438 SOLVE_TEMPLATE( __MEAN_OF_SQUARES )
3442 #undef __MEAN_OF_SQUARES
3446 #define __MEDIAN( I ) \
3447 result = static_cast<const pcl::I&>( **this ).Median( rect, firstChannel, lastChannel, maxProcessors )
3454 double Median(
const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3455 int maxProcessors = 0 )
const
3459 SOLVE_TEMPLATE( __MEDIAN )
3467 #define __ORDER_STATISTIC( I ) \
3468 result = static_cast<const pcl::I&>( **this ).OrderStatistic( k, rect, firstChannel, lastChannel, maxProcessors )
3476 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3477 int maxProcessors = 0 )
const
3481 SOLVE_TEMPLATE( __ORDER_STATISTIC )
3485 #undef __ORDER_STATISTIC
3489 #define __MINIMUM( I ) \
3490 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Minimum( scalar, rect, firstChannel, lastChannel ) ) ); \
3491 result.SetOwnership( true )
3500 template <
typename T>
3502 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
3506 SOLVE_TEMPLATE( __MINIMUM )
3514 #define __MINIMUM_SAMPLE_VALUE( I ) \
3515 pcl::I::pixel_traits::FromSample( result, static_cast<const pcl::I&>( **this ).MinimumSampleValue( rect, firstChannel, lastChannel, maxProcessors ) )
3524 int maxProcessors = 0 )
const
3528 SOLVE_TEMPLATE( __MINIMUM_SAMPLE_VALUE )
3532 #undef __MINIMUM_SAMPLE_VALUE
3536 #define __MODULUS( I ) \
3537 result = static_cast<const pcl::I&>( **this ).Modulus( rect, firstChannel, lastChannel, maxProcessors )
3545 double Modulus(
const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3546 int maxProcessors = 0 )
const
3550 SOLVE_TEMPLATE( __MODULUS )
3558 #define __MOVE( I ) \
3559 static_cast<pcl::I&>( **this ).Move( scalar, rect, firstChannel, lastChannel )
3567 template <
typename T>
3569 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3572 SOLVE_TEMPLATE( __MOVE )
3581 template <
typename T>
3584 return Move( scalar, rect, firstChannel, lastChannel );
3589 #define __MOVE_1( I ) \
3590 ImageVariant::Move( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
3592 #define __MOVE_2( I ) \
3593 image1.Move( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
3597 template <
class P>
static
3599 const Point& point,
int channel,
3600 const Rect& rect,
int firstChannel,
int lastChannel )
3602 SOLVE_TEMPLATE_2( image2, __MOVE_2 )
3614 const Point& point =
Point( int_max ),
int channel = -1,
3615 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3619 SOLVE_TEMPLATE( __MOVE_1 )
3627 const Point& point =
Point( int_max ),
int channel = -1,
3628 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3630 return Move( image, point, channel, rect, firstChannel, lastChannel );
3635 #define __MULTIPLY( I ) \
3636 static_cast<pcl::I&>( **this ).Multiply( scalar, rect, firstChannel, lastChannel )
3645 template <
typename T>
3647 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3650 SOLVE_TEMPLATE( __MULTIPLY )
3659 template <
typename T>
3661 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3663 return Multiply( scalar, rect, firstChannel, lastChannel );
3668 #define __MULTIPLY_1( I ) \
3669 ImageVariant::Multiply( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
3671 #define __MULTIPLY_2( I ) \
3672 image1.Multiply( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
3676 template <
class P>
static
3678 const Point& point,
int channel,
3679 const Rect& rect,
int firstChannel,
int lastChannel )
3681 SOLVE_TEMPLATE_2( image2, __MULTIPLY_2 )
3694 const Point& point =
Point( int_max ),
int channel = -1,
3695 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3699 SOLVE_TEMPLATE( __MULTIPLY_1 )
3710 const Point& point =
Point( int_max ),
int channel = -1,
3711 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3713 return Multiply( image, point, channel, rect, firstChannel, lastChannel );
3718 #define __MULTIPLIED( I ) \
3719 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Multiplied( scalar, rect, firstChannel, lastChannel ) ) ); \
3720 result.SetOwnership( true )
3729 template <
typename T>
3731 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
3735 SOLVE_TEMPLATE( __MULTIPLIED )
3743 #define __NAND( I ) \
3744 static_cast<pcl::I&>( **this ).Nand( scalar, rect, firstChannel, lastChannel )
3753 template <
typename T>
3755 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3758 SOLVE_TEMPLATE_REAL( __NAND )
3766 #define __NAND_1( I ) \
3767 ImageVariant::Nand( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
3769 #define __NAND_2( I ) \
3770 image1.Nand( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
3774 template <
class P>
static
3776 const Point& point,
int channel,
3777 const Rect& rect,
int firstChannel,
int lastChannel )
3779 SOLVE_TEMPLATE_REAL_2( image2, __NAND_2 )
3792 const Point& point =
Point( int_max ),
int channel = -1,
3793 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3797 SOLVE_TEMPLATE_REAL( __NAND_1 )
3806 #define __NOR( I ) \
3807 static_cast<pcl::I&>( **this ).Nor( scalar, rect, firstChannel, lastChannel )
3816 template <
typename T>
3818 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3821 SOLVE_TEMPLATE_REAL( __NOR )
3829 #define __NOR_1( I ) \
3830 ImageVariant::Nor( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
3832 #define __NOR_2( I ) \
3833 image1.Nor( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
3837 template <
class P>
static
3839 const Point& point,
int channel,
3840 const Rect& rect,
int firstChannel,
int lastChannel )
3842 SOLVE_TEMPLATE_REAL_2( image2, __NOR_2 )
3855 const Point& point =
Point( int_max ),
int channel = -1,
3856 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3860 SOLVE_TEMPLATE_REAL( __NOR_1 )
3869 #define __NORM( I ) \
3870 result = static_cast<const pcl::I&>( **this ).Norm( rect, firstChannel, lastChannel, maxProcessors )
3878 double Norm(
const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
3879 int maxProcessors = 0 )
const
3883 SOLVE_TEMPLATE( __NORM )
3891 #define __NORMS( I ) \
3892 result = static_cast<const pcl::I&>( **this ).Norms( maxDegree, rect, firstChannel, lastChannel, maxProcessors )
3900 int maxProcessors = 0 )
const
3904 SOLVE_TEMPLATE( __NORMS )
3912 #define __NORMALIZE( I ) \
3913 static_cast<pcl::I&>( **this ).Normalize( lowerBound, upperBound, rect, firstChannel, lastChannel )
3922 template <
typename T>
3924 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
3927 SOLVE_TEMPLATE_REAL( __NORMALIZE )
3935 #define __NORMALIZE( I ) \
3936 static_cast<pcl::I&>( **this ).Normalize( rect, firstChannel, lastChannel )
3948 SOLVE_TEMPLATE_REAL( __NORMALIZE )
3956 #define __NORMALIZED( I ) \
3957 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Normalized( lowerBound, upperBound, rect, firstChannel, lastChannel ) ) ); \
3958 result.SetOwnership( true )
3967 template <
typename T>
3969 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
3973 SOLVE_TEMPLATE_REAL( __NORMALIZED )
3981 #define __NORMALIZED( I ) \
3982 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Normalized( rect, firstChannel, lastChannel ) ) ); \
3983 result.SetOwnership( true )
3996 SOLVE_TEMPLATE_REAL( __NORMALIZED )
4004 #define __NOT( I ) \
4005 static_cast<pcl::I&>( **this ).Not( rect, firstChannel, lastChannel )
4016 SOLVE_TEMPLATE_REAL( __NOT )
4024 #define __ONE( I ) \
4025 static_cast<pcl::I&>( **this ).One( rect, firstChannel, lastChannel )
4037 SOLVE_TEMPLATE_REAL( __ONE )
4045 #define __MULTIPLY( I ) \
4046 static_cast<pcl::I&>( **this ) *= scalar
4051 template <
typename T>
4055 SOLVE_TEMPLATE( __MULTIPLY )
4063 #define __MULTIPLY_1( I ) \
4064 ImageVariant::Multiply( static_cast<pcl::I&>( **this ), image )
4066 #define __MULTIPLY_2( I ) \
4067 image1 *= static_cast<const pcl::I&>( *image2 )
4071 template <
class P>
static
4074 SOLVE_TEMPLATE_2( image2, __MULTIPLY_2 )
4086 SOLVE_TEMPLATE( __MULTIPLY_1 )
4095 #define __ADD( I ) \
4096 static_cast<pcl::I&>( **this ) += scalar
4101 template <
typename T>
4105 SOLVE_TEMPLATE( __ADD )
4113 #define __ADD_1( I ) \
4114 ImageVariant::Add( static_cast<pcl::I&>( **this ), image )
4116 #define __ADD_2( I ) \
4117 image1 += static_cast<const pcl::I&>( *image2 )
4121 template <
class P>
static
4124 SOLVE_TEMPLATE_2( image2, __ADD_2 )
4136 SOLVE_TEMPLATE( __ADD_1 )
4145 #define __SUBTRACT( I ) \
4146 static_cast<pcl::I&>( **this ) -= scalar
4151 template <
typename T>
4155 SOLVE_TEMPLATE( __SUBTRACT )
4163 #define __SUBTRACT_1( I ) \
4164 ImageVariant::Subtract( static_cast<pcl::I&>( **this ), image )
4166 #define __SUBTRACT_2( I ) \
4167 image1 -= static_cast<const pcl::I&>( *image2 )
4171 template <
class P>
static
4174 SOLVE_TEMPLATE_2( image2, __SUBTRACT_2 )
4186 SOLVE_TEMPLATE( __SUBTRACT_1 )
4195 #define __DIVIDE( I ) \
4196 static_cast<pcl::I&>( **this ) /= scalar
4201 template <
typename T>
4205 SOLVE_TEMPLATE( __DIVIDE )
4213 #define __DIVIDE_1( I ) \
4214 ImageVariant::Divide( static_cast<pcl::I&>( **this ), image )
4216 #define __DIVIDE_2( I ) \
4217 image1 /= static_cast<const pcl::I&>( *image2 )
4221 template <
class P>
static
4224 SOLVE_TEMPLATE_2( image2, __DIVIDE_2 )
4236 SOLVE_TEMPLATE( __DIVIDE_1 )
4245 #define __RAISE( I ) \
4246 static_cast<pcl::I&>( **this ) ^= scalar
4251 template <
typename T>
4255 SOLVE_TEMPLATE( __RAISE )
4263 #define __RAISE_1( I ) \
4264 ImageVariant::Raise( static_cast<pcl::I&>( **this ), image )
4266 #define __RAISE_2( I ) \
4267 image1 ^= static_cast<const pcl::I&>( *image2 )
4271 template <
class P>
static
4274 SOLVE_TEMPLATE_2( image2, __RAISE_2 )
4286 SOLVE_TEMPLATE( __RAISE_1 )
4295 #define __INVERTED( I ) \
4296 result.SetImage( *new pcl::I( ~static_cast<const pcl::I&>( **this ) ) ); \
4297 result.SetOwnership( true )
4311 SOLVE_TEMPLATE( __INVERTED )
4320 static_cast<pcl::I&>( **this ).Or( scalar, rect, firstChannel, lastChannel )
4329 template <
typename T>
4333 SOLVE_TEMPLATE_REAL( __OR )
4341 #define __OR_1( I ) \
4342 ImageVariant::Or( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
4344 #define __OR_2( I ) \
4345 image1.Or( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
4349 template <
class P>
static
4351 const Point& point,
int channel,
4352 const Rect& rect,
int firstChannel,
int lastChannel )
4354 SOLVE_TEMPLATE_REAL_2( image2, __OR_2 )
4367 const Point& point =
Point( int_max ),
int channel = -1,
4368 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4372 SOLVE_TEMPLATE_REAL( __OR_1 )
4381 #define __RAISE( I ) \
4382 static_cast<pcl::I&>( **this ).Raise( scalar, rect, firstChannel, lastChannel )
4390 template <
typename T>
4392 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4395 SOLVE_TEMPLATE( __RAISE )
4404 template <
typename T>
4406 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4408 return Raise( scalar, rect, firstChannel, lastChannel );
4414 result = static_cast<const pcl::I&>( **this ).Qn( rect, firstChannel, lastChannel, maxProcessors )
4422 double Qn(
const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
4423 int maxProcessors = 0 )
const
4425 double result =
false;
4427 SOLVE_TEMPLATE( __Qn )
4435 #define __RAISE_1( I ) \
4436 ImageVariant::Raise( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
4438 #define __RAISE_2( I ) \
4439 image1.Raise( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
4443 template <
class P>
static
4445 const Point& point,
int channel,
4446 const Rect& rect,
int firstChannel,
int lastChannel )
4448 SOLVE_TEMPLATE_2( image2, __RAISE_2 )
4461 const Point& point =
Point( int_max ),
int channel = -1,
4462 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4466 SOLVE_TEMPLATE( __RAISE_1 )
4477 const Point& point =
Point( int_max ),
int channel = -1,
4478 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4480 return Raise( image, point, channel, rect, firstChannel, lastChannel );
4485 #define __RAISED( I ) \
4486 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Raised( scalar, rect, firstChannel, lastChannel ) ) ); \
4487 result.SetOwnership( true )
4495 template <
typename T>
4497 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
4501 SOLVE_TEMPLATE( __RAISED )
4509 #define __READ( I ) \
4510 static_cast<pcl::I&>( **this ).Read( file )
4521 SOLVE_TEMPLATE( __READ )
4529 #define __READ( I ) \
4530 static_cast<pcl::I&>( **this ).Read( filePath )
4541 SOLVE_TEMPLATE( __READ )
4549 #define __RESCALE( I ) \
4550 static_cast<pcl::I&>( **this ).Rescale( lowerBound, upperBound, rect, firstChannel, lastChannel )
4558 template <
typename T>
4560 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4563 SOLVE_TEMPLATE_REAL( __RESCALE )
4571 #define __RESCALE( I ) \
4572 static_cast<pcl::I&>( **this ).Rescale( rect, firstChannel, lastChannel )
4583 SOLVE_TEMPLATE_REAL( __RESCALE )
4591 #define __RESCALED( I ) \
4592 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Rescaled( lowerBound, upperBound, rect, firstChannel, lastChannel ) ) ); \
4593 result.SetOwnership( true )
4602 template <
typename T>
4604 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
4608 SOLVE_TEMPLATE_REAL( __RESCALED )
4616 #define __RESCALED( I ) \
4617 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Rescaled( rect, firstChannel, lastChannel ) ) ); \
4618 result.SetOwnership( true )
4631 SOLVE_TEMPLATE_REAL( __RESCALED )
4639 #define __SET_ABSOLUTE_DIFFERENCE( I ) \
4640 static_cast<pcl::I&>( **this ).SetAbsoluteDifference( scalar, rect, firstChannel, lastChannel )
4650 template <
typename T>
4652 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4655 SOLVE_TEMPLATE( __SET_ABSOLUTE_DIFFERENCE )
4659 #undef __SET_ABSOLUTE_DIFFERENCE
4664 template <
typename T>
4666 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4668 return SetAbsoluteDifference( scalar, rect, firstChannel, lastChannel );
4673 #define __SET_ABSOLUTE_DIFFERENCE_1( I ) \
4674 ImageVariant::SetAbsoluteDifference( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
4676 #define __SET_ABSOLUTE_DIFFERENCE_2( I ) \
4677 image1.SetAbsoluteDifference( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
4681 template <
class P>
static
4683 const Point& point,
int channel,
4684 const Rect& rect,
int firstChannel,
int lastChannel )
4686 SOLVE_TEMPLATE_2( image2, __SET_ABSOLUTE_DIFFERENCE_2 )
4700 const Point& point =
Point( int_max ),
int channel = -1,
4701 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4705 SOLVE_TEMPLATE( __SET_ABSOLUTE_DIFFERENCE_1 )
4709 #undef __SET_ABSOLUTE_DIFFERENCE_1
4710 #undef __SET_ABSOLUTE_DIFFERENCE_2
4713 const Point& point =
Point( int_max ),
int channel = -1,
4714 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4716 return SetAbsoluteDifference( image, point, channel, rect, firstChannel, lastChannel );
4721 #define __SET_ABSOLUTE_VALUE( I ) \
4722 static_cast<pcl::I&>( **this ).SetAbsoluteValue( rect, firstChannel, lastChannel )
4734 SOLVE_TEMPLATE( __SET_ABSOLUTE_VALUE )
4740 return SetAbsoluteValue( rect, firstChannel, lastChannel );
4743 #undef __SET_ABSOLUTE_VALUE
4747 #define __SET_COLOR_SPACE( I ) \
4748 static_cast<pcl::I&>( **this ).SetColorSpace( colorSpace, maxProcessors )
4760 SOLVE_TEMPLATE( __SET_COLOR_SPACE )
4764 #undef __SET_COLOR_SPACE
4768 #define __SET_COLUMN( I ) \
4769 static_cast<pcl::I&>( **this ).SetColumn( buffer, x, channel )
4778 template <
typename T>
4781 PCL_PRECONDITION( buffer != 0 )
4783 SOLVE_TEMPLATE( __SET_COLUMN )
4791 #define __SET_LIGHTNESS_1( I ) \
4792 ImageVariant::SetLightness( static_cast<pcl::I&>( **this ), L, point, rect, maxProcessors )
4794 #define __SET_LIGHTNESS_2( I ) \
4795 image.SetLightness( static_cast<const pcl::I&>( *L ), point, rect, maxProcessors )
4799 template <
class P>
static
4801 const Point& point,
const Rect& rect,
int maxProcessors )
4803 if ( !L.IsComplexSample() )
4804 SOLVE_TEMPLATE_REAL_2( L, __SET_LIGHTNESS_2 )
4818 const Rect& rect =
Rect( 0 ),
int maxProcessors = 0 )
4821 if ( !IsComplexSample() )
4823 SOLVE_TEMPLATE_REAL( __SET_LIGHTNESS_1 )
4827 #undef __SET_LIGHTNESS_1
4828 #undef __SET_LIGHTNESS_2
4832 #define __SET_LUMINANCE_1( I ) \
4833 ImageVariant::SetLuminance( static_cast<pcl::I&>( **this ), Y, point, rect, maxProcessors )
4835 #define __SET_LUMINANCE_2( I ) \
4836 image.SetLuminance( static_cast<const pcl::I&>( *Y ), point, rect, maxProcessors )
4840 template <
class P>
static
4842 const Point& point,
const Rect& rect,
int maxProcessors )
4844 if ( !Y.IsComplexSample() )
4845 SOLVE_TEMPLATE_REAL_2( Y, __SET_LUMINANCE_2 )
4859 const Rect& rect =
Rect( 0 ),
int maxProcessors = 0 )
4862 if ( !IsComplexSample() )
4864 SOLVE_TEMPLATE_REAL( __SET_LUMINANCE_1 )
4868 #undef __SET_LUMINANCE_1
4869 #undef __SET_LUMINANCE_2
4873 #define __SET_MAXIMUM( I ) \
4874 static_cast<pcl::I&>( **this ).SetMaximum( scalar, rect, firstChannel, lastChannel )
4883 template <
typename T>
4885 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4888 SOLVE_TEMPLATE( __SET_MAXIMUM )
4892 #undef __SET_MAXIMUM
4897 template <
typename T>
4899 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4901 return SetMaximum( scalar, rect, firstChannel, lastChannel );
4906 #define __SET_MAXIMUM_1( I ) \
4907 ImageVariant::SetMaximum( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
4909 #define __SET_MAXIMUM_2( I ) \
4910 image1.SetMaximum( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
4914 template <
class P>
static
4916 const Point& point,
int channel,
4917 const Rect& rect,
int firstChannel,
int lastChannel )
4919 SOLVE_TEMPLATE_2( image2, __SET_MAXIMUM_2 )
4933 const Point& point =
Point( int_max ),
int channel = -1,
4934 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4938 SOLVE_TEMPLATE( __SET_MAXIMUM_1 )
4942 #undef __SET_MAXIMUM_1
4943 #undef __SET_MAXIMUM_2
4949 const Point& point =
Point( int_max ),
int channel = -1,
4950 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4952 return SetMaximum( image, point, channel, rect, firstChannel, lastChannel );
4957 #define __SET_MINIMUM( I ) \
4958 static_cast<pcl::I&>( **this ).SetMinimum( scalar, rect, firstChannel, lastChannel )
4967 template <
typename T>
4969 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4972 SOLVE_TEMPLATE( __SET_MINIMUM )
4976 #undef __SET_MINIMUM
4981 template <
typename T>
4983 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
4985 return SetMinimum( scalar, rect, firstChannel, lastChannel );
4990 #define __SET_MINIMUM_1( I ) \
4991 ImageVariant::SetMinimum( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
4993 #define __SET_MINIMUM_2( I ) \
4994 image1.SetMinimum( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
4998 template <
class P>
static
5000 const Point& point,
int channel,
5001 const Rect& rect,
int firstChannel,
int lastChannel )
5003 SOLVE_TEMPLATE_2( image2, __SET_MINIMUM_2 )
5017 const Point& point =
Point( int_max ),
int channel = -1,
5018 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5022 SOLVE_TEMPLATE( __SET_MINIMUM_1 )
5026 #undef __SET_MINIMUM_1
5027 #undef __SET_MINIMUM_2
5033 const Point& point =
Point( int_max ),
int channel = -1,
5034 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5036 return SetMinimum( image, point, channel, rect, firstChannel, lastChannel );
5042 result = static_cast<const pcl::I&>( **this ).Sn( rect, firstChannel, lastChannel, maxProcessors )
5050 double Sn(
const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
5051 int maxProcessors = 0 )
const
5053 double result =
false;
5055 SOLVE_TEMPLATE( __Sn )
5063 #define __SET_ROW( I ) \
5064 static_cast<pcl::I&>( **this ).SetRow( buffer, y, channel )
5073 template <
typename T>
5076 PCL_PRECONDITION( buffer != 0 )
5078 SOLVE_TEMPLATE( __SET_ROW )
5086 #define __ENSURE_UNIQUE_IMAGE( I ) \
5087 static_cast<pcl::I&>( **this ).EnsureUnique()
5100 SOLVE_TEMPLATE( __ENSURE_UNIQUE_IMAGE )
5104 #undef __ENSURE_UNIQUE_IMAGE
5108 #define __ENSURE_LOCAL_IMAGE( I ) \
5109 static_cast<pcl::I&>( **this ).EnsureLocal()
5121 SOLVE_TEMPLATE( __ENSURE_LOCAL_IMAGE )
5125 #undef __ENSURE_LOCAL_IMAGE
5129 #define __SHIFT( I ) \
5130 static_cast<pcl::I&>( **this ).Shift( fillValues )
5138 template <
typename T>
5142 SOLVE_TEMPLATE( __SHIFT )
5150 #define __SHIFT( I ) \
5151 static_cast<pcl::I&>( **this ).Shift()
5163 SOLVE_TEMPLATE( __SHIFT )
5171 #define __SHIFT_BY( I ) \
5172 static_cast<pcl::I&>( **this ).ShiftBy( dx, dy, fillValues )
5180 template <
typename T>
5184 SOLVE_TEMPLATE( __SHIFT_BY )
5192 #define __SHIFT_BY( I ) \
5193 static_cast<pcl::I&>( **this ).ShiftBy( dx, dy )
5205 SOLVE_TEMPLATE( __SHIFT_BY )
5213 #define __SHIFT_TO( I ) \
5214 static_cast<pcl::I&>( **this ).ShiftTo( x, y, fillValues )
5222 template <
typename T>
5226 SOLVE_TEMPLATE( __SHIFT_TO )
5234 #define __SHIFT_TO( I ) \
5235 static_cast<pcl::I&>( **this ).ShiftTo( x, y )
5247 SOLVE_TEMPLATE( __SHIFT_TO )
5255 #define __SHIFT_TO( I ) \
5256 static_cast<pcl::I&>( **this ).ShiftTo( p, fillValues )
5264 template <
typename T>
5268 SOLVE_TEMPLATE( __SHIFT_TO )
5276 #define __SHIFT_TO( I ) \
5277 static_cast<pcl::I&>( **this ).ShiftTo( p )
5289 SOLVE_TEMPLATE( __SHIFT_TO )
5297 #define __SHIFT_TO_BOTTOM_LEFT( I ) \
5298 static_cast<pcl::I&>( **this ).ShiftToBottomLeft( width, height, fillValues )
5307 template <
typename T>
5311 SOLVE_TEMPLATE( __SHIFT_TO_BOTTOM_LEFT )
5315 #undef __SHIFT_TO_BOTTOM_LEFT
5319 #define __SHIFT_TO_BOTTOM_LEFT( I ) \
5320 static_cast<pcl::I&>( **this ).ShiftToBottomLeft( width, height )
5334 SOLVE_TEMPLATE( __SHIFT_TO_BOTTOM_LEFT )
5338 #undef __SHIFT_TO_BOTTOM_LEFT
5342 #define __SHIFT_TO_BOTTOM_RIGHT( I ) \
5343 static_cast<pcl::I&>( **this ).ShiftToBottomRight( width, height, fillValues )
5352 template <
typename T>
5356 SOLVE_TEMPLATE( __SHIFT_TO_BOTTOM_RIGHT )
5360 #undef __SHIFT_TO_BOTTOM_RIGHT
5364 #define __SHIFT_TO_BOTTOM_RIGHT( I ) \
5365 static_cast<pcl::I&>( **this ).ShiftToBottomRight( width, height )
5379 SOLVE_TEMPLATE( __SHIFT_TO_BOTTOM_RIGHT )
5383 #undef __SHIFT_TO_BOTTOM_RIGHT
5387 #define __SHIFT_TO_BOTTOM_CENTER( I ) \
5388 static_cast<pcl::I&>( **this ).ShiftToCenter( width, height, fillValues )
5397 template <
typename T>
5401 SOLVE_TEMPLATE( __SHIFT_TO_BOTTOM_CENTER )
5405 #undef __SHIFT_TO_BOTTOM_CENTER
5409 #define __SHIFT_TO_BOTTOM_CENTER( I ) \
5410 static_cast<pcl::I&>( **this ).ShiftToCenter( width, height )
5424 SOLVE_TEMPLATE( __SHIFT_TO_BOTTOM_CENTER )
5428 #undef __SHIFT_TO_BOTTOM_CENTER
5432 #define __SHIFT_TO_TOP_LEFT( I ) \
5433 static_cast<pcl::I&>( **this ).ShiftToTopLeft( width, height, fillValues )
5442 template <
typename T>
5446 SOLVE_TEMPLATE( __SHIFT_TO_TOP_LEFT )
5450 #undef __SHIFT_TO_TOP_LEFT
5454 #define __SHIFT_TO_TOP_LEFT( I ) \
5455 static_cast<pcl::I&>( **this ).ShiftToTopLeft( width, height )
5469 SOLVE_TEMPLATE( __SHIFT_TO_TOP_LEFT )
5473 #undef __SHIFT_TO_TOP_LEFT
5477 #define __SHIFT_TO_TOP_RIGHT( I ) \
5478 static_cast<pcl::I&>( **this ).ShiftToTopRight( width, height, fillValues )
5487 template <
typename T>
5491 SOLVE_TEMPLATE( __SHIFT_TO_TOP_RIGHT )
5495 #undef __SHIFT_TO_TOP_RIGHT
5499 #define __SHIFT_TO_TOP_RIGHT( I ) \
5500 static_cast<pcl::I&>( **this ).ShiftToTopRight( width, height )
5514 SOLVE_TEMPLATE( __SHIFT_TO_TOP_RIGHT )
5518 #undef __SHIFT_TO_TOP_RIGHT
5522 #define __STD_DEV( I ) \
5523 result = static_cast<const pcl::I&>( **this ).StdDev( rect, firstChannel, lastChannel, maxProcessors )
5530 double StdDev(
const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
5531 int maxProcessors = 0 )
const
5535 SOLVE_TEMPLATE( __STD_DEV )
5543 #define __SUBTRACT( I ) \
5544 static_cast<pcl::I&>( **this ).Subtract( scalar, rect, firstChannel, lastChannel )
5553 template <
typename T>
5555 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5558 SOLVE_TEMPLATE( __SUBTRACT )
5567 template <
typename T>
5569 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5571 return Subtract( scalar, rect, firstChannel, lastChannel );
5576 #define __SUBTRACT_1( I ) \
5577 ImageVariant::Subtract( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
5579 #define __SUBTRACT_2( I ) \
5580 image1.Subtract( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
5584 template <
class P>
static
5586 const Point& point,
int channel,
5587 const Rect& rect,
int firstChannel,
int lastChannel )
5589 SOLVE_TEMPLATE_2( image2, __SUBTRACT_2 )
5602 const Point& point =
Point( int_max ),
int channel = -1,
5603 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5607 SOLVE_TEMPLATE( __SUBTRACT_1 )
5618 const Point& point =
Point( int_max ),
int channel = -1,
5619 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5621 return Subtract( image, point, channel, rect, firstChannel, lastChannel );
5626 #define __SUBTRACTED( I ) \
5627 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Subtracted( scalar, rect, firstChannel, lastChannel ) ) ); \
5628 result.SetOwnership( true )
5637 template <
typename T>
5639 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
5643 SOLVE_TEMPLATE( __SUBTRACTED )
5651 #define __SUM_OF_SQUARES( I ) \
5652 result = static_cast<const pcl::I&>( **this ).SumOfSquares( rect, firstChannel, lastChannel, maxProcessors )
5661 int maxProcessors = 0 )
const
5665 SOLVE_TEMPLATE( __SUM_OF_SQUARES )
5669 #undef __SUM_OF_SQUARES
5673 #define __TRANSFER_IMAGE_1( I ) \
5674 ImageVariant::TransferImage( static_cast<pcl::I&>( **this ), image )
5676 #define __TRANSFER_IMAGE_2( I ) \
5677 image1.Transfer( static_cast<pcl::I&>( *image2 ) )
5681 template <
class P>
static
5684 SOLVE_TEMPLATE_2( image2, __TRANSFER_IMAGE_2 )
5701 SOLVE_TEMPLATE( __TRANSFER_IMAGE_1 )
5705 #undef __TRANSFER_IMAGE_1
5706 #undef __TRANSFER_IMAGE_2
5710 #define __TRANSFORM( I ) \
5711 static_cast<const pcl::I&>( **this ).Transform( transform, rect, firstChannel, lastChannel )
5721 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
5724 SOLVE_TEMPLATE( __TRANSFORM )
5731 #define __TRUNCATE( I ) \
5732 static_cast<pcl::I&>( **this ).Truncate( lowerBound, upperBound, rect, firstChannel, lastChannel )
5741 template <
typename T>
5743 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5746 SOLVE_TEMPLATE_REAL( __TRUNCATE )
5754 #define __TRUNCATE( I ) \
5755 static_cast<pcl::I&>( **this ).Truncate( rect, firstChannel, lastChannel )
5767 SOLVE_TEMPLATE_REAL( __TRUNCATE )
5775 #define __TRUNCATED( I ) \
5776 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Truncated( lowerBound, upperBound, rect, firstChannel, lastChannel ) ) ); \
5777 result.SetOwnership( true )
5786 template <
typename T>
5788 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
5792 SOLVE_TEMPLATE( __TRUNCATED )
5800 #define __TRUNCATED( I ) \
5801 result.SetImage( *new pcl::I( static_cast<const pcl::I&>( **this ).Truncated( rect, firstChannel, lastChannel ) ) ); \
5802 result.SetOwnership( true )
5815 SOLVE_TEMPLATE( __TRUNCATED )
5823 #define __VARIANCE( I ) \
5824 result = static_cast<const pcl::I&>( **this ).Variance( rect, firstChannel, lastChannel, maxProcessors )
5831 double Variance(
const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1,
int maxProcessors = 0 )
const
5835 SOLVE_TEMPLATE( __VARIANCE )
5843 #define __WHITE( I ) \
5844 static_cast<pcl::I&>( **this ).White( rect, firstChannel, lastChannel )
5855 SOLVE_TEMPLATE_REAL( __WHITE )
5863 #define __WRITE( I ) \
5864 static_cast<const pcl::I&>( **this ).Write( file, rect, firstChannel, lastChannel )
5873 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
5876 SOLVE_TEMPLATE( __WRITE )
5884 #define __WRITE( I ) \
5885 static_cast<const pcl::I&>( **this ).Write( filePath, rect, firstChannel, lastChannel )
5894 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
const
5897 SOLVE_TEMPLATE( __WRITE )
5905 #define __XNOR( I ) \
5906 static_cast<pcl::I&>( **this ).Xnor( scalar, rect, firstChannel, lastChannel )
5915 template <
typename T>
5917 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5920 SOLVE_TEMPLATE_REAL( __XNOR )
5928 #define __XNOR_1( I ) \
5929 ImageVariant::Xnor( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
5931 #define __XNOR_2( I ) \
5932 image1.Xnor( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
5936 template <
class P>
static
5938 const Point& point,
int channel,
5939 const Rect& rect,
int firstChannel,
int lastChannel )
5941 SOLVE_TEMPLATE_REAL_2( image2, __XNOR_2 )
5954 const Point& point =
Point( int_max ),
int channel = -1,
5955 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5959 SOLVE_TEMPLATE_REAL( __XNOR_1 )
5968 #define __XOR( I ) \
5969 static_cast<pcl::I&>( **this ).Xor( scalar, rect, firstChannel, lastChannel )
5978 template <
typename T>
5980 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
5983 SOLVE_TEMPLATE_REAL( __XOR )
5991 #define __XOR_1( I ) \
5992 ImageVariant::Xor( static_cast<pcl::I&>( **this ), image, point, channel, rect, firstChannel, lastChannel )
5994 #define __XOR_2( I ) \
5995 image1.Xor( static_cast<const pcl::I&>( *image2 ), point, channel, rect, firstChannel, lastChannel )
5999 template <
class P>
static
6001 const Point& point,
int channel,
6002 const Rect& rect,
int firstChannel,
int lastChannel )
6004 SOLVE_TEMPLATE_REAL_2( image2, __XOR_2 )
6017 const Point& point =
Point( int_max ),
int channel = -1,
6018 const Rect& rect =
Rect( 0 ),
int firstChannel = -1,
int lastChannel = -1 )
6022 SOLVE_TEMPLATE_REAL( __XOR_1 )
6031 #define __ZERO( I ) \
6032 static_cast<pcl::I&>( **this ).Zero( rect, firstChannel, lastChannel )
6044 SOLVE_TEMPLATE_REAL( __ZERO )
6052 #define __COMPRESS( I ) \
6053 return static_cast<const pcl::I&>( **this ).Compress( compressor, rect, channel, perf )
6066 const Rect& rect =
Rect( 0 ),
int channel = -1,
6070 SOLVE_TEMPLATE( __COMPRESS )
6085 return m_data->image && m_data->isFloatSample == P::IsFloatSample() &&
6086 m_data->isComplexSample == P::IsComplexSample() &&
6087 m_data->bitsPerSample == P::BitsPerSample();
6100 image.m_data->Attach();
6102 m_data = image.m_data;
6113 return Assign( image );
6116 #define TRANSFER_BODY() \
6117 if ( &image != this ) \
6120 m_data = image.m_data; \
6121 image.m_data = nullptr; \
6157 #undef TRANSFER_BODY
6166 return Transfer( image );
6179 if ( &image !=
this )
6181 Data* newData =
new Data;
6182 image.DetachFromData();
6183 image.m_data = m_data;
6199 if ( &image != m_data->image )
6202 m_data->Update( &image );
6244 CreateComplexImage( bitSize );
6246 CreateFloatImage( bitSize );
6251 CreateUIntImage( bitSize );
6265 #define CREATE_IMAGE( I ) m_data->Update( new pcl::I )
6281 PCL_PRECONDITION( bitSize == 32 || bitSize == 64 )
6285 case 32: CREATE_IMAGE(
Image );
break;
6286 case 64: CREATE_IMAGE(
DImage );
break;
6288 m_data->ownsImage = m_data->image !=
nullptr;
6302 return CreateFloatImage();
6318 PCL_PRECONDITION( bitSize == 32 || bitSize == 64 )
6325 m_data->ownsImage = m_data->image !=
nullptr;
6342 PCL_PRECONDITION( bitSize == 8 || bitSize == 16 || bitSize == 32 )
6350 m_data->ownsImage = m_data->image !=
nullptr;
6372 return CreateImage( P::IsFloatSample(), P::IsComplexSample(), P::BitsPerSample() );
6393 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
6433 CreateSharedComplexImage( bitSize );
6435 CreateSharedFloatImage( bitSize );
6440 CreateSharedUIntImage( bitSize );
6446 #define CREATE_SHARED_IMAGE( I ) m_data->Update( new pcl::I( (void*)0, 0, 0 ) )
6464 PCL_PRECONDITION( bitSize == 32 || bitSize == 64 )
6468 case 32: CREATE_SHARED_IMAGE(
Image );
break;
6469 case 64: CREATE_SHARED_IMAGE(
DImage );
break;
6471 m_data->ownsImage = m_data->image !=
nullptr;
6488 return CreateSharedFloatImage();
6507 PCL_PRECONDITION( bitSize == 32 || bitSize == 64 )
6514 m_data->ownsImage = m_data->image !=
nullptr;
6534 PCL_PRECONDITION( bitSize == 8 || bitSize == 16 || bitSize == 32 )
6538 case 8: CREATE_SHARED_IMAGE(
UInt8Image );
break;
6539 case 16: CREATE_SHARED_IMAGE(
UInt16Image );
break;
6540 case 32: CREATE_SHARED_IMAGE(
UInt32Image );
break;
6542 m_data->ownsImage = m_data->image !=
nullptr;
6546 #undef CREATE_SHARED_IMAGE
6567 return CreateSharedImage( P::IsFloatSample(), P::IsComplexSample(), P::BitsPerSample() );
6593 #define ALLOCATE_IMAGE( I ) \
6594 static_cast<pcl::I&>( **this ).AllocateData( width, height, numberOfChannels, colorSpace )
6624 SOLVE_TEMPLATE( ALLOCATE_IMAGE )
6628 #undef ALLOCATE_IMAGE
6630 #define COPY_IMAGE( I ) static_cast<pcl::I&>( **this ).Assign( image )
6652 CreateImageAs( image );
6653 SOLVE_TEMPLATE( COPY_IMAGE )
6659 #define COPY_IMAGE( I ) CopyImage( static_cast<const pcl::I&>( *image ) )
6675 SOLVE_TEMPLATE_2( image, COPY_IMAGE )
6683 #define FREE_IMAGE( I ) static_cast<pcl::I&>( **this ).FreeData()
6703 SOLVE_TEMPLATE( FREE_IMAGE )
6747 swap_compression compression = SwapCompression::None,
6749 bool processEvents =
false )
const;
6796 swap_compression compression = SwapCompression::None,
6798 bool processEvents =
false )
const;
6829 bool processEvents =
false );
6868 bool processEvents =
false );
6906 bool processEvents =
false );
6943 bool processEvents =
false );
7022 return m_data->ownsImage;
7037 m_data->ownsImage = owner && m_data->image;
7050 if ( m_data->IsUnique() )
7054 Data* newData =
new Data;
7070 PCL_PRECONDITION( m_data->image !=
nullptr )
7071 return m_data->image;
7083 PCL_PRECONDITION( m_data->image !=
nullptr )
7084 return m_data->image;
7096 PCL_PRECONDITION( m_data->image !=
nullptr )
7097 return *m_data->image;
7109 PCL_PRECONDITION( m_data->image !=
nullptr )
7110 return *m_data->image;
7116 operator bool() const noexcept
7118 return m_data->image !=
nullptr;
7121 #define __PIXEL_ACCESS_OPERATOR( I ) \
7122 pcl::I::pixel_traits::FromSample( result, *static_cast<const pcl::I&>( **this ).PixelAddress( x, y, channel ) )
7149 double operator ()(
int x,
int y,
int channel = 0 ) const noexcept
7153 SOLVE_TEMPLATE( __PIXEL_ACCESS_OPERATOR )
7157 #undef __PIXEL_ACCESS_OPERATOR
7159 #ifdef __PCL_BUILDING_PIXINSIGHT_APPLICATION
7161 bool IsShared() const noexcept
7163 return m_shared !=
nullptr;
7166 const pi::SharedImage* SharedImage()
const
7172 pi::SharedImage* GetSharedImage(
bool rdOnly =
false )
const;
7173 pi::SharedImage* NewSharedImage(
void* owner,
bool rdOnly =
false );
7179 struct Data :
public ReferenceCounter
7181 AbstractImage* image =
nullptr;
7182 bool isFloatSample =
false;
7183 bool isComplexSample =
false;
7184 uint8 bitsPerSample = 0;
7185 bool ownsImage =
false;
7195 void Update( GenericImage<P>* a_image ) noexcept
7198 isFloatSample = P::IsFloatSample();
7199 isComplexSample = P::IsComplexSample();
7200 bitsPerSample =
uint8( P::BitsPerSample() );
7208 isFloatSample = isComplexSample =
false;
7214 Data* m_data =
nullptr;
7216 #ifdef __PCL_BUILDING_PIXINSIGHT_APPLICATION
7218 pi::SharedImage* m_shared =
nullptr;
7220 const void* m_shared =
nullptr;
7223 void DetachFromData()
7225 if ( !m_data->Detach() )
7229 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
7232 ImageVariant( GenericImage<P>* image,
int )
7235 m_data->Update( image );
7236 m_data->ownsImage =
true;
7240 #ifdef __PCL_BUILDING_PIXINSIGHT_APPLICATION
7241 friend class pi::SharedImage;
7244 friend class ImageView;
7255 template <
class P>
inline
7261 template <
class P>
inline
7267 template <
class P>
inline
7273 template <
class P>
inline
7276 (void)
ImageVariant(
this ).SetLuminance( Y, point, rect, maxProcessors );
7280 template <
class P>
inline
7283 (void)
ImageVariant(
this ).SetLightness( L, point, rect, maxProcessors );
Base class of all two-dimensional images in PCL.
ImageColor::color_space color_space
Client-side interface to a PixInsight Bitmap object.
Abstract base class of data compression algorithm implementations.
Array< Subblock > subblock_list
A platform-independent interface to the local file system.
Implements a generic, two-dimensional, shared or local image.
void GetIntensity(GenericImage< P1 > &I, const Rect &rect=Rect(0), int maxProcessors=0) const
void GetLightness(GenericImage< P1 > &L, const Rect &rect=Rect(0), int maxProcessors=0) const
GenericImage & SetLightness(const GenericImage< P1 > &L, const Point &point=Point(int_max), const Rect &rect=Rect(0), int maxProcessors=0)
void GetLuminance(GenericImage< P1 > &Y, const Rect &rect=Rect(0), int maxProcessors=0) const
GenericImage & SetLuminance(const GenericImage< P1 > &Y, const Point &point=Point(int_max), const Rect &rect=Rect(0), int maxProcessors=0)
A generic point in the two-dimensional space.
A generic rectangle in the two-dimensional space.
Generic vector of arbitrary length.
Acts like a union for all types of images in PCL, with optional class-wide ownership of transported i...
void MaskFromSwapFiles(const String &fileName, const StringList &directories, const ImageVariant &mask, bool invert=false, bool processEvents=false)
ImageVariant & CropTo(int x0, int y0, int x1, int y1, const GenericVector< T > &fillValues)
ImageVariant & Read(const String &filePath)
size_type NumberOfSamples() const noexcept
void PopSelections() const
ImageVariant & Blend(const Bitmap &bitmap, const Point &point=Point(int_max), const Rect &rect=Rect(0))
ImageVariant & Dif(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
bool HasAlphaChannels() const noexcept
ImageVariant(const ImageVariant &image)
void GetRow(T *buffer, int y, int channel=-1) const
ImageVariant & EnsureLocalImage()
void PushSelections() const
int NumberOfNominalChannels() const noexcept
ImageVariant & Divide(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant Filled(const GenericVector< T > &values, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
double BendMidvariance(double center, double beta=0.2, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & CreateSharedUIntImage(int bitSize=16)
ImageVariant & Fill(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & AllocateData(const Rect &rect, int numberOfChannels=1, color_space colorSpace=ColorSpace::Gray)
ImageVariant & Xnor(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & SetOwnership(bool owner=true) noexcept
ImageVariant & SetMinimum(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Divide(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
Compression::subblock_list Compress(const Compression &compressor, const Rect &rect=Rect(0), int channel=-1, Compression::Performance *perf=nullptr) const
void SelectChannel(int c) const noexcept
bool IsFullSelection() const noexcept
void DisableParallelProcessing(bool disable=true) noexcept
ImageVariant & White(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Mul(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void GetSelectedChannelRange(int &c0, int &c1) const noexcept
ImageVariant & Raise(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
double StdDev(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & Add(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
Point SelectedPoint() const noexcept
void MaskImage(const ImageVariant &src, const ImageVariant &mask, bool invert=false)
double Variance(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
void MaskFromSwapFile(const String &filePath, const ImageVariant &mask, bool invert=false, bool processEvents=false)
ImageVariant & Shift(const GenericVector< T > &fillValues)
ImageVariant & AllocateData(int width, int height, int numberOfChannels=1, color_space colorSpace=ColorSpace::Gray)
double Qn(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant Filled(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
void LocateExtremeSampleValues(Point &pmin, T &min, Point &pmax, T &max, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & Xchg(ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
const AbstractImage * ImagePtr() const noexcept
ImageVariant Inverted(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & Write(const String &filePath, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
double MAD(double center, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
bool CanPopSelections() const noexcept
void SetRangeClipping(double clipLow, double clipHigh) const noexcept
ImageVariant & CreateSharedFloatImage(int bitSize=32)
bool IsEmptySelection() const noexcept
ImageVariant & Rescale(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Div(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & ShiftToTopLeft(int width, int height, const GenericVector< T > &fillValues)
Rect Bounds() const noexcept
ImageVariant & One(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & ShiftToTopRight(int width, int height, const GenericVector< T > &fillValues)
ImageVariant & Assign(const ImageVariant &image)
ImageVariant & Move(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant Divided(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & CreateSharedImage()
ImageVariant Applied(T scalar, image_op op=ImageOp::Mov, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & And(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant Minimum(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
bool OwnsImage() const noexcept
double SumOfSquares(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
bool Clip(pcl::GenericRectangle< T > &r) const noexcept
ImageVariant & CreateImage()
ImageVariant & Move(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void ResetRangeClipping() const noexcept
ImageVariant(ImageVariant &&image)
ImageVariant Applied(const ImageVariant &image, image_op op=ImageOp::Mov, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant Rescaled(T lowerBound, T upperBound, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & Nor(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant Raised(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & CropTo(int x0, int y0, int x1, int y1)
size_type ImageSize() const noexcept
ImageVariant & Crop(const GenericVector< T > &fillValues)
TwoSidedEstimate TwoSidedMAD(double center, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
static uint64 SwapFilesSize(const String &fileName, const StringList &directories)
ImageVariant(GenericImage< P > *image)
int LastChannel() const noexcept
ImageVariant & TransferImage(ImageVariant &image)
void SetMaxProcessors(int maxProcessors) noexcept
Rect SelectedRectangle() const noexcept
void EnableRangeClipping(bool enableLow=true, bool enableHigh=true) const noexcept
ImageVariant & Write(File &file, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
void WriteSwapFile(const String &filePath, swap_compression compression=SwapCompression::None, Compression::Performance *perf=nullptr, bool processEvents=false) const
uint64 Count(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & SetAbsoluteValue(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void SelectChannelRange(int c0, int c1) const noexcept
ImageVariant & Multiply(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void SetRGBWorkingSpace(const RGBColorSystem &rgbws)
ImageVariant & SetLightness(const ImageVariant &L, const Point &point=Point(int_max), const Rect &rect=Rect(0), int maxProcessors=0)
double LocateMaximumSampleValue(Point &pmax, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
void SetRangeClipHigh(double clipHigh) const noexcept
int Width() const noexcept
size_type NumberOfNominalSamples() const noexcept
bool IsSharedImage() const noexcept
ImageVariant & CreateImageAs(const pcl::GenericImage< P > &image)
void ReleaseTo(ImageVariant &image)
ImageVariant & Not(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Transfer(ImageVariant &image)
int LastSelectedChannel() const noexcept
size_type LineSize() const noexcept
static void DeleteSwapFiles(const String &fileName, const StringList &directories)
ImageVariant & SetMaximum(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & ShiftTo(const Point &p, const GenericVector< T > &fillValues)
double BiweightMidvariance(double center, double sigma, int k=9, bool reducedLength=false, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
AbstractImage * ImagePtr() noexcept
ImageVariant & Invert(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Sub(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
size_type NumberOfAlphaSamples() const noexcept
ImageVariant & CropTo(const Rect &rect)
ImageVariant & Zero(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
int SelectedChannel() const noexcept
ImageVariant & CropTo(const Rect &rect, const GenericVector< T > &fillValues)
ImageVariant Applied(const ImageTransformation &transformation, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
double Norm(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
bool IsHighRangeClippingEnabled() const noexcept
ImageVariant Truncated(T lowerBound, T upperBound, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & ShiftToCenter(int width, int height)
ImageVariant & CropBy(int left, int top, int right, int bottom, const GenericVector< T > &fillValues)
double LocateMinimumSampleValue(int &xmin, int &ymin, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & Max(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
bool Includes(const GenericRectangle< T > &r) const noexcept
bool IsFloatSample() const noexcept
ImageVariant AbsoluteValue(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & AllocateImage(int width, int height, int numberOfChannels, color_space colorSpace)
ImageVariant & ShiftToBottomRight(int width, int height, const GenericVector< T > &fillValues)
size_type NumberOfPixels() const noexcept
ImageVariant & Truncate(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
bool Intersects(T x0, T y0, T x1, T y1) const noexcept
void * SharedImageHandle() const noexcept
double LocateMaximumSampleValue(int &xmax, int &ymax, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
void ForgetAlphaChannel(int channel)
ImageVariant Binarized(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
const RGBColorSystem & RGBWorkingSpace() const noexcept
ImageVariant & Nand(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
bool Clip(T &x, T &y) const noexcept
void DeleteAlphaChannel(int channel)
double MaximumSampleValue(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & Invert(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void WriteSwapFiles(const String &fileName, const StringList &directories, swap_compression compression=SwapCompression::None, Compression::Performance *perf=nullptr, bool processEvents=false) const
ImageVariant & CreateImageAs(const ImageVariant &image)
ImageVariant & Xnor(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & SetImage(GenericImage< P > &image)
ImageVariant Multiplied(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
bool IsComplexSample() const noexcept
ImageVariant & SetMaximum(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & CreateSharedComplexImage(int bitSize=32)
void ResetPoint() const noexcept
ImageVariant & Xor(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Black(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
TwoSidedEstimate TwoSidedBiweightMidvariance(double center, const TwoSidedEstimate &sigma, int k=9, bool reducedLength=false, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
bool IsUniqueImage() const noexcept
static uint64 SwapFileSize(const String &filePath)
void ResetChannelRange() const noexcept
void DisableRangeClipping(bool disableLow=true, bool disableHigh=true) const noexcept
double MinimumSampleValue(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & Pow(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant Subtracted(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant Added(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
bool IsColor() const noexcept
ImageVariant & AssignImage(const ImageVariant &image, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void SelectAlphaChannels() const noexcept
ImageVariant & CreateSharedImageAs(const ImageVariant &image)
void GetColumn(T *buffer, int x, int channel=-1) const
ImageVariant & Read(File &file)
void ReadSwapFiles(const String &fileName, const StringList &directories, Compression::Performance *perf=nullptr, bool processEvents=false)
ImageVariant & ShiftTo(int x, int y, const GenericVector< T > &fillValues)
void ResetSelections() const noexcept
ImageVariant & ShiftToBottomLeft(int width, int height)
ImageVariant & Max(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void SelectRectangle(int x0, int y0, int x1, int y1) const noexcept
int NumberOfSelectedChannels() const noexcept
ImageVariant & SetColumn(const T *buffer, int x, int channel=-1)
bool IsCompletelySelected() const noexcept
size_type ChannelSize() const noexcept
int NumberOfChannels() const noexcept
ImageVariant Blended(const Bitmap &bitmap, const Point &point=Point(int_max), const Rect &rect=Rect(0)) const
bool Includes(T x, T y) const noexcept
String ChannelId(int c) const noexcept
int BytesPerSample() const noexcept
void DeleteAlphaChannels()
bool Clip(pcl::GenericPoint< T > &p) const noexcept
ImageVariant & Binarize(T threshold, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Mul(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Nor(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
static Compression * NewCompression(swap_compression algorithm, int itemSize=1)
void ReadSwapFile(const String &filePath, Compression::Performance *perf=nullptr, bool processEvents=false)
double RangeClipHigh() const noexcept
int Height() const noexcept
ImageVariant & Exchange(ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
bool IsParallelProcessingEnabled() const noexcept
void CreateAlphaChannels(int n)
ImageVariant & CopyImage(const ImageVariant &image)
int BitsPerSample() const noexcept
color_space ColorSpace() const noexcept
ImageVariant & Rescale(T lowerBound, T upperBound, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Truncate(T lowerBound, T upperBound, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
size_type NumberOfSelectedPixels() const noexcept
ImageVariant Normalized(T lowerBound, T upperBound, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
double Modulus(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
static void DeleteSwapFile(const String &filePath)
ImageVariant & Normalize(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & CreateSharedImage(bool isFloat, bool isComplex, int bitSize)
ImageVariant & SetAbsoluteDifference(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
bool IsValidChannelIndex(int c) const noexcept
ImageVariant & FreeImage()
ImageVariant & Subtract(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void SelectPoint(int x, int y) const noexcept
ImageVariant & ShiftToTopRight(int width, int height)
ImageVariant & SetAbsoluteDifference(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Pow(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void GetIntensity(ImageVariant &Y, const Rect &rect=Rect(0), int maxProcessors=0) const
ImageVariant & ShiftToTopLeft(int width, int height)
size_type NominalSize() const noexcept
size_type AlphaSize() const noexcept
Vector Norms(int maxDegree, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & Apply(const ImageTransformation &transformation, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void SetRangeClipLow(double clipLow) const noexcept
ImageVariant & ShiftToBottomRight(int width, int height)
ImageSelections & Selections() const noexcept
ImageVariant & Add(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void GetLuminance(ImageVariant &Y, const Rect &rect=Rect(0), int maxProcessors=0) const
double Mean(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
bool Includes(const GenericPoint< T > &p) const noexcept
double Sn(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & SetRow(const T *buffer, int y, int channel=-1)
ImageVariant & Binarize(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant Truncated(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & CreateSharedImageAs(const pcl::GenericImage< P > &image)
ImageVariant & Subtract(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Xor(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & SetMinimum(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
void SelectNominalChannels() const noexcept
void GetExtremeSampleValues(T &min, T &max, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & CreateComplexImage(int bitSize=32)
ImageVariant & CreateUIntImage(int bitSize=16)
ImageVariant & Transfer(ImageVariant &&image)
ImageVariant & ShiftBy(int dx, int dy, const GenericVector< T > &fillValues)
void SetStatusCallback(pcl::StatusCallback *callback) const noexcept
void EnableParallelProcessing(bool enable=true, int maxProcessors=0) noexcept
ImageVariant & SetColorSpace(color_space colorSpace, int maxProcessors=0)
ImageVariant & Raise(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Min(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
bool Intersects(const pcl::GenericRectangle< T > &r) const noexcept
ImageVariant Binarized(T threshold, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
double MeanOfSquares(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & ShiftTo(const Point &p)
double OrderStatistic(double k, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant Maximum(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & Apply(T scalar, image_op op=ImageOp::Mov, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
bool IsLowRangeClippingEnabled() const noexcept
ImageVariant & Sub(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Apply(const ImageVariant &image, image_op op=ImageOp::Mov, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & CreateImage(bool isFloat, bool isComplex, int bitSize)
int MaxProcessors() const noexcept
ImageVariant & CropBy(int left, int top, int right, int bottom)
ImageVariant & CreateFloatImage(int bitSize=32)
bool Clip(T &x0, T &y0, T &x1, T &y1) const noexcept
int NumberOfAlphaChannels() const noexcept
bool Includes(T x0, T y0, T x1, T y1) const noexcept
double AvgDev(double center, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
TwoSidedEstimate TwoSidedAvgDev(double center, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
void ResetSelection() const noexcept
double Median(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
void Transform(BidirectionalImageTransformation &transform, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & Div(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & ShiftBy(int dx, int dy)
ImageVariant & Nand(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & ShiftTo(int x, int y)
ImageVariant Inverted(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & Normalize(T lowerBound, T upperBound, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant AbsoluteDifference(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
void GetLightness(ImageVariant &L, const Rect &rect=Rect(0), int maxProcessors=0) const
bool IsRangeClippingEnabled() const noexcept
bool IsAs(const pcl::GenericImage< P > &) const
ImageVariant Rescaled(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
ImageVariant & Min(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & CopyImage(const GenericImage< P > &image)
double RangeClipLow() const noexcept
StatusMonitor & Status() const noexcept
pcl::StatusCallback * StatusCallback() const noexcept
ImageVariant & EnsureUniqueImage()
void SelectRectangle(const Point &p0, const Point &p1) const noexcept
ImageVariant & And(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
friend void Swap(ImageVariant &x1, ImageVariant &x2) noexcept
void LocateExtremeSampleValues(int &xmin, int &ymin, T &min, int &xmax, int &ymax, T &max, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & Or(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & Mov(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
ImageVariant & ShiftToBottomLeft(int width, int height, const GenericVector< T > &fillValues)
double LocateMinimumSampleValue(Point &pmin, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1, int maxProcessors=0) const
ImageVariant & Multiply(T scalar, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
int FirstSelectedChannel() const noexcept
ImageVariant & Fill(const GenericVector< T > &values, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
size_type NumberOfSelectedSamples() const noexcept
ImageVariant & Or(const ImageVariant &image, const Point &point=Point(int_max), int channel=-1, const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1)
bool IsSameImage(const ImageVariant &image) const noexcept
ImageVariant & ShiftToCenter(int width, int height, const GenericVector< T > &fillValues)
ImageVariant & SetLuminance(const ImageVariant &Y, const Point &point=Point(int_max), const Rect &rect=Rect(0), int maxProcessors=0)
void ForgetAlphaChannels()
void SelectPoint(const Point &p) const noexcept
void SelectRectangle(const Rect &r) const noexcept
ImageVariant Normalized(const Rect &rect=Rect(0), int firstChannel=-1, int lastChannel=-1) const
Colorimetrically defined RGB working color space.
Provides status monitoring callback functions.
An asynchronous status monitoring system.
Complex< T1 > operator*(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
T Abs(const Complex< T > &c) noexcept
void Swap(GenericPoint< T > &p1, GenericPoint< T > &p2) noexcept
unsigned long long uint64
void Apply(FI i, FI j, F f) noexcept(noexcept(f))
int NumberOfNominalChannels(int colorSpace)
A structure used to store rectangular image selections, channel ranges, anchor points,...
Two-sided descriptive statistical estimate.