/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
switch (nFormat)
{ case GraphicFileFormat::BMP:
aKeyName = u"BMP"_ustr; break; case GraphicFileFormat::GIF:
aKeyName = u"GIF"_ustr; break; case GraphicFileFormat::JPG:
aKeyName = u"JPG"_ustr; break; case GraphicFileFormat::PCD:
aKeyName = u"PCD"_ustr; break; case GraphicFileFormat::PCX:
aKeyName = u"PCX"_ustr; break; case GraphicFileFormat::PNG:
aKeyName = u"PNG"_ustr; break; case GraphicFileFormat::APNG:
aKeyName = u"APNG"_ustr; break; case GraphicFileFormat::XBM:
aKeyName = u"XBM"_ustr; break; case GraphicFileFormat::XPM:
aKeyName = u"XPM"_ustr; break; case GraphicFileFormat::PBM:
aKeyName = u"PBM"_ustr; break; case GraphicFileFormat::PGM:
aKeyName = u"PGM"_ustr; break; case GraphicFileFormat::PPM:
aKeyName = u"PPM"_ustr; break; case GraphicFileFormat::RAS:
aKeyName = u"RAS"_ustr; break; case GraphicFileFormat::TGA:
aKeyName = u"TGA"_ustr; break; case GraphicFileFormat::PSD:
aKeyName = u"PSD"_ustr; break; case GraphicFileFormat::EPS:
aKeyName = u"EPS"_ustr; break; case GraphicFileFormat::TIF:
aKeyName = u"TIF"_ustr; break; case GraphicFileFormat::DXF:
aKeyName = u"DXF"_ustr; break; case GraphicFileFormat::MET:
aKeyName = u"MET"_ustr; break; case GraphicFileFormat::PCT:
aKeyName = u"PCT"_ustr; break; case GraphicFileFormat::SVM:
aKeyName = u"SVM"_ustr; break; case GraphicFileFormat::WMF:
aKeyName = u"WMF"_ustr; break; case GraphicFileFormat::EMF:
aKeyName = u"EMF"_ustr; break; case GraphicFileFormat::SVG:
aKeyName = u"SVG"_ustr; break; case GraphicFileFormat::WMZ:
aKeyName = u"WMZ"_ustr; break; case GraphicFileFormat::EMZ:
aKeyName = u"EMZ"_ustr; break; case GraphicFileFormat::SVGZ:
aKeyName = u"SVGZ"_ustr; break; case GraphicFileFormat::WEBP:
aKeyName = u"WEBP"_ustr; break; case GraphicFileFormat::MOV:
aKeyName = u"MOV"_ustr; break; case GraphicFileFormat::PDF:
aKeyName = u"PDF"_ustr; break; default:
assert(false);
}
return aKeyName;
} /*** * This function is has two modes: * - determine the file format when bTest = false * returns true, success * out rFormatExtension - on success: file format string * - verify file format when bTest = true * returns false, if file type can't be verified * true, if the format is verified or the format is not known
*/
VCL_DLLPUBLIC bool peekGraphicFormat(SvStream& rStream, OUString& rFormatExtension, bool bTest);
class VCL_DLLPUBLIC GraphicFormatDetector
{ public:
SvStream& mrStream;
OUString maExtension;
private: /** * @brief Checks whether mrStream needs to be uncompressed and returns a pointer to the * to aUncompressedBuffer or a pointer to maFirstBytes if it doesn't need to be uncompressed * * @param aUncompressedBuffer the buffer to hold the uncompressed data * @param nSize the amount of bytes to uncompress * @param nRetSize the amount of bytes actually uncompressed * @return sal_uInt8* a pointer to maFirstBytes or aUncompressed buffer
*/
SAL_DLLPRIVATE sal_uInt8* checkAndUncompressBuffer(sal_uInt8* aUncompressedBuffer,
sal_uInt32 nSize,
sal_uInt64& nDecompressedSize); bool mbExtendedInfo; bool mbWasCompressed;
GraphicMetadata maMetadata;
};
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.