Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference
A newer version of this document is available. Customers should click here to go to the newest version.
SampleLine
Puts a raster line into buffer.
Syntax
IppStatus ippiSampleLine_<mod>(const Ipp<datatype>* pSrc, int srcStep, IppiSize roiSize, Ipp<datatype>* pDst, IppiPoint pt1, IppiPoint pt2);
Supported values for mod:
| 8u_C1R | 16u_C1R | 32f_C1R | 
| 8u_C3R | 16u_C3R | 32f_C3R | 
Include Files
ippcv.h
Domain Dependencies
Headers: ippcore.h, ippvm.h, ipps.h, ippi.h
Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib
Parameters
| pSrc | Pointer to the ROI in the source raster image. | 
| srcStep | Distance in bytes between starts of consecutive lines in the raster image. | 
| roiSize | Size of the image ROI in pixels. | 
| pDst | Pointer to the destination buffer. The buffer is to store at least max(|pt2.x - pt1.x| + 1, |pt2.y - pt1.y| + 1) points. | 
| pt1 | Starting point of the line. | 
| pt2 | Ending point of the line. | 
Description
This function operates with ROI (see Regions of Interest in Intel IPP).
This function iterates through the points that belong to the raster line using the 8-point connected Bresenham algorithm, and puts the resulting pixels into the destination buffer.
Return Values
| ippStsNoErr | Indicates no error. Any other value indicates an error or a warning. | 
| ippStsNullPtrErr | Indicates an error condition if any of the specified pointers is NULL. | 
| ippStsSizeErr | Indicates an error condition if roiSize.width or roiSize.height is less than or equal to zero. | 
| ippStsStepErr | Indicates an error condition if srcStep is less than roiSize.width * <pixelSize>. | 
| ippStsNotEvenStepErr | Indicates an error when the step for the floating-point image cannot be divided by 4. | 
| ippStsOutOfRangeErr | Indicates an error when any of the line ending points is outside the image. | 
Example
The code example below shows how to use the function ippiSampleLine_8u_C1R .
void func_sampleline() 
{ 
    Ipp8u pSrc[5*4] = { 0, 1, 2, 3, 4, 
                        5, 6, 7, 8, 9, 
                        0, 9, 8, 7, 6, 
                        5, 4, 3, 2, 1 }; 
    IppiSize roiSize = {5, 4}; 
    IppiPoint pt1 = {1, 1}; 
    IppiPoint pt2 = {2, 3}; 
    Ipp8u pDst[3]; 
    int srcStep = 5; 
                
    ippiSampleLine_8u_C1R( pSrc, srcStep, roiSize, pDst, pt1, pt2 ); 
                                
  printf("%Result: d,    %d, %d\n", pDst[0], pDst[1], pDst[2] ); // << this wrong line 
  printf("%Result: %d, %d, %d\n", pDst[0], pDst[1], pDst[2] ); // this is correct line 
} 
    
    
   Result: 6, 9, 3