Class PixbufFormat
- All Implemented Interfaces:
Proxy
GdkPixbufFormat contains information about the image format accepted
by a module.
Only modules should access the fields directly, applications should
use the gdk_pixbuf_format_* family of functions.
- Since:
- 2.2
-
Constructor Summary
ConstructorsConstructorDescriptionAllocate a new PixbufFormat.PixbufFormat(Arena arena) Allocate a new PixbufFormat.PixbufFormat(MemorySegment address) Create a PixbufFormat proxy instance for the provided memory address.PixbufFormat(String name, PixbufModulePattern signature, String domain, String description, String[] mimeTypes, String[] extensions, int flags, boolean disabled, String license) Allocate a new PixbufFormat with the fields set to the provided values.PixbufFormat(String name, PixbufModulePattern signature, String domain, String description, String[] mimeTypes, String[] extensions, int flags, boolean disabled, String license, Arena arena) Allocate a new PixbufFormat with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescription@Nullable PixbufFormatcopy()Creates a copy offormat.voidfree()Frees the resources allocated when copying aGdkPixbufFormatusing gdk_pixbuf_format_copy()@Nullable StringReturns a description of the format.@Nullable String @Nullable []Returns the filename extensions typically used for files in the given format.@Nullable StringReturns information about the license of the image loader for the format.static MemoryLayoutThe memory layout of the native struct.@Nullable String @Nullable []Returns the mime types supported by the format.@Nullable StringgetName()Returns the name of the format.static @Nullable TypegetType()Get the GType of the PixbufFormat classbooleanReturns whether this image format is disabled.booleanisSaveOptionSupported(String optionKey) ReturnsTRUEif the save option specified byoptionKeyis supported when saving a pixbuf using the module implementingformat.booleanReturns whether this image format is scalable.booleanReturns whether pixbufs can be saved in the given format.Read the value of the fielddescription.booleanRead the value of the fielddisabled.Read the value of the fielddomain.@Nullable String @Nullable []Read the value of the fieldextensions.intRead the value of the fieldflags.Read the value of the fieldlicense.@Nullable String @Nullable []Read the value of the fieldmime_types.readName()Read the value of the fieldname.Read the value of the fieldsignature.voidsetDisabled(boolean disabled) Disables or enables an image format.voidwriteDescription(String description, Arena _arena) Write a value in the fielddescription.voidwriteDisabled(boolean disabled) Write a value in the fielddisabled.voidwriteDomain(String domain, Arena _arena) Write a value in the fielddomain.voidwriteExtensions(@Nullable String @Nullable [] extensions, Arena _arena) Write a value in the fieldextensions.voidwriteFlags(int flags) Write a value in the fieldflags.voidwriteLicense(String license, Arena _arena) Write a value in the fieldlicense.voidwriteMimeTypes(@Nullable String @Nullable [] mimeTypes, Arena _arena) Write a value in the fieldmime_types.voidWrite a value in the fieldname.voidwriteSignature(PixbufModulePattern signature) Write a value in the fieldsignature.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
PixbufFormat
Create a PixbufFormat proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
PixbufFormat
Allocate a new PixbufFormat.- Parameters:
arena- to control the memory allocation scope
-
PixbufFormat
public PixbufFormat()Allocate a new PixbufFormat. The memory is allocated withArena.ofAuto(). -
PixbufFormat
public PixbufFormat(String name, PixbufModulePattern signature, String domain, String description, String[] mimeTypes, String[] extensions, int flags, boolean disabled, String license, Arena arena) Allocate a new PixbufFormat with the fields set to the provided values.- Parameters:
name- value for the fieldnamesignature- value for the fieldsignaturedomain- value for the fielddomaindescription- value for the fielddescriptionmimeTypes- value for the fieldmimeTypesextensions- value for the fieldextensionsflags- value for the fieldflagsdisabled- value for the fielddisabledlicense- value for the fieldlicensearena- to control the memory allocation scope
-
PixbufFormat
public PixbufFormat(String name, PixbufModulePattern signature, String domain, String description, String[] mimeTypes, String[] extensions, int flags, boolean disabled, String license) Allocate a new PixbufFormat with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
name- value for the fieldnamesignature- value for the fieldsignaturedomain- value for the fielddomaindescription- value for the fielddescriptionmimeTypes- value for the fieldmimeTypesextensions- value for the fieldextensionsflags- value for the fieldflagsdisabled- value for the fielddisabledlicense- value for the fieldlicense
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readName
-
writeName
-
readSignature
Read the value of the fieldsignature.- Returns:
- The value of the field
signature
-
writeSignature
Write a value in the fieldsignature.- Parameters:
signature- The new value for the fieldsignature
-
readDomain
Read the value of the fielddomain.- Returns:
- The value of the field
domain
-
writeDomain
-
readDescription
Read the value of the fielddescription.- Returns:
- The value of the field
description
-
writeDescription
-
readMimeTypes
Read the value of the fieldmime_types.- Returns:
- The value of the field
mime_types
-
writeMimeTypes
-
readExtensions
Read the value of the fieldextensions.- Returns:
- The value of the field
extensions
-
writeExtensions
-
readFlags
public int readFlags()Read the value of the fieldflags.- Returns:
- The value of the field
flags
-
writeFlags
public void writeFlags(int flags) Write a value in the fieldflags.- Parameters:
flags- The new value for the fieldflags
-
readDisabled
public boolean readDisabled()Read the value of the fielddisabled.- Returns:
- The value of the field
disabled
-
writeDisabled
public void writeDisabled(boolean disabled) Write a value in the fielddisabled.- Parameters:
disabled- The new value for the fielddisabled
-
readLicense
Read the value of the fieldlicense.- Returns:
- The value of the field
license
-
writeLicense
-
copy
Creates a copy offormat.- Returns:
- the newly allocated copy of a
GdkPixbufFormat. Use gdk_pixbuf_format_free() to free the resources when done - Since:
- 2.22
-
free
public void free()Frees the resources allocated when copying aGdkPixbufFormatusing gdk_pixbuf_format_copy()- Since:
- 2.22
-
getDescription
Returns a description of the format.- Returns:
- a description of the format.
- Since:
- 2.2
-
getExtensions
Returns the filename extensions typically used for files in the given format.- Returns:
- an array of filename extensions
- Since:
- 2.2
-
getLicense
Returns information about the license of the image loader for the format.The returned string should be a shorthand for a well known license, e.g. "LGPL", "GPL", "QPL", "GPL/QPL", or "other" to indicate some other license.
- Returns:
- a string describing the license of the pixbuf format
- Since:
- 2.6
-
getMimeTypes
Returns the mime types supported by the format.- Returns:
- an array of mime types
- Since:
- 2.2
-
getName
Returns the name of the format.- Returns:
- the name of the format.
- Since:
- 2.2
-
isDisabled
public boolean isDisabled()Returns whether this image format is disabled.See gdk_pixbuf_format_set_disabled().
- Returns:
- whether this image format is disabled.
- Since:
- 2.6
-
isSaveOptionSupported
ReturnsTRUEif the save option specified byoptionKeyis supported when saving a pixbuf using the module implementingformat.See gdk_pixbuf_save() for more information about option keys.
- Parameters:
optionKey- the name of an option- Returns:
TRUEif the specified option is supported- Since:
- 2.36
-
isScalable
public boolean isScalable()Returns whether this image format is scalable.If a file is in a scalable format, it is preferable to load it at the desired size, rather than loading it at the default size and scaling the resulting pixbuf to the desired size.
- Returns:
- whether this image format is scalable.
- Since:
- 2.6
-
isWritable
public boolean isWritable()Returns whether pixbufs can be saved in the given format.- Returns:
- whether pixbufs can be saved in the given format.
- Since:
- 2.2
-
setDisabled
public void setDisabled(boolean disabled) Disables or enables an image format.If a format is disabled, GdkPixbuf won't use the image loader for this format to load images.
Applications can use this to avoid using image loaders with an inappropriate license, see gdk_pixbuf_format_get_license().
- Parameters:
disabled-TRUEto disable the format this PixbufFormat- Since:
- 2.6
-