J2KSetDefaults Example for Delphi
LEADRasterIO * pRasterIO = NULL;
AnsiString csmsg;
AnsiString cstemp;
CoCreateInstance (CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_J2K, AnsiToOLESTR (L_KEY_J2K));
// Display all the default JPEG2000 advanced options
pRasterIO->J2KSetDefaults ();
csmsg= "";
if ( pRasterIO->J2KUseColorTransform )
cstemp= "J2KUseColorTransform = True \n";
else
cstemp= "J2KUseColorTransform = False \n";
csmsg= csmsg + cstemp;
if ( pRasterIO->J2KDerivedQuantization )
cstemp= "J2KDerivedQuantization = True \n";
else
cstemp= "J2KDerivedQuantization = False \n";
csmsg= csmsg + cstemp;
cstemp= "J2KXOsiz = " + IntToStr((int)pRasterIO->J2KXOsiz) + "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KYOsiz = " + IntToStr((int)pRasterIO->J2KYOsiz) + "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KXTsiz = "+ IntToStr((int)pRasterIO->J2KXTsiz) + "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KYTsiz = "+ IntToStr((int)pRasterIO->J2KYTsiz)+ "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KXTOsiz = " + IntToStr((int)pRasterIO->J2KXTOsiz) + "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KYTOsiz = " + IntToStr((int)pRasterIO->J2KYTOsiz) + "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KDecompLevel = "+ IntToStr((int)pRasterIO->J2KDecompLevel)+ "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KProgressOrder = " + IntToStr((int)pRasterIO->J2KProgressOrder) + "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KCodBlockWidth = " + IntToStr((int)pRasterIO->J2KCodBlockWidth) + "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KCodBlockHeight = " + IntToStr((int)pRasterIO->J2KCodBlockHeight) + "\n";
csmsg= csmsg + cstemp;
if ( pRasterIO->J2KCBS_SelectiveACBypass )
cstemp= "J2KCBS_SelectiveACBypass = True \n";
else
cstemp= "J2KCBS_SelectiveACBypass = False \n";
csmsg= csmsg + cstemp;
if ( pRasterIO->J2KCBS_ResetContextOnBoundaries )
cstemp= "J2KCBS_ResetContextOnBoundaries = True \n";
else
cstemp= "J2KCBS_ResetContextOnBoundaries = False \n";
csmsg= csmsg + cstemp;
if ( pRasterIO->J2KCBS_TerminationOnEachPass )
cstemp= "J2KCBS_TerminationOnEachPass = True \n";
else
cstemp= "J2KCBS_TerminationOnEachPass = False \n";
csmsg= csmsg + cstemp;
if ( pRasterIO->J2KCBS_VerticallyCausalContext )
cstemp= "J2KCBS_VerticallyCausalContext = True \n";
else
cstemp= "J2KCBS_VerticallyCausalContext = False \n";
csmsg= csmsg + cstemp;
if ( pRasterIO->J2KCBS_PredictableTermination )
cstemp= "J2KCBS_PredictableTermination = True \n";
else
cstemp= "J2KCBS_PredictableTermination = False \n";
csmsg= csmsg + cstemp;
if ( pRasterIO->J2KCBS_ErrorResilienceSymbol )
cstemp= "J2KCBS_ErrorResilienceSymbol = True \n";
else
cstemp= "J2KCBS_ErrorResilienceSymbol = False \n";
csmsg= csmsg + cstemp;
cstemp= "J2KGuardBits = " + IntToStr((int)pRasterIO->J2KGuardBits)+ "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KDerivedBaseMantissa = " + IntToStr ((int) pRasterIO->J2KDerivedBaseMantissa)+ "\n";
csmsg= csmsg + cstemp;
cstemp= "J2KDerivedBaseExponent = " + IntToStr ((int) pRasterIO->J2KDerivedBaseExponent)+ "\n";
csmsg= csmsg + cstemp;
if ( pRasterIO->J2KUseSOPMarker )
cstemp= "J2KUseSOPMarker = True \n";
else
cstemp= "J2KUseSOPMarker = False \n";
csmsg= csmsg + cstemp;
if (pRasterIO->J2KUseEPHMarker)
cstemp= "J2KUseEPHMarker = True \n";
else
cstemp= "J2KUseEPHMarker = False \n";
csmsg= csmsg + cstemp;
ShowMessage (csmsg);
pRasterIO->Release();