Description

Validation, is it possible to cast to the specified type

Return Type

A Boolean value.  

Syntax

object.IsCastLegal (ePixelDataType, eInterpretation, eBitsPerChannel, eNumberOfChannels)

The IsCastLegal Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McImageType.
ePixelDataTypeRequired. A mcPixelDataType enumeration, as described in settings.

[in]

eInterpretationRequired. A mcInterpretation enumeration, as described in settings.

[in]

eBitsPerChannelRequired. A mcBitsPerChannel enumeration, as described in settings.

[in]

eNumberOfChannelsRequired. A Long value.

[in]

Settings

The settings for ePixelDataType are:

ConstantValueDescription
 mcpdtAnyType0

current band type

 mcpdtInteger1

pixels hold integral values

 mcpdtFloat2

numbers are floating point

The settings for eInterpretation are:

ConstantValueDescription
 mciAnyInterp0

current interpretation

 mciMonochrome1

only one channel

 mciIndexedColor2

8 bits per pixel, pseudo-colored

 mciGenericMultiBand3

multichannel, when needed, pixel luminance is averaged across the channels

 mciRGB4

normal color model, 3 channels arranged as “RGBRGBRGB...”

 mciBGR5

Similar to RGB, except the channels are reversed for DIBs as “BGRBGRBGR...”

 mciHSL6

Three channels, Hue, Saturation, and Luminance

 mciHSI7

Three channels, Hue, Saturation, and Intensity

 mciComplex8

Two channels, real and imaginary arranged as “RIRIRI...”, only supported with McFloat

 mciPolar9

Two channels, magnitude and phase arranged as “MPMPMP...”, only supported with McFloat

The settings for eBitsPerChannel are:

ConstantValueDescription
 mcbpcAnyBits0

don't care

 mcbpc8Bits8

integer only, values range from 0 to 255

 mcbpc12Bits12

integer only, needs 16 bits, values range from 0 to 4095

 mcbpc16Bits16

integer only, values range from 0 to 65535

 mcbpc32Bits32

can be either integer or float. If integer, values range from 0 to 4Gig.

 mcbpc64Bits64

float only