11using namespace NS_IIOF_HELPERS;
15 Q_DECLARE_PUBLIC(QMacJp2Handler)
38 bool bCanRead =
false;
40 if (iod && iod->peek(buf, 12) == 12)
41 bCanRead = !memcmp(buf,
"\000\000\000\fjP \r\n\207\n", 12);
47 if (canRead(device())) {
56 return QIIOFHelpers::readImage(
this, image);
61 return QIIOFHelpers::writeImage(
this, image, QStringLiteral(
"public.jpeg-2000"));
66 Q_D(
const QMacJp2Handler);
67 if (option == Quality)
68 return QVariant(d->writeQuality);
75 if (option == Quality) {
77 const int quality = value.toInt(&ok);
79 d->writeQuality = quality;
85 return (option == Quality);
static bool canRead(QIODevice *iod)
bool write(const QImage &image) override
Writes the image image to the assigned device.
bool supportsOption(ImageOption option) const override
Returns true if the QImageIOHandler supports the option option; otherwise returns false.
void setOption(ImageOption option, const QVariant &value) override
Sets the option option with the value value.
bool read(QImage *image) override
Read an image from the device, and stores it in image.
bool canRead() const override
Returns true if an image can be read from the device (i.e., the image format is supported,...
QVariant option(ImageOption option) const override
Returns the value assigned to option as a QVariant.