3 * Copyright 2013 Google, Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
10 #ifndef SkDebugUtils_DEFINED
11 #define SkDebugUtils_DEFINED
15 // These functions dump 0, 1, and 2d arrays of data in a format that's
16 // compatible with Mathematica for quick visualization
20 inline void SkDebugDumpMathematica( const T val ) {
21 SkDEBUGFAIL("Need to specialize SkDebugDumpMathematica for your type, sorry.");
25 inline void SkDebugDumpMathematica(const char *name, const T *array, int size) {
28 for (int i=0 ; i < size ; i++) {
29 SkDebugDumpMathematica<T>(array[i]);
30 if (i != size-1) SkDebugf(", ");
36 inline void SkDebugDumpMathematica(const char *name, const T *array, int width, int height) {
39 for (int i=0 ; i < height ; i++) {
41 for (int j = 0 ; j < width ; j++) {
42 SkDebugDumpMathematica<T>(array[i*width + j]);
56 inline void SkDebugDumpMathematica( const char *name, const T val ) {
59 SkDebugDumpMathematica<T>(val);
64 inline void SkDebugDumpMathematica<uint8_t>( const uint8_t val ) {
69 inline void SkDebugDumpMathematica<unsigned int>( const unsigned int val ) {
74 inline void SkDebugDumpMathematica<int>( const int val ) {
79 inline void SkDebugDumpMathematica<size_t>( const size_t val ) {
84 void SkDebugDumpMathematica<const char *>( const char * val ) {
89 inline void SkDebugDumpMathematica<float>( float val ) {