FLTK 1.4.4

Loading...
Searching...
No Matches
Fl_PNG_Image.H
1//
2// PNG image header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2023 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17/* \file
18 Fl_PNG_Image class . */
19
20#ifndef Fl_PNG_Image_H
21#define Fl_PNG_Image_H
22# include "Fl_Image.H"
23
30 class FL_EXPORT Fl_PNG_Image : public Fl_RGB_Image {
31 friend class Fl_ICO_Image;
32 public:
33
34 Fl_PNG_Image(const char* filename);
35 Fl_PNG_Image (const char *name_png, const unsigned char *buffer, int datasize);
36 private:
37 Fl_PNG_Image(const char *filename, int offset); // used by Fl_ICO_Image
38 void load_png_(const char *name_png, int offset, const unsigned char *buffer_png, int datasize);
39};
40
41// Support functions to write PNG image files (since 1.4.0)
42
43FL_EXPORT int fl_write_png(const char *filename, Fl_RGB_Image *img);
44FL_EXPORT int fl_write_png(const char *filename, const char *pixels, int w, int h, int d=3, int ld=0);
45FL_EXPORT int fl_write_png(const char *filename, const unsigned char *pixels, int w, int h, int d=3, int ld=0);
46
47#endif
Fl_Image.H
Fl_Image, Fl_RGB_Image classes.
Fl_Image::ld
int ld() const
Returns the current line data size in bytes.
Definition Fl_Image.H:156
Fl_Image::d
int d() const
Returns the image depth.
Definition Fl_Image.H:151
Fl_PNG_Image::Fl_PNG_Image
Fl_PNG_Image(const char *filename)
The constructor loads the named PNG image from the given png filename.
Definition Fl_PNG_Image.cxx:88
Fl_RGB_Image
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition Fl_Image.H:339
Fl_RGB_Image::Fl_RGB_Image
Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0)
The constructor creates a new image from the specified data.
Definition Fl_Image.cxx:374