@@ -264,17 +264,19 @@ \subsection{Render Image}
264264The image will be rendered with the top-left matching the current ANSI cursor position.
265265The cursor will not be moved by this operation.
266266
267+ \subsubsection* {Parameters }
268+
267269\begin {itemize }
268- \item Id ; unique identifier referencing a previously uploaded image
269- \item grid-width; number of grid cells to render horizontally
270- \item grid-height; number of grid cells to render vertically
271- \item resizePolicy ; optional, mandates how to resize the image within the grid cells (default NoResize)
272- \item alignmentPolicy ; optional, mandates how to align the image within the grid cells (default: MiddleCenter)
273- \item image-x-offset; optional, start rendering at the given pixel x-offset cell of the image (default 0)
274- \item image-y-offset; optional, start rendering at the given pixel y-offset cell of the image (default 0)
275- \item image-width; optional, number of pixels of the image's width to display (default: max width)
276- \item image-height; optional, number of pixels of the image's height to display (default max height)
277- \item status: optional, request a success/failure status response code from the terminal, by default
270+ \item \textbf { Id } ; unique identifier referencing a previously uploaded image
271+ \item \textbf { grid-width } ; number of grid cells to render horizontally
272+ \item \textbf { grid-height } ; number of grid cells to render vertically
273+ \item \textbf { resize-policy } ; optional, mandates how to resize the image within the grid cells (default NoResize)
274+ \item \textbf { alignment-policy } ; optional, mandates how to align the image within the grid cells (default: MiddleCenter)
275+ \item \textbf { image-x-offset } ; optional, start rendering at the given pixel x-offset cell of the image (default 0)
276+ \item \textbf { image-y-offset } ; optional, start rendering at the given pixel y-offset cell of the image (default 0)
277+ \item \textbf { image-width } ; optional, number of pixels of the image's width to display (default: max width)
278+ \item \textbf { image-height } ; optional, number of pixels of the image's height to display (default max height)
279+ \item \textbf { status } : optional, request a success/failure status response code from the terminal, by default
278280 no status result will be sent back to the client application.
279281 The response status code can be one of the following:
280282 \begin {itemize }
@@ -283,6 +285,59 @@ \subsection{Render Image}
283285 \end {itemize }
284286\end {itemize }
285287
288+ \paragraph* {}
289+ If parameter \textbf {grid-width } and \textbf {grid-height } are both omitted (or set to 0), then the
290+ number of grid cells will be automatically determined.
291+
292+ \paragraph* {}
293+ If one of the parameters \textbf {grid-width } and \textbf {grid-height } is present and the other is
294+ missing, the missing one will be automatically determined by preserving the aspect ratio.
295+
296+ \paragraph* {}
297+ Rendered images that produce a padding due to alignment- and resize-policy will fill the gap with the
298+ currently active SGR background color.
299+
300+ \paragraph* {}
301+ Reverse video mode mode (\code {DECSCNM}) will affect the padding color but not the image.
302+
303+ \subsubsection* {Resize Policy }
304+
305+ \begin {tabular }{ |l|l| }
306+ \hline
307+ \textbf {Name } & \textbf {Description } \\
308+ \hline
309+ NoResize & Does not perform any resize, leading to a padding on one or two sides \\
310+ & as mandated by the alignment-policy. \\
311+ ResizeToFit & Resizes the image to fit the specified grid width and height, \\
312+ & leading to a padding on zero or one sides as mandated by the alignment-policy. \\
313+ ResizeToFill & Resizes the image to fill the specified grid width and height, \\
314+ & preserving the aspect ratio, leading to potential clipping depending on the \\
315+ & alignment-policy. \\
316+ StretchToFill & Resizes the image to fill the specified grid width and height, \\
317+ & ignoring the aspect ratio, ignoring alignment-policy. \\
318+ \hline
319+ \end {tabular }
320+
321+ \subsubsection* {Resize Policy }
322+
323+ \begin {tabular }{ |l|l| }
324+ \hline
325+ \textbf {Name } & \textbf {Description } \\
326+ \hline
327+ TopCenter & The image is aligned vertically on the top and horizontally in the center of the grid. \\
328+ TopStart & The image is aligned vertically on the top and horizontally on the left. \\
329+ TopEnd & The image is aligned vertically on the top and horizontally on the right. \\
330+ \hline
331+ MiddleCenter & The image is aligned vertically and horizontally in the center of the grid. \\
332+ MiddleStart & The image is aligned vertically centered and horizontally on the left. \\
333+ MiddleEnd & The image is aligned vertically centered and horizontally on the right. \\
334+ \hline
335+ BottomCenter & The image is aligned vertically on the bottom and horizontally in the center of the grid. \\
336+ BottomStart & The image is aligned vertically on the bottom and horizontally on the left. \\
337+ BottomEnd & The image is aligned vertically on the bottom and horizontally on the right. \\
338+ \hline
339+ \end {tabular }
340+
286341\subsection {Upload and Render Image }
287342
288343This uploads and renders the image via a single VT sequence. Therefore no image Id
@@ -309,7 +364,9 @@ \subsection{Upload and Render Image}
309364
310365\subsection {Release Image }
311366
312- Dereferences the use-count of a previously uploaded image.
367+ Removes the mapping from unique Id to the image in a storage pool.
368+
369+ This will cause decrementing the use-count of the previously uploaded image.
313370
314371\begin {itemize }
315372 \item Id; Unique identifier referencing a previously uploaded image.
@@ -366,8 +423,8 @@ \subsubsection*{Named Parameters}
366423 \hline
367424 \textbf {parameter } & \textbf {Value } \\
368425 \hline
369- id & image Id \\
370- payload & Base64 encoded image data \\
426+ id & image Id as string \\
427+ p & Base64 encoded image data \\
371428 \hline
372429\end {tabular }
373430
@@ -381,7 +438,7 @@ \subsubsection*{Example}
381438 local ImageId=$(echo -ne "org.binutils.ls.$1" | base64 -)
382439 local ImageData=$(base64 "$2")
383440 local ImageFormat=3 # 3=PNG
384- echo -ne "\033P1:${ImageFormat};2:640;3:480u;id =${ImageId};p=${ImageData}\033\\"
441+ echo -ne "\033P1:${ImageFormat}uid =${ImageId};p=${ImageData}\033\\"
385442 }
386443\end {verbatim }
387444
@@ -415,7 +472,7 @@ \subsubsection*{Named parameters}
415472 \hline
416473 \textbf {parameter } & \textbf {Value } \\
417474 \hline
418- Id & String \\
475+ id & image Id as string \\
419476 \hline
420477\end {tabular }
421478
0 commit comments