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

FreeBSD Manual Pages

  
 
  

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

NAME
       raw_surface - Create a new surface using	a table	as input.

SYNOPSIS
       vid
       raw_surface( width, height, bytes_per_pixel, input_table, out_file )

DESCRIPTION
       This  function  creates	a new 'raw' surface using user-supplied	values
       for pixel data. The internal representation is set to a	compile-  time
       system default (typically RGBA 888). If the optional out_file  argument
       is  set,	 a PNG	image will also	be stored in the APPL_TEMP  namespace.
       Using an	out_file  is primarily intended	as a debugging/developer  fea-
       ture and	the actual encode/store	operation is synchronous.

NOTES
       1      There might be a loss of precision imposed by the	texture	format
	      native to	the system that	is running.

       2

	      width  and height	 should	be within the compile-time constraints
	      of

	      MAX_SURFACEW  and	MAX_SURFACEH , exceeding those dimensions is a
	      terminal state transition.

       3      Only acceptable bytes_per_pixel  values are 1, 3 and 4. All oth-
	      ers are terminal state transitions.

       4      All  input_table	values will be treated as 8-bit	unsigned inte-
	      gers.

       5

	      input_table    is	 expected  to  have   exactly	width	height
	      bytes_per_pixel  values, starting	at index 1. Any	deviation is a
	      terminal state transition.

EXAMPLE
       function	raw_surface0()
	     local rtbl	= {};
	     local ofs = 1;
	     for row=1,64 do
		   for col=1,64	do
			 rtbl[ofs+0] = math.random(255);
			 rtbl[ofs+1] = math.random(255);
			 rtbl[ofs+2] = math.random(255);
			 ofs = ofs + 3;
		   end
	     end
	     local vid = raw_surface(64, 64, 3,	rtbl);
	     show_image(vid);
       end

image				  April	2025			raw_surface(3)

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

home | help