Forge

Functions

FGAPI fg_err fg_create_image (fg_image *pImage, const unsigned pWidth, const unsigned pHeight, const fg_channel_format pFormat, const fg_dtype pType)
 Create a Image object. More...
 
FGAPI fg_err fg_destroy_image (fg_image pImage)
 Destroy image object. More...
 
FGAPI fg_err fg_set_image_alpha (fg_image pImage, const float pAlpha)
 Set a global alpha value for rendering the image. More...
 
FGAPI fg_err fg_set_image_aspect_ratio (fg_image pImage, const bool pKeepRatio)
 Set option to inform whether to maintain aspect ratio of original image. More...
 
FGAPI fg_err fg_get_image_width (unsigned *pOut, const fg_image pImage)
 Get the width of the image. More...
 
FGAPI fg_err fg_get_image_height (unsigned *pOut, const fg_image pImage)
 Get the height of the image. More...
 
FGAPI fg_err fg_get_image_pixelformat (fg_channel_format *pOut, const fg_image pImage)
 Get the channel format of the image. More...
 
FGAPI fg_err fg_get_image_type (fg_dtype *pOut, const fg_image pImage)
 Get the pixel data type of the image. More...
 
FGAPI fg_err fg_get_pixel_buffer (unsigned *pOut, const fg_image pImage)
 Get the image buffer resource identifier. More...
 
FGAPI fg_err fg_get_image_size (unsigned *pOut, const fg_image pImage)
 Get the image buffer size in bytes. More...
 
FGAPI fg_err fg_render_image (const fg_window pWindow, const fg_image pImage, const int pX, const int pY, const int pWidth, const int pHeight)
 Render the image to given window. More...
 

Detailed Description

Function Documentation

◆ fg_create_image()

FGAPI fg_err fg_create_image ( fg_image pImage,
const unsigned  pWidth,
const unsigned  pHeight,
const fg_channel_format  pFormat,
const fg_dtype  pType 
)

Create a Image object.

Parameters
[out]pImagewill be set to created Image object
[in]pWidthWidth of the image
[in]pHeightHeight of the image
[in]pFormatColor channel format of image, uses one of the values of fg_channel_format
[in]pTypetakes one of the values of fg_dtype that indicates the integral data type of histogram data
Returns
fg_err error code

◆ fg_destroy_image()

FGAPI fg_err fg_destroy_image ( fg_image  pImage)

Destroy image object.

Parameters
[in]pImageis the image handle
Returns
fg_err error code

◆ fg_get_image_height()

FGAPI fg_err fg_get_image_height ( unsigned *  pOut,
const fg_image  pImage 
)

Get the height of the image.

Parameters
[out]pOutwill be set to the height of the image
[in]pImageis the image handle
Returns
fg_err error code

◆ fg_get_image_pixelformat()

FGAPI fg_err fg_get_image_pixelformat ( fg_channel_format pOut,
const fg_image  pImage 
)

Get the channel format of the image.

Parameters
[out]pOutwill be set to the channel format of the image
[in]pImageis the image handle
Returns
fg_err error code

◆ fg_get_image_size()

FGAPI fg_err fg_get_image_size ( unsigned *  pOut,
const fg_image  pImage 
)

Get the image buffer size in bytes.

Parameters
[out]pOutwill be set to the image buffer size in bytes
[in]pImageis the image handle
Returns
fg_err error code

◆ fg_get_image_type()

FGAPI fg_err fg_get_image_type ( fg_dtype pOut,
const fg_image  pImage 
)

Get the pixel data type of the image.

Parameters
[out]pOutwill be set to the pixel data type of the image
[in]pImageis the image handle
Returns
fg_err error code

◆ fg_get_image_width()

FGAPI fg_err fg_get_image_width ( unsigned *  pOut,
const fg_image  pImage 
)

Get the width of the image.

Parameters
[out]pOutwill be set to the width of the image
[in]pImageis the image handle
Returns
fg_err error code

◆ fg_get_pixel_buffer()

FGAPI fg_err fg_get_pixel_buffer ( unsigned *  pOut,
const fg_image  pImage 
)

Get the image buffer resource identifier.

Parameters
[out]pOutwill be set to the image resource identifier
[in]pImageis the image handle
Returns
fg_err error code

◆ fg_render_image()

FGAPI fg_err fg_render_image ( const fg_window  pWindow,
const fg_image  pImage,
const int  pX,
const int  pY,
const int  pWidth,
const int  pHeight 
)

Render the image to given window.

Parameters
[in]pWindowis target window to where image will be rendered
[in]pImageis the image handle
[in]pXis x coordinate of origin of viewport in window coordinates
[in]pYis y coordinate of origin of viewport in window coordinates
[in]pWidthis the width of the viewport
[in]pHeightis the height of the viewport
Returns
fg_err error code

◆ fg_set_image_alpha()

FGAPI fg_err fg_set_image_alpha ( fg_image  pImage,
const float  pAlpha 
)

Set a global alpha value for rendering the image.

Parameters
[in]pImageis the image handle
[in]pAlpha
Returns
fg_err error code

◆ fg_set_image_aspect_ratio()

FGAPI fg_err fg_set_image_aspect_ratio ( fg_image  pImage,
const bool  pKeepRatio 
)

Set option to inform whether to maintain aspect ratio of original image.

Parameters
[in]pImageis the image handle
[in]pKeepRatioinforms the image object if original aspect ratio has to be maintained
Returns
fg_err error code