Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
image_access_storage(3)		 Arcan Lua API	       image_access_storage(3)

NAME
       image_access_storage  -	Access	the underlying backing store of	a tex-
       tured video object.

SYNOPSIS
       true or false
       image_access_storage( vid, callback(table, width, height) )
       image_access_storage( vid, callback(table, width, height, cols, rows) )

DESCRIPTION
       This function permits limited, blocking,	access to a backing store. The
       primary purpose is to provide  quick  access  to	 trivial  measurements
       without	the  overhead  of setting up a calctarget and performing read-
       backs. The function returns false if the	backing	store was unavailable.

       If the second callback form provides cols and rows  the	backing	 store
       has  a  text  representation  available.	In that	case there is an addi-
       tional :read(x, y) = string, format_table function and a	:cursor() = x,
       y for querying the cursor.

       The format_table	returned by read includes colors as "fr, fg,  fb"  and
       "br,  bg,  bb"  as  well	as one or more of "bold", "italic", "inverse",
       "underline",  "underline_alt",  "protect",  "blink",   "strikethrough",
       "break",	 "border_left",	 "border_right",  "border_down", "border_top",
       "id".

NOTES
       1      methods  and  properties	in  table    are  described   in   de-
	      fine_calctarget.

       2      The  table  provided  in	the  callback is only valid during the
	      scope of the callback, creating aliases outside this  scope  and
	      trying  to  use  any table method	is a terminal state transition
	      that may be difficult to debug.

       3      Most frameserver connections do not synchronize the contents  of
	      the backing store	buffer due to the added	bandwidth cost of per-
	      forming  an extra	copy each update. This behavior	can be changed
	      by calling target_flags and enable TARGET_VSTORE_SYNCH  for  the
	      specific frameserver.

       4      The backing store	of a texture video object is not always	avail-
	      able,  particularly  when	 the engine is running in conservative
	      mode. Make sure that your	appl can handle	 scenarios  where  the
	      backing store cannot be read.

       5      :read  is	 only permitted	on a tui backed	store. Calling it on a
	      regular one is a terminal	state transition.

EXAMPLE
       function	image_access_storage0()
	     img = fill_surface(32, 32,	255, 0,	0);
	     image_access_storage(a, function(tbl, w, h)
		   print(w, h, tbl:get(1, 1));
	     end);
       end

SEE ALSO:
       define_calctarget(3)

image				  April	2025	       image_access_storage(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=image_access_storage&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help