The stick2xyz Documentation 1.14.1
pane2dgray.c File Reference
#include "pane2dgraypriv.h"
#include "pane2dgray.h"
#include "pane2dgray16.h"
#include "pane2drgb.h"
#include "pane2drgb16.h"
Include dependency graph for pane2dgray.c:

Go to the source code of this file.

Functions

stick2xyz_pctchar mod_pane2d_name (void)
 
stick2xyz_pctchar mod_pane2d_desc (void)
 
void mod_pane2d_version (int *dest)
 
int mod_pane2d_type (void)
 
void mod_pane2d_set_tty (void *fildescout, void *fildescerr)
 
int mod_pane2d_can_multithread (void)
 
int mod_pane2d_is_multithreaded (pane2d_handle pane)
 
int mod_pane2d_get_bpp (void)
 
void mod_pane2d_getref (pane2d_handle pane, int *refcount, int *refwaiting)
 
int mod_pane2d_addref (pane2d_handle pane)
 
int mod_pane2d_releaseref (pane2d_handle pane, int asyncrelease, int shutdown)
 
int mod_pane2d_isowner (pane2d_handle pane)
 
int mod_pane2d_candraw (pane2d_handle pane)
 
DWORD mod_pane2d_getownerinfo_windows (pane2d_handle pane, LPHANDLE destvar)
 
BOOL mod_pane2d_getdrawaclinfo_windows (pane2d_handle pane, struct pane2d_drawacl *dest)
 
BOOL mod_pane2d_freedrawaclinfo_windows (pane2d_handle pane, struct pane2d_drawacl *src)
 
int mod_pane2d_waituntilowner (pane2d_handle pane, int addref)
 
int mod_pane2d_termwaituntilowner (pane2d_handle pane)
 
int mod_pane2d_changeaccesscontrol (pane2d_handle pane, void *hthread, int hthreadsize, uint32_t flags)
 
int mod_pane2d_changeowningthread (pane2d_handle pane, void *newthread, int addref)
 
void * mod_pane2d_eventreleased (pane2d_handle pane)
 
pane2d_handle mod_pane2d_alloc (int x, int y)
 
pane2d_handle mod_pane2d_alloc_multithread (int x, int y, size_t maxthreads, uint32_t typesallowed)
 
void mod_pane2d_clear (pane2d_handle pane)
 
void mod_pane2d_free (pane2d_handle pane)
 
uint32_t mod_pane2d_vertex_getopts (pane2d_handle pane)
 
void mod_pane2d_vertex_setopts (pane2d_handle pane, uint32_t newopts)
 
int mod_pane2d_vertex_get (pane2d_handle pane, int elm, struct pane2d_vertex_elm *dest)
 
int mod_pane2d_vertex_get_v2 (pane2d_handle pane, int elm, struct pane2d_vertex_elm_v2 *dest)
 
uint64_t mod_pane2d_texture_add_gray (pane2d_handle pane, uint8_t gray, uint8_t alpha, pane2d_texture_handle *dest)
 
uint64_t mod_pane2d_texture_add_gray16 (pane2d_handle pane, uint16_t gray, uint16_t alpha, pane2d_texture_handle *dest)
 
uint64_t mod_pane2d_texture_add_rgb (pane2d_handle pane, uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha, pane2d_texture_handle *dest)
 
uint64_t mod_pane2d_texture_add_rgb16 (pane2d_handle pane, uint16_t red, uint16_t green, uint16_t blue, uint16_t alpha, pane2d_texture_handle *dest)
 
int mod_pane2d_texture_enum (pane2d_handle pane, pane2d_texture_handle *dest, uint64_t number)
 
void mod_pane2d_texture_clear (pane2d_handle pane)
 
uint32_t mod_pane2d_colortype (void)
 
uint8_t ** mod_pane2d_dupdata (pane2d_handle pane, int padding)
 
uint8_t ** mod_pane2d_dupimage (pane2d_handle pane, int padding)
 
void mod_pane2d_freeimage (pane2d_handle pane, uint8_t **image)
 
uint16_t ** mod_pane2d_dupimage16 (pane2d_handle pane, int padding)
 
void mod_pane2d_freeimage16 (pane2d_handle pane, uint16_t **image)
 
uint8_t * mod_pane2d_dupdatap (pane2d_handle pane, int padding)
 
void mod_pane2d_freedatap (pane2d_handle pane, uint8_t *image)
 
uint16_t * mod_pane2d_dupdata16p (pane2d_handle pane, int padding)
 
void mod_pane2d_freedata16p (pane2d_handle pane, uint16_t *image)
 
void mod_pane2d_dupxy (pane2d_handle pane, int *x, int *y)
 
int mod_pane2d_dupfunc_getlist (uint32_t typerequested, struct pane2d_dupgen_funcs *dest)
 
void mod_pane2d_drawpixel (pane2d_handle pane, int x, int y)
 
void mod_pane2d_drawline (pane2d_handle pane, int d, int x1, int y1, int x2, int y2)
 
void mod_pane2d_drawcircle (pane2d_handle pane, int d, int x, int y, int r)
 
void mod_pane2d_fillcircle (pane2d_handle pane, pane2d_texture_handle src, int x, int y, int r)
 
void mod_pane2d_drawellipse (pane2d_handle pane, int d, int x, int y, int rx, int ry)
 
void mod_pane2d_fillellipse (pane2d_handle pane, pane2d_texture_handle src, int x, int y, int rx, int ry)
 
void mod_pane2d_drawrect (pane2d_handle pane, int d, int x1, int y1, int x2, int y2)
 
void mod_pane2d_fillrect (pane2d_handle pane, pane2d_texture_handle src, int x1, int y1, int x2, int y2)
 
void mod_pane2d_drawsquare (pane2d_handle pane, int d, int l, int x1, int y1)
 
void mod_pane2d_fillsquare (pane2d_handle pane, pane2d_texture_handle src, int l, int x1, int y1)
 
void mod_pane2d_drawtriangle (pane2d_handle pane, int d, int x1, int y1, int x2, int y2, int x3, int y3)
 
void mod_pane2d_filltriangle (pane2d_handle pane, pane2d_texture_handle src, int x1, int y1, int x2, int y2, int x3, int y3)
 
void mod_pane2d_drawrighttriangle (pane2d_handle pane, int d, int x1, int y1, int x2, int y2, int b)
 
void mod_pane2d_fillrighttriangle (pane2d_handle pane, pane2d_texture_handle src, int x1, int y1, int x2, int y2, int b)
 
void mod_pane2d_drawtworighttriangles (pane2d_handle pane, int d, int x1, int y1, int x2, int y2)
 
void mod_pane2d_print_segment (pane2d_handle pane, int use_rgb)
 
void mod_pane2d_lang (stick2xyz_print_ptr newval)
 
int mod_pane2d_init (int multithread)
 
int mod_pane2d_release (void)
 
int mod_pane2d_sigterm (pane2d_sigterm_ready func, int modnumber)
 

Function Documentation

◆ mod_pane2d_addref()

int mod_pane2d_addref ( pane2d_handle  pane)

This function adds a reference to an allocated Pane 2-D handle.

