SampleLine

Stores a raster line into buffer.

Syntax

IppStatus ippiSampleLine_<mod>(const Ipp<datatype>* pSrc, int scrStep, 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

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

The function ippiSampleLine is declared in the ippcv.h file. It 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 stores the resulting pixels in the destination buffer.

Example “Using ippiSampleLine Function” shows how to use the function ippiSampleLine_8u_C1R .

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.

Using ippiSampleLine Function


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 = 8*sizeof(Ipp8u); ippiSampleLine_8u_C1R( pSrc, srcStep, roiSize, pDst, pt1, pt2 ); }

Result: 9 3 18


Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.