osmesa

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNSIGNED_BYTE = gl.UNSIGNED_BYTE
)

Variables

This section is empty.

Functions

func ColorClamp

func ColorClamp(enable bool)

*

  • Enable/disable color clamping, off by default.
  • New in Mesa 6.4.2

func DestroyContext

func DestroyContext(ctx Context)

* Destroy an Off-Screen Mesa rendering context. * * Input: ctx - the context to destroy

func GetColorBuffer

func GetColorBuffer(c Context, width *int, height *int,
	format *Format, buffer *unsafe.Pointer)

* Return the color buffer associated with an OSMesa context. * Input: c - the OSMesa context * Output: width, height - size of buffer in pixels * format - buffer format (OSMESA_FORMAT) * buffer - pointer to depth buffer values * Return: GL_TRUE or GL_FALSE to indicate success or failure. * * New in Mesa 3.3.

func GetDepthBuffer

func GetDepthBuffer(c Context, width *int, height *int,
	bytesPerValue *int, buffer *unsafe.Pointer)

* Return the depth buffer associated with an OSMesa context. * Input: c - the OSMesa context * Output: width, height - size of buffer in pixels * bytesPerValue - bytes per depth value (2 or 4) * buffer - pointer to depth buffer values * Return: GL_TRUE or GL_FALSE to indicate success or failure. * * New in Mesa 2.4.

func GetIntegerv

func GetIntegerv(pname PropertyName) int

* Return an integer value like glGetIntegerv. * Input: pname - * OSMESA_WIDTH return current image width * OSMESA_HEIGHT return current image height * OSMESA_FORMAT return image format * OSMESA_TYPE return color component data type * OSMESA_ROW_LENGTH return row length in pixels * OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction * value - pointer to integer in which to return result.

func MakeCurrent

func MakeCurrent(ctx Context, buffer unsafe.Pointer, type_ PixelType,
	width int, height int) bool

* Bind an osmesa.Context to an image buffer. The image buffer is just a * block of memory which the client provides. Its size must be at least * as large as width*height*sizeof(type). Its address should be a multiple * of 4 if using RGBA mode. * * Image data is stored in the order of glDrawPixels: row-major order * with the lower-left image pixel stored in the first array position * (ie. bottom-to-top). * * Since the only type initially supported is GL_UNSIGNED_BYTE, if the * context is in RGBA mode, each pixel will be stored as a 4-byte RGBA * value. If the context is in color indexed mode, each pixel will be * stored as a 1-byte value. * * If the context's viewport hasn't been initialized yet, it will now be * initialized to (0,0,width,height). * * Input: ctx - the rendering context * buffer - the image buffer memory * type - data type for pixel components, only GL_UNSIGNED_BYTE * supported now * width, height - size of image buffer in pixels, at least 1 * Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx, * invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1, * width>internal limit or height>internal limit.

func PixelStore

func PixelStore(pname PixelStoreParameter, value int)

* Set pixel store/packing parameters for the current context. * This is similar to glPixelStore. * Input: pname - OSMESA_ROW_LENGTH * specify actual pixels per row in image buffer * 0 = same as image width (default) * OSMESA_Y_UP * zero = Y coordinates increase downward * non-zero = Y coordinates increase upward (default) * value - the value for the parameter pname * * New in version 2.0.

Types

type Context

type Context C.OSMesaContext

func CreateContext

func CreateContext(format Format, sharelist Context) Context

* Create an Off-Screen Mesa rendering context. The only attribute needed is * an RGBA vs Color-Index mode flag. * * Input: format - one of OSMESA_COLOR_INDEX, OSMESA_RGBA, OSMESA_BGRA, * OSMESA_ARGB, OSMESA_RGB, or OSMESA_BGR. * sharelist - specifies another osmesa.Context with which to share * display lists. NULL indicates no sharing. * Return: an osmesa.Context or 0 if error

func CreateContextExt

func CreateContextExt(format Format, depthBits int, stencilBits int,
	accumBits int, sharelist Context) Context

* Create an Off-Screen Mesa rendering context and specify desired * size of depth buffer, stencil buffer and accumulation buffer. * If you specify zero for depthBits, stencilBits, accumBits you * can save some memory. * * New in Mesa 3.5

func GetCurrentContext

func GetCurrentContext() Context

* Return the current Off-Screen Mesa rendering context handle.

type Format

type Format int
const (
	COLOR_INDEX Format = gl.COLOR_INDEX
	RGBA        Format = gl.RGBA
	BGRA        Format = 0x1
	ARGB        Format = 0x2
	RGB         Format = gl.RGB
	BGR         Format = 0x4
	RGB_565     Format = 0x5
)

* Values for the format parameter of OSMesaCreateContext() * New in version 2.0.

type PixelStoreParameter

type PixelStoreParameter int
const (
	ROW_LENGTH PixelStoreParameter = 0x10
	Y_UP       PixelStoreParameter = 0x11
)

* OSMesaPixelStore() parameters: * New in version 2.0.

type PixelType

type PixelType int

type PropertyName

type PropertyName int

* Accepted by OSMesaGetIntegerv:

const (
	WIDTH      PropertyName = 0x20
	HEIGHT     PropertyName = 0x21
	FORMAT     PropertyName = 0x22
	TYPE       PropertyName = 0x23
	MAX_WIDTH  PropertyName = 0x24 /* new in 4.0 */
	MAX_HEIGHT PropertyName = 0x25 /* new in 4.0 */
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL