CImage:DimEq
The DimEq method returns true if a test image has the same number of columns and rows as the current image.
bResult = CImage:DimEq( CImage Test )
Test is the comparison image.
On success, this method returns true if the dimensions are the same.
If the dimensions are different, or Test is invalid, this method returns false .
This method compares the dimensionality of two images, which involves comparing the pixel count along the first two axes (column and row axes). The data types are not compared, but something like
if ( I1:Datatype() == I2:Datatype() ) then (...) end
may be used to test the data type for equality.
The following script fragment compares 2 images in files sPath1 andsPath2 for equal number of rows and columns:
I1 = CImage:new() |
-- create image 1 |
I1:Open(sPath1) |
-- open image 1 |
I2 = CImage:new() |
-- create image 2 |
I2:Open(sPath) |
-- open image 2 |
if ( I1:DimEq(I2) ) then |
-- compare the dimensions |
Msg("Equal Dimensions") |
-- announce that they are equal |
end |
|
I1:delete() |
|
I2:delete() |
|
Related Topics