Parameters
[in]paneThe handle to operate on.
Return values
>0The new number of references to the handle.
-1If an error occured. errno will be set to: EINVAL if pane is NULL. EDEADLK if the function would have deadlocked the thread.

Definition at line 296 of file pane2dgray.c.

References pane2dgray16_addref(), pane2dgray_addref(), pane2drgb16_addref(), and pane2drgb_addref().

Here is the call graph for this function:

◆ mod_pane2d_alloc()

pane2d_handle mod_pane2d_alloc ( int  x,
int  y 
)

Allocates a new Pane 2-D handle. This function does not allocate a handle with multithread support.

Note
The '0' coordinate is counted as such, so a maximum coordinate of '10' is actually considered '11' to conform to the pixel system.
Parameters
[in]xThe maximum x coordinate allowed.
[in]yThe maximum y coordinate allowed.
Return values
pane2d_handleThe newly allocated handle.
NULLIf the function fails, usually due to lack of memory.

Definition at line 785 of file pane2dgray.c.

References pane2dgray16_alloc(), pane2dgray_alloc(), pane2drgb16_alloc(), and pane2drgb_alloc().

Here is the call graph for this function:

◆ mod_pane2d_alloc_multithread()

pane2d_handle mod_pane2d_alloc_multithread ( int  x,
int  y,
size_t  maxthreads,
uint32_t  typesallowed 
)

Allocates a new Pane 2-D handle with multithread support for the dupimage and dupdata functions.

Note
The '0' coordinate is counted as such, so a maximum coordinate of '10' is actually considered '11' to conform to the pixel system.
Parameters
[in]xThe maximum x coordinate allowed.
[in]yThe maximum y coordinate allowed.
[in]maxthreadsThe maximum number of threads anticipated to use the handle.
[in]typesallowedSets types allowed to allocate using STICK2XYZ_PANE2D_ALLOC_*. If unsure, this can be set to STICK2XYZ_PANE2D_ALLOC_ALL. Setting specific types besides ALL is intended to help save on memory.
Return values
pane2d_handleThe newly allocated handle.
NULLIf the function fails, usually due to lack of memory or the module was not compiled with multithread support.

Definition at line 819 of file pane2dgray.c.

References pane2dgray16_alloc_multithread(), pane2dgray_alloc_multithread(), pane2drgb16_alloc_multithread(), and pane2drgb_alloc_multithread().

Here is the call graph for this function:

◆ mod_pane2d_can_multithread()

int mod_pane2d_can_multithread ( void  )

This function tells the caller whether or not the module was compiled with multithread support.

Return values
1If the module was compiled with multithread support.
0If the module was not compiled with multithread support.

Definition at line 209 of file pane2dgray.c.

References pane2dgray16_can_multithread(), pane2dgray_can_multithread(), pane2drgb16_can_multithread(), and pane2drgb_can_multithread().

Here is the call graph for this function:

◆ mod_pane2d_candraw()

int mod_pane2d_candraw ( pane2d_handle  pane)

This function returns a boolean value indicating whether the calling thread can or can not draw on the Pane 2-D handle.

Parameters
[in]paneThe handle to operate on.
Return values
1If the calling thread can draw on the handle.
0If the calling thread can not draw on the handle, or the parameter was NULL.

Definition at line 384 of file pane2dgray.c.

References pane2dgray16_candraw(), pane2dgray_candraw(), pane2drgb16_candraw(), and pane2drgb_candraw().

Here is the call graph for this function:

◆ mod_pane2d_changeaccesscontrol()

int mod_pane2d_changeaccesscontrol ( pane2d_handle  pane,
void *  hthread,
int  hthreadsize,
uint32_t  flags 
)

This function is a multipurpose access control changing function.

Note
On Windows, you will need to use DuplicateHandle from the Windows API and pass the duplicate handle into hthread. The changeaccesscontrol function will take over the handle and close the thread handle when the Pane 2-D handle is freed. If the changeaccesscontrol function fails, the thread handle is not closed. The handles must have at least THREAD_QUERY_LIMITED_INFORMATION and SYNCHRONIZE access rights. No other access rights are required to be set on the handle.
Parameters
[in]paneThe handle to operate on.
[in]hthreadOn Windows, this will be an array to HANDLE objects. On other platforms, this will be an array to thrd_t variables. When threads.h is not available, this is a void * because in the situation outside of Windows, no supported multithreading mechanism is available.
[in]hthreadsizeThe number of elements that is in hthread.
[in]flagsBitwise OR'ed flags to indicate what to do.

STICK2XYZ_PANE2D_ACCESSCTRL_ADDREF Adds a reference count to the Pane 2-D handle.

STICK2XYZ_PANE2D_ACCESSCTRL_CHANGEOWNER Changes the owner of the Pane 2-D handle.

STICK2XYZ_PANE2D_ACCESSCTRL_NONBLOCK Makes the function run asyncronously.

STICK2XYZ_PANE2D_ACCESSCTRL_ACLDRAWSET Changes the access rights to the Pane 2-D handle regarding the ability to draw. Setting hthreadsize to -1 will give all threads write access, and setting hthreadsize to 0 will deny all threads write access.

Return values
1On success.
0If an error occured. errno will be set to: EINVAL if pane is NULL. EDEADLK if the function would have deadlocked the thread. ENOSYS if the module was compiled without multithreading support. EACCES if the calling thread does not own the handle.

Definition at line 587 of file pane2dgray.c.

References pane2dgray16_changeaccesscontrol(), pane2dgray_changeaccesscontrol(), pane2drgb16_changeaccesscontrol(), and pane2drgb_changeaccesscontrol().

Here is the call graph for this function:

◆ mod_pane2d_changeowningthread()

int mod_pane2d_changeowningthread ( pane2d_handle  pane,
void *  newthread,
int  addref 
)

This function allows the owning thread to pass ownership of a given handle to another thread.

Note
On Windows, you will need to use DuplicateHandle from the Windows API and pass the duplicate handle into newthread. The changeowningthread function will take over the handle and close the thread handle when the Pane 2-D handle is freed. If the changeowningthread function fails, the thread handle is not closed. The handle must have at least THREAD_QUERY_LIMITED_INFORMATION and SYNCHRONIZE access rights. No other access rights are required to be set on the handle.
Parameters
[in]paneThe handle to operate on.
[in]newthreadOn Windows, this will be a HANDLE object. On other platforms, this will be a thrd_t. When threads.h is not available, this is a void * because in the situation outside of Windows, no supported multithreading mechanism is available.
[in]addrefIf TRUE, increments the reference count by 1. This can save you from having to call an addref function seperately. A reference is not added if the function fails.
Return values
1On success.
0If an error occured. errno will be set to: EINVAL if pane is NULL. EDEADLK if the function would have deadlocked the thread. ENOSYS if the module was compiled without multithreading support. EACCES if the calling thread does not own the handle.

Definition at line 642 of file pane2dgray.c.

References pane2dgray16_changeowningthread(), pane2dgray_changeowningthread(), pane2drgb16_changeowningthread(), and pane2drgb_changeowningthread().

Here is the call graph for this function:

◆ mod_pane2d_clear()

void mod_pane2d_clear ( pane2d_handle  pane)

Clears the image data in a Pane 2-D handle to pure white.

Parameters
[in]paneThe Pane 2-D handle to clear the image data on.

Definition at line 839 of file pane2dgray.c.

References pane2dgray16_clear(), pane2dgray_clear(), pane2drgb16_clear(), and pane2drgb_clear().

Here is the call graph for this function:

◆ mod_pane2d_colortype()

uint32_t mod_pane2d_colortype ( void  )

Obtains the bitwise integer of what type of color is used in the Pane 2-D module. This is used to determine whether the module stores color or grayscale information.

Return values
STICK2XYZ_PANE2D_COLORTYPE_GRAYIf the image created by the module is in grayscale format.
STICK2XYZ_PANE2D_COLORTYPE_RGBIf the image created by the module is in RGB format.
STICK2XYZ_PANE2D_COLORTYPE_ALPHAIf the image created by the module has alpha information. This type is bitwise or'ed, so it is not the only type returned.
STICK2XYZ_PANE2D_COLORTYPE_16BITIf the image created by the module is internally stored in 16 bits per channel. This type is bitwise or'ed, so it is not the only type returned.
Note
You can use this function to select a Pane 2-D module that meets your needs regarding color. Pane 2-D modules using grayscale color types are much faster since they do not have to manipulate and store image data in color (except when converting RGB to grayscale).

Definition at line 1227 of file pane2dgray.c.

References pane2dgray16_colortype(), pane2dgray_colortype(), pane2drgb16_colortype(), and pane2drgb_colortype().

Here is the call graph for this function:

◆ mod_pane2d_desc()

stick2xyz_pctchar mod_pane2d_desc ( void  )

Returns the the internally stored module short description.

Return values
stick2xyz_pctcharThe constant module short description.

Definition at line 126 of file pane2dgray.c.

References pane2dgray16_desc(), pane2dgray_desc(), pane2drgb16_desc(), and pane2drgb_desc().

Here is the call graph for this function:

◆ mod_pane2d_drawcircle()

void mod_pane2d_drawcircle ( pane2d_handle  pane,
int  d,
int  x,
int  y,
int  r 
)

Draws a circle with a center at x1,y1, r pixels long.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]dThe density of the line.
[in]xThe x coordinate of the center.
[in]yThe y coordinate of the center.
[in]rThe radius (how far maximum to travel from the center point)

Definition at line 1537 of file pane2dgray.c.

References pane2dgray16_drawcircle(), pane2dgray_drawcircle(), pane2drgb16_drawcircle(), and pane2drgb_drawcircle().

Here is the call graph for this function:

◆ mod_pane2d_drawellipse()

void mod_pane2d_drawellipse ( pane2d_handle  pane,
int  d,
int  x,
int  y,
int  rx,
int  ry 
)

Draws an ellipse starting at x1,y1, rx and ry pixels long.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]dThe density of the line.
[in]xThe x coordinate of the center.
[in]yThe y coordinate of the center.
[in]rxThe radius (how far x max. to travel from the center point)
[in]ryThe radius (how far y max. to travel from the center point)

Definition at line 1598 of file pane2dgray.c.

References pane2dgray16_drawellipse(), pane2dgray_drawellipse(), pane2drgb16_drawellipse(), and pane2drgb_drawellipse().

Here is the call graph for this function:

◆ mod_pane2d_drawline()

void mod_pane2d_drawline ( pane2d_handle  pane,
int  d,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draws a line starting at x1,y1 and ending at x2,y2.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]dThe density of the line.
[in]x1The starting x1 coordinate.
[in]y1The starting y1 coordinate.
[in]x2The ending x2 coordinate.
[in]y2The ending y2 coordinate.

Definition at line 1507 of file pane2dgray.c.

References pane2dgray16_drawline(), pane2dgray_drawline(), pane2drgb16_drawline(), and pane2drgb_drawline().

Here is the call graph for this function:

◆ mod_pane2d_drawpixel()

void mod_pane2d_drawpixel ( pane2d_handle  pane,
int  x,
int  y 
)

Draws a pixel at x,y.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]xThe x coordinate.
[in]yThe y coordinate.

Definition at line 1482 of file pane2dgray.c.

References pane2dgray16_drawpixel(), pane2dgray_drawpixel(), pane2drgb16_drawpixel(), and pane2drgb_drawpixel().

Here is the call graph for this function:

◆ mod_pane2d_drawrect()

void mod_pane2d_drawrect ( pane2d_handle  pane,
int  d,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draws a rectangle starting at x1,y1 and ending at x2,y2.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]dThe density of the line.
[in]x1The starting x1 coordinate.
[in]y1The starting y1 coordinate.
[in]x2The ending x2 coordinate.
[in]y2The ending y2 coordinate.

Definition at line 1663 of file pane2dgray.c.

References pane2dgray16_drawrect(), pane2dgray_drawrect(), pane2drgb16_drawrect(), and pane2drgb_drawrect().

Here is the call graph for this function:

◆ mod_pane2d_drawrighttriangle()

void mod_pane2d_drawrighttriangle ( pane2d_handle  pane,
int  d,
int  x1,
int  y1,
int  x2,
int  y2,
int  b 
)

Draws a triangle with a 90 degree angle on a side.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]dThe density of the line.
[in]x1The x1 coordinate.
[in]y1The y1 coordinate.
[in]x2The x2 coordinate.
[in]y2The y2 coordinate.
[in]b1 if the 90 degree is to be on the top, 0 otherwise.

Definition at line 1874 of file pane2dgray.c.

References pane2dgray16_drawrighttriangle(), pane2dgray_drawrighttriangle(), pane2drgb16_drawrighttriangle(), and pane2drgb_drawrighttriangle().

Here is the call graph for this function:

◆ mod_pane2d_drawsquare()

void mod_pane2d_drawsquare ( pane2d_handle  pane,
int  d,
int  l,
int  x1,
int  y1 
)

Draws a square starting at x1,y1 and ending at a x2,y2 as determined by l.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]dThe density of the line.
[in]lThe length of each side.
[in]x1The starting x1 coordinate.
[in]y1The starting y1 coordinate.

Definition at line 1726 of file pane2dgray.c.

References pane2dgray16_drawsquare(), pane2dgray_drawsquare(), pane2drgb16_drawsquare(), and pane2drgb_drawsquare().

Here is the call graph for this function:

◆ mod_pane2d_drawtriangle()

void mod_pane2d_drawtriangle ( pane2d_handle  pane,
int  d,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
)

Draws a triangle with lines starting at x1,y1, moving on to x2,y2, and ending at a x3,y3.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]dThe density of the line.
[in]x1The x1 coordinate.
[in]y1The y1 coordinate.
[in]x2The x2 coordinate.
[in]y2The y2 coordinate.
[in]x3The x3 coordinate.
[in]y3The y3 coordinate.

Definition at line 1792 of file pane2dgray.c.

References pane2dgray16_drawtriangle(), pane2dgray_drawtriangle(), pane2drgb16_drawtriangle(), and pane2drgb_drawtriangle().

Here is the call graph for this function:

◆ mod_pane2d_drawtworighttriangles()

