File indexing completed on 2025-01-19 03:51:02

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2005-11-01
0007  * Description : a PNG image loader for DImg framework.
0008  *
0009  * SPDX-FileCopyrightText: 2005-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #define PNG_BYTES_TO_CHECK 4
0016 
0017 #include "dimgpngloader.h"
0018 
0019 // C ANSI includes
0020 
0021 extern "C"
0022 {
0023 #ifndef Q_CC_MSVC
0024 #   include <unistd.h>
0025 #endif
0026 }
0027 
0028 // C++ includes
0029 
0030 #include <cstdlib>
0031 #include <cstdio>
0032 
0033 // Qt includes
0034 
0035 #include <QFile>
0036 #include <QByteArray>
0037 #include <QSysInfo>
0038 
0039 // Local includes
0040 
0041 #include "metaengine.h"
0042 #include "digikam_debug.h"
0043 #include "digikam_config.h"
0044 #include "digikam_version.h"
0045 #include "dimgloaderobserver.h"
0046 
0047 // libPNG includes
0048 
0049 extern "C"
0050 {
0051 #include <png.h>
0052 }
0053 
0054 using namespace Digikam;
0055 
0056 namespace DigikamPNGDImgPlugin
0057 {
0058 
0059 DImgPNGLoader::DImgPNGLoader(DImg* const image)
0060     : DImgLoader(image)
0061 {
0062     m_hasAlpha   = false;
0063     m_sixteenBit = false;
0064 }
0065 
0066 DImgPNGLoader::~DImgPNGLoader()
0067 {
0068 }
0069 
0070 bool DImgPNGLoader::hasAlpha() const
0071 {
0072     return m_hasAlpha;
0073 }
0074 
0075 bool DImgPNGLoader::sixteenBit() const
0076 {
0077     return m_sixteenBit;
0078 }
0079 
0080 bool DImgPNGLoader::isReadOnly() const
0081 {
0082     return false;
0083 }
0084 
0085 } // namespace DigikamPNGDImgPlugin