~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to gdk-pixbuf/pixops/pixbuf-transform-math.ltx

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\documentclass{article}
 
2
 
 
3
\begin{document}
 
4
 
 
5
\title{Some image transform math}
 
6
\author{Owen Taylor}
 
7
\date{18 February 2003}
 
8
\maketitle
 
9
 
 
10
\section{Basics}
 
11
 
 
12
The transform process is composed of three steps;
 
13
first we reconstruct a continuous image from the 
 
14
source data \(A_{i,j}\):
 
15
\[a(u,v) = \sum_{i = -\infty}^{\infty} \sum_{j = -\infty}^{\infty} A_{i,j}F\left( {u - i \atop v - j} \right) \]
 
16
Then we transform from destination coordinates to source coordinates:
 
17
\[b(x,y) = a\left(u(x,y) \atop v(x,y)\right)
 
18
         = a\left(t_{00}x + t_{01}y + t_{02} \atop t_{10}x + t_{11}y + t_{12} \right)\]
 
19
Finally, we resample using a sampling function \(G\):
 
20
\[B_{x_0,y_0} = \int_{-\infty}^{\infty}\int_{-\infty}^{\infty} b(x,y)G\left( {x - x_0 \atop y - y_0} \right) dxdy\]
 
21
Putting all of these together:
 
22
\[B_{x_0,y_0} = 
 
23
\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}
 
24
\sum_{i = -\infty}^{\infty} \sum_{j = -\infty}^{\infty} A_{i,j}
 
25
F\left( {u(x,y) - i \atop v(x,y) - j} \right)
 
26
G\left( {x - x_0 \atop y - y_0} \right) dxdy\]
 
27
We can reverse the order of the integrals and the sums:
 
28
\[B_{x_0,y_0} = 
 
29
\sum_{i = -\infty}^{\infty} \sum_{j = -\infty}^{\infty} A_{i,j}
 
30
\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}
 
31
F\left( {u(x,y) - i \atop v(x,y) - j} \right)
 
32
G\left( {x - x_0 \atop y - y_0} \right) dxdy\]
 
33
Which shows that the destination pixel values are a linear combination of the 
 
34
source pixel values. But the coefficents depend on \(x_0\) and \(y_0\). 
 
35
To simplify this a bit, define:
 
36
\[i_0 = \lfloor u(x_0,y_0) \rfloor = \lfloor {t_{00}x_0 + t_{01}y_0 + t_{02}} \rfloor \]
 
37
\[j_0 = \lfloor v(x_0,y_0) \rfloor = \lfloor {t_{10}x_0 + t_{11}y_0 + t_{12}} \rfloor \]
 
38
\[\Delta_u = u(x_0,y_0) - i_0 = t_{00}x_0 + t_{01}y_0 + t_{02} - \lfloor {t_{00}x_0 + t_{01}y_0 + t_{02}} \rfloor \]
 
39
\[\Delta_v = v(x_0,y_0) - j_0 = t_{10}x_0 + t_{11}y_0 + t_{12} - \lfloor {t_{10}x_0 + t_{11}y_0 + t_{12}} \rfloor \]
 
40
Then making the transforms \(x' = x - x_0\), \(y' = y - x_0\), \(i' = i - i_0\), \(j' = j - x_0\)
 
41
\begin{eqnarray*}
 
42
F(u,v) & = & F\left( {t_{00}x + t_{01}y + t_{02} - i \atop t_{10}x + t_{11}y + t_{12} - j} \right)\\
 
