Deduplicate cell_renderer_height_override()
[geeqie.git] / src / image-load-jpeg.h
1 /*
2  * Copyright (C) 2004 John Ellis
3  * Copyright (C) 2008 - 2016 The Geeqie Team
4  *
5  * Author: Vladimir Nadvornik
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef IMAGE_LOAD_JPEG_H
23 #define IMAGE_LOAD_JPEG_H
24
25 #include <memory>
26
27 #include <gdk-pixbuf/gdk-pixbuf.h>
28 #include <glib.h>
29
30 #include "image-load.h"
31
32 struct ImageLoaderJpeg : public ImageLoaderBackend
33 {
34 public:
35         ~ImageLoaderJpeg() override;
36
37         void init(AreaUpdatedCb area_updated_cb, SizePreparedCb size_prepared_cb, AreaPreparedCb area_prepared_cb, gpointer data) override;
38         void set_size(int width, int height) override;
39         gboolean write(const guchar *buf, gsize &chunk_size, gsize count, GError **error) override;
40         GdkPixbuf *get_pixbuf() override;
41         void abort() override;
42         gchar *get_format_name() override;
43         gchar **get_format_mime_types() override;
44
45 private:
46         AreaUpdatedCb area_updated_cb;
47         SizePreparedCb size_prepared_cb;
48         AreaPreparedCb area_prepared_cb;
49
50         gpointer data;
51
52         GdkPixbuf *pixbuf;
53         guint requested_width;
54         guint requested_height;
55
56         gboolean aborted;
57         gboolean stereo;
58 };
59
60 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_jpeg();
61
62 #endif /* IMAGE_LOAD_JPEG_H */
63
64 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */