-/* convert_pixels_to_time
- *
- * Convert from window pixel and time interval to an absolute time.
- */
-__inline void convert_pixels_to_time(
- gint width,
- guint x,
- LttTime window_time_begin,
- LttTime window_time_end,
- LttTime *time)
-{
- LttTime window_time_interval;
- guint64 time_ll;
-
- window_time_interval = ltt_time_sub(window_time_end,
- window_time_begin);
- time_ll = ltt_time_to_uint64(window_time_interval);
- time_ll = time_ll * x / width;
- *time = ltt_time_from_uint64(time_ll);
- *time = ltt_time_add(window_time_begin, *time);
-}
-
-
-__inline void convert_time_to_pixels(
- LttTime window_time_begin,
- LttTime window_time_end,
- LttTime time,
- int width,
- guint *x)
-{
- LttTime window_time_interval;
- guint64 time_ll, interval_ll;
-
- g_assert(ltt_time_compare(window_time_begin, time) <= 0 &&
- ltt_time_compare(window_time_end, time) >= 0);
-
- window_time_interval = ltt_time_sub(window_time_end,window_time_begin);
-
- time = ltt_time_sub(time, window_time_begin);
-
- time_ll = ltt_time_to_uint64(time);
- interval_ll = ltt_time_to_uint64(window_time_interval);
-
- if(interval_ll == 0) {
- g_assert(time_ll == 0);
- *x = 0;
- } else {
- *x = (guint)(time_ll * width / interval_ll);
- }
-
-}
-