summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2018-05-14 17:44:11 -0500
committerFederico Mena Quintero <federico@gnome.org>2018-06-01 18:47:33 -0500
commita90b4e5bf43d62f9ea5ebd913b06716e52d4654f (patch)
tree669edf9acb881b400b45c9a304e7c96cae20dd12
parent5dd78ae0f43666206848bd7223689b9547056933 (diff)
downloadgdk-pixbuf-a90b4e5bf43d62f9ea5ebd913b06716e52d4654f.tar.gz
Move the macros to convert the DPI/DPM density units to where they are needed
We'll be removing gdk-pixbuf-private.h from io-*.c shortly.
-rw-r--r--gdk-pixbuf/gdk-pixbuf-private.h6
-rw-r--r--gdk-pixbuf/io-jpeg.c3
-rw-r--r--gdk-pixbuf/io-png.c4
-rw-r--r--gdk-pixbuf/io-tiff.c3
4 files changed, 10 insertions, 6 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-private.h b/gdk-pixbuf/gdk-pixbuf-private.h
index fc63d8f90..79ccf1531 100644
--- a/gdk-pixbuf/gdk-pixbuf-private.h
+++ b/gdk-pixbuf/gdk-pixbuf-private.h
@@ -46,12 +46,6 @@ typedef struct _GdkPixbufClass GdkPixbufClass;
#define GDK_IS_PIXBUF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF))
#define GDK_PIXBUF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF, GdkPixbufClass))
-/* Helper macros to convert between density units */
-#define DPI_TO_DPM(value) ((int) round ((value) * 1000 / 25.4))
-#define DPI_TO_DPCM(value) ((int) round ((value) / 2.54))
-#define DPM_TO_DPI(value) ((int) round ((value) * 25.4 / 1000))
-#define DPCM_TO_DPI(value) ((int) round ((value) * 2.54))
-
/* Default fill color */
#define DEFAULT_FILL_COLOR 0x979899ff
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 8b94dbc0a..15c0d635f 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -44,6 +44,9 @@
#endif
+/* Helper macros to convert between density units */
+#define DPCM_TO_DPI(value) ((int) round ((value) * 2.54))
+
/* we are a "source manager" as far as libjpeg is concerned */
#define JPEG_PROG_BUF_SIZE 65536
diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c
index b039af678..ac1aa9a11 100644
--- a/gdk-pixbuf/io-png.c
+++ b/gdk-pixbuf/io-png.c
@@ -30,6 +30,10 @@
#include "gdk-pixbuf-private.h"
#include "fallback-c89.c"
+/* Helper macros to convert between density units */
+#define DPI_TO_DPM(value) ((int) round ((value) * 1000 / 25.4))
+#define DPM_TO_DPI(value) ((int) round ((value) * 25.4 / 1000))
+
static gboolean
setup_png_transformations(png_structp png_read_ptr, png_infop png_info_ptr,
GError **error,
diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c
index c25c28707..607d2e325 100644
--- a/gdk-pixbuf/io-tiff.c
+++ b/gdk-pixbuf/io-tiff.c
@@ -47,6 +47,9 @@
#endif
+/* Helper macros to convert between density units */
+#define DPCM_TO_DPI(value) ((int) round ((value) * 2.54))
+
typedef struct _TiffContext TiffContext;
struct _TiffContext
{