File indexing completed on 2025-12-11 10:26:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef PNGWRITER_H
0017 #define PNGWRITER_H
0018
0019 #include "poppler-config.h"
0020 #include "poppler_private_export.h"
0021
0022 #ifdef ENABLE_LIBPNG
0023
0024 # include "ImgWriter.h"
0025
0026 struct PNGWriterPrivate;
0027
0028 class POPPLER_PRIVATE_EXPORT PNGWriter : public ImgWriter
0029 {
0030 public:
0031
0032
0033
0034
0035
0036
0037 enum Format
0038 {
0039 RGB,
0040 RGBA,
0041 GRAY,
0042 MONOCHROME,
0043 RGB48
0044 };
0045
0046 explicit PNGWriter(Format format = RGB);
0047 ~PNGWriter() override;
0048
0049 PNGWriter(const PNGWriter &other) = delete;
0050 PNGWriter &operator=(const PNGWriter &other) = delete;
0051
0052 void setICCProfile(const char *name, unsigned char *data, int size);
0053 void setSRGBProfile();
0054
0055 bool init(FILE *f, int width, int height, double hDPI, double vDPI) override;
0056
0057 bool writePointers(unsigned char **rowPointers, int rowCount) override;
0058 bool writeRow(unsigned char **row) override;
0059
0060 bool close() override;
0061
0062 private:
0063 PNGWriterPrivate *priv;
0064 };
0065
0066 #endif
0067
0068 #endif