DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Renderer Interface

Detailed Description

Defines Renderer related types, structs, and functions.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Data Structures

struct  dwRenderBufferVertexLayout
 Vertex layout describing format and semantics for position, color, and texture. More...
 

Typedefs

typedef const struct dwRenderBufferObject * dwConstRenderBufferHandle_t
 Const handle representing vertex data for rendering. More...
 
typedef const struct dwRendererObject * dwConstRendererHandle_t
 Const handle for the renderer. More...
 
typedef struct dwRenderBufferObject * dwRenderBufferHandle_t
 Handle representing vertex data for rendering. More...
 
typedef struct dwRendererObject * dwRendererHandle_t
 Handle for the renderer. More...
 

Enumerations

enum  dwRenderBufferColorSemantic {
  DW_RENDER_SEMANTIC_COL_NULL = 0,
  DW_RENDER_SEMANTIC_COL_R = 1,
  DW_RENDER_SEMANTIC_COL_A = 2,
  DW_RENDER_SEMANTIC_COL_RGB = 3,
  DW_RENDER_SEMANTIC_COL_RGBA = 4,
  DW_RENDER_SEMANTIC_COL_LUT = 5,
  DW_RENDER_SEMANTIC_COL_HUE = 6
}
 Vertex component semantics. More...
 
enum  dwRenderBufferFormat {
  DW_RENDER_FORMAT_NULL = 0,
  DW_RENDER_FORMAT_R32G32B32A32_FLOAT = 1,
  DW_RENDER_FORMAT_R32G32B32_FLOAT = 2,
  DW_RENDER_FORMAT_R32G32_FLOAT = 3,
  DW_RENDER_FORMAT_R32_FLOAT = 4
}
 Vertex component channel count and format. More...
 
enum  dwRenderBufferPositionSemantic {
  DW_RENDER_SEMANTIC_POS_NULL = 0,
  DW_RENDER_SEMANTIC_POS_XY = 1,
  DW_RENDER_SEMANTIC_POS_XYZ = 2
}
 Vertex component semantics. More...
 
enum  dwRenderBufferPrimitiveType {
  DW_RENDER_PRIM_POINTLIST = 0,
  DW_RENDER_PRIM_LINELIST = 1,
  DW_RENDER_PRIM_TRIANGLELIST = 2,
  DW_RENDER_PRIM_LINESTRIP = 3,
  DW_RENDER_PRIM_LINELOOP = 4,
  DW_RENDER_PRIM_COUNT = 5
}
 Render primitives supported by the renderer. More...
 
enum  dwRenderBufferTexSemantic {
  DW_RENDER_SEMANTIC_TEX_NULL = 0,
  DW_RENDER_SEMANTIC_TEX_S = 1,
  DW_RENDER_SEMANTIC_TEX_ST = 2
}
 Vertex component semantics. More...
 
enum  dwRendererFonts {
  DW_RENDER_FONT_VERDANA_8 = 0,
  DW_RENDER_FONT_VERDANA_12 = 1,
  DW_RENDER_FONT_VERDANA_16 = 2,
  DW_RENDER_FONT_VERDANA_20 = 3,
  DW_RENDER_FONT_VERDANA_24 = 4,
  DW_RENDER_FONT_VERDANA_32 = 5,
  DW_RENDER_FONT_VERDANA_48 = 6,
  DW_RENDER_FONT_VERDANA_64 = 7,
  DW_RENDER_FONT_COUNT
}
 Font types and sizes supported by the renderer. More...
 

Functions

DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_createView (uint32_t *slot, dwRenderBufferHandle_t renderbuffer, const dwRenderBufferVertexLayout newLayout, const dwRenderBufferPrimitiveType newPrimType, dwVisualizationContextHandle_t context)
 Creates an additional view for a render buffer, allowing you to change layout and primitive type, but not vertex stride. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_initialize (dwRenderBufferHandle_t *renderbuffer, const dwRenderBufferVertexLayout layout, const dwRenderBufferPrimitiveType primType, const uint32_t primCount, dwVisualizationContextHandle_t context)
 Initializes a RenderBuffer structure for rendering. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_map (float32_t **map, uint32_t *maxVertices, uint32_t *vertexStride, dwRenderBufferHandle_t renderbuffer)
 Maps the CPU copy of a RenderBuffer to the application for updating. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_mapRange (float32_t **map, uint32_t *maxVertices, uint32_t *vertexStride, const uint32_t startVertex, dwRenderBufferHandle_t renderbuffer)
 Maps a contiguous range of the CPU copy of a RenderBuffer to the application for updating. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_release (dwRenderBufferHandle_t renderbuffer)
 Releases the RenderBuffer data structure. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_set2DCoordNormalizationFactors (const float32_t width, const float32_t height, dwRenderBufferHandle_t renderbuffer)
 Sets 2D normalization values when 2D coordinates are specified in pixel values and not in 0..1 range. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_unmap (uint32_t nVerts, dwRenderBufferHandle_t renderbuffer)
 After a map/mapRange, returns the updated buffer to the RenderBuffer structure and updates the GPU portion. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_get2DTransform (dwMatrix3f *matrix, dwConstRendererHandle_t obj)
 Gets current 2D transformation applied when rendering to the screen. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_getColor (dwVector4f *color, dwConstRendererHandle_t obj)
 Gets current rendering color. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_getColorMapScale (dwVector3f *colorMapScale, dwConstRendererHandle_t obj)
 Gets current rendering color map scale. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_getFont (dwRendererFonts *value, dwConstRendererHandle_t obj)
 Gets current font. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_getLineWidth (float32_t *value, dwConstRendererHandle_t obj)
 Gets current line width, in pixels. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_getModelView (dwMatrix4f *matrix, dwConstRendererHandle_t obj)
 Gets current ModelView matrix. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_getPointSize (float32_t *value, dwConstRendererHandle_t obj)
 Gets current point size. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_getProjection (dwMatrix4f *matrix, dwConstRendererHandle_t obj)
 Gets current projection matrix. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_getRect (dwRect *rect, dwConstRendererHandle_t obj)
 Gets current rendering screen area expressed in pixel values. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_initialize (dwRendererHandle_t *renderer, dwVisualizationContextHandle_t context)
 Initializes a Renderer. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_release (dwRendererHandle_t renderer)
 Released the renderer. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderBuffer (dwConstRenderBufferHandle_t buffer, dwRendererHandle_t obj)
 Renders a RenderBuffer. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderCircle (dwVector2f center, float32_t radius, dwRendererHandle_t obj)
 Renders a 2D circle. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderData2D (const dwVector2f *buffer, size_t count, dwRenderBufferPrimitiveType primitiveType, dwRendererHandle_t obj)
 Renders a set of 2D vertices. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderData3D (const dwVector3f *buffer, size_t count, dwRenderBufferPrimitiveType primitiveType, dwRendererHandle_t obj)
 Renders a set of 3D vertices. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderSubTexture (const GLuint inputTexture, const GLenum textureTarget, const float32_t minx, const float32_t miny, const float32_t maxx, const float32_t maxy, dwRendererHandle_t obj)
 Renders a subrect of a textured quad on the screen. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderText (const int32_t x, const int32_t y, const char *text, dwRendererHandle_t obj)
 Renders a text line on the screen. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderTextNorm (const float32_t normX, const float32_t normY, const char *text, dwRendererHandle_t obj)
 Renders a text line on the screen. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderTexture (const GLuint inputTexture, const GLenum textureTarget, dwRendererHandle_t obj)
 Renders a textured quad on the screen. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_reset (dwRendererHandle_t renderer)
 Resets renderer state. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_set2DTransform (const dwMatrix3f *matrix, dwRendererHandle_t obj)
 Sets current 2D transformation applied when rendering to the screen. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_setColor (const dwVector4f color, dwRendererHandle_t obj)
 Sets current rendering color. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_setColorMapScale (const dwVector3f colorMapScale, dwRendererHandle_t obj)
 Sets current rendering color mapping scale. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_setFont (const dwRendererFonts value, dwRendererHandle_t obj)
 Sets current font. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_setLineWidth (const float32_t value, dwRendererHandle_t obj)
 Sets current line width, in pixels. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_setModelView (const dwMatrix4f *matrix, dwRendererHandle_t obj)
 Sets current ModelView matrix. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_setPointSize (const float32_t value, dwRendererHandle_t obj)
 Sets current point size. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_setProjection (const dwMatrix4f *matrix, dwRendererHandle_t obj)
 Sets current projection matrix. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_setRect (const dwRect rect, dwRendererHandle_t obj)
 Sets current rendering screen area expressed in pixel values. More...
 
DW_VIZ_API_PUBLIC dwStatus dwRenderer_setViewportAndScissorRects (const dwRect viewport, const dwRect scissor, dwRendererHandle_t obj)
 Sets viewport and scissor rectangles in pixel values. More...
 

Variables

const dwVector3f DW_RENDER_COLORMAPSCALE_100M = {100.0f, 100.0f, 100.0f}
 
const dwVector3f DW_RENDER_COLORMAPSCALE_130M = {130.0f, 130.0f, 130.0f}
 
const dwVector3f DW_RENDER_COLORMAPSCALE_150M = {150.0f, 150.0f, 150.0f}
 
const dwVector3f DW_RENDER_COLORMAPSCALE_75M = {75.0f, 75.0f, 75.0f}
 Color map scales - determine the bandwidth of the color spectrum. More...
 
static const uint32_t DW_RENDERBUFFER_MAX_VIEWS = 10
 The maximal number of views that can be created in with. More...
 
const dwVector4f DW_RENDERER_COLOR_BLACK = {0.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_BLUE = {32.0f / 255.0f, 72.0f / 255.0f, 230.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_CYAN = {40.0f / 255.0f, 130.0f / 255.0f, 255.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_DARKBLUE = {45.0f / 255.0f, 44.0f / 255.0f, 100.0f / 255.0f, 0.6f}
 
const dwVector4f DW_RENDERER_COLOR_DARKGREEN = {45.0f / 255.0f, 100.0f / 255.0f, 44.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_DARKGREY = {72.0f / 255.0f, 72.0f / 255.0f, 72.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_DARKRED = {180.0f / 255.0f, 5.0f / 255.0f, 0.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_GREEN = {32.0f / 255.0f, 230.0f / 255.0f, 32.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_LIGHTBLUE = {51.0f / 255.0f, 153.0f / 255.0f, 255.0f / 255.0f, 0.6f}
 
const dwVector4f DW_RENDERER_COLOR_LIGHTGREEN = {118.0f / 255.0f, 185.0f / 255.0f, 0.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_LIGHTGREY = {185.0f / 255.0f, 185.0f / 255.0f, 185.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_LIGHTPURPLE = {181.0f / 255.0f, 138.0f / 255.0f, 242.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_MAGENTA = {230.f / 255.f, 25.f / 255.f, 230.f / 255.f, 1.f}
 
const dwVector4f DW_RENDERER_COLOR_NVIDIA_GREEN = {0.4609375f, 0.72265625f, 0.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_ORANGE = {230.0f / 255.0f, 100.0f / 255.0f, 10.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_PURPLE = {255.0f / 255.0f, 0.0f / 255.0f, 240.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_RED = {230.0f / 255.0f, 72.0f / 255.0f, 32.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_WHITE = {255.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f, 1.0f}
 
const dwVector4f DW_RENDERER_COLOR_YELLOW = {230.0f / 255.0f, 230.0f / 255.0f, 10.0f / 255.0f, 1.0f}
 
static const uint32_t DW_RENDERER_DEFAULT_BUFFER_SIZE = 10000
 The maximum number of vertices that can be passed to a call dwRenderer_renderData3D() or dwRenderer_renderData2D() More...
 
const dwVector3f DW_RENDERER_HSV_BLUE = {240.0f, 1.0f, 0.75f}
 
const dwVector3f DW_RENDERER_HSV_PURPLE = {270.0f, 1.0f, 0.75f}
 
const dwVector3f DW_RENDERER_HSV_RED = {0.0f, 1.0f, 0.75f}
 

Data Structure Documentation

◆ dwRenderBufferVertexLayout

struct dwRenderBufferVertexLayout
Data Fields
dwRenderBufferFormat colFormat

format of the color data

dwRenderBufferColorSemantic colSemantic

description of the color data

dwRenderBufferFormat posFormat

format of the position data

dwRenderBufferPositionSemantic posSemantic

description of the color data

dwRenderBufferFormat texFormat

format of the texture coordinates data

dwRenderBufferTexSemantic texSemantic

description of the color data

Typedef Documentation

◆ dwConstRenderBufferHandle_t

typedef const struct dwRenderBufferObject* dwConstRenderBufferHandle_t

Const handle representing vertex data for rendering.

Definition at line 175 of file Renderer.h.

◆ dwConstRendererHandle_t

typedef const struct dwRendererObject* dwConstRendererHandle_t

Const handle for the renderer.

Definition at line 181 of file Renderer.h.

◆ dwRenderBufferHandle_t

typedef struct dwRenderBufferObject* dwRenderBufferHandle_t

Handle representing vertex data for rendering.

Definition at line 172 of file Renderer.h.

◆ dwRendererHandle_t

typedef struct dwRendererObject* dwRendererHandle_t

Handle for the renderer.

Definition at line 178 of file Renderer.h.

Enumeration Type Documentation

◆ dwRenderBufferColorSemantic

Vertex component semantics.

Enumerator
DW_RENDER_SEMANTIC_COL_NULL 
DW_RENDER_SEMANTIC_COL_R 
DW_RENDER_SEMANTIC_COL_A 
DW_RENDER_SEMANTIC_COL_RGB 
DW_RENDER_SEMANTIC_COL_RGBA 
DW_RENDER_SEMANTIC_COL_LUT 
DW_RENDER_SEMANTIC_COL_HUE 

Definition at line 130 of file Renderer.h.

◆ dwRenderBufferFormat

Vertex component channel count and format.

Enumerator
DW_RENDER_FORMAT_NULL 
DW_RENDER_FORMAT_R32G32B32A32_FLOAT 
DW_RENDER_FORMAT_R32G32B32_FLOAT 
DW_RENDER_FORMAT_R32G32_FLOAT 
DW_RENDER_FORMAT_R32_FLOAT 

Definition at line 111 of file Renderer.h.

◆ dwRenderBufferPositionSemantic

Vertex component semantics.

Origin of POS_XY coordinates is top-left.

Enumerator
DW_RENDER_SEMANTIC_POS_NULL 
DW_RENDER_SEMANTIC_POS_XY 
DW_RENDER_SEMANTIC_POS_XYZ 

Definition at line 123 of file Renderer.h.

◆ dwRenderBufferPrimitiveType

Render primitives supported by the renderer.

Enumerator
DW_RENDER_PRIM_POINTLIST 
DW_RENDER_PRIM_LINELIST 
DW_RENDER_PRIM_TRIANGLELIST 
DW_RENDER_PRIM_LINESTRIP 
DW_RENDER_PRIM_LINELOOP 
DW_RENDER_PRIM_COUNT 

Definition at line 159 of file Renderer.h.

◆ dwRenderBufferTexSemantic

Vertex component semantics.

Enumerator
DW_RENDER_SEMANTIC_TEX_NULL 
DW_RENDER_SEMANTIC_TEX_S 
DW_RENDER_SEMANTIC_TEX_ST 

Definition at line 141 of file Renderer.h.

◆ dwRendererFonts

Font types and sizes supported by the renderer.

Enumerator
DW_RENDER_FONT_VERDANA_8 
DW_RENDER_FONT_VERDANA_12 
DW_RENDER_FONT_VERDANA_16 
DW_RENDER_FONT_VERDANA_20 
DW_RENDER_FONT_VERDANA_24 
DW_RENDER_FONT_VERDANA_32 
DW_RENDER_FONT_VERDANA_48 
DW_RENDER_FONT_VERDANA_64 
DW_RENDER_FONT_COUNT 

Definition at line 97 of file Renderer.h.

Function Documentation

◆ dwRenderBuffer_createView()

DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_createView ( uint32_t *  slot,
dwRenderBufferHandle_t  renderbuffer,
const dwRenderBufferVertexLayout  newLayout,
const dwRenderBufferPrimitiveType  newPrimType,
dwVisualizationContextHandle_t  context 
)

Creates an additional view for a render buffer, allowing you to change layout and primitive type, but not vertex stride.

Note
This method performs allocations on the heap.
Parameters
[out]slotA pointer to the slot this view is allocated in. Slot 0 is the default view.
[in]renderbufferSpecifies the RenderBuffer with the data.
[in]newLayoutSpecifies the new size of a vertex.
[in]newPrimTypeSpecifies how many vertices are in a primitive.
[in]contextSpecifies a handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS, DW_FAILURE

◆ dwRenderBuffer_initialize()

DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_initialize ( dwRenderBufferHandle_t renderbuffer,
const dwRenderBufferVertexLayout  layout,
const dwRenderBufferPrimitiveType  primType,
const uint32_t  primCount,
dwVisualizationContextHandle_t  context 
)

Initializes a RenderBuffer structure for rendering.

It must be initialized on a thread with a valid current OpenGL context. This call creates data both on the heap and on the GPU.

Parameters
[out]renderbufferA pointer to an initialized render buffer object.
[in]layoutSpecifies the stride of a vertex.
[in]primTypeSpecifies how many vertices are in a primitive.
[in]primCountSpecifies how many primitives the buffer should contain.
[in]contextSpecifies a handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderBuffer_map()

DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_map ( float32_t **  map,
uint32_t *  maxVertices,
uint32_t *  vertexStride,
dwRenderBufferHandle_t  renderbuffer 
)

Maps the CPU copy of a RenderBuffer to the application for updating.

The pointer provided is only valid until the corresponding unmap call. The application can overwrite any portion of the buffer. Note that the number of valid vertices in the buffer is updated to nVerts in unmap. This is a lightweight call. Mapping a currently mapped RenderBuffer returns an error.

Parameters
[out]mapA pointer to the CPU side of the RenderBuffer data.
[out]maxVerticesA pointer to the maximum number of vertices in the allocated data.
[out]vertexStrideA pointer to the size (in float32_t) of a vertex.
[in]renderbufferSpecifies the RenderBuffer being mapped to the CPU.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS, DW_FAILURE

◆ dwRenderBuffer_mapRange()

DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_mapRange ( float32_t **  map,
uint32_t *  maxVertices,
uint32_t *  vertexStride,
const uint32_t  startVertex,
dwRenderBufferHandle_t  renderbuffer 
)

Maps a contiguous range of the CPU copy of a RenderBuffer to the application for updating.

The pointer provided is only valid until the corresponding unmap call. The application can overwrite parts or the entirety of the specified range. This is a lightweight call. Mapping a currently mapped RenderBuffer returns an error. The vertices before startVertex must be valid.

Parameters
[out]mapA pointer to the CPU side of the RenderBuffer data.
[out]maxVerticesA pointer to the maximum number of vertices that can be mapped.
[out]vertexStrideA pointer to the size (in floats) of a vertex.
[in]startVertexSpecifies the first vertex to map. This corresponds to map[0].
[in]renderbufferSpecifies the RenderBuffer being mapped to the CPU.
Returns
DW_CALL_NOT_ALLOWED, DW_SUCCESS

◆ dwRenderBuffer_release()

DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_release ( dwRenderBufferHandle_t  renderbuffer)

Releases the RenderBuffer data structure.

It frees both the CPU and GPU memory allocated during the initialization call. The RenderBuffer is assigned a NULL value.

Parameters
[out]renderbufferThe RenderBuffer to be released.
Returns
DW_CALL_NOT_ALLOWED, DW_SUCCESS

◆ dwRenderBuffer_set2DCoordNormalizationFactors()

DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_set2DCoordNormalizationFactors ( const float32_t  width,
const float32_t  height,
dwRenderBufferHandle_t  renderbuffer 
)

Sets 2D normalization values when 2D coordinates are specified in pixel values and not in 0..1 range.

To reset to normalized values, set values to 1.0.

Parameters
[in]widthSpecifies the pixels to scale the X coordinate with.
[in]heightSpecifies the pixels to scale the Y coordinate with.
[in]renderbufferSpecifies the RenderBuffer to be released.
Returns
DW_INVALID_HANDLE, DW_SUCCESS

◆ dwRenderBuffer_unmap()

DW_VIZ_API_PUBLIC dwStatus dwRenderBuffer_unmap ( uint32_t  nVerts,
dwRenderBufferHandle_t  renderbuffer 
)

After a map/mapRange, returns the updated buffer to the RenderBuffer structure and updates the GPU portion.

Since a host to device copy is required, this method is not lightweight. If the GPU buffer is in use, this can incur an extra cost. If the provided RenderBuffer has not been mapped, it returns an error.

Parameters
[in]nVertsSpecifies how many vertices have been updated. Assumes a contiguous update from the origin to nVerts. map: Current number of valid vertices in buffer is updated to nVerts. mapRange: Current number of valid vertices extended if necessary, but not reduced.
[in]renderbufferSpecifies the RenderBuffer being mapped to the CPU.
Returns
DW_INVALID_HANDLE, DW_SUCCESS, DW_CALL_NOT_ALLOWED

◆ dwRenderer_get2DTransform()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_get2DTransform ( dwMatrix3f matrix,
dwConstRendererHandle_t  obj 
)

Gets current 2D transformation applied when rendering to the screen.

Parameters
[out]matrixSpecifies a 3x3 matrix containing a 2D rasterization transform applied during rendering.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getColor()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_getColor ( dwVector4f color,
dwConstRendererHandle_t  obj 
)

Gets current rendering color.

Parameters
[out]colorSpecifies a float[4] vector in 0..1 range.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getColorMapScale()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_getColorMapScale ( dwVector3f colorMapScale,
dwConstRendererHandle_t  obj 
)

Gets current rendering color map scale.

Parameters
[out]colorMapScaleSpecifies a scale factor via float32_t[3] in meters for the saturation range. colorScale[0], colorScale[1] and colorScale[2] to x, y, z respectively. E.g. {150, 150, std::numeric_limits<double>::infinity()} indicates the color will wrap after 150 meters in the x,y plane (z component is ignored).
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getFont()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_getFont ( dwRendererFonts value,
dwConstRendererHandle_t  obj 
)

Gets current font.

Parameters
[out]valueSpecifies the active valid font.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getLineWidth()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_getLineWidth ( float32_t value,
dwConstRendererHandle_t  obj 
)

Gets current line width, in pixels.

Parameters
[out]valueSpecifies the width of a line, in pixels.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getModelView()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_getModelView ( dwMatrix4f matrix,
dwConstRendererHandle_t  obj 
)

Gets current ModelView matrix.

Parameters
[out]matrixSpecifies a 4D homogeneous matrix as float[16] col major.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getPointSize()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_getPointSize ( float32_t value,
dwConstRendererHandle_t  obj 
)

Gets current point size.

Parameters
[out]valueSpecifies the size of a point, in pixels.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getProjection()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_getProjection ( dwMatrix4f matrix,
dwConstRendererHandle_t  obj 
)

Gets current projection matrix.

Parameters
[out]matrixSpecifies a 4D homogeneous matrix as float[16] col major
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_getRect()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_getRect ( dwRect rect,
dwConstRendererHandle_t  obj 
)

Gets current rendering screen area expressed in pixel values.

Parameters
[out]rectA pointer to a structure containing the current react area.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_initialize()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_initialize ( dwRendererHandle_t renderer,
dwVisualizationContextHandle_t  context 
)

Initializes a Renderer.

This initialization implies creation of various graphics resources including shaders, vertex data, and textures. It must be initialized on a thread with a valid current OpenGL context. While multiple renderers may coexist, resources among them are not shared.

Parameters
[out]rendererA pointer to an initialized renderer object.
[in]contextSpecifies a handle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT, DW_FAILURE, DW_SUCCESS

◆ dwRenderer_release()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_release ( dwRendererHandle_t  renderer)

Released the renderer.

This call frees all GPU resources. The handle points to NULL on success.

Parameters
[in]rendererThe Renderer object to be released.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_renderBuffer()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderBuffer ( dwConstRenderBufferHandle_t  buffer,
dwRendererHandle_t  obj 
)

Renders a RenderBuffer.

Parameters
[in]bufferSpecifies the buffer to render.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderCircle()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderCircle ( dwVector2f  center,
float32_t  radius,
dwRendererHandle_t  obj 
)

Renders a 2D circle.

Parameters
[in]centerCenter of circle.
[in]radiusRadius of circle.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderData2D()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderData2D ( const dwVector2f buffer,
size_t  count,
dwRenderBufferPrimitiveType  primitiveType,
dwRendererHandle_t  obj 
)

Renders a set of 2D vertices.

This is equivalent to rendering a RenderBuffer with only xy positions. No 2d normalization factors are used.

Parameters
[in]bufferSpecifies the vertices to render. Vertices are in opengl [-1..+1] range.
[in]countNumber of vertices.
[in]primitiveTypeGL primitive type.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderData3D()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderData3D ( const dwVector3f buffer,
size_t  count,
dwRenderBufferPrimitiveType  primitiveType,
dwRendererHandle_t  obj 
)

Renders a set of 3D vertices.

This is equivalent to rendering a RenderBuffer with only xyz positions.

Parameters
[in]bufferSpecifies the buffer to render. The active projection matrix determines the expected range of the vertices.
[in]countNumber of vertices.
[in]primitiveTypeGL primitive type.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderSubTexture()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderSubTexture ( const GLuint  inputTexture,
const GLenum  textureTarget,
const float32_t  minx,
const float32_t  miny,
const float32_t  maxx,
const float32_t  maxy,
dwRendererHandle_t  obj 
)

Renders a subrect of a textured quad on the screen.

If this texture comes from an external device such as a camera, then use GL_TEXTURE_EXTERNAL_OES as the format instead of a regular GL_TEXTURE_2D for the rest.

Parameters
[in]inputTextureSpecifies the GL texture ID to render.
[in]textureTargetSpecifies the GL texture type. Only GL_TEXTURE_2D and GL_TEXTURE_EXTERNAL_OES are supported.
[in]minxSpecifies the smallest value of the x coordinate in -1..1 range.
[in]minySpecifies the smallest value of the y coordinate in -1..1 range.
[in]maxxSpecifies the largest value of the x coordinate in -1..1 range.
[in]maxySpecifies the largest value of the y coordinate in -1..1 range.
[in]objSpecifies a handle to renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_renderText()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderText ( const int32_t  x,
const int32_t  y,
const char *  text,
dwRendererHandle_t  obj 
)

Renders a text line on the screen.

Parameters
[in]xSpecifies the coordinate of the start of the string, in pixel values.
[in]ySpecifies the coordinate of the start of the string, in pixel values.
[in]textSpecifies the text to render.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_renderTextNorm()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderTextNorm ( const float32_t  normX,
const float32_t  normY,
const char *  text,
dwRendererHandle_t  obj 
)

Renders a text line on the screen.

Parameters
[in]normXSpecifies the x coordinate of the start of the string, in 0..1 range.
[in]normYSpecifies the y coordinate of the start of the string, in 0..1 range.
[in]textSpecifies the text to render.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_renderTexture()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_renderTexture ( const GLuint  inputTexture,
const GLenum  textureTarget,
dwRendererHandle_t  obj 
)

Renders a textured quad on the screen.

If this texture comes from an external device such as a camera, then use GL_TEXTURE_EXTERNAL_OES as format instead of a regular GL_TEXTURE_2D for the rest.

Parameters
[in]inputTextureSpecifies the GL texture ID to render.
[in]textureTargetSpecifies the GL texture type. Only GL_TEXTURE_2D and GL_TEXTURE_EXTERNAL_OES are supported.
[in]objSpecifies a handle to the renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_reset()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_reset ( dwRendererHandle_t  renderer)

Resets renderer state.

THis is a Lightweight call that does not destroy or create resources.

Parameters
[in]rendererA pointer to Renderer object to be reset.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_set2DTransform()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_set2DTransform ( const dwMatrix3f matrix,
dwRendererHandle_t  obj 
)

Sets current 2D transformation applied when rendering to the screen.

Parameters
[in]matrixSpecifies the 3x3 matrix containing the 2D rasterization applied to the data being rendered.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setColor()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_setColor ( const dwVector4f  color,
dwRendererHandle_t  obj 
)

Sets current rendering color.

Parameters
[in]colorSpecifies the color as float[4] values in 0..1 range.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setColorMapScale()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_setColorMapScale ( const dwVector3f  colorMapScale,
dwRendererHandle_t  obj 
)

Sets current rendering color mapping scale.

Parameters
[in]colorMapScaleSpecifies a scale factor via float32_t[3] in meters for the saturation range.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS
Note
colorScale[0], colorScale[1] and colorScale[2] to x, y, z respectively. E.g. colorMapScale = {150, 150, std::numeric_limits<double>::infinity()} indicates the color will wrap after 150 meters in the x-y plane.

◆ dwRenderer_setFont()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_setFont ( const dwRendererFonts  value,
dwRendererHandle_t  obj 
)

Sets current font.

Parameters
[in]valueSpecifies the enum value corresponding to the desired valid font.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setLineWidth()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_setLineWidth ( const float32_t  value,
dwRendererHandle_t  obj 
)

Sets current line width, in pixels.

Parameters
[in]valueSpecifies the float value representing the width of a line, in pixels.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setModelView()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_setModelView ( const dwMatrix4f matrix,
dwRendererHandle_t  obj 
)

Sets current ModelView matrix.

Parameters
[in]matrixSpecifies the 4D homogeneous matrix as float[16] col major. OpenGL ModelView matrix.
[in]objSpecifies a handle to the renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setPointSize()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_setPointSize ( const float32_t  value,
dwRendererHandle_t  obj 
)

Sets current point size.

Parameters
[in]valueSpecifies the float value representing the size of a point, in pixels.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setProjection()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_setProjection ( const dwMatrix4f matrix,
dwRendererHandle_t  obj 
)

Sets current projection matrix.

Parameters
[in]matrixSpecifies the 4D homogeneous matrix as float[16] col major. OpenGL projection matrix.
[in]objSpecifies a handle to renderer object.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwRenderer_setRect()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_setRect ( const dwRect  rect,
dwRendererHandle_t  obj 
)

Sets current rendering screen area expressed in pixel values.

Origin of rectangle coordinates is bottom-left.

Parameters
[out]rectSpecifies the structure containing the current react area.
[in]objSpecifies a handle to renderer object.
Returns
DW_SUCCESS

◆ dwRenderer_setViewportAndScissorRects()

DW_VIZ_API_PUBLIC dwStatus dwRenderer_setViewportAndScissorRects ( const dwRect  viewport,
const dwRect  scissor,
dwRendererHandle_t  obj 
)

Sets viewport and scissor rectangles in pixel values.

Origin of rectangle coordinates is bottom-left.

Parameters
[in]viewportSpecifies the desired viewport rectangle.
[in]scissorSpecifies the desired scissor rectangle.
[in]objSpecifies a handle to renderer object.
Returns
DW_SUCCESS

Variable Documentation

◆ DW_RENDER_COLORMAPSCALE_100M

const dwVector3f DW_RENDER_COLORMAPSCALE_100M = {100.0f, 100.0f, 100.0f}

Definition at line 91 of file Renderer.h.

◆ DW_RENDER_COLORMAPSCALE_130M

const dwVector3f DW_RENDER_COLORMAPSCALE_130M = {130.0f, 130.0f, 130.0f}

Definition at line 92 of file Renderer.h.

◆ DW_RENDER_COLORMAPSCALE_150M

const dwVector3f DW_RENDER_COLORMAPSCALE_150M = {150.0f, 150.0f, 150.0f}

Definition at line 93 of file Renderer.h.

◆ DW_RENDER_COLORMAPSCALE_75M

const dwVector3f DW_RENDER_COLORMAPSCALE_75M = {75.0f, 75.0f, 75.0f}

Color map scales - determine the bandwidth of the color spectrum.

Definition at line 90 of file Renderer.h.

◆ DW_RENDERBUFFER_MAX_VIEWS

const uint32_t DW_RENDERBUFFER_MAX_VIEWS = 10
static

The maximal number of views that can be created in with.

See also
dwRenderBuffer_createView().

Definition at line 86 of file Renderer.h.

◆ DW_RENDERER_COLOR_BLACK

const dwVector4f DW_RENDERER_COLOR_BLACK = {0.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f, 1.0f}

Definition at line 75 of file Renderer.h.

◆ DW_RENDERER_COLOR_BLUE

const dwVector4f DW_RENDERER_COLOR_BLUE = {32.0f / 255.0f, 72.0f / 255.0f, 230.0f / 255.0f, 1.0f}

Definition at line 63 of file Renderer.h.

◆ DW_RENDERER_COLOR_CYAN

const dwVector4f DW_RENDERER_COLOR_CYAN = {40.0f / 255.0f, 130.0f / 255.0f, 255.0f / 255.0f, 1.0f}

Definition at line 74 of file Renderer.h.

◆ DW_RENDERER_COLOR_DARKBLUE

const dwVector4f DW_RENDERER_COLOR_DARKBLUE = {45.0f / 255.0f, 44.0f / 255.0f, 100.0f / 255.0f, 0.6f}

Definition at line 70 of file Renderer.h.

◆ DW_RENDERER_COLOR_DARKGREEN

const dwVector4f DW_RENDERER_COLOR_DARKGREEN = {45.0f / 255.0f, 100.0f / 255.0f, 44.0f / 255.0f, 1.0f}

Definition at line 66 of file Renderer.h.

◆ DW_RENDERER_COLOR_DARKGREY

const dwVector4f DW_RENDERER_COLOR_DARKGREY = {72.0f / 255.0f, 72.0f / 255.0f, 72.0f / 255.0f, 1.0f}

Definition at line 69 of file Renderer.h.

◆ DW_RENDERER_COLOR_DARKRED

const dwVector4f DW_RENDERER_COLOR_DARKRED = {180.0f / 255.0f, 5.0f / 255.0f, 0.0f / 255.0f, 1.0f}

Definition at line 61 of file Renderer.h.

◆ DW_RENDERER_COLOR_GREEN

const dwVector4f DW_RENDERER_COLOR_GREEN = {32.0f / 255.0f, 230.0f / 255.0f, 32.0f / 255.0f, 1.0f}

Definition at line 64 of file Renderer.h.

◆ DW_RENDERER_COLOR_LIGHTBLUE

const dwVector4f DW_RENDERER_COLOR_LIGHTBLUE = {51.0f / 255.0f, 153.0f / 255.0f, 255.0f / 255.0f, 0.6f}

Definition at line 73 of file Renderer.h.

◆ DW_RENDERER_COLOR_LIGHTGREEN

const dwVector4f DW_RENDERER_COLOR_LIGHTGREEN = {118.0f / 255.0f, 185.0f / 255.0f, 0.0f / 255.0f, 1.0f}

Definition at line 67 of file Renderer.h.

◆ DW_RENDERER_COLOR_LIGHTGREY

const dwVector4f DW_RENDERER_COLOR_LIGHTGREY = {185.0f / 255.0f, 185.0f / 255.0f, 185.0f / 255.0f, 1.0f}

Definition at line 68 of file Renderer.h.

◆ DW_RENDERER_COLOR_LIGHTPURPLE

const dwVector4f DW_RENDERER_COLOR_LIGHTPURPLE = {181.0f / 255.0f, 138.0f / 255.0f, 242.0f / 255.0f, 1.0f}

Definition at line 76 of file Renderer.h.

◆ DW_RENDERER_COLOR_MAGENTA

const dwVector4f DW_RENDERER_COLOR_MAGENTA = {230.f / 255.f, 25.f / 255.f, 230.f / 255.f, 1.f}

Definition at line 77 of file Renderer.h.

◆ DW_RENDERER_COLOR_NVIDIA_GREEN

const dwVector4f DW_RENDERER_COLOR_NVIDIA_GREEN = {0.4609375f, 0.72265625f, 0.0f, 1.0f}

Definition at line 83 of file Renderer.h.

◆ DW_RENDERER_COLOR_ORANGE

const dwVector4f DW_RENDERER_COLOR_ORANGE = {230.0f / 255.0f, 100.0f / 255.0f, 10.0f / 255.0f, 1.0f}

Definition at line 72 of file Renderer.h.

◆ DW_RENDERER_COLOR_PURPLE

const dwVector4f DW_RENDERER_COLOR_PURPLE = {255.0f / 255.0f, 0.0f / 255.0f, 240.0f / 255.0f, 1.0f}

Definition at line 62 of file Renderer.h.

◆ DW_RENDERER_COLOR_RED

const dwVector4f DW_RENDERER_COLOR_RED = {230.0f / 255.0f, 72.0f / 255.0f, 32.0f / 255.0f, 1.0f}

Definition at line 60 of file Renderer.h.

◆ DW_RENDERER_COLOR_WHITE

const dwVector4f DW_RENDERER_COLOR_WHITE = {255.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f, 1.0f}

Definition at line 65 of file Renderer.h.

◆ DW_RENDERER_COLOR_YELLOW

const dwVector4f DW_RENDERER_COLOR_YELLOW = {230.0f / 255.0f, 230.0f / 255.0f, 10.0f / 255.0f, 1.0f}

Definition at line 71 of file Renderer.h.

◆ DW_RENDERER_DEFAULT_BUFFER_SIZE

const uint32_t DW_RENDERER_DEFAULT_BUFFER_SIZE = 10000
static

The maximum number of vertices that can be passed to a call dwRenderer_renderData3D() or dwRenderer_renderData2D()

Definition at line 169 of file Renderer.h.

◆ DW_RENDERER_HSV_BLUE

const dwVector3f DW_RENDERER_HSV_BLUE = {240.0f, 1.0f, 0.75f}

Definition at line 80 of file Renderer.h.

◆ DW_RENDERER_HSV_PURPLE

const dwVector3f DW_RENDERER_HSV_PURPLE = {270.0f, 1.0f, 0.75f}

Definition at line 81 of file Renderer.h.

◆ DW_RENDERER_HSV_RED

const dwVector3f DW_RENDERER_HSV_RED = {0.0f, 1.0f, 0.75f}

Definition at line 79 of file Renderer.h.