- Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathqimagewriter.go
788 lines (626 loc) · 25 KB
/
qimagewriter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
package qtgui
// /usr/include/qt/QtGui/qimagewriter.h
// #include <qimagewriter.h>
// #include <QtGui>
// header block end
// main block begin
// main block end
// use block begin
// use block end
// ext block begin
/*
#include <stdlib.h>
// extern C begin: 50
*/
// import "C"
import"unsafe"
import"reflect"
import"fmt"
import"log"
import"github.com/kitech/qt.go/qtrt"
import"github.com/kitech/qt.go/qtcore"
// ext block end
// body block begin
/*
*/
typeQImageWriterstruct {
*qtrt.CObject
}
typeQImageWriter_ITFinterface {
QImageWriter_PTR() *QImageWriter
}
func (ptr*QImageWriter) QImageWriter_PTR() *QImageWriter { returnptr }
func (this*QImageWriter) GetCthis() unsafe.Pointer {
ifthis==nil {
returnnil
} else {
returnthis.Cthis
}
}
func (this*QImageWriter) SetCthis(cthis unsafe.Pointer) {
ifthis.CObject==nil {
this.CObject=&qtrt.CObject{cthis}
} else {
this.CObject.Cthis=cthis
}
}
funcNewQImageWriterFromPointer(cthis unsafe.Pointer) *QImageWriter {
return&QImageWriter{&qtrt.CObject{cthis}}
}
func (*QImageWriter) NewFromPointer(cthis unsafe.Pointer) *QImageWriter {
returnNewQImageWriterFromPointer(cthis)
}
// /usr/include/qt/QtGui/qimagewriter.h:67
// index:0
// Public Visibility=Default Availability=Available
// [-2] void QImageWriter()
/*
Constructs an empty QImageWriter object. Before writing, you must call setFormat() to set an image format, then setDevice() or setFileName().
*/
func (*QImageWriter) NewForInherit() *QImageWriter {
returnNewQImageWriter()
}
funcNewQImageWriter() *QImageWriter {
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriterC2Ev", qtrt.FFI_TYPE_POINTER)
qtrt.ErrPrint(err, rv)
gothis:=NewQImageWriterFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.SetFinalizer(gothis, DeleteQImageWriter)
returngothis
}
// /usr/include/qt/QtGui/qimagewriter.h:68
// index:1
// Public Visibility=Default Availability=Available
// [-2] void QImageWriter(QIODevice *, const QByteArray &)
/*
Constructs an empty QImageWriter object. Before writing, you must call setFormat() to set an image format, then setDevice() or setFileName().
*/
func (*QImageWriter) NewForInherit1(device qtcore.QIODevice_ITF/*777 QIODevice **/, format qtcore.QByteArray_ITF) *QImageWriter {
returnNewQImageWriter1(device, format)
}
funcNewQImageWriter1(device qtcore.QIODevice_ITF/*777 QIODevice **/, format qtcore.QByteArray_ITF) *QImageWriter {
varconvArg0 unsafe.Pointer
ifdevice!=nil&&device.QIODevice_PTR() !=nil {
convArg0=device.QIODevice_PTR().GetCthis()
}
varconvArg1 unsafe.Pointer
ifformat!=nil&&format.QByteArray_PTR() !=nil {
convArg1=format.QByteArray_PTR().GetCthis()
}
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriterC2EP9QIODeviceRK10QByteArray", qtrt.FFI_TYPE_POINTER, convArg0, convArg1)
qtrt.ErrPrint(err, rv)
gothis:=NewQImageWriterFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.SetFinalizer(gothis, DeleteQImageWriter)
returngothis
}
// /usr/include/qt/QtGui/qimagewriter.h:69
// index:2
// Public Visibility=Default Availability=Available
// [-2] void QImageWriter(const QString &, const QByteArray &)
/*
Constructs an empty QImageWriter object. Before writing, you must call setFormat() to set an image format, then setDevice() or setFileName().
*/
func (*QImageWriter) NewForInherit2(fileNamestring, format qtcore.QByteArray_ITF) *QImageWriter {
returnNewQImageWriter2(fileName, format)
}
funcNewQImageWriter2(fileNamestring, format qtcore.QByteArray_ITF) *QImageWriter {
vartmpArg0=qtcore.NewQString5(fileName)
varconvArg0=tmpArg0.GetCthis()
varconvArg1 unsafe.Pointer
ifformat!=nil&&format.QByteArray_PTR() !=nil {
convArg1=format.QByteArray_PTR().GetCthis()
}
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriterC2ERK7QStringRK10QByteArray", qtrt.FFI_TYPE_POINTER, convArg0, convArg1)
qtrt.ErrPrint(err, rv)
gothis:=NewQImageWriterFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.SetFinalizer(gothis, DeleteQImageWriter)
returngothis
}
// /usr/include/qt/QtGui/qimagewriter.h:69
// index:2
// Public Visibility=Default Availability=Available
// [-2] void QImageWriter(const QString &, const QByteArray &)
/*
Constructs an empty QImageWriter object. Before writing, you must call setFormat() to set an image format, then setDevice() or setFileName().
*/
func (*QImageWriter) NewForInherit2p(fileNamestring) *QImageWriter {
returnNewQImageWriter2p(fileName)
}
funcNewQImageWriter2p(fileNamestring) *QImageWriter {
vartmpArg0=qtcore.NewQString5(fileName)
varconvArg0=tmpArg0.GetCthis()
// arg: 1, const QByteArray &=LValueReference, QByteArray=Record, , Invalid
varconvArg1=qtcore.NewQByteArray()
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriterC2ERK7QStringRK10QByteArray", qtrt.FFI_TYPE_POINTER, convArg0, convArg1)
qtrt.ErrPrint(err, rv)
gothis:=NewQImageWriterFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.SetFinalizer(gothis, DeleteQImageWriter)
returngothis
}
// /usr/include/qt/QtGui/qimagewriter.h:70
// index:0
// Public Visibility=Default Availability=Available
// [-2] void ~QImageWriter()
/*
*/
funcDeleteQImageWriter(this*QImageWriter) {
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriterD2Ev", qtrt.FFI_TYPE_VOID, this.GetCthis())
qtrt.Cmemset(this.GetCthis(), 9, 8)
qtrt.ErrPrint(err, rv)
this.SetCthis(nil)
}
// /usr/include/qt/QtGui/qimagewriter.h:72
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setFormat(const QByteArray &)
/*
Sets the format QImageWriter will use when writing images, to format. format is a case insensitive text string. Example:
QImageWriter writer;
writer.setFormat("png"); // same as writer.setFormat("PNG");
You can call supportedImageFormats() for the full list of formats QImageWriter supports.
See also format().
*/
func (this*QImageWriter) SetFormat(format qtcore.QByteArray_ITF) {
varconvArg0 unsafe.Pointer
ifformat!=nil&&format.QByteArray_PTR() !=nil {
convArg0=format.QByteArray_PTR().GetCthis()
}
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter9setFormatERK10QByteArray", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:73
// index:0
// Public Visibility=Default Availability=Available
// [8] QByteArray format() const
/*
Returns the format QImageWriter uses for writing images.
See also setFormat().
*/
func (this*QImageWriter) Format() *qtcore.QByteArray/*123*/ {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter6formatEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2:=qtcore.NewQByteArrayFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2, qtcore.DeleteQByteArray)
returnrv2
}
// /usr/include/qt/QtGui/qimagewriter.h:75
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setDevice(QIODevice *)
/*
Sets QImageWriter's device to device. If a device has already been set, the old device is removed from QImageWriter and is otherwise left unchanged.
If the device is not already open, QImageWriter will attempt to open the device in QIODevice::WriteOnly mode by calling open(). Note that this does not work for certain devices, such as QProcess, QTcpSocket and QUdpSocket, where more logic is required to open the device.
See also device() and setFileName().
*/
func (this*QImageWriter) SetDevice(device qtcore.QIODevice_ITF/*777 QIODevice **/) {
varconvArg0 unsafe.Pointer
ifdevice!=nil&&device.QIODevice_PTR() !=nil {
convArg0=device.QIODevice_PTR().GetCthis()
}
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter9setDeviceEP9QIODevice", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:76
// index:0
// Public Visibility=Default Availability=Available
// [8] QIODevice * device() const
/*
Returns the device currently assigned to QImageWriter, or 0 if no device has been assigned.
See also setDevice().
*/
func (this*QImageWriter) Device() *qtcore.QIODevice/*777 QIODevice **/ {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter6deviceEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
returnqtcore.NewQIODeviceFromPointer(unsafe.Pointer(uintptr(rv))) // 444
}
// /usr/include/qt/QtGui/qimagewriter.h:78
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setFileName(const QString &)
/*
Sets the file name of QImageWriter to fileName. Internally, QImageWriter will create a QFile and open it in QIODevice::WriteOnly mode, and use this file when writing images.
See also fileName() and setDevice().
*/
func (this*QImageWriter) SetFileName(fileNamestring) {
vartmpArg0=qtcore.NewQString5(fileName)
varconvArg0=tmpArg0.GetCthis()
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter11setFileNameERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:79
// index:0
// Public Visibility=Default Availability=Available
// [8] QString fileName() const
/*
If the currently assigned device is a QFile, or if setFileName() has been called, this function returns the name of the file QImageWriter writes to. Otherwise (i.e., if no device has been assigned or the device is not a QFile), an empty QString is returned.
See also setFileName() and setDevice().
*/
func (this*QImageWriter) FileName() string {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter8fileNameEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2:=qtcore.NewQStringFromPointer(unsafe.Pointer(uintptr(rv)))
rv3:=rv2.ToUtf8().Data()
qtcore.DeleteQString(rv2)
returnrv3
}
// /usr/include/qt/QtGui/qimagewriter.h:81
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setQuality(int)
/*
Sets the quality setting of the image format to quality.
Some image formats, in particular lossy ones, entail a tradeoff between a) visual quality of the resulting image, and b) encoding execution time and compression level. This function sets the level of that tradeoff for image formats that support it. For other formats, this value is ignored.
The value range of quality depends on the image format. For example, the "jpeg" format supports a quality range from 0 (low visual quality, high compression) to 100 (high visual quality, low compression).
See also quality().
*/
func (this*QImageWriter) SetQuality(qualityint) {
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter10setQualityEi", qtrt.FFI_TYPE_POINTER, this.GetCthis(), quality)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:82
// index:0
// Public Visibility=Default Availability=Available
// [4] int quality() const
/*
Returns the quality setting of the image format.
See also setQuality().
*/
func (this*QImageWriter) Quality() int {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter7qualityEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
returnqtrt.Cretval2go("int", rv).(int) // 1111
}
// /usr/include/qt/QtGui/qimagewriter.h:84
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setCompression(int)
/*
This is an image format specific function that set the compression of an image. For image formats that do not support setting the compression, this value is ignored.
The value range of compression depends on the image format. For example, the "tiff" format supports two values, 0(no compression) and 1(LZW-compression).
See also compression().
*/
func (this*QImageWriter) SetCompression(compressionint) {
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter14setCompressionEi", qtrt.FFI_TYPE_POINTER, this.GetCthis(), compression)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:85
// index:0
// Public Visibility=Default Availability=Available
// [4] int compression() const
/*
Returns the compression of the image.
See also setCompression().
*/
func (this*QImageWriter) Compression() int {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter11compressionEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
returnqtrt.Cretval2go("int", rv).(int) // 1111
}
// /usr/include/qt/QtGui/qimagewriter.h:87
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setGamma(float)
/*
This is an image format specific function that sets the gamma level of the image to gamma. For image formats that do not support setting the gamma level, this value is ignored.
The value range of gamma depends on the image format. For example, the "png" format supports a gamma range from 0.0 to 1.0.
See also gamma() and quality().
*/
func (this*QImageWriter) SetGamma(gammafloat32) {
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter8setGammaEf", qtrt.FFI_TYPE_POINTER, this.GetCthis(), gamma)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:88
// index:0
// Public Visibility=Default Availability=Available
// [4] float gamma() const
/*
Returns the gamma level of the image.
See also setGamma().
*/
func (this*QImageWriter) Gamma() float32 {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter5gammaEv", qtrt.FFI_TYPE_DOUBLE, this.GetCthis())
qtrt.ErrPrint(err, rv)
returnqtrt.Cretval2go("float32", rv).(float32) // 1111
}
// /usr/include/qt/QtGui/qimagewriter.h:90
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setSubType(const QByteArray &)
/*
This is an image format specific function that sets the subtype of the image to type. Subtype can be used by a handler to determine which format it should use while saving the image.
For example, saving an image in DDS format with A8R8G8R8 subtype:
QImageWriter writer("some/image.dds");
if (writer.supportsOption(QImageIOHandler::SubType))
writer.setSubType("A8R8G8B8");
writer.write(image);
This function was introduced in Qt 5.4.
See also subType().
*/
func (this*QImageWriter) SetSubType(type_ qtcore.QByteArray_ITF) {
varconvArg0 unsafe.Pointer
iftype_!=nil&&type_.QByteArray_PTR() !=nil {
convArg0=type_.QByteArray_PTR().GetCthis()
}
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter10setSubTypeERK10QByteArray", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:91
// index:0
// Public Visibility=Default Availability=Available
// [8] QByteArray subType() const
/*
Returns the subtype of the image.
This function was introduced in Qt 5.4.
See also setSubType().
*/
func (this*QImageWriter) SubType() *qtcore.QByteArray/*123*/ {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter7subTypeEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2:=qtcore.NewQByteArrayFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2, qtcore.DeleteQByteArray)
returnrv2
}
// /usr/include/qt/QtGui/qimagewriter.h:94
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setOptimizedWrite(bool)
/*
This is an image format-specific function which sets the optimize flags when writing images. For image formats that do not support setting an optimize flag, this value is ignored.
The default is false.
This function was introduced in Qt 5.5.
See also optimizedWrite().
*/
func (this*QImageWriter) SetOptimizedWrite(optimizebool) {
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter17setOptimizedWriteEb", qtrt.FFI_TYPE_POINTER, this.GetCthis(), optimize)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:95
// index:0
// Public Visibility=Default Availability=Available
// [1] bool optimizedWrite() const
/*
Returns whether optimization has been turned on for writing the image.
This function was introduced in Qt 5.5.
See also setOptimizedWrite().
*/
func (this*QImageWriter) OptimizedWrite() bool {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter14optimizedWriteEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
returnrv!=0
}
// /usr/include/qt/QtGui/qimagewriter.h:97
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setProgressiveScanWrite(bool)
/*
This is an image format-specific function which turns on progressive scanning when writing images. For image formats that do not support setting a progressive scan flag, this value is ignored.
The default is false.
This function was introduced in Qt 5.5.
See also progressiveScanWrite().
*/
func (this*QImageWriter) SetProgressiveScanWrite(progressivebool) {
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter23setProgressiveScanWriteEb", qtrt.FFI_TYPE_POINTER, this.GetCthis(), progressive)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:98
// index:0
// Public Visibility=Default Availability=Available
// [1] bool progressiveScanWrite() const
/*
Returns whether the image should be written as a progressive image.
This function was introduced in Qt 5.5.
See also setProgressiveScanWrite().
*/
func (this*QImageWriter) ProgressiveScanWrite() bool {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter20progressiveScanWriteEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
returnrv!=0
}
// /usr/include/qt/QtGui/qimagewriter.h:100
// index:0
// Public Visibility=Default Availability=Available
// [-2] QImageIOHandler::Transformations transformation() const
/*
Returns the transformation and orientation the image has been set to written with.
This function was introduced in Qt 5.5.
See also setTransformation().
*/
func (this*QImageWriter) Transformation() int {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter14transformationEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
returnint(rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:101
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setTransformation(QImageIOHandler::Transformations)
/*
Sets the image transformations metadata including orientation to transform.
If transformation metadata is not supported by the image format, the transform is applied before writing.
This function was introduced in Qt 5.5.
See also transformation() and write().
*/
func (this*QImageWriter) SetTransformation(orientationint) {
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter17setTransformationE6QFlagsIN15QImageIOHandler14TransformationEE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), orientation)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:104
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setDescription(const QString &)
/*
*/
func (this*QImageWriter) SetDescription(descriptionstring) {
vartmpArg0=qtcore.NewQString5(description)
varconvArg0=tmpArg0.GetCthis()
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter14setDescriptionERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:105
// index:0
// Public Visibility=Default Availability=Available
// [8] QString description() const
/*
*/
func (this*QImageWriter) Description() string {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter11descriptionEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2:=qtcore.NewQStringFromPointer(unsafe.Pointer(uintptr(rv)))
rv3:=rv2.ToUtf8().Data()
qtcore.DeleteQString(rv2)
returnrv3
}
// /usr/include/qt/QtGui/qimagewriter.h:107
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setText(const QString &, const QString &)
/*
Sets the image text associated with the key key to text. This is useful for storing copyright information or other information about the image. Example:
QImage image("some/image.jpeg");
QImageWriter writer("images/outimage.png", "png");
writer.setText("Author", "John Smith");
writer.write(image);
If you want to store a single block of data (e.g., a comment), you can pass an empty key, or use a generic key like "Description".
The key and text will be embedded into the image data after calling write().
Support for this option is implemented through QImageIOHandler::Description.
This function was introduced in Qt 4.1.
See also QImage::setText() and QImageReader::text().
*/
func (this*QImageWriter) SetText(keystring, textstring) {
vartmpArg0=qtcore.NewQString5(key)
varconvArg0=tmpArg0.GetCthis()
vartmpArg1=qtcore.NewQString5(text)
varconvArg1=tmpArg1.GetCthis()
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter7setTextERK7QStringS2_", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, convArg1)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:109
// index:0
// Public Visibility=Default Availability=Available
// [1] bool canWrite() const
/*
Returns true if QImageWriter can write the image; i.e., the image format is supported and the assigned device is open for reading.
See also write(), setDevice(), and setFormat().
*/
func (this*QImageWriter) CanWrite() bool {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter8canWriteEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
returnrv!=0
}
// /usr/include/qt/QtGui/qimagewriter.h:110
// index:0
// Public Visibility=Default Availability=Available
// [1] bool write(const QImage &)
/*
Writes the image image to the assigned device or file name. Returns true on success; otherwise returns false. If the operation fails, you can call error() to find the type of error that occurred, or errorString() to get a human readable description of the error.
See also canWrite(), error(), and errorString().
*/
func (this*QImageWriter) Write(imageQImage_ITF) bool {
varconvArg0 unsafe.Pointer
ifimage!=nil&&image.QImage_PTR() !=nil {
convArg0=image.QImage_PTR().GetCthis()
}
rv, err:=qtrt.InvokeQtFunc6("_ZN12QImageWriter5writeERK6QImage", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
returnrv!=0
}
// /usr/include/qt/QtGui/qimagewriter.h:112
// index:0
// Public Visibility=Default Availability=Available
// [4] QImageWriter::ImageWriterError error() const
/*
Returns the type of error that last occurred.
See also ImageWriterError and errorString().
*/
func (this*QImageWriter) Error() int {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter5errorEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
returnint(rv)
}
// /usr/include/qt/QtGui/qimagewriter.h:113
// index:0
// Public Visibility=Default Availability=Available
// [8] QString errorString() const
/*
Returns a human readable description of the last error that occurred.
See also error().
*/
func (this*QImageWriter) ErrorString() string {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter11errorStringEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2:=qtcore.NewQStringFromPointer(unsafe.Pointer(uintptr(rv)))
rv3:=rv2.ToUtf8().Data()
qtcore.DeleteQString(rv2)
returnrv3
}
// /usr/include/qt/QtGui/qimagewriter.h:115
// index:0
// Public Visibility=Default Availability=Available
// [1] bool supportsOption(QImageIOHandler::ImageOption) const
/*
Returns true if the writer supports option; otherwise returns false.
Different image formats support different options. Call this function to determine whether a certain option is supported by the current format. For example, the PNG format allows you to embed text into the image's metadata (see text()).
QImageWriter writer(fileName);
if (writer.supportsOption(QImageIOHandler::Description))
writer.setText("Author", "John Smith");
Options can be tested after the writer has been associated with a format.
This function was introduced in Qt 4.2.
See also QImageReader::supportsOption() and setFormat().
*/
func (this*QImageWriter) SupportsOption(optionint) bool {
rv, err:=qtrt.InvokeQtFunc6("_ZNK12QImageWriter14supportsOptionEN15QImageIOHandler11ImageOptionE", qtrt.FFI_TYPE_POINTER, this.GetCthis(), option)
qtrt.ErrPrint(err, rv)
returnrv!=0
}
/*
This enum describes errors that can occur when writing images with QImageWriter.
*/
typeQImageWriter__ImageWriterError=int
// An unknown error occurred. If you get this value after calling write(), it is most likely caused by a bug in QImageWriter.
constQImageWriter__UnknownErrorQImageWriter__ImageWriterError=0
// QImageWriter encountered a device error when writing the image data. Consult your device for more details on what went wrong.
constQImageWriter__DeviceErrorQImageWriter__ImageWriterError=1
// Qt does not support the requested image format.
constQImageWriter__UnsupportedFormatErrorQImageWriter__ImageWriterError=2
// An attempt was made to write an invalid QImage. An example of an invalid image would be a null QImage.
constQImageWriter__InvalidImageErrorQImageWriter__ImageWriterError=3
func (this*QImageWriter) ImageWriterErrorItemName(valint) string {
switchval {
caseQImageWriter__UnknownError: // 0
return"UnknownError"
caseQImageWriter__DeviceError: // 1
return"DeviceError"
caseQImageWriter__UnsupportedFormatError: // 2
return"UnsupportedFormatError"
caseQImageWriter__InvalidImageError: // 3
return"InvalidImageError"
default:
returnfmt.Sprintf("%d", val)
}
}
funcQImageWriter_ImageWriterErrorItemName(valint) string {
varnilthis*QImageWriter
returnnilthis.ImageWriterErrorItemName(val)
}
// body block end
// keep block begin
funcinit_unused_10887() {
iffalse {
reflect.TypeOf(123)
}
iffalse {
reflect.TypeOf(unsafe.Sizeof(0))
}
iffalse {
fmt.Println(123)
}
iffalse {
log.Println(123)
}
iffalse {
qtrt.KeepMe()
}
iffalse {
qtcore.KeepMe()
}
}
// keep block end