[Rawstudio-commit] r3033 - branches/rawstudio-ng-color/librawstudio

Anders Kvist anders at kvistmail.dk
Mon Jan 18 23:20:20 CET 2010


Author: akv
Date: 2010-01-18 23:20:19 +0100 (Mon, 18 Jan 2010)
New Revision: 3033

Modified:
   branches/rawstudio-ng-color/librawstudio/rs-rawfile.c
   branches/rawstudio-ng-color/librawstudio/rs-rawfile.h
Log:
Added raw_get_rational().

Modified: branches/rawstudio-ng-color/librawstudio/rs-rawfile.c
===================================================================
--- branches/rawstudio-ng-color/librawstudio/rs-rawfile.c	2010-01-18 16:37:28 UTC (rev 3032)
+++ branches/rawstudio-ng-color/librawstudio/rs-rawfile.c	2010-01-18 22:20:19 UTC (rev 3033)
@@ -142,6 +142,17 @@
 }
 
 gboolean
+raw_get_rational(RAWFILE *rawfile, guint pos, gfloat *target)
+{
+	guint counter, divisor;
+	raw_get_uint(rawfile, pos, &counter);
+	raw_get_uint(rawfile, pos+4, &divisor);
+	*target = (gfloat) counter / (gfloat) divisor;
+
+	return(TRUE);
+}
+
+gboolean
 raw_strcmp(RAWFILE *rawfile, guint pos, const gchar *needle, gint len)
 {
 	if((rawfile->base+pos+len) > rawfile->size)

Modified: branches/rawstudio-ng-color/librawstudio/rs-rawfile.h
===================================================================
--- branches/rawstudio-ng-color/librawstudio/rs-rawfile.h	2010-01-18 16:37:28 UTC (rev 3032)
+++ branches/rawstudio-ng-color/librawstudio/rs-rawfile.h	2010-01-18 22:20:19 UTC (rev 3033)
@@ -34,6 +34,7 @@
 gshort raw_get_short_from_string(RAWFILE *rawfile, gchar *source);
 gboolean raw_get_float(RAWFILE *rawfile, guint pos, gfloat *target);
 gboolean raw_get_uchar(RAWFILE *rawfile, guint pos, guchar *target);
+gboolean raw_get_rational(RAWFILE *rawfile, guint pos, gfloat *target);
 gboolean raw_strcmp(RAWFILE *rawfile, guint pos, const gchar *needle, gint len);
 gboolean raw_strcpy(RAWFILE *rawfile, guint pos, void *target, gint len);
 gchar *raw_strdup(RAWFILE *rawfile, guint pos, gint len);




More information about the Rawstudio-commit mailing list