3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
coat.Render Class Reference

Static Public Member Functions

int CreateFBO (int width, int height, image_format format)
 Create frame buffer object.
 
int clear (int fbo_id, any fill_color, bool clear_color=True, bool clear_depth=True, float fill_depth=1)
 Clear the framebuffer object - fill each pixel of the FBO sample with the same data.
 
int draw_on_screen (int texture=1, int left=0, int top=0, int right=0, int bottom=0, int red=255, int green=255, int blue=255, int opacity=255)
 Draw a texture rectangle in the main 3DCoat window.
 
int draw_text (float x, float y, str text, float color_r=1, float color_g=1, float color_b=1, float color_a=1)
 Draw the text in the main 3DCoat window.
 
int CreateGPUTexture (any src_data, image_format format)
 Create a 2D sampler in GPU memory from a numpy array.
 
int GPUTextureFromFile (str file_path, bool Clamp=False, bool Smooth=True, bool swapRB=False, bool Flip=False)
 Create a 2D sampler in GPU memory from a numpy array.
 
bool DeleteGPUTexture (int texture_id)
 Remove sampler from GPU memory.
 
any work_area ()
 3DCoat workspace rectangle (viewport)
 

Member Function Documentation

◆ clear()

int coat.Render.clear ( int fbo_id,
any fill_color,
bool clear_color = True,
bool clear_depth = True,
float fill_depth = 1 )
static

Clear the framebuffer object - fill each pixel of the FBO sample with the same data.

Parameters
fbo_idFBO ID to be filled for clearing
fill_colorColor to fill each pixel
clear_colorDo you want to clear the FBO color? if "true" the color of each pixel will be changed to fill_color, if "false" the color will not be changed.
clear_depthDo you want to clear the FBO depth? if "true" the depth of each pixel will be changed to fill_depth, if "false" the depth will not be changed.
fill_depthDepth value for fill each pixel
Returns
true if successfully

◆ CreateFBO()

int coat.Render.CreateFBO ( int width,
int height,
image_format format )
static

Create frame buffer object.

An FBO is a texture or data that can accept a rendered result

Parameters
widthThe size of the sampler in width
heightThe size of the sampler in height
formatimage_format - enum with the number of channels and the channel type. For example coat.image_format.Rgb8
Returns
texture id - can be used as texture id and as FBO for rendering target

◆ CreateGPUTexture()

int coat.Render.CreateGPUTexture ( any src_data,
image_format format )
static

Create a 2D sampler in GPU memory from a numpy array.

Parameters
src_datanumpy array from which the 2d sampler will be created. A numpy array must have the correct width and height, type and number of channels as in OpenCV
formatThe texture type must match the numpy structure and type. For example coat.image_format.Rgb8
Returns
the texture id of the new sampler

◆ DeleteGPUTexture()

bool coat.Render.DeleteGPUTexture ( int texture_id)
static

Remove sampler from GPU memory.

Parameters
texture_idTexture ID
Returns
true if successfully

◆ draw_on_screen()

int coat.Render.draw_on_screen ( int texture = 1,
int left = 0,
int top = 0,
int right = 0,
int bottom = 0,
int red = 255,
int green = 255,
int blue = 255,
int opacity = 255 )
static

Draw a texture rectangle in the main 3DCoat window.

Parameters
textureThe ID of the texture that will be rendered
leftThe position of the left side of the rendered texture on the screen
topThe position of the top side of the rendered texture on the screen
rightThe position of the right side of the rendered texture on the screen
bottomThe position of the bottom side of the rendered texture on the screen
redMultiplier for the red channel of the texture
greenMultiplier for the green channel of the texture
blueMultiplier for the blue channel of the texture
Returns
true if successfully

◆ draw_text()

int coat.Render.draw_text ( float x,
float y,
str text,
float color_r = 1,
float color_g = 1,
float color_b = 1,
float color_a = 1 )
static

Draw the text in the main 3DCoat window.

Parameters
xThe position of the left side of the text block
yThe position of the top side of the text block
textThe content of the text block you want to display
color_rValue of the red channel of the text color
color_gValue of the gleen channel of the text color
color_bValue of the blue channel of the text color
color_aOpacity of the rendered text
Returns
true if successfully

◆ GPUTextureFromFile()

int coat.Render.GPUTextureFromFile ( str file_path,
bool Clamp = False,
bool Smooth = True,
bool swapRB = False,
bool Flip = False )
static

Create a 2D sampler in GPU memory from a numpy array.

Returns
the texture id of the new sampler

◆ work_area()

any coat.Render.work_area ( )
static

3DCoat workspace rectangle (viewport)


The documentation for this class was generated from the following file: