Lines Matching refs:ts
106 ts_transform_stack_resize(struct ts_transform_stack * const ts, uint32_t const size) in ts_transform_stack_resize() argument
108 ts->size = size; in ts_transform_stack_resize()
109 ts->weakrefs = realloc(ts->weakrefs, size * sizeof(*ts->weakrefs)); in ts_transform_stack_resize()
110 ts->transforms = realloc(ts->transforms,size * sizeof(*ts->transforms)); in ts_transform_stack_resize()
115 ts_transform_stack_ensure(struct ts_transform_stack * const ts) in ts_transform_stack_ensure() argument
117 if (ts->count < ts->size) in ts_transform_stack_ensure()
121 ts_transform_stack_resize(ts,ts->size + max(ts->size/2,8)); in ts_transform_stack_ensure()
131 struct ts_transform_stack * ts = malloc(sizeof(*ts)); in ts_transform_stack_create() local
133 ts->size = size; in ts_transform_stack_create()
134 ts->count = 0; in ts_transform_stack_create()
136 ts->transforms = NULL; in ts_transform_stack_create()
137 ts->weakrefs = NULL; in ts_transform_stack_create()
139 ts_transform_stack_resize(ts,size); in ts_transform_stack_create()
141 return ts; in ts_transform_stack_create()
145 ts_transform_stack_release(struct ts_transform_stack * const ts) in ts_transform_stack_release() argument
147 free(ts->transforms); in ts_transform_stack_release()
148 free(ts->weakrefs); in ts_transform_stack_release()
150 free(ts); in ts_transform_stack_release()
158 ts_transform_stack_save(struct ts_transform_stack * const ts) in ts_transform_stack_save() argument
160 return ts->count; in ts_transform_stack_save()
164 ts_transform_stack_restore(struct ts_transform_stack * const ts, in ts_transform_stack_restore() argument
167 ts->count = restore; in ts_transform_stack_restore()
176 ts_transform_stack_tos(struct ts_transform_stack * const ts) in ts_transform_stack_tos() argument
178 return ts->transforms + ts->count - 1; in ts_transform_stack_tos()
218 ts_transform_stack_classify(struct ts_transform_stack * const ts) in ts_transform_stack_classify() argument
220 union ts_transform_stack_3x3_u const * const t = ts_transform_stack_tos(ts); in ts_transform_stack_classify()
233 ts_transform_stack_top_transform(struct ts_transform_stack * const ts) in ts_transform_stack_top_transform() argument
235 return ts_transform_stack_tos(ts)->a8; in ts_transform_stack_top_transform()
239 ts_transform_stack_top_weakref(struct ts_transform_stack * const ts) in ts_transform_stack_top_weakref() argument
241 return ts->weakrefs + ts->count - 1; in ts_transform_stack_top_weakref()
249 ts_transform_stack_dup(struct ts_transform_stack * const ts) in ts_transform_stack_dup() argument
251 ts_transform_stack_ensure(ts); in ts_transform_stack_dup()
253 union ts_transform_stack_3x3_u * const tos = ts_transform_stack_tos(ts); in ts_transform_stack_dup()
257 ts->weakrefs[ts->count] = ts->weakrefs[ts->count-1]; in ts_transform_stack_dup()
259 ts->count += 1; in ts_transform_stack_dup()
263 ts_transform_stack_drop(struct ts_transform_stack * const ts) in ts_transform_stack_drop() argument
265 assert(ts->count >= 1); in ts_transform_stack_drop()
267 ts->count -= 1; in ts_transform_stack_drop()
276 ts_transform_stack_swap_drop(struct ts_transform_stack * const ts) in ts_transform_stack_swap_drop() argument
278 assert(ts->count >= 2); in ts_transform_stack_swap_drop()
280 union ts_transform_stack_3x3_u * const tos = ts_transform_stack_tos(ts); in ts_transform_stack_swap_drop()
284 ts->weakrefs[ts->count-2] = ts->weakrefs[ts->count-1]; in ts_transform_stack_swap_drop()
286 ts->count -= 1; in ts_transform_stack_swap_drop()
295 ts_transform_stack_store_matrix_8(struct ts_transform_stack * const ts, in ts_transform_stack_store_matrix_8() argument
306 union ts_transform_stack_3x3_u * t = ts->transforms + idx; in ts_transform_stack_store_matrix_8()
319 ts->weakrefs[idx] = TS_TRANSFORM_WEAKREF_INVALID; in ts_transform_stack_store_matrix_8()
328 ts_transform_stack_store_matrix(struct ts_transform_stack * const ts, in ts_transform_stack_store_matrix() argument
342 ts_transform_stack_store_matrix_8(ts,idx, in ts_transform_stack_store_matrix()
352 ts_transform_stack_store_matrix_8(ts,idx, in ts_transform_stack_store_matrix()
365 ts_transform_stack_push_matrix_8(struct ts_transform_stack * const ts, in ts_transform_stack_push_matrix_8() argument
375 ts_transform_stack_ensure(ts); in ts_transform_stack_push_matrix_8()
377 ts_transform_stack_store_matrix_8(ts,ts->count++, in ts_transform_stack_push_matrix_8()
388 ts_transform_stack_push_matrix(struct ts_transform_stack * const ts, in ts_transform_stack_push_matrix() argument
401 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_matrix()
411 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_matrix()
423 ts_transform_stack_push_identity(struct ts_transform_stack * const ts) in ts_transform_stack_push_identity() argument
425 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_identity()
432 ts_transform_stack_push_affine(struct ts_transform_stack * const ts, in ts_transform_stack_push_affine() argument
440 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_affine()
447 ts_transform_stack_push_translate(struct ts_transform_stack * const ts, in ts_transform_stack_push_translate() argument
451 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_translate()
458 ts_transform_stack_push_scale(struct ts_transform_stack * const ts, in ts_transform_stack_push_scale() argument
462 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_scale()
469 ts_transform_stack_push_shear(struct ts_transform_stack * const ts, in ts_transform_stack_push_shear() argument
473 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_shear()
480 ts_transform_stack_push_skew_x(struct ts_transform_stack * const ts, in ts_transform_stack_push_skew_x() argument
485 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_skew_x()
492 ts_transform_stack_push_skew_y(struct ts_transform_stack * const ts, in ts_transform_stack_push_skew_y() argument
497 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_skew_y()
504 ts_transform_stack_push_rotate(struct ts_transform_stack * const ts, in ts_transform_stack_push_rotate() argument
510 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_rotate()
517 ts_transform_stack_push_rotate_xy2(struct ts_transform_stack * const ts, in ts_transform_stack_push_rotate_xy2() argument
527 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_rotate_xy2()
534 ts_transform_stack_push_rotate_xy(struct ts_transform_stack * const ts, in ts_transform_stack_push_rotate_xy() argument
539 ts_transform_stack_push_rotate_xy2(ts,theta,cx,cy,cx,cy); in ts_transform_stack_push_rotate_xy()
543 ts_transform_stack_push_rotate_scale_xy(struct ts_transform_stack * const ts, in ts_transform_stack_push_rotate_scale_xy() argument
553 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_rotate_scale_xy()
573 ts_transform_stack_adjoint(struct ts_transform_stack * const ts) in ts_transform_stack_adjoint() argument
575 union ts_transform_stack_3x3_u * const t = ts_transform_stack_tos(ts); in ts_transform_stack_adjoint()
584 ts_transform_stack_store_matrix(ts,ts->count-1, in ts_transform_stack_adjoint()
603 return ts_transform_stack_classify(ts); in ts_transform_stack_adjoint()
611 ts_transform_stack_push_unit_to_quad(struct ts_transform_stack * const ts, in ts_transform_stack_push_unit_to_quad() argument
641 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_unit_to_quad()
670 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_unit_to_quad()
684 ts_transform_stack_push_quad_to_unit(struct ts_transform_stack * const ts, in ts_transform_stack_push_quad_to_unit() argument
687 if (ts_transform_stack_push_unit_to_quad(ts,quad) == TS_TRANSFORM_TYPE_INVALID) in ts_transform_stack_push_quad_to_unit()
690 return ts_transform_stack_adjoint(ts); in ts_transform_stack_push_quad_to_unit()
698 ts_transform_stack_push_quad_to_quad(struct ts_transform_stack * const ts, in ts_transform_stack_push_quad_to_quad() argument
702 if (ts_transform_stack_push_unit_to_quad(ts,quad_dst) == TS_TRANSFORM_TYPE_INVALID) in ts_transform_stack_push_quad_to_quad()
705 if (ts_transform_stack_push_quad_to_unit(ts,quad_src) == TS_TRANSFORM_TYPE_INVALID) in ts_transform_stack_push_quad_to_quad()
708 ts_transform_stack_multiply(ts); in ts_transform_stack_push_quad_to_quad()
710 return ts_transform_stack_classify(ts); in ts_transform_stack_push_quad_to_quad()
718 ts_transform_stack_push_rect_to_quad(struct ts_transform_stack * const ts, in ts_transform_stack_push_rect_to_quad() argument
725 if (ts_transform_stack_push_unit_to_quad(ts,quad_dst) == TS_TRANSFORM_TYPE_INVALID) in ts_transform_stack_push_rect_to_quad()
728 ts_transform_stack_push_matrix_8(ts, in ts_transform_stack_push_rect_to_quad()
738 ts_transform_stack_multiply(ts); in ts_transform_stack_push_rect_to_quad()
740 return ts_transform_stack_classify(ts); in ts_transform_stack_push_rect_to_quad()
758 ts_transform_stack_concat(struct ts_transform_stack * const ts) in ts_transform_stack_concat() argument
760 assert(ts->count >= 2); in ts_transform_stack_concat()
763 union ts_transform_stack_3x3_u const * const B = ts_transform_stack_tos(ts); in ts_transform_stack_concat()
766 ts_transform_stack_store_matrix(ts,ts->count-1,TS_TRANSFORM_MULTIPLY(A,B)); in ts_transform_stack_concat()
784 ts_transform_stack_multiply(struct ts_transform_stack * const ts) in ts_transform_stack_multiply() argument
786 assert(ts->count >= 2); in ts_transform_stack_multiply()
789 union ts_transform_stack_3x3_u const * const B = ts_transform_stack_tos(ts); in ts_transform_stack_multiply()
792 ts_transform_stack_store_matrix(ts,ts->count-- - 2,TS_TRANSFORM_MULTIPLY(A,B)); in ts_transform_stack_multiply()
800 ts_transform_stack_transform_xy(struct ts_transform_stack * const ts, in ts_transform_stack_transform_xy() argument
806 union ts_transform_stack_3x3_u const * const t = ts_transform_stack_tos(ts); in ts_transform_stack_transform_xy()
835 ts_transform_stack_tos_debug(struct ts_transform_stack * const ts) in ts_transform_stack_tos_debug() argument
837 union ts_transform_stack_3x3_u const * const t = ts_transform_stack_tos(ts); in ts_transform_stack_tos_debug()
858 ts_debug(struct ts_transform_stack * const ts, in ts_debug() argument
861 ts_transform_stack_tos_debug(ts); in ts_debug()
867 ts_transform_stack_transform_xy(ts, in ts_debug()
883 struct ts_transform_stack * const ts = ts_transform_stack_create(32); in main() local
889 ts_transform_stack_push_scale(ts,TS_DEBUG_SCALE,TS_DEBUG_SCALE); in main()
892 ts_transform_stack_push_affine(ts, in main()
896 ts_transform_stack_concat(ts); in main()
898 ts_transform_stack_push_identity(ts); in main()
901 uint32_t const restore = ts_transform_stack_save(ts); in main()
924 ts_transform_stack_push_rect_to_quad(ts, in main()
928 ts_transform_stack_concat(ts); in main()
930 ts_debug(ts,quad_src); in main()
935 ts_transform_stack_restore(ts,restore); in main()
938 ts_transform_stack_push_quad_to_quad(ts, in main()
941 ts_transform_stack_concat(ts); in main()
943 ts_debug(ts,quad_src); in main()
948 ts_transform_stack_restore(ts,restore); in main()
950 ts_transform_stack_push_matrix(ts, in main()
955 ts_transform_stack_concat(ts); in main()
962 ts_debug(ts,quad_foo); in main()