void mod_pane2d_drawtworighttriangles ( pane2d_handle  pane,
int  d,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draws a triangle with a 90 degree angle on a side.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]dThe density of the line.
[in]x1The x1 coordinate.
[in]y1The y1 coordinate.
[in]x2The x2 coordinate.
[in]y2The y2 coordinate.

Definition at line 1944 of file pane2dgray.c.

References pane2dgray16_drawtworighttriangles(), pane2dgray_drawtworighttriangles(), pane2drgb16_drawtworighttriangles(), and pane2drgb_drawtworighttriangles().

Here is the call graph for this function:

◆ mod_pane2d_dupdata()

uint8_t ** mod_pane2d_dupdata ( pane2d_handle  pane,
int  padding 
)

Duplicates image data stored in a Pane 2-D handle.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]paddingThe extra amount of bytes to pad onto the result.
Return values
uint8_t**The duplicated image data.
NULLIf out of memory or STICK2XYZ_PANE2D_VERTEX_NODRAW is set.
Deprecated:
You will need to use free() to deallocate the returned pointer. For this reason, the function can be programmed to always return NULL. Use mod_pane2d_dupimage instead.

Definition at line 1253 of file pane2dgray.c.

References pane2dgray16_dupdata(), pane2dgray_dupdata(), pane2drgb16_dupdata(), and pane2drgb_dupdata().

Here is the call graph for this function:

◆ mod_pane2d_dupdata16p()

uint16_t * mod_pane2d_dupdata16p ( pane2d_handle  pane,
int  padding 
)

Duplicates image data stored in a Pane 2-D handle in 16 bits.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]paddingThe extra amount of bytes to pad onto the result.
Return values
uint8_t**The duplicated image data.
NULLIf out of memory or STICK2XYZ_PANE2D_VERTEX_NODRAW is set.
Note
You will need to use mod_pane2d_freedata16p to deallocate the returned pointer.

Definition at line 1400 of file pane2dgray.c.

References pane2dgray16_dupdata16p(), pane2dgray_dupdata16p(), pane2drgb16_dupdata16p(), and pane2drgb_dupdata16p().

Here is the call graph for this function:

◆ mod_pane2d_dupdatap()

uint8_t * mod_pane2d_dupdatap ( pane2d_handle  pane,
int  padding 
)

Duplicates image data stored in a Pane 2-D handle in 8 bits.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]paddingThe extra amount of bytes to pad onto the result.
Return values
uint8_t**The duplicated image data.
NULLIf out of memory or STICK2XYZ_PANE2D_VERTEX_NODRAW is set.
Note
You will need to use mod_pane2d_freedatap to deallocate the returned pointer.

Definition at line 1359 of file pane2dgray.c.

References pane2dgray16_dupdatap(), pane2dgray_dupdatap(), pane2drgb16_dupdatap(), and pane2drgb_dupdatap().

Here is the call graph for this function:

◆ mod_pane2d_dupfunc_getlist()

int mod_pane2d_dupfunc_getlist ( uint32_t  typerequested,
struct pane2d_dupgen_funcs dest 
)

Fills in a structure with pointers to functions that are for allocating and freeing image data from a Pane 2-D handle. This function is typically called by an Output 2-D module.

Parameters
[in]typerequestedMust be STICK2XYZ_PANE2D_REQUEST_UINT8PP, STICK2XYZ_PANE2D_REQUEST_UINT8P, STICK2XYZ_PANE2D_REQUEST_UINT16PP, or STICK2XYZ_PANE2D_REQUEST_UINT16P
[out]destThe structure to fill in.

Definition at line 1459 of file pane2dgray.c.

References pane2dgray16_dupfunc_getlist(), pane2dgray_dupfunc_getlist(), pane2drgb16_dupfunc_getlist(), and pane2drgb_dupfunc_getlist().

Here is the call graph for this function:

◆ mod_pane2d_dupimage()

uint8_t ** mod_pane2d_dupimage ( pane2d_handle  pane,
int  padding 
)

Duplicates image data stored in a Pane 2-D handle in 8 bits.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]paddingThe extra amount of bytes to pad onto the result.
Return values
uint8_t**The duplicated image data.
NULLIf out of memory or STICK2XYZ_PANE2D_VERTEX_NODRAW is set.
Note
You will need to use mod_pane2d_freeimage to deallocate the returned pointer.

Definition at line 1277 of file pane2dgray.c.

References pane2dgray16_dupimage(), pane2dgray_dupimage(), pane2drgb16_dupimage(), and pane2drgb_dupimage().

Here is the call graph for this function:

◆ mod_pane2d_dupimage16()

uint16_t ** mod_pane2d_dupimage16 ( pane2d_handle  pane,
int  padding 
)

Duplicates image data stored in a Pane 2-D handle in 16 bits.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]paddingThe extra amount of bytes to pad onto the result.
Return values
uint8_t**The duplicated image data.
NULLIf out of memory or STICK2XYZ_PANE2D_VERTEX_NODRAW is set.
Note
You will need to use mod_pane2d_freeimage16 to deallocate the returned pointer.

Definition at line 1318 of file pane2dgray.c.

References pane2dgray16_dupimage16(), pane2dgray_dupimage16(), pane2drgb16_dupimage16(), and pane2drgb_dupimage16().

Here is the call graph for this function:

◆ mod_pane2d_dupxy()

void mod_pane2d_dupxy ( pane2d_handle  pane,
int *  x,
int *  y 
)

Duplicates the maximum x and y coordinates stored in a Pane 2-D handle.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[out]xThe receiver of the maximum x coordinate.
[out]yThe receiver of the maximum y coordinate.

Definition at line 1436 of file pane2dgray.c.

References pane2dgray16_dupxy(), pane2dgray_dupxy(), pane2drgb16_dupxy(), and pane2drgb_dupxy().

Here is the call graph for this function:

◆ mod_pane2d_eventreleased()

void * mod_pane2d_eventreleased ( pane2d_handle  pane)

This function returns a duplicate handle or descriptor to the event object that is signaled when the Pane 2-D handle is being deallocated.

Note
Event objects are a Windows and Linux specific feature, so this function is available only on Windows and Linux. Also, the duplicate handle on Windows will only have the SYNCHRONIZE access right. You will need to call CloseHandle() on the returned handle (Windows) and close() on the returned descriptor (Linux) when you are done with it.
Parameters
[in]paneThe handle to query.
Return values
HANDLEThe duplicate handle to the event object.
intThe duplicate descriptor to the event object. The return value of the function is an int on Linux builds.
NULLIf DuplicateHandle() failed.
-1If dup() failed.

Definition at line 680 of file pane2dgray.c.

References pane2dgray16_eventreleased(), pane2dgray_eventreleased(), pane2drgb16_eventreleased(), and pane2drgb_eventreleased().

Here is the call graph for this function:

◆ mod_pane2d_fillcircle()

void mod_pane2d_fillcircle ( pane2d_handle  pane,
pane2d_texture_handle  src,
int  x,
int  y,
int  r 
)

Draws a circle with a center at x1,y1, r pixels long.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]srcThe source picture to copy from. If NULL, the black character will be used.
[in]xThe x coordinate of the center.
[in]yThe y coordinate of the center.
[in]rThe radius (how far maximum to travel from the center point)

Definition at line 1567 of file pane2dgray.c.

References pane2dgray16_fillcircle(), pane2dgray_fillcircle(), pane2drgb16_fillcircle(), and pane2drgb_fillcircle().

Here is the call graph for this function:

◆ mod_pane2d_fillellipse()

void mod_pane2d_fillellipse ( pane2d_handle  pane,
pane2d_texture_handle  src,
int  x,
int  y,
int  rx,
int  ry 
)

Draws an ellipse starting at x1,y1, rx and ry pixels long.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]srcThe source picture to copy from. If NULL, the black character will be used.
[in]xThe x coordinate of the center.
[in]yThe y coordinate of the center.
[in]rxThe radius (how far x max. to travel from the center point)
[in]ryThe radius (how far y max. to travel from the center point)

Definition at line 1631 of file pane2dgray.c.

References pane2dgray16_fillellipse(), pane2dgray_fillellipse(), pane2drgb16_fillellipse(), and pane2drgb_fillellipse().

Here is the call graph for this function:

◆ mod_pane2d_fillrect()

void mod_pane2d_fillrect ( pane2d_handle  pane,
pane2d_texture_handle  src,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draws a filled rectangle starting at x1,y1 and ending at x2,y2.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]srcThe source picture to copy from. If NULL, the black character will be used.
[in]x1The starting x1 coordinate.
[in]y1The starting y1 coordinate.
[in]x2The ending x2 coordinate.
[in]y2The ending y2 coordinate.

Definition at line 1696 of file pane2dgray.c.

References pane2dgray16_fillrect(), pane2dgray_fillrect(), pane2drgb16_fillrect(), and pane2drgb_fillrect().

Here is the call graph for this function:

◆ mod_pane2d_fillrighttriangle()

void mod_pane2d_fillrighttriangle ( pane2d_handle  pane,
pane2d_texture_handle  src,
int  x1,
int  y1,
int  x2,
int  y2,
int  b 
)

Draws a triangle with a 90 degree angle on a side. Then the function fills in the triangle with the designated picture.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]srcThe source picture to copy from. If NULL, the black character will be used.
[in]x1The x1 coordinate.
[in]y1The y1 coordinate.
[in]x2The x2 coordinate.
[in]y2The y2 coordinate.
[in]b1 if the 90 degree is to be on the top, 0 otherwise.

Definition at line 1911 of file pane2dgray.c.

References pane2dgray16_fillrighttriangle(), pane2dgray_fillrighttriangle(), pane2drgb16_fillrighttriangle(), and pane2drgb_fillrighttriangle().

Here is the call graph for this function:

◆ mod_pane2d_fillsquare()

void mod_pane2d_fillsquare ( pane2d_handle  pane,
pane2d_texture_handle  src,
int  l,
int  x1,
int  y1 
)

Draws a square starting at x1,y1 and ending at a x2,y2 as determined by l.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]srcThe source picture to copy from. If NULL, the black character will be used.
[in]lThe length of each side.
[in]x1The starting x1 coordinate.
[in]y1The starting y1 coordinate.

Definition at line 1756 of file pane2dgray.c.

References pane2dgray16_fillsquare(), pane2dgray_fillsquare(), pane2drgb16_fillsquare(), and pane2drgb_fillsquare().

Here is the call graph for this function:

◆ mod_pane2d_filltriangle()

void mod_pane2d_filltriangle ( pane2d_handle  pane,
pane2d_texture_handle  src,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
)

Draws a triangle with lines starting at x1,y1, moving on to x2,y2, and ending at a x3,y3. Then the function fills in the triangle with the designated picture.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]srcThe source picture to copy from. If NULL, the black character will be used.
[in]x1The x1 coordinate.
[in]y1The y1 coordinate.
[in]x2The x2 coordinate.
[in]y2The y2 coordinate.
[in]x3The x3 coordinate.
[in]y3The y3 coordinate.

Definition at line 1834 of file pane2dgray.c.

References pane2dgray16_filltriangle(), pane2dgray_filltriangle(), pane2drgb16_filltriangle(), and pane2drgb_filltriangle().

Here is the call graph for this function:

◆ mod_pane2d_free()

void mod_pane2d_free ( pane2d_handle  pane)

Deallocates a Pane 2-D handle.

Note
If the handle is multithreaded, you should use mod_pane2d_releaseref instead of this function.
Parameters
[in]paneThe Pane 2-D handle to deallocate.

Definition at line 857 of file pane2dgray.c.

References pane2dgray16_free(), pane2dgray_free(), pane2drgb16_free(), and pane2drgb_free().

Here is the call graph for this function:

◆ mod_pane2d_freedata16p()

void mod_pane2d_freedata16p ( pane2d_handle  pane,
uint16_t *  image 
)

Frees image data created from a call to mod_pane2d_dupdata16p

Parameters
[in]paneThe Pane 2-D handle that the image was created from.
[in]imageThe image data to free.

Definition at line 1417 of file pane2dgray.c.

References pane2dgray16_freedata16p(), pane2dgray_freedata16p(), pane2drgb16_freedata16p(), and pane2drgb_freedata16p().

Here is the call graph for this function:

◆ mod_pane2d_freedatap()

void mod_pane2d_freedatap ( pane2d_handle  pane,
uint8_t *  image 
)

Frees image data created from a call to mod_pane2d_dupdatap

Parameters
[in]paneThe Pane 2-D handle that the image was created from.
[in]imageThe image data to free.

Definition at line 1376 of file pane2dgray.c.

References pane2dgray16_freedatap(), pane2dgray_freedatap(), pane2drgb16_freedatap(), and pane2drgb_freedatap().

Here is the call graph for this function:

◆ mod_pane2d_freedrawaclinfo_windows()

BOOL mod_pane2d_freedrawaclinfo_windows ( pane2d_handle  pane,
struct pane2d_drawacl src 
)

This function frees ACL data from the provided structure.

Parameters
[in]paneThe handle to operate on.
[in,out]srcThe structure with ACL data to free.
Return values
TRUEOn success.
FALSEOn error.

Definition at line 465 of file pane2dgray.c.

References pane2dgray16_freedrawaclinfo_windows(), pane2dgray_freedrawaclinfo_windows(), pane2drgb16_freedrawaclinfo_windows(), and pane2drgb_freedrawaclinfo_windows().

Here is the call graph for this function:

◆ mod_pane2d_freeimage()

void mod_pane2d_freeimage ( pane2d_handle  pane,
uint8_t **  image 
)

Frees image data created from a call to mod_pane2d_dupimage

Parameters
[in]paneThe Pane 2-D handle that the image was created from.
[in]imageThe image data to free.

Definition at line 1294 of file pane2dgray.c.

References pane2dgray16_freeimage(), pane2dgray_freeimage(), pane2drgb16_freeimage(), and pane2drgb_freeimage().

Here is the call graph for this function:

◆ mod_pane2d_freeimage16()

void mod_pane2d_freeimage16 ( pane2d_handle  pane,
uint16_t **  image 
)

Frees image data created from a call to mod_pane2d_dupimage16

Parameters
[in]paneThe Pane 2-D handle that the image was created from.
[in]imageThe image data to free.

Definition at line 1335 of file pane2dgray.c.

References pane2dgray16_freeimage16(), pane2dgray_freeimage16(), pane2drgb16_freeimage16(), and pane2drgb_freeimage16().

Here is the call graph for this function:

◆ mod_pane2d_get_bpp()

int mod_pane2d_get_bpp ( void  )

This function returns the bits per pixel (bpp) that the module stores image data in.

Return values
intThe bpp of the module.
Note
Before this function was implemented in 1.11.0, the bpp was 8 in all Pane 2-D modules.

Definition at line 250 of file pane2dgray.c.

References pane2dgray16_get_bpp(), pane2dgray_get_bpp(), pane2drgb16_get_bpp(), and pane2drgb_get_bpp().

Here is the call graph for this function:

◆ mod_pane2d_getdrawaclinfo_windows()

BOOL mod_pane2d_getdrawaclinfo_windows ( pane2d_handle  pane,
struct pane2d_drawacl dest 
)

This function gets the draw writing ACL from a Pane 2-D handle.

Parameters
[in]paneThe handle to operate on.
[in,out]destThe structure to fill the ACL info with.
Return values
TRUEOn success.
FALSEOn error.

Definition at line 441 of file pane2dgray.c.

References pane2dgray16_getdrawaclinfo_windows(), pane2dgray_getdrawaclinfo_windows(), pane2drgb16_getdrawaclinfo_windows(), and pane2drgb_getdrawaclinfo_windows().

Here is the call graph for this function:

◆ mod_pane2d_getownerinfo_windows()

DWORD mod_pane2d_getownerinfo_windows ( pane2d_handle  pane,
LPHANDLE  destvar 
)

This function is a Windows specific function that retrieves the owning thread's id and can also return a duplicated handle to the stored thread handle. The duplicate thread handle will have the SYNCHRONIZE and THREAD_QUERY_LIMITED_INFORMATION rights.

Parameters
[in]paneThe handle to query.
[out]destvarAn optional parameter to store the duplicated thread handle in. Set to NULL if not desired.
Return values
>0If the function was able to get the thread id. The function will set the pointer in destvar to NULL if DuplicateHandle() fails.
0If pane is NULL or the module denies access. This value is not returned if DuplicateHandle() fails.

Definition at line 415 of file pane2dgray.c.

References pane2dgray16_getownerinfo_windows(), pane2dgray_getownerinfo_windows(), pane2drgb16_getownerinfo_windows(), and pane2drgb_getownerinfo_windows().

Here is the call graph for this function:

◆ mod_pane2d_getref()

void mod_pane2d_getref ( pane2d_handle  pane,
int *  refcount,
int *  refwaiting 
)

This function retrieves the reference counts from an allocated Pane 2-D handle.

Parameters
[in]paneThe handle to query.
[out]refcountA pointer to an integer for the reference count.
[out]refwaitingA pointer to an integer for the reference waiting count.
Note
Reference waiting counts can be useful for determining if a thread is done with the handle, but not ready to continue until the owner of the thread shuts down the handle.

Definition at line 276 of file pane2dgray.c.

References pane2dgray16_getref(), pane2dgray_getref(), pane2drgb16_getref(), and pane2drgb_getref().

Here is the call graph for this function:

◆ mod_pane2d_init()

int mod_pane2d_init ( int  multithread)

This optional function is called when the module is initialized. This function allows you to return a count of references to the module.

Parameters
[in]multithread1 if program is running with multiple threads, 0 if program is running single threaded.
Return values
0on error.
1any positive integer means success.

Definition at line 2021 of file pane2dgray.c.

◆ mod_pane2d_is_multithreaded()

int mod_pane2d_is_multithreaded ( pane2d_handle  pane)

This function tells the caller whether a handle is allocated with multithreading enabled.

Parameters
[in]paneThe handle to query.
Return values
1If the handle is using the multithreading mechanism.
0If the handle is not using the multithreading mechanism, or the module was compiled without multithread support.

Definition at line 230 of file pane2dgray.c.

References pane2dgray16_is_multithreaded(), pane2dgray_is_multithreaded(), pane2drgb16_is_multithreaded(), and pane2drgb_is_multithreaded().

Here is the call graph for this function:

◆ mod_pane2d_isowner()

int mod_pane2d_isowner ( pane2d_handle  pane)

This function returns a boolean value indicating whether or not the calling thread owns the handle.

Parameters
[in]paneThe handle to operate on.
Return values
1If the calling thread owns the handle.
0If the calling thread does not own the handle, or the parameter was NULL.

Definition at line 361 of file pane2dgray.c.

References pane2dgray16_isowner(), pane2dgray_isowner(), pane2drgb16_isowner(), and pane2drgb_isowner().

Here is the call graph for this function:

◆ mod_pane2d_lang()

void mod_pane2d_lang ( stick2xyz_print_ptr  newval)

Changes the pointer type of the language pack calling function.

Parameters
[in]newvalThe new function pointer to store.
Note
This function is not implemented on Windows builds.

Definition at line 1996 of file pane2dgray.c.

References pane2dgray16_lang(), pane2dgray_lang(), pane2drgb16_lang(), and pane2drgb_lang().

Here is the call graph for this function:

◆ mod_pane2d_name()

stick2xyz_pctchar mod_pane2d_name ( void  )

Returns the internally stored UNIX module name.

Return values
stick2xyz_pctcharThe constant UNIX module name.

Definition at line 111 of file pane2dgray.c.

References pane2dgray16_name(), pane2dgray_name(), pane2drgb16_name(), and pane2drgb_name().

Here is the call graph for this function:

◆ mod_pane2d_print_segment()

void mod_pane2d_print_segment ( pane2d_handle  pane,
int  use_rgb 
)

Prints out some information about the image stored in a Pane 2-D handle.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]use_rgb1 if output is to represent RGB values, 0 otherwise.

Definition at line 1970 of file pane2dgray.c.

References pane2dgray16_print_segment(), pane2dgray_print_segment(), pane2drgb16_print_segment(), and pane2drgb_print_segment().

Here is the call graph for this function:

◆ mod_pane2d_release()

int mod_pane2d_release ( void  )

This optional function is called when the module is being unloaded. This function allows you to run any cleanup code independent of the operating system's way of notifying the module.

Return values
0when module is ready to be unloaded.
1any positive integer means module is not ready to be unloaded.

Definition at line 2036 of file pane2dgray.c.

◆ mod_pane2d_releaseref()

int mod_pane2d_releaseref ( pane2d_handle  pane,
int  asyncrelease,
int  shutdown 
)

This function subtracts a reference from an allocated Pane 2-D handle. When the reference count is zero, the handle is freed (deallocated).

