Click or drag to resize

IMcImageStorageSizeClosestSubsampledSubFrame Method

Inquire as to what size a subsampled sub-rectangle may be gotten.

Namespace:  MediaCy.IQL.Engine
Assembly:  MediaCy.IQL.Engine (in MediaCy.IQL.Engine.dll) Version: 10.0.6912.0
Syntax
VB
Function SizeClosestSubsampledSubFrame ( 
	FrameIndex As Integer,
	<OutAttribute> ByRef FrameCount As Integer,
	<OutAttribute> ByRef Left As Integer,
	<OutAttribute> ByRef Top As Integer,
	<OutAttribute> ByRef Right As Integer,
	<OutAttribute> ByRef Bottom As Integer,
	FrameCountLimit As Integer,
	LeftLimit As Integer,
	TopLimit As Integer,
	RightLimit As Integer,
	BottomLimit As Integer,
	<OutAttribute> ByRef SizeRatioX As Double,
	<OutAttribute> ByRef SizeRatioY As Double,
	<OutAttribute> ByRef SubsampledWidth As Integer,
	<OutAttribute> ByRef SubsampledHeight As Integer
) As Boolean

Parameters

FrameIndex
Type: SystemInt32
Index of frame to be accessed
FrameCount
Type: SystemInt32
Left
Type: SystemInt32
Left of minimal rectangle needed. Updated on exit to equal the rectangle that can be provided.
Top
Type: SystemInt32
Top of minimal rectangle needed. Updated on exit to equal the rectangle that can be provided.
Right
Type: SystemInt32
Right of minimal rectangle needed. Updated on exit to equal the rectangle that can be provided.
Bottom
Type: SystemInt32
Bottom of minimal rectangle needed. Updated on exit to equal the rectangle that can be provided.
FrameCountLimit
Type: SystemInt32
LeftLimit
Type: SystemInt32
Limit of Left of rectangle to be provided. Must be less than or equal to the entry Left value.
TopLimit
Type: SystemInt32
Limit of Top of rectangle to be provided. Must be less than or equal to the entry Top value.
RightLimit
Type: SystemInt32
Limit of Right of rectangle to be provided. Must be greater than or equal to the entry Right value.
BottomLimit
Type: SystemInt32
Limit of Bottom of rectangle to be provided. Must be greater than or equal to the entry Bottom value.
SizeRatioX
Type: SystemDouble
Requested horizontal decimation (i.e., tile width; 1 is no averaging). Updated on exit to equal the decimation that can be provided; this will always be less than or equal to the supplied value. E.g. if 3 is requested, 2 might be returned (but the returned value will never be less than 1). Only 1 is supported here.
SizeRatioY
Type: SystemDouble
Requested vertical decimation (i.e., tile height; 1 is no averaging). Updated on exit to equal the decimation that can be provided; this will always be less than or equal to the supplied value. E.g. if 3 is requested, 2 might be returned (but the returned value will never be less than 1). Only 1 is supported here.
SubsampledWidth
Type: SystemInt32
On return, filled with the width of each subsampled row that ReadSubsampledSubFrame will read for the returned Left, Right and SizeRatioX. The integer arithmetic formula used is Right/SizeRatioX - Left/SizeRatioX + 1
SubsampledHeight
Type: SystemInt32
On return, filled with the height of each subsampled column that ReadSubsampledSubFrame will read for the returned Top, Bottom and SizeRatioY. The integer arithmetic formula used is Bottom/SizeRatioY - Top/SizeRatioY + 1

Return Value

Type: Boolean
True if the requested subrectangle can be gotten.
Remarks
The coordinates are always given and returned as un-subsampled values. The decimation model is based on the assumption that the decimation will be performed by averaging the entire frame in "tiles" of size SizeRatioX by SizeRatioY. Decimation always starts at 0,0 to ensure that the same pixels are returned independent of the Left,Top coordinates of the SubFrame. All subsampled "tiles" that are touched by the un-subsampled subframe are returned. This means that for any given decimation and given width in un-subsampled sub-frame coordinates, the number of subsampled pixels returned may vary by 1 depending on the Left,Top of the subframe. The width and height of the subsampled subframe is returned in the SubsampledWidth and SubsampledHeight parameters. For example, if Left is 1 and Right is 8 (an un-subsampled width of 8 pixels), and SizeRatioX is 2, then the SubsampledWidth of a row filled by ReadSubsampledSubFrame would be 5 tiles. Decimation always starts at 0,0, so in our example, the 5 averaged horizontal tiles returned would be 0/1, 2/3, 4/5, 6/7 and 8/9. However, if Left is 0 and Right is 7 (also an un-subsampled width of 8 pixels), the SubsampledWidth will be 4 (averaged pixels 0/1, 2/3, 4/5, 6/7). FIX!!!! Below replaced by above, but the decimation algorithms have not been updated. Decimation always starts at 0,0 so that the same pixels are returned independent of the Left,Top coordinates of the SubFrame. This means that for any given decimation and given width in un-subsampled sub-frame coordinates, the number of subsampled pixels returned may vary by 1 depending on the Left,Top of the subframe. The width and height of the subsampled subframe is returned in the SubsampledWidth and SubsampledHeight parameters. For example, if Left is 1 and Right is 9 (an un-subsampled width of 9 pixels), and SizeRatioX is 2, then the SubsampledWidth of a row filled by ReadSubsampledSubFrame would be 4 pixels. Decimation always starts at 0,0, so in our example, the 4 horizontal pixels returned would be 2, 4, 6 and 8. However, if Left is 0 and Right is 8 (also an un-subsampled width of 9 pixels), the SubsampledWidth will be 5 (pixels 0,2,4,6,8).
See Also