io.qt.gui.QImageIOHandler Maven / Gradle / Ivy
package io.qt.gui;
/**
* Defines the common image I/O interface for all image formats in Qt
* Java wrapper for Qt class QImageIOHandler
*/
public abstract class QImageIOHandler extends io.qt.QtObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
@io.qt.QtPropertyMember(enabled=false)
private Object __rcDevice = null;
@io.qt.NativeAccess
private static final class ConcreteWrapper extends QImageIOHandler {
@io.qt.NativeAccess
private ConcreteWrapper(QPrivateConstructor p) { super(p); }
@Override
@io.qt.QtUninvokable
public boolean canRead(){
return canRead_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean canRead_native_constfct(long __this__nativeId);
@Override
@io.qt.QtUninvokable
public io.qt.gui.QImage read(){
return read_native_QImage_ptr(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.gui.QImage read_native_QImage_ptr(long __this__nativeId);
}
/**
* Java wrapper for Qt enum QImageIOHandler::ImageOption
*/
public enum ImageOption implements io.qt.QtEnumerator {
Size(0),
ClipRect(1),
Description(2),
ScaledClipRect(3),
ScaledSize(4),
CompressionRatio(5),
Gamma(6),
Quality(7),
Name(8),
SubType(9),
IncrementalReading(10),
Endianness(11),
Animation(12),
BackgroundColor(13),
ImageFormat(14),
SupportedSubTypes(15),
OptimizedWrite(16),
ProgressiveScanWrite(17),
ImageTransformation(18);
private ImageOption(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static ImageOption resolve(int value) {
switch (value) {
case 0: return Size;
case 1: return ClipRect;
case 2: return Description;
case 3: return ScaledClipRect;
case 4: return ScaledSize;
case 5: return CompressionRatio;
case 6: return Gamma;
case 7: return Quality;
case 8: return Name;
case 9: return SubType;
case 10: return IncrementalReading;
case 11: return Endianness;
case 12: return Animation;
case 13: return BackgroundColor;
case 14: return ImageFormat;
case 15: return SupportedSubTypes;
case 16: return OptimizedWrite;
case 17: return ProgressiveScanWrite;
case 18: return ImageTransformation;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QImageIOHandler::Transformation
*
* @see Transformations
*/
public enum Transformation implements io.qt.QtFlagEnumerator {
TransformationNone(0),
TransformationMirror(1),
TransformationFlip(2),
TransformationRotate180(3),
TransformationRotate90(4),
TransformationMirrorAndRotate90(5),
TransformationFlipAndRotate90(6),
TransformationRotate270(7);
private Transformation(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public Transformations asFlags() {
return new Transformations(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public Transformations combined(Transformation e) {
return new Transformations(this, e);
}
/**
* Creates a new {@link Transformations} from the entries.
* @param values entries
* @return new flag
*/
public static Transformations flags(Transformation ... values) {
return new Transformations(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static Transformation resolve(int value) {
switch (value) {
case 0: return TransformationNone;
case 1: return TransformationMirror;
case 2: return TransformationFlip;
case 3: return TransformationRotate180;
case 4: return TransformationRotate90;
case 5: return TransformationMirrorAndRotate90;
case 6: return TransformationFlipAndRotate90;
case 7: return TransformationRotate270;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* QFlags type for enum {@link Transformation}
*/
public static final class Transformations extends io.qt.QFlags implements Comparable {
private static final long serialVersionUID = 0x15d7fab4012afec4L;
/**
* Creates a new Transformations where the flags in args
are set.
* @param args enum entries
*/
public Transformations(Transformation ... args){
super(args);
}
/**
* Creates a new Transformations with given value
.
* @param value
*/
public Transformations(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new Transformations
*/
@Override
public final Transformations combined(Transformation e){
return new Transformations(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final Transformations setFlag(Transformation e){
super.setFlag(e);
return this;
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
public final Transformations setFlag(Transformation e, boolean on){
super.setFlag(e, on);
return this;
}
/**
* Returns an array of flag objects represented by this Transformations.
* @return array of enum entries
*/
@Override
public final Transformation[] flags(){
return super.flags(Transformation.values());
}
/**
* {@inheritDoc}
*/
@Override
public final Transformations clone(){
return new Transformations(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(Transformations other){
return Integer.compare(value(), other.value());
}
}
/**
* See QImageIOHandler::QImageIOHandler()
*/
public QImageIOHandler(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QImageIOHandler instance);
/**
* See QImageIOHandler::device()const
*/
@io.qt.QtUninvokable
public final io.qt.core.QIODevice device(){
return device_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QIODevice device_native_constfct(long __this__nativeId);
/**
* See QImageIOHandler::format()const
*/
@io.qt.QtUninvokable
public final io.qt.core.QByteArray format(){
return format_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QByteArray format_native_constfct(long __this__nativeId);
/**
* See QImageIOHandler::setDevice(QIODevice*)
*/
@io.qt.QtUninvokable
public final void setDevice(io.qt.core.QIODevice device){
setDevice_native_QIODevice_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(device));
__rcDevice = device;
}
@io.qt.QtUninvokable
private native void setDevice_native_QIODevice_ptr(long __this__nativeId, long device);
/**
* See QImageIOHandler::setFormat(QByteArray)
*/
@io.qt.QtUninvokable
public final void setFormat(io.qt.core.QByteArray format){
setFormat_native_cref_QByteArray(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(format));
}
@io.qt.QtUninvokable
private native void setFormat_native_cref_QByteArray(long __this__nativeId, long format);
/**
* See QImageIOHandler::canRead()const
*/
@io.qt.QtUninvokable
public abstract boolean canRead();
@io.qt.QtUninvokable
private native boolean canRead_native_constfct(long __this__nativeId);
/**
* See QImageIOHandler::currentImageNumber()const
*/
@io.qt.QtUninvokable
public int currentImageNumber(){
return currentImageNumber_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int currentImageNumber_native_constfct(long __this__nativeId);
/**
* See QImageIOHandler::currentImageRect()const
*/
@io.qt.QtUninvokable
public io.qt.core.QRect currentImageRect(){
return currentImageRect_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QRect currentImageRect_native_constfct(long __this__nativeId);
/**
* See QImageIOHandler::imageCount()const
*/
@io.qt.QtUninvokable
public int imageCount(){
return imageCount_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int imageCount_native_constfct(long __this__nativeId);
/**
* See QImageIOHandler::jumpToImage(int)
*/
@io.qt.QtUninvokable
public boolean jumpToImage(int imageNumber){
return jumpToImage_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), imageNumber);
}
@io.qt.QtUninvokable
private native boolean jumpToImage_native_int(long __this__nativeId, int imageNumber);
/**
* See QImageIOHandler::jumpToNextImage()
*/
@io.qt.QtUninvokable
public boolean jumpToNextImage(){
return jumpToNextImage_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean jumpToNextImage_native(long __this__nativeId);
/**
* See QImageIOHandler::loopCount()const
*/
@io.qt.QtUninvokable
public int loopCount(){
return loopCount_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int loopCount_native_constfct(long __this__nativeId);
/**
* See QImageIOHandler::nextImageDelay()const
*/
@io.qt.QtUninvokable
public int nextImageDelay(){
return nextImageDelay_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int nextImageDelay_native_constfct(long __this__nativeId);
/**
* See QImageIOHandler::option(QImageIOHandler::ImageOption)const
*/
@io.qt.QtUninvokable
public java.lang.Object option(io.qt.gui.QImageIOHandler.ImageOption option){
return option_native_QImageIOHandler_ImageOption_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), option.value());
}
@io.qt.QtUninvokable
private native java.lang.Object option_native_QImageIOHandler_ImageOption_constfct(long __this__nativeId, int option);
/**
* See QImageIOHandler::read(QImage*)
*/
@io.qt.QtUninvokable
public abstract io.qt.gui.QImage read();
@io.qt.QtUninvokable
private native io.qt.gui.QImage read_native_QImage_ptr(long __this__nativeId);
/**
* See QImageIOHandler::setOption(QImageIOHandler::ImageOption,QVariant)
*/
@io.qt.QtUninvokable
public void setOption(io.qt.gui.QImageIOHandler.ImageOption option, java.lang.Object value){
setOption_native_QImageIOHandler_ImageOption_cref_QVariant(QtJambi_LibraryUtilities.internal.nativeId(this), option.value(), value);
}
@io.qt.QtUninvokable
private native void setOption_native_QImageIOHandler_ImageOption_cref_QVariant(long __this__nativeId, int option, java.lang.Object value);
/**
* See QImageIOHandler::supportsOption(QImageIOHandler::ImageOption)const
*/
@io.qt.QtUninvokable
public boolean supportsOption(io.qt.gui.QImageIOHandler.ImageOption option){
return supportsOption_native_QImageIOHandler_ImageOption_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), option.value());
}
@io.qt.QtUninvokable
private native boolean supportsOption_native_QImageIOHandler_ImageOption_constfct(long __this__nativeId, int option);
/**
* See QImageIOHandler::write(QImage)
*/
@io.qt.QtUninvokable
public boolean write(io.qt.gui.QImage image){
return write_native_cref_QImage(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(image));
}
@io.qt.QtUninvokable
private native boolean write_native_cref_QImage(long __this__nativeId, long image);
/**
* See QImageIOHandler::allocateImage(QSize,QImage::Format,QImage*)
*/
public static io.qt.gui.QImage allocateImage(io.qt.core.QSize size, io.qt.gui.QImage.Format format){
return allocateImage_native_QSize_QImage_Format_QImage_ptr(QtJambi_LibraryUtilities.internal.checkedNativeId(size), format.value());
}
private native static io.qt.gui.QImage allocateImage_native_QSize_QImage_Format_QImage_ptr(long size, int format);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QImageIOHandler(QPrivateConstructor p) { super(p); }
}