Files

105 lines
4.0 KiB
Plaintext

\begin{tikzpicture}[auto, on grid, scale=.5, y=-1cm, every node/.style={scale=.5, y=-1cm}]
\def\BlockSize{4}
\tikzstyle{TextStyle}=[text centered, scale=1/.5, font=\footnotesize]
\tikzstyle{PU} =[draw, minimum height=\BlockSize cm, minimum width=\BlockSize cm]
\tikzstyle{Neighbour} =[draw, minimum height=1 cm, minimum width=\BlockSize cm, fill=gray!60]
\tikzstyle{PixelAnchor} =[xshift=.5cm, yshift=-.5cm]
\tikzstyle{Pixel} =[circle, thin, fill=TikZColorFill, inner sep=0, minimum size=10pt]
\tikzstyle{PixelNeighbour} =[Pixel, fill=black!70]
\tikzstyle{Arrow} =[-latex,thick, draw=black]
\tikzstyle{NeighbourSquares} =[fill=TikZColorFillDark]
\tikzstyle{EllipseDup} =[PixelAnchor, draw, ellipse, minimum width=5cm, minimum height=.7cm, inner sep=0]
\draw[Pixel] (0,0) grid ++(4.5,4.5);
\node[NeighbourSquares, anchor=north west, minimum width=1cm, minimum height=1cm] at (-1,-1) {};
\node[NeighbourSquares, anchor=north west, minimum width=4cm, minimum height=1cm] at (0,-1) {};
\node[NeighbourSquares, anchor=north west, minimum width=4cm, minimum height=1cm] at (4,-1) {};
\node[NeighbourSquares, anchor=north west, minimum width=1cm, minimum height=4cm] at (-1,0) {};
\node[NeighbourSquares, anchor=north west, minimum width=1cm, minimum height=4cm] at (-1,4) {};
% Pixels
\foreach \x in {0,...,3}
\foreach \y in {0,...,3}
{
\node at (\x,\y) [PixelAnchor,Pixel]() {};
}
\path[PixelAnchor, Arrow, shorten >= 2pt] (-1,1) -- ++( 2, 0 );
\path[PixelAnchor, Arrow, shorten >= 2pt] (4,1) -- ++( -3, 0 );
\path[PixelAnchor, Arrow, shorten >= 2pt] (1,-1) -- ++( 0, 2 );
\path[PixelAnchor, Arrow, shorten >= 2pt] (1,4) -- ++( 0, -3 );
\node[EllipseDup] at (1,4) {};
\node[EllipseDup, rotate=90] at (4,1) {};
\foreach \y in {-1,...,7}
{
\node at (-1,\y) [PixelAnchor,PixelNeighbour]() {};
}
\foreach \y in {-1,...,3}
{
\node at (4,\y) [PixelAnchor,PixelNeighbour]() {};
}
% \path[PixelAnchor, Arrow, dashed, shorten >= 3pt] (4,-1) -- ++( 0 , \BlockSize );
% \path[PixelAnchor, Arrow, dashed, shorten >= 3pt] (-1,4) -- ++( \BlockSize, 0 );
\foreach \x in {0,1,...,7}
{
\node at (\x,-1) [PixelAnchor,PixelNeighbour]() {};
}
\foreach \x in {0,1,...,3}
{
\node at (\x,4) [PixelAnchor,PixelNeighbour]() {};
}
\node[TextStyle] at (1.2,-1.3) {$p_1$};
\node[TextStyle] at (4.2,-1.3) {$p_2$};
\node[TextStyle] at (5.3,1.3) {$p'_2$};
\node[TextStyle] at (-1.3,1.3) {$p_3$};
\node[TextStyle] at (-1.3,4.3) {$p_4$};
\node[TextStyle] at (1.2,5.3) {$p'_4$};
\path[Arrow, very thick, -] (-1,4) -- ++(6,0);
\path[Arrow, very thick, -] (4,-1) -- ++(0,6);
\path[Arrow, very thick, -] (-1,0) -- ++(1,0);
\path[Arrow, very thick, -] (0,-1) -- ++(0,1);
\path[Arrow, very thick, -] (0,0) -- ++(4,0);
\path[Arrow, very thick, -] (4,0) -- ++(4,0);
\path[Arrow, very thick, -] (0,0) -- ++(0,4);
\path[Arrow, very thick, -] (0,4) -- ++(0,4);
% \node[TextStyle] at (-1.2,-1.5) {Top-left};
\node[TextStyle, anchor=south west, align=left, text width=4cm] at (-3,10) (RefLabel) {Reference pixels};
\node[TextStyle, anchor=south west, align=left, text width=4cm, below=.5cm of RefLabel] (PredLabel) {Predicted pixels};
% \node[TextStyle, anchor=south west, align=left, text width=4cm, right=4cm of RefLabel] (PixelDup) {Pixel duplication};
% \node[TextStyle, anchor=south west, align=left, text width=4cm, below=.5cm of PixelDup] (PredDir) {Prediction reference};
\node[TextStyle, anchor=south west, align=left, text width=4cm, right=4cm of RefLabel] (PredDir) {Prediction reference};
\node[Pixel, , minimum size=12pt, left=.1 cm of PredLabel.west] {};
\node[PixelNeighbour, minimum size=12pt, left=.1 cm of RefLabel.west] {};
% \path[Arrow, latex-, dashed] (PixelDup.west) -- ++(-1,0);
\path[Arrow, latex-] (PredDir.west) -- ++(-1,0);
% \path[PixelAnchor, Arrow, blue] (2.75,-1) -- ++( -2 , \BlockSize );
\end{tikzpicture}