Lines Matching defs:curve1

479 piecewise_curve_checks(stp_curve_t *curve1, int resample_points, int expected)
488 curve_points = stp_curve_get_data_points(curve1, &count);
523 SIMPLE_TEST_CHECK(!stp_curve_get_sequence(curve1));
526 SIMPLE_TEST_CHECK(!stp_curve_get_data(curve1, &count));
529 SIMPLE_TEST_CHECK(!stp_curve_set_point(curve1, 2, 1.0));
532 SIMPLE_TEST_CHECK(!stp_curve_get_point(curve1, 2, &low));
535 SIMPLE_TEST_CHECK(!stp_curve_interpolate_value(curve1, .5, &low));
538 SIMPLE_TEST_CHECK(stp_curve_rescale(curve1, .5, STP_CURVE_COMPOSE_ADD,
542 SIMPLE_TEST_CHECK(!stp_curve_get_float_data(curve1, &count));
545 SIMPLE_TEST_CHECK(!(curve2 = stp_curve_get_subrange(curve1, 0, 2)));
551 if (stp_curve_set_subrange(curve1, curve2, 1))
565 SIMPLE_TEST_CHECK(stp_curve_resample(curve1, resample_points));
568 SIMPLE_TEST_CHECK(!stp_curve_is_piecewise(curve1));
571 SIMPLE_TEST_CHECK(!stp_curve_get_data_points(curve1, &count));
574 SIMPLE_TEST_CHECK(stp_curve_get_sequence(curve1));
577 SIMPLE_TEST_CHECK(stp_curve_get_data(curve1, &count));
580 SIMPLE_TEST_CHECK(stp_curve_set_point(curve1, 2, 0.51));
583 SIMPLE_TEST_CHECK(stp_curve_get_point(curve1, 2, &low));
586 SIMPLE_TEST_CHECK(stp_curve_interpolate_value(curve1, .5, &low));
589 SIMPLE_TEST_CHECK(stp_curve_rescale(curve1, 2,
594 SIMPLE_TEST_CHECK(stp_curve_get_float_data(curve1, &count));
597 SIMPLE_TEST_CHECK((curve2 = stp_curve_get_subrange(curve1, 0, 2)));
606 stp_curve_write(stdout, curve1);
607 if (stp_curve_set_subrange(curve1, curve2, 4))
611 stp_curve_write(stdout, curve1);
627 stp_curve_t *curve1;
660 curve1 = stp_curve_create(STP_CURVE_WRAP_AROUND);
661 stp_curve_set_bounds(curve1, 0.0, 4.0);
662 stp_curve_set_data(curve1, 48, standard_sat_adjustment);
663 tmp = stp_curve_write_string(curve1);
664 stp_curve_destroy(curve1);
665 curve1 = NULL;
758 curve1 = stp_curve_create(STP_CURVE_WRAP_NONE);
763 SIMPLE_TEST_CHECK(stp_curve_set_gamma(curve1, 1.2));
765 stp_curve_write(stdout, curve1);
772 SIMPLE_TEST_CHECK(stp_curve_compose(&curve3, curve1, curve2,
778 SIMPLE_TEST_CHECK(stp_curve_resample(curve1, 64));
779 if (verbose && curve1)
780 stp_curve_write(stdout, curve1);
787 if (!stp_curve_compose(&curve3, curve1, curve2, STP_CURVE_COMPOSE_MULTIPLY, 64))
794 stp_curve_write(stdout, curve1);
801 stp_curve_destroy(curve1);
804 curve1 = stp_curve_create_from_string(good_curves[0]);
806 SIMPLE_TEST_CHECK(stp_curve_compose(&curve3, curve1, curve2,
812 SIMPLE_TEST_CHECK(stp_curve_resample(curve1, 64));
813 if (verbose && curve1)
814 stp_curve_write(stdout, curve1);
821 if (!stp_curve_compose(&curve3, curve1, curve2, STP_CURVE_COMPOSE_MULTIPLY, 64))
828 stp_curve_write(stdout, curve1);
845 SIMPLE_TEST_CHECK(stp_curve_compose(&curve3, curve1, curve2,
855 if (curve1)
857 stp_curve_destroy(curve1);
858 curve1 = NULL;
867 SIMPLE_TEST_CHECK((curve1 = stp_curve_create_from_string(spline_curve_1)));
870 if (curve1)
873 stp_curve_write(stdout, curve1);
875 SIMPLE_TEST_CHECK(stp_curve_resample(curve1, 41));
876 if (verbose && curve1)
877 stp_curve_write(stdout, curve1);
879 SIMPLE_TEST_CHECK(stp_curve_resample(curve1, 83));
880 if (verbose && curve1)
881 stp_curve_write(stdout, curve1);
893 if (curve1 && curve2 &&
894 stp_curve_compose(&curve3, curve1, curve2, STP_CURVE_COMPOSE_MULTIPLY, -1))
902 if (curve1)
904 stp_curve_destroy(curve1);
905 curve1 = NULL;
914 SIMPLE_TEST_CHECK((curve1 = stp_curve_create_from_string(linear_curve_1)));
922 if (curve1)
925 stp_curve_write(stdout, curve1);
927 SIMPLE_TEST_CHECK(stp_curve_resample(curve1, 41));
928 if (verbose && curve1)
929 stp_curve_write(stdout, curve1);
930 stp_curve_destroy(curve1);
931 curve1 = NULL;
945 curve1 = stp_curve_create(STP_CURVE_WRAP_AROUND);
946 stp_curve_set_interpolation_type(curve1, STP_CURVE_TYPE_SPLINE);
947 stp_curve_set_bounds(curve1, 0.0, 4.0);
948 stp_curve_set_data(curve1, 48, standard_sat_adjustment);
950 SIMPLE_TEST_CHECK(curve1 && (stp_curve_count_points(curve1) == 48));
952 stp_curve_write(stdout, curve1);
954 SIMPLE_TEST_CHECK(stp_curve_resample(curve1, 384));
956 stp_curve_write(stdout, curve1);
958 SIMPLE_TEST_CHECK(stp_curve_resample(curve1, 65535));
961 stp_curve_get_range(curve1, &low, &high);
963 stp_curve_get_bounds(curve1, &low, &high);
966 SIMPLE_TEST_CHECK(stp_curve_rescale(curve1, 2.0, STP_CURVE_COMPOSE_ADD,
969 stp_curve_rescale(curve1, 1.0, STP_CURVE_COMPOSE_ADD,
971 stp_curve_get_bounds(curve1, &low, &high);
972 stp_curve_rescale(curve1, 0.0, STP_CURVE_COMPOSE_ADD,
974 stp_curve_get_bounds(curve1, &low, &high);
975 stp_curve_rescale(curve1, 0.0, STP_CURVE_COMPOSE_ADD,
977 stp_curve_get_bounds(curve1, &low, &high);
978 stp_curve_rescale(curve1, 0.0, STP_CURVE_COMPOSE_ADD,
980 stp_curve_get_bounds(curve1, &low, &high);
982 tmp = stp_curve_write_string(curve1);
999 SIMPLE_TEST_CHECK(stp_curve_compose(&curve3, curve1, curve2,
1007 if (curve1)
1009 stp_curve_destroy(curve1);
1010 curve1 = NULL;
1015 curve1 = stp_curve_create(STP_CURVE_WRAP_AROUND);
1016 stp_curve_set_bounds(curve1, 0.0, 4.0);
1019 (curve1, 48, standard_piecewise_sat_adjustment));
1022 tmp = stp_curve_write_string(curve1);
1028 SIMPLE_TEST_CHECK(stp_curve_is_piecewise(curve1));
1031 curve2 = stp_curve_create_copy(curve1);
1037 piecewise_curve_checks(curve1, 0, 48);
1038 stp_curve_rescale(curve1, -.5, STP_CURVE_COMPOSE_ADD,
1043 stp_curve_copy(curve2, curve1);
1044 SIMPLE_TEST_CHECK(curve1);
1046 stp_curve_copy(curve2, curve1);
1048 stp_curve_copy(curve2, curve1);
1050 stp_curve_copy(curve2, curve1);
1052 stp_curve_copy(curve2, curve1);
1054 stp_curve_copy(curve2, curve1);
1056 stp_curve_copy(curve2, curve1);
1058 stp_curve_destroy(curve1);
1061 curve1 = stp_curve_create(STP_CURVE_WRAP_NONE);
1062 stp_curve_set_bounds(curve1, 0.0, 4.0);
1064 (curve1, 48, standard_piecewise_sat_adjustment));
1068 (curve1, 49, standard_piecewise_sat_adjustment));
1071 tmp = stp_curve_write_string(curve1);
1077 SIMPLE_TEST_CHECK(stp_curve_is_piecewise(curve1));
1080 curve2 = stp_curve_create_copy(curve1);
1085 piecewise_curve_checks(curve1, 0, 49);
1086 stp_curve_rescale(curve1, -.5, STP_CURVE_COMPOSE_ADD,
1091 stp_curve_copy(curve2, curve1);
1093 stp_curve_copy(curve2, curve1);
1095 stp_curve_copy(curve2, curve1);
1097 stp_curve_copy(curve2, curve1);
1099 stp_curve_copy(curve2, curve1);
1101 stp_curve_copy(curve2, curve1);
1103 stp_curve_copy(curve2, curve1);
1108 curve1 = stp_curve_create(STP_CURVE_WRAP_AROUND);
1109 stp_curve_set_interpolation_type(curve1, STP_CURVE_TYPE_SPLINE);
1110 stp_curve_set_bounds(curve1, 0.0, 4.0);
1113 (curve1, 48, standard_piecewise_sat_adjustment));
1116 tmp = stp_curve_write_string(curve1);
1122 SIMPLE_TEST_CHECK(stp_curve_is_piecewise(curve1));
1125 curve2 = stp_curve_create_copy(curve1);
1130 piecewise_curve_checks(curve1, 0, 48);
1131 stp_curve_rescale(curve1, -.5, STP_CURVE_COMPOSE_ADD,
1136 stp_curve_copy(curve2, curve1);
1138 stp_curve_copy(curve2, curve1);
1140 stp_curve_copy(curve2, curve1);
1142 stp_curve_copy(curve2, curve1);
1144 stp_curve_copy(curve2, curve1);
1146 stp_curve_copy(curve2, curve1);
1148 stp_curve_copy(curve2, curve1);
1150 stp_curve_destroy(curve1);
1153 curve1 = stp_curve_create(STP_CURVE_WRAP_NONE);
1154 stp_curve_set_interpolation_type(curve1, STP_CURVE_TYPE_SPLINE);
1155 stp_curve_set_bounds(curve1, 0.0, 4.0);
1158 (curve1, 49, standard_piecewise_sat_adjustment));
1161 tmp = stp_curve_write_string(curve1);
1167 SIMPLE_TEST_CHECK(stp_curve_is_piecewise(curve1));
1170 curve2 = stp_curve_create_copy(curve1);
1175 piecewise_curve_checks(curve1, 0, 49);
1176 stp_curve_rescale(curve1, -.5, STP_CURVE_COMPOSE_ADD,
1181 stp_curve_copy(curve2, curve1);
1183 stp_curve_copy(curve2, curve1);
1185 stp_curve_copy(curve2, curve1);
1187 stp_curve_copy(curve2, curve1);
1189 stp_curve_copy(curve2, curve1);
1191 stp_curve_copy(curve2, curve1);
1193 stp_curve_copy(curve2, curve1);
1197 curve1 = stp_curve_create_from_string(small_piecewise_curve);
1198 SIMPLE_TEST_CHECK(curve1);
1200 stp_curve_destroy(curve1);
1201 curve1 = NULL;