43
       & = & F\left( {t_{00}(x'+x_0) + t_{01}(y'+y_0) + t_{02} - (i'+i_0) \atop 
 
44
                      t_{10}(x'+x_0) + t_{11}(y'+y_0) + t_{12} - (j'+j_0)} \right) \\
 
45
       & = & F\left( {\Delta_u + t_{00}x' + t_{01}y' - i' \atop 
 
46
                      \Delta_v + t_{10}x' + t_{11}y' - j'} \right)
 
47
\end{eqnarray*}
 
48
Using that, we can then reparameterize the sums and integrals and
 
49
define coefficients that depend only on \((\Delta_u,\Delta_v)\),
 
50
which we'll call the \emph{phase} at the point \((x_0,y_0)\):
 
51
\[
 
52
B_{x_0,y_0} = 
 
53
\sum_{i = -\infty}^{\infty} \sum_{j = -\infty}^{\infty} A_{i_0+i,j_0+j} C_{i,j}(\Delta_u,\Delta_v)
 
54
\]
 
55
\[
 
56
C_{i,j}(\Delta_u,\Delta_v) =
 
57
\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}
 
58
F\left( {\Delta_u + t_{00}x + t_{01}y - i \atop 
 
59
         \Delta_v + t_{10}x + t_{11}y - j} \right)
 
60
G\left( {x \atop y} \right) dxdy
 
61
\]
 
62
\section{Separability}
 
63
A frequent special case is when the reconstruction and sampling functions
 
64
are of the form:
 
65
\[F(u,v) = f(u)f(v)\]
 
66
\[G(x,y) = g(x)g(y)\]
 
67
If we also have a transform that is purely a scale and translation;
 
68
(\(t_{10} = 0\), \(t_{01} = 0\)), then we can separate 
 
69
\(C_{i,j}(\Delta_u,\Delta_v)\) into the product of a \(x\) portion
 
70
and a \(y\) portion:
 
71
\[C_{i,j}(\Delta_u,\Delta_v) = c_{i}(\Delta_u) c_{j}(\Delta_v)\]
 
72
\[c_{i}(\Delta_u) = \int_{-\infty}^{\infty} f(\Delta_u + t_{00}x - i)g(x)dx\]
 
73
\[c_{j}(\Delta_v) = \int_{-\infty}^{\infty} f(\Delta_v + t_{11}y - j)g(y)dy\]
 
74
 
 
75
\section{Some filters}
 
76
gdk-pixbuf provides 4 standard filters for scaling, under the names ``NEAREST'',
 
77
``TILES'', ``BILINEAR'', and ``HYPER''. All of turn out to be separable
 
78
as discussed in the previous section. 
 
79
For ``NEAREST'' filter, the reconstruction function is simple replication
 
80
and the sampling function is a delta function\footnote{A delta function is an infinitely narrow spike, such that:
 
81
\[\int_{-\infty}^{\infty}\delta(x)f(x) = f(0)\]}:
 
82
\[f(t) = \cases{1, & if \(0 \le t \le 1\); \cr 
 
83
                0, & otherwise}\]
 
84
\[g(t) = \delta(t - 0.5)\]
 
85
For ``TILES'', the reconstruction function is again replication, but we
 
86
replace the delta-function for sampling with a box filter:
 
87
\[f(t) = \cases{1, & if \(0 \le t \le 1\); \cr 
 
88
                0, & otherwise}\]
 
89
\[g(t) = \cases{1, & if \(0 \le t \le 1\); \cr 
 
90
                0, & otherwise}\]
 
91
The ``HYPER'' filter (in practice, it was originally intended to be 
 
92
something else) uses bilinear interpolation for reconstruction and
 
93
a box filter for sampling:
 
94
\[f(t) = \cases{1 - |t - 0.5|, & if \(-0.5 \le t \le 1.5\); \cr 
 
95
                0, & otherwise}\]
 
96
\[g(t) = \cases{1, & if \(0 \le t \le 1\); \cr 
 
97
                0, & otherwise}\]
 
98
The ``BILINEAR'' filter is defined in a somewhat more complicated way;
 
99
the definition depends on the scale factor in the transform (\(t_{00}\)
 
100
or \(t_{01}]\). In the \(x\) direction, for \(t_{00} < 1\), it is
 
101
the same as for ``TILES'':
 
102
\[f_u(t) = \cases{1, & if \(0 \le t \le 1\); \cr 
 
103
                  0, & otherwise}\]
 
104
\[g_u(t) = \cases{1, & if \(0 \le t \le 1\); \cr 
 
105
                  0, & otherwise}\]
 
106
but for \(t_{10} > 1\), we use bilinear reconstruction and delta-function
 
107
sampling:
 
108
\[f_u(t) = \cases{1 - |t - 0.5|, & if \(-0.5 \le t \le 1.5\); \cr 
 
109
                  0, & otherwise}\]
 
110
\[g_u(t) = \delta(t - 0.5)\]
 
111
The behavior in the \(y\) direction depends in the same way on \(t_{11}\).
 
112
\end{document}
 
 
b'\\ No newline at end of file'