[Rawstudio-commit] rawspeed r56 - RawSpeed

Klaus Post klauspost at gmail.com
Sun Feb 8 12:46:08 CET 2009


Author: post
Date: 2009-02-08 12:46:08 +0100 (Sun, 08 Feb 2009)
New Revision: 56

Modified:
   RawSpeed/Common.h
Log:
- Remove unneeded blit, copy while correcting black&scale instead.
- Don't collect min, max information all the way to the left side of image.
- "Fix" Compiler warnings.
- Proper indentation (Rawstudio style :)

Modified: RawSpeed/Common.h
===================================================================
--- RawSpeed/Common.h	2009-02-08 10:59:48 UTC (rev 55)
+++ RawSpeed/Common.h	2009-02-08 11:46:08 UTC (rev 56)
@@ -15,24 +15,24 @@
 
     You should have received a copy of the GNU Lesser General Public
     License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
-
-    http://www.klauspost.com
-*/
-#pragma once
-
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+
+    http://www.klauspost.com
+*/
+#pragma once
+
 #ifndef __unix__
-#include <intrin.h>
-#pragma intrinsic(_ReturnAddress)
-#define MIN(a,b) min(a,b)
-#define MAX(a,b) max(a,b)
-#else
+#include <intrin.h>
+#pragma intrinsic(_ReturnAddress)
+#define MIN(a,b) min(a,b)
+#define MAX(a,b) max(a,b)
+#else
 #include <rawstudio.h>
 #include <exception>
 #include <string.h>
 #include <assert.h>
 #define BYTE unsigned char
-#define _ASSERTE(a) g_assert(a)
+#define _ASSERTE(a) void(a)
 #include <stdexcept>
 #define _RPT0(a,b) 
 #define _RPT1(a,b,c) 
@@ -50,63 +50,63 @@
 #define MAX(a, b)  lmin(a,b)
 #endif
 typedef char* LPCWSTR;
-#endif // __unix__
+#endif // __unix__
 
-
-inline void BitBlt(BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height) {
-  if (height == 1 || (dst_pitch == src_pitch && src_pitch == row_size)) {
-    memcpy(dstp, srcp, row_size*height);
-    return;
-  }
-  for (int y=height; y>0; --y) {
-    memcpy(dstp, srcp, row_size);
-    dstp += dst_pitch;
-    srcp += src_pitch;
-  }
-}
-
-inline int lmin(int p0, int p1) {
-  return p1 + ((p0 - p1) & ((p0 - p1) >> 31));
-}
-inline int lmax(int p0, int p1) {
-  return p0 - ((p0 - p1) & ((p0 - p1) >> 31));
-}
-
-
-
-/* -------------------------------------------------------------------- */
-#ifndef __unix__
-
-typedef   bool          gboolean;
-typedef   void*         gpointer;
-typedef   const void*   gconstpointer;
-typedef   char          gchar;
-typedef   unsigned char guchar;
-
-typedef  int           gint;
-typedef  unsigned int  guint;
-typedef  short           gshort;
-typedef  unsigned short           gushort;
-typedef  long           glong;
-typedef  unsigned long           gulong;
-
-typedef  char gint8;
-typedef  unsigned char           guint8;
-typedef  short           gint16;
-typedef  unsigned short           guint16;
-typedef  int           gint32;
-typedef  unsigned int           guint32;
-
-typedef  long long       gint64;
-typedef  unsigned long long          guint64;
-
-typedef float            gfloat;
-typedef double            gdouble;
-
-typedef unsigned int            gsize;
-typedef signed int            gssize;
-typedef gint64            goffset;
-#endif // __unix__
 
-inline guint clampbits(gint x, guint n) { guint32 _y_temp; if( _y_temp=x>>n ) x = ~_y_temp >> (32-n); return x;}
+inline void BitBlt(BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height) {
+  if (height == 1 || (dst_pitch == src_pitch && src_pitch == row_size)) {
+    memcpy(dstp, srcp, row_size*height);
+    return;
+  }
+  for (int y=height; y>0; --y) {
+    memcpy(dstp, srcp, row_size);
+    dstp += dst_pitch;
+    srcp += src_pitch;
+  }
+}
 
+inline int lmin(int p0, int p1) {
+  return p1 + ((p0 - p1) & ((p0 - p1) >> 31));
+}
+inline int lmax(int p0, int p1) {
+  return p0 - ((p0 - p1) & ((p0 - p1) >> 31));
+}
+
+
+
+/* -------------------------------------------------------------------- */
+#ifndef __unix__
+
+typedef   bool          gboolean;
+typedef   void*         gpointer;
+typedef   const void*   gconstpointer;
+typedef   char          gchar;
+typedef   unsigned char guchar;
+
+typedef  int           gint;
+typedef  unsigned int  guint;
+typedef  short           gshort;
+typedef  unsigned short           gushort;
+typedef  long           glong;
+typedef  unsigned long           gulong;
+
+typedef  char gint8;
+typedef  unsigned char           guint8;
+typedef  short           gint16;
+typedef  unsigned short           guint16;
+typedef  int           gint32;
+typedef  unsigned int           guint32;
+
+typedef  long long       gint64;
+typedef  unsigned long long          guint64;
+
+typedef float            gfloat;
+typedef double            gdouble;
+
+typedef unsigned int            gsize;
+typedef signed int            gssize;
+typedef gint64            goffset;
+#endif // __unix__
+
+inline guint clampbits(gint x, guint n) { guint32 _y_temp; if( (_y_temp=x>>n) ) x = ~_y_temp >> (32-n); return x;}
+




More information about the Rawstudio-commit mailing list