LoadOptions

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.internal.progressmanagement.IProgressEventHandler

public class LoadOptions implements IProgressEventHandler

Represents the loading options.

Constructors

ConstructorDescription
LoadOptions()

Methods

MethodDescription
getDataRecoveryMode()Gets the data recovery mode.
setDataRecoveryMode(int value)Sets the data recovery mode.
getDataBackgroundColor()Gets the Image background Color.
setDataBackgroundColor(Color value)Sets the Image background Color.
getUseIccProfileConversion()Gets a value indicating whether ICC profile conversion should be applied.
setUseIccProfileConversion(boolean value)Sets a value indicating whether ICC profile conversion should be applied.
addCustomFontSource(CustomFontSource source, Object[] args)Adds the custom font source to supply image-specific fonts.
getBufferSizeHint()Gets the buffer size hint which is defined max allowed size for all internal buffers.
setBufferSizeHint(int value)Sets the buffer size hint which is defined max allowed size for all internal buffers.
getIProgressEventHandler()Gets the progress event handler.
setIProgressEventHandler(ProgressEventHandler value)Sets the progress event handler.

LoadOptions()

public LoadOptions()

getDataRecoveryMode()

public int getDataRecoveryMode()

Gets the data recovery mode.

Returns: int - The data recovery mode.

setDataRecoveryMode(int value)

public void setDataRecoveryMode(int value)

Sets the data recovery mode.

Parameters:

ParameterTypeDescription
valueintThe data recovery mode.

getDataBackgroundColor()

public Color getDataBackgroundColor()

Gets the Image background Color.

Returns: Color - The background color.

Typically the background color is set whenever pixel value cannot be recovered due to data corruption.

setDataBackgroundColor(Color value)

public void setDataBackgroundColor(Color value)

Sets the Image background Color.

Parameters:

ParameterTypeDescription
valueColorThe background color.

Typically the background color is set whenever pixel value cannot be recovered due to data corruption. |

getUseIccProfileConversion()

public boolean getUseIccProfileConversion()

Gets a value indicating whether ICC profile conversion should be applied.

Returns: boolean

setUseIccProfileConversion(boolean value)

public void setUseIccProfileConversion(boolean value)

Sets a value indicating whether ICC profile conversion should be applied.

Parameters:

ParameterTypeDescription
valueboolean

addCustomFontSource(CustomFontSource source, Object[] args)

public final void addCustomFontSource(CustomFontSource source, Object[] args)

Adds the custom font source to supply image-specific fonts.

Parameters:

ParameterTypeDescription
sourceCustomFontSourceThe custom font source provider function.
argsjava.lang.Object[]The arguments.

getBufferSizeHint()

public final int getBufferSizeHint()

Gets the buffer size hint which is defined max allowed size for all internal buffers.

Value: The buffer size hint, in megabytes. Non-positive value means no memory limitation for internal buffers

Returns: int - the buffer size hint which is defined max allowed size for all internal buffers.

setBufferSizeHint(int value)

public final void setBufferSizeHint(int value)

Sets the buffer size hint which is defined max allowed size for all internal buffers.

Value: The buffer size hint, in megabytes. Non-positive value means no memory limitation for internal buffers

Parameters:

ParameterTypeDescription
valueintthe buffer size hint which is defined max allowed size for all internal buffers.

Example: The following example shows how to set a memory limit when loading a JPEG image. The following example shows how to set a memory limit when loading a JPEG image. The memory limit is the maximum allowed size (in megabytes) for all internal buffers.

String workDir = "c:\\temp\\";
// Setting a memory limit of 50 megabytes for target loaded image
com.aspose.imaging.LoadOptions loadOptions = new com.aspose.imaging.LoadOptions();
loadOptions.setBufferSizeHint(50);
com.aspose.imaging.Image image = com.aspose.imaging.Image.load(workDir + "inputFile.jpg", loadOptions);
try {
    com.aspose.imaging.imageoptions.JpegOptions jpegOptions = new com.aspose.imaging.imageoptions.JpegOptions();
    jpegOptions.setCompressionType(com.aspose.imaging.fileformats.jpeg.JpegCompressionMode.Baseline);
    jpegOptions.setQuality(100);
    image.save(workDir + "outputFile_Baseline.jpg", jpegOptions);

    jpegOptions = new com.aspose.imaging.imageoptions.JpegOptions();
    jpegOptions.setCompressionType(com.aspose.imaging.fileformats.jpeg.JpegCompressionMode.Progressive);
    image.save(workDir + "outputFile_Progressive.jpg", jpegOptions);

    jpegOptions = new com.aspose.imaging.imageoptions.JpegOptions();
    jpegOptions.setCompressionType(com.aspose.imaging.fileformats.jpeg.JpegCompressionMode.Lossless);
    jpegOptions.setColorType(com.aspose.imaging.fileformats.jpeg.JpegCompressionColorMode.YCbCr);
    jpegOptions.setBitsPerChannel((byte) 4);
    image.save(workDir + "outputFile_Lossless.jpg", jpegOptions);

    jpegOptions = new com.aspose.imaging.imageoptions.JpegOptions();
    jpegOptions.setCompressionType(com.aspose.imaging.fileformats.jpeg.JpegCompressionMode.JpegLs);
    jpegOptions.setJpegLsInterleaveMode(com.aspose.imaging.fileformats.jpeg.JpegLsInterleaveMode.None);
    jpegOptions.setJpegLsAllowedLossyError(3);
    jpegOptions.setJpegLsPreset(null);
    image.save(workDir + "outputFile_JpegLs.jpg", jpegOptions);
} finally {
    image.close();
}

getIProgressEventHandler()

public ProgressEventHandler getIProgressEventHandler()

Gets the progress event handler.

Value: The progress event handler.

Returns: ProgressEventHandler - the progress event handler.

setIProgressEventHandler(ProgressEventHandler value)

public void setIProgressEventHandler(ProgressEventHandler value)

Sets the progress event handler.

Parameters:

ParameterTypeDescription
valueProgressEventHandlerthe progress event handler.