ExtractRegion Data Member Function

Extracts a square or rectangular region from a 1-dimensional array by performing the extraction as if the array were 2-dimensional. This is equivalent to the functionality of a BitBlt operation on a standard <Image> object. This differs from the ExtractRegion algorithm because it can extract bytes from any basic array type: <Uint8Array>, <Uint16Array>, <Uint32Array>, <Uint64Array>, <Int8Array>, <Int16Array>, <Int32Array>, <Int64Array>, <Float16Array>, <Float32Array>, or <Float64Array>. This makes it easier to implement some types of algorithms more generically.

Prototype

int32 ExtractRegion( Int64Iterator first, Int64Iterator last, Int64Iterator dst, Int32Array p_aiParams )

Parameters

Parameter Type Parameter Name Documentation
<Int64Iterator>firstAn iterator at the start of the source range. Typically, for extraction, this will be the first element in the source array.
<Int64Iterator>lastAn iterator at the end of the source range. Typically, for extraction, this will be the first element in the source array.
<Int64Iterator>dstAn iterator at the start of the destination range. Typically, for extraction, this will be the first element in the destination array.
<Int32Array>p_aiParamsAn <Int32Array> containing the parameters for the extraction. The number of elements in the source array must match the submitted width and height parameters. Array item [0] = the source width as if the array were 2D. Array item [1] = the source height as if the array were 2D. Array item [2] = the region start X coordinate as if the array were 2D. Array item [3] = the region start Y coordinate as if the array were 2D. Array item [4] = the width of the region as if the array were 2D. Array item [5] = the height of the region as if the array were 2D. Given a 1D array representing 2D array of 1024x1024, the minimum region coordinates are 0 - 1024 ( 0 minus 1024 ) for region start X, 0 - 1024 ( 0 minus 1024 ) for region start Y, and 1024 + 1024 for region width X and 1024 + 1024 for region width Y. In order, these 'parameters' are as follows: a_nSrcWidth, a_nSrcHeight, a_nRegStartX, a_nRegStartY, a_nRegWidthX, and a_nRegWidthY.

Examples

Copy Text To Clipboard

None published. Please look for an example in the Scenome Scripting Language code base.