Developer Reference

  • 2020
  • 07/15/2020
  • Public Content
Contents

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

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804