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 feature and the
     actual encode/store operation is synchronous.

NOTES
     1	    There might be a loss of precision imposed by the texture format na-
	    tive 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 others
	    are terminal state transitions.

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

     5

	    input_table     is	 expected   to	 have	exactly   width   height
	    bytes_per_pixel values, starting at index 1. Any deviation is a ter-
	    minal 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				   August 2026			  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+15.1.quarterly>

home | help