Note
Only the owning thread of the handle can set the parameter shutdown to TRUE, or 1. The thread that created the handle is the initial owner of the handle. To change the owning thread, use mod_pane2d_changeaccesscontrol. shutdown does not need to be TRUE for the handle to be deallocated when the reference count goes to zero. However, the shutdown argument is useful to use when it is time to shut down the program or for some other reason that the handle needs to be deallocated as soon as possible. On Windows, if the owning thread terminated before shutting down the handle, the function will attempt to take over the handle to perform the shutdown.
Parameters
[in]paneThe handle to operate on.
[in]asyncreleaseIf 0, the function will block while waiting for other threads with a reference to call release. If 1, the function does not block. This parameter is ignored on handles allocated without multithreading.
[in]shutdownPer the note, should always be 0 when the calling thread is not the owner of the handle. This parameter is ignored on handles allocated without multithreading.
Return values
>0If there are still references to other threads.
0If the handle is completely deallocated.
-1If an error occured. errno will be set to: EINVAL if pane is NULL. EDEADLK if the function would have deadlocked the thread. EACCES if shutdown is TRUE and the thread does not own the handle.

Definition at line 340 of file pane2dgray.c.

References pane2dgray16_releaseref(), pane2dgray_releaseref(), pane2drgb16_releaseref(), and pane2drgb_releaseref().

Here is the call graph for this function:

◆ mod_pane2d_set_tty()

void mod_pane2d_set_tty ( void *  fildescout,
void *  fildescerr 
)

This function sets the file descriptors for writing to the terminal.

By default, the library uses stdout and stderr.

This function was introduced in version 1.5.0.

Parameters
[in]fildescoutThe file descriptor (FILE *) for stdout.
[in]fildescerrThe file descriptor (FILE *) for stderr.

Definition at line 190 of file pane2dgray.c.

References pane2dgray16_set_tty(), pane2dgray_set_tty(), pane2drgb16_set_tty(), and pane2drgb_set_tty().

Here is the call graph for this function:

◆ mod_pane2d_sigterm()

int mod_pane2d_sigterm ( pane2d_sigterm_ready  func,
int  modnumber 
)

This optional function is called when the program receives signal SIGTERM.

Note
One use of this function is to let all output to a file, pipe, or socket finish before letting the program terminate itself.
Warning
This function will be called inside a signal handler. Also, do not attempt to directly catch SIGTERM in a module. This function is the way for a module to catch SIGTERM. The code needs to be written as light as possible. Remember that the signal handler will freeze the entire program and the modules until the handler returns. This function is not implemented on Windows because TerminateProcess() is equivalent to SIGKILL. There is no equivalent SIGTERM on Windows, even though the C runtime defines SIGTERM.
Parameters
[in]funcThe function for the module to call when ready for program exit, if 0 is returned by the module.
[in]modnumberThe module number in the dynamic or static array. This number is the parameter when calling func.
Return values
1module is ready to be unloaded.
0module is not ready to be unloaded.

Definition at line 2068 of file pane2dgray.c.

◆ mod_pane2d_termwaituntilowner()

int mod_pane2d_termwaituntilowner ( pane2d_handle  pane)

This function causes waiting for mod_pane2d_waituntilowner to fail as interrupted. This function is a polite way for an owning thread to indicate that it is unable to complete the changing of ownership to another thread.

Parameters
[in]paneThe handle to operate on.
Return values
1If the function sets the termination of wait on owner change.
0If an error occured. errno will be set to: EINVAL if pane is NULL. EDEADLK if the function would have deadlocked the thread. ENOSYS if the module was compiled without multithreading support. EACCES if the calling thread does not own the handle.

Definition at line 531 of file pane2dgray.c.

References pane2dgray16_termwaituntilowner(), pane2dgray_termwaituntilowner(), pane2drgb16_termwaituntilowner(), and pane2drgb_termwaituntilowner().

Here is the call graph for this function:

◆ mod_pane2d_texture_add_gray()

uint64_t mod_pane2d_texture_add_gray ( pane2d_handle  pane,
uint8_t  gray,
uint8_t  alpha,
pane2d_texture_handle dest 
)

Creates a texture with a background 8-bit grayscale color.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]grayThe grayscale color in 0xXX to use as background.
[in]alphaThe alpha value to assign. This is used for transparency. If transparency is not needed, this can be set to 0xFF, or 255.
[out]destA pointer to a location in memory to receive the handle to the new texture. If you do not need the handle right away, this can be set to NULL.
Return values
>0If the add is successful, the ID number of the texture is returned.
0If an error occured.

Definition at line 995 of file pane2dgray.c.

References pane2dgray16_texture_add_gray(), pane2dgray_texture_add_gray(), pane2drgb16_texture_add_gray(), and pane2drgb_texture_add_gray().

Here is the call graph for this function:

◆ mod_pane2d_texture_add_gray16()

uint64_t mod_pane2d_texture_add_gray16 ( pane2d_handle  pane,
uint16_t  gray,
uint16_t  alpha,
pane2d_texture_handle dest 
)

Creates a texture with a background 16-bit grayscale color.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]grayThe grayscale color in 0xXXXX to use as background.
[in]alphaThe alpha value to assign. This is used for transparency. If transparency is not needed, this can be set to 0xFFFF, or 65535.
[out]destA pointer to a location in memory to receive the handle to the new texture. If you do not need the handle right away, this can be set to NULL.
Return values
>0If the add is successful, the ID number of the texture is returned.
0If an error occured.

Definition at line 1030 of file pane2dgray.c.

References pane2dgray16_texture_add_gray16(), pane2dgray_texture_add_gray16(), pane2drgb16_texture_add_gray16(), and pane2drgb_texture_add_gray16().

Here is the call graph for this function:

◆ mod_pane2d_texture_add_rgb()

uint64_t mod_pane2d_texture_add_rgb ( pane2d_handle  pane,
uint8_t  red,
uint8_t  green,
uint8_t  blue,
uint8_t  alpha,
pane2d_texture_handle dest 
)

Creates a texture with a background 8-bit RGB color.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]redThe red color in 0xXX to use as background.
[in]greenThe green color in 0xXX to use as background.
[in]blueThe blue color in 0xXX to use as background.
[in]alphaThe alpha value to assign. This is used for transparency. If transparency is not needed, this can be set to 0xFF, or 255.
[out]destA pointer to a location in memory to receive the handle to the new texture. If you do not need the handle right away, this can be set to NULL.
Return values
>0If the add is successful, the ID number of the texture is returned.
0If an error occured.
Note
If the module supports grayscale only, the RGB values may be converted into a gray value. This is intended design to help improve speed of the program when color is not desired.

Definition at line 1073 of file pane2dgray.c.

References pane2dgray16_texture_add_rgb(), pane2dgray_texture_add_rgb(), pane2drgb16_texture_add_rgb(), and pane2drgb_texture_add_rgb().

Here is the call graph for this function:

◆ mod_pane2d_texture_add_rgb16()

uint64_t mod_pane2d_texture_add_rgb16 ( pane2d_handle  pane,
uint16_t  red,
uint16_t  green,
uint16_t  blue,
uint16_t  alpha,
pane2d_texture_handle dest 
)

Creates a texture with a background 16-bit RGB color.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]redThe red color in 0xXXXX to use as background.
[in]greenThe green color in 0xXXXX to use as background.
[in]blueThe blue color in 0xXXXX to use as background.
[in]alphaThe alpha value to assign. This is used for transparency. If transparency is not needed, this can be set to 0xFFFF, or 65535.
[out]destA pointer to a location in memory to receive the handle to the new texture. If you do not need the handle right away, this can be set to NULL.
Return values
>0If the add is successful, the ID number of the texture is returned.
0If an error occured.
Note
If the module supports grayscale only, the RGB values may be converted into a gray value. This is intended design to help improve speed of the program when color is not desired.

