2
* Copyright (C) 2006-2008 Anders Brander <anders@brander.dk> and
3
* Anders Kvist <akv@lnxbx.dk>
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
* A version of atof() that isn't locale specific
27
* @note This doesn't do any error checking!
28
* @param str A NULL terminated string representing a number
29
* @return The number represented by str or 0.0 if str is NULL
31
extern gdouble rs_atof(const gchar *str);
34
* A convenience function to convert an EXIF timestamp to a unix timestamp.
35
* @note This will only work until 2038 unless glib fixes its GTime
36
* @param str A NULL terminated string containing a timestamp in the format "YYYY:MM:DD HH:MM:SS" (EXIF 2.2 section 4.6.4)
37
* @return A unix timestamp or -1 on error
40
rs_exiftime_to_unixtime(const gchar *str);
43
* A convenience function to convert an unix timestamp to an EXIF timestamp.
44
* @note This will only work until 2038 unless glib fixes its GTime
45
* @param timestamp A unix timestamp
46
* @return A string formatted as specified in EXIF 2.2 section 4.6.4
49
rs_unixtime_to_exiftime(GTime timestamp);
52
* Constrains a box to fill a bounding box without changing aspect
53
* @param target_width The width of the bounding box
54
* @param target_height The height of the bounding box
55
* @param width The input and output width
56
* @param height The input and output height
59
rs_constrain_to_bounding_box(gint target_width, gint target_height, gint *width, gint *height);
62
* Try to count the number of processor cores in a system.
63
* @note This currently only works for systems with /proc/cpuinfo
64
* @return The numver of cores or 1 if the system is unsupported
67
rs_get_number_of_processor_cores();
69
#endif /* RS_UTILS_H */