add skcms_TransferFunction_isFooish()

I don't think I want to get into the business of saying whether an
skcms_Profile / SkColorSpace is "HDR", but I think we can certainly tell
you what sort of skcms_TransferFunction you're holding and let you
decide from there.

Bug: chromium:1106417
Change-Id: Iac2841b08e3f34bf2a7a089b465409115b38d42a
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/303388
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/skcms.cc b/skcms.cc
index 92af963..0489a8a 100644
--- a/skcms.cc
+++ b/skcms.cc
@@ -166,11 +166,21 @@
     return Bad;
 }
 
+bool skcms_TransferFunction_isSRGBish(const skcms_TransferFunction* tf) {
+    return classify(*tf) == sRGBish;
+}
+bool skcms_TransferFunction_isPQish(const skcms_TransferFunction* tf) {
+    return classify(*tf) == PQish;
+}
+bool skcms_TransferFunction_isHLGish(const skcms_TransferFunction* tf) {
+    return classify(*tf) == HLGish;
+}
+
 bool skcms_TransferFunction_makePQish(skcms_TransferFunction* tf,
                                       float A, float B, float C,
                                       float D, float E, float F) {
     *tf = { TFKind_marker(PQish), A,B,C,D,E,F };
-    assert(classify(*tf) == PQish);
+    assert(skcms_TransferFunction_isPQish(tf));
     return true;
 }
 
@@ -178,7 +188,7 @@
                                        float R, float G,
                                        float a, float b, float c) {
     *tf = { TFKind_marker(HLGish), R,G, a,b,c, 0 };
-    assert(classify(*tf) == HLGish);
+    assert(skcms_TransferFunction_isHLGish(tf));
     return true;
 }
 
@@ -485,7 +495,7 @@
             curve->parametric.f = read_big_fixed(paraTag->variable + 24);
             break;
     }
-    return classify(curve->parametric) == sRGBish;
+    return skcms_TransferFunction_isSRGBish(&curve->parametric);
 }
 
 typedef struct {
diff --git a/skcms.h b/skcms.h
index eec1442..2bee9d9 100644
--- a/skcms.h
+++ b/skcms.h
@@ -79,6 +79,11 @@
                                                , 1/0.17883277f, 0.28466892f, 0.55991073f);
 }
 
+// Is this an ordinary sRGB-ish transfer function, or one of the HDR forms we support?
+SKCMS_API bool skcms_TransferFunction_isSRGBish(const skcms_TransferFunction*);
+SKCMS_API bool skcms_TransferFunction_isPQish  (const skcms_TransferFunction*);
+SKCMS_API bool skcms_TransferFunction_isHLGish (const skcms_TransferFunction*);
+
 // Unified representation of 'curv' or 'para' tag data, or a 1D table from 'mft1' or 'mft2'
 typedef union skcms_Curve {
     struct {