Definition at line 1126 of file pane2dgray.c.

References pane2dgray16_texture_add_rgb16(), pane2dgray_texture_add_rgb16(), pane2drgb16_texture_add_rgb16(), and pane2drgb_texture_add_rgb16().

Here is the call graph for this function:

◆ mod_pane2d_texture_clear()

void mod_pane2d_texture_clear ( pane2d_handle  pane)

Clears the array of textures in a Pane 2-D handle.

Parameters
[in]paneThe Pane 2-D handle to operate on.
Warning
This function will cause all issued texture handles related to pane to become invalid. You will need to retrieve a new set of texture handles after calling this function on pane.

Definition at line 1192 of file pane2dgray.c.

References pane2dgray16_texture_clear(), pane2dgray_texture_clear(), pane2drgb16_texture_clear(), and pane2drgb_texture_clear().

Here is the call graph for this function:

◆ mod_pane2d_texture_enum()

int mod_pane2d_texture_enum ( pane2d_handle  pane,
pane2d_texture_handle dest,
uint64_t  number 
)

Retrieves a texture item from the array as a handle.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[out]destThe pointer to a location of memory to store the handle to the texture enum.
[in]numberThe item number to retrieve from the array. Note that this has to be 1 for the first item in the array since 0 is not a valid texture item number.
Return values
1If the element exists.
0If the element does not exist or is out of bounds.
Note
This function is safe to use as a conditional in a for loop.

Definition at line 1169 of file pane2dgray.c.

References pane2dgray16_texture_enum(), pane2dgray_texture_enum(), pane2drgb16_texture_enum(), and pane2drgb_texture_enum().

Here is the call graph for this function:

◆ mod_pane2d_type()

int mod_pane2d_type ( void  )

Returns the integer describing the module type.

The possible values are:

ASCII Modules:

STICK2XYZ_MODTYPE_PANE2D

STICK2XYZ_MODTYPE_PANE2D_DEBUG

UNICODE Modules:

STICK2XYZ_MODTYPE_PANE2D_UNICODE

STICK2XYZ_MODTYPE_PANE2D_UNICODE_DEBUG

Return values
intThe module type as described above.

Definition at line 170 of file pane2dgray.c.

References pane2dgray16_type(), pane2dgray_type(), pane2drgb16_type(), and pane2drgb_type().

Here is the call graph for this function:

◆ mod_pane2d_version()

void mod_pane2d_version ( int *  dest)

Sets up the major, minor, and revision numbers into three integers.

Parameters
[out]destAn array of three integers to receive the module data.

Definition at line 141 of file pane2dgray.c.

References pane2dgray16_version(), pane2dgray_version(), pane2drgb16_version(), and pane2drgb_version().

Here is the call graph for this function:

◆ mod_pane2d_vertex_get()

int mod_pane2d_vertex_get ( pane2d_handle  pane,
int  elm,
struct pane2d_vertex_elm dest 
)

Retrieves an item from the vertex array.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]elmThe element number to retrieve.
[out]destThe memory location to receive the pointer data.
Return values
1If the element exists.
0If the element does not exist or is out of bounds.
Note
This function is safe to use as a conditional in a for loop.
Bug:
Currently, the function can not read an elm number past STICK2XYZ_MINVERTEX in the Pane2D General module.

Definition at line 925 of file pane2dgray.c.

References pane2dgray16_vertex_get(), pane2dgray_vertex_get(), pane2drgb16_vertex_get(), and pane2drgb_vertex_get().

Here is the call graph for this function:

◆ mod_pane2d_vertex_get_v2()

int mod_pane2d_vertex_get_v2 ( pane2d_handle  pane,
int  elm,
struct pane2d_vertex_elm_v2 dest 
)

Retrieves an item from the vertex array. This function also retrieves the texture handle.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]elmThe element number to retrieve.
[out]destThe memory location to receive the pointer data.
Return values
1If the element exists.
0If the element does not exist or is out of bounds.
Note
This function is safe to use as a conditional in a for loop.
Bug:
Currently, the function can not read an elm number past STICK2XYZ_MINVERTEX in the Pane2D General module.

Definition at line 960 of file pane2dgray.c.

References pane2dgray16_vertex_get_v2(), pane2dgray_vertex_get_v2(), pane2drgb16_vertex_get_v2(), and pane2drgb_vertex_get_v2().

Here is the call graph for this function:

◆ mod_pane2d_vertex_getopts()

uint32_t mod_pane2d_vertex_getopts ( pane2d_handle  pane)

Gets the bit-wise vertex options.

Parameters
[in]paneThe Pane 2-D handle to operate on.
Return values
uint32_tThe stored vertex options.

Definition at line 875 of file pane2dgray.c.

References pane2dgray16_vertex_getopts(), pane2dgray_vertex_getopts(), pane2drgb16_vertex_getopts(), and pane2drgb_vertex_getopts().

Here is the call graph for this function:

◆ mod_pane2d_vertex_setopts()

void mod_pane2d_vertex_setopts ( pane2d_handle  pane,
uint32_t  newopts 
)

Sets the bit-wise vertex options.

Parameters
[in]paneThe Pane 2-D handle to operate on.
[in]newoptsThe new vertex options to store.
Note
You will need to use STICK2XYZ_PANE2D_VERTEX_DRAWSTRUCT to get a vertex drawn as well. Vertex is not drawn by default in order to maintain backward compatibility.

Definition at line 896 of file pane2dgray.c.

References pane2dgray16_vertex_setopts(), pane2dgray_vertex_setopts(), pane2drgb16_vertex_setopts(), and pane2drgb_vertex_setopts().

Here is the call graph for this function:

◆ mod_pane2d_waituntilowner()

int mod_pane2d_waituntilowner ( pane2d_handle  pane,
int  addref 
)

This function blocks until the calling thread owns the given handle. If the owning thread abandoned the handle (terminated without deallocating the handle) on the Windows build, the function will have the calling thread take over the given handle.

Note
If you are clever enough, you can have a newly created thread use this function to wait until the new thread is the new owner of the handle.
Parameters
[in]paneThe handle to operate on.
[in]addrefIf TRUE, Increments the reference count by 1. This can save you from having to call an addref function seperately. A reference is not added if the function fails.
Return values
1When calling thread now owns the handle.
0If an error occured. errno will be set to: EINVAL if pane is NULL. EDEADLK if the function would have deadlocked the thread. ENOSYS if the module was compiled without multithreading support. EDEADLK for this function means that the handle is being shut down by the owning thread. EINTR if mod_pane2d_termwaituntilowner was called successfully.

Definition at line 505 of file pane2dgray.c.

References pane2dgray16_waituntilowner(), pane2dgray_waituntilowner(), pane2drgb16_waituntilowner(), and pane2drgb_waituntilowner().

Here is the call graph for this function:

SourceForge.net Logo  stick2xyz Project Page