|
Photon Engine C API 2.0.0-beta
A physically based renderer.
|
#include "ph_c_core.h"#include "Api/api_helpers.h"#include <ph_core.h>#include <Api/ApiDatabase.h>#include <Common/assertion.h>#include <Common/config.h>#include <Common/logging.h>#include <Common/profiling.h>#include <Common/memory.h>#include <Core/Engine.h>#include <Core/Receiver/Receiver.h>#include <Core/Renderer/Renderer.h>#include <Core/Renderer/RenderRegionStatus.h>#include <Api/test_scene.h>#include <Math/TArithmeticArray.h>#include <DataIO/FileSystem/Path.h>#include <DataIO/io_utils.h>#include <Api/ApiHelper.h>#include <Frame/frame_utils.h>#include <Frame/TFrame.h>#include <Frame/PictureMeta.h>#include <Common/io_exceptions.h>#include <Utility/ByteBuffer.h>#include <Utility/utility.h>#include <memory>#include <iostream>#include <cstring>#include <cstddef>#include <array>Functions | |
| PH_DEFINE_INTERNAL_LOG_GROUP (CAPI, Engine) | |
| void | phConfigRendererResourceDirectory (const PhChar *const directory) |
| PhBool | phInit () |
| PhBool | phExit () |
| void | phCreateEngine (PhUInt64 *const out_engineId, const PhUInt32 numRenderThreads) |
| Creates an engine. | |
| void | phSetNumRenderThreads (const PhUInt64 engineId, const PhUInt32 numRenderThreads) |
| void | phDeleteEngine (const PhUInt64 engineId) |
| void | phEnterCommand (const PhUInt64 engineId, const PhChar *const commandFragment) |
| PhBool | phLoadCommands (const PhUInt64 engineId, const PhChar *const filePath) |
| void | phRender (const PhUInt64 engineId) |
| void | phUpdate (const PhUInt64 engineId) |
| void | phAquireFrame (const PhUInt64 engineId, const PhUInt64 channelIndex, const PhUInt64 frameId) |
| void | phAquireFrameRaw (const PhUInt64 engineId, const PhUInt64 channelIndex, const PhUInt64 frameId) |
| void | phGetRenderDimension (const PhUInt64 engineId, PhUInt32 *const out_widthPx, PhUInt32 *const out_heightPx) |
| void | phGetObservableRenderData (const PhUInt64 engineId, struct PHObservableRenderData *const out_data) |
| void | phCreateFrame (PhUInt64 *const out_frameId, const PhUInt32 widthPx, const PhUInt32 heightPx) |
| void | phGetFrameDimension (const PhUInt64 frameId, PhUInt32 *const out_widthPx, PhUInt32 *const out_heightPx) |
| void | phGetFrameRgbData (const PhUInt64 frameId, const PhFloat32 **const out_data) |
| void | phDeleteFrame (const PhUInt64 frameId) |
| PhBool | phLoadFrame (PhUInt64 frameId, const PhChar *const filePath) |
| PhBool | phSaveFrame (const PhUInt64 frameId, const PhChar *filePath, const PhFrameSaveInfo *saveInfo) |
| Save a frame to the filesystem. | |
| PhBool | phSaveFrameToBuffer (const PhUInt64 frameId, const PhUInt64 bufferId, const PhBufferFormat format, const PhFrameSaveInfo *saveInfo) |
| Save a frame to a buffer. | |
| void | phFrameOpAbsDifference (const PhUInt64 frameAId, const PhUInt64 frameBId, const PhUInt64 resultFrameId) |
| PhFloat32 | phFrameOpMSE (const PhUInt64 expectedFrameId, const PhUInt64 estimatedFrameId) |
| void | phAsyncGetRenderProgress (PhUInt64 engineId, PhRenderProgress *out_progress) |
| void | phAsyncGetRenderStatistics (const PhUInt64 engineId, PhFloat32 *const out_percentageProgress, PhFloat32 *const out_samplesPerSecond) |
| void | phAsyncGetRenderState (const PhUInt64 engineId, struct PHRenderState *const out_state) |
| PhBool | phAsyncPollUpdatedFrameRegion (PhUInt64 engineId, PhFrameRegionInfo *out_regionInfo) |
| Polls for a single changed region during engine runtime. | |
| PhSize | phAsyncPollUpdatedFrameRegions (PhUInt64 engineId, PhUInt64 bufferId, PhFrameRegionInfo *out_regionInfos, PhSize maxRegionInfos) |
| Polls for multiple changed regions during engine runtime. | |
| PhSize | phAsyncPollMergedUpdatedFrameRegions (PhUInt64 engineId, PhUInt64 bufferId, PhSize mergeSize, PhFrameRegionInfo *out_regionInfos, PhSize maxRegionInfos) |
| Polls for multiple changed regions during engine runtime. | |
| void | phAsyncPeekFrame (PhUInt64 engineId, PhUInt64 layerIndex, PhUInt32 xPx, PhUInt32 yPx, PhUInt32 widthPx, PhUInt32 heightPx, PhUInt64 frameId) |
| void | phAsyncPeekFrameRaw (PhUInt64 engineId, PhUInt64 layerIndex, PhUInt32 xPx, PhUInt32 yPx, PhUInt32 widthPx, PhUInt32 heightPx, PhUInt64 frameId) |
| void | phSetWorkingDirectory (const PhUInt64 engineId, const PhChar *const workingDirectory) |
| void | phCreateBuffer (PhUInt64 *const out_bufferId) |
| void | phGetBufferBytes (const PhUInt64 bufferId, const PhUChar **const out_bytesPtr, PhSize *const out_numBytes) |
| void | phDeleteBuffer (const PhUInt64 bufferId) |
| PH_DEFINE_INTERNAL_LOG_GROUP | ( | CAPI | , |
| Engine | ) |
| void phAquireFrameRaw | ( | const PhUInt64 | engineId, |
| const PhUInt64 | channelIndex, | ||
| const PhUInt64 | frameId ) |
| void phAsyncGetRenderProgress | ( | PhUInt64 | engineId, |
| PhRenderProgress * | out_progress ) |
| void phAsyncGetRenderState | ( | const PhUInt64 | engineId, |
| struct PHRenderState *const | out_state ) |
| void phAsyncGetRenderStatistics | ( | const PhUInt64 | engineId, |
| PhFloat32 *const | out_percentageProgress, | ||
| PhFloat32 *const | out_samplesPerSecond ) |
| void phAsyncPeekFrame | ( | PhUInt64 | engineId, |
| PhUInt64 | layerIndex, | ||
| PhUInt32 | xPx, | ||
| PhUInt32 | yPx, | ||
| PhUInt32 | widthPx, | ||
| PhUInt32 | heightPx, | ||
| PhUInt64 | frameId ) |
| void phAsyncPeekFrameRaw | ( | PhUInt64 | engineId, |
| PhUInt64 | layerIndex, | ||
| PhUInt32 | xPx, | ||
| PhUInt32 | yPx, | ||
| PhUInt32 | widthPx, | ||
| PhUInt32 | heightPx, | ||
| PhUInt64 | frameId ) |
| PhSize phAsyncPollMergedUpdatedFrameRegions | ( | PhUInt64 | engineId, |
| PhUInt64 | bufferId, | ||
| PhSize | mergeSize, | ||
| PhFrameRegionInfo * | out_regionInfos, | ||
| PhSize | maxRegionInfos ) |
Polls for multiple changed regions during engine runtime.
| out_regionInfos | Output buffer for storing the updated regions. The size of the buffer also determines the maximum number of regions that will participate in the merging process. |
| mergeSize | Number of regions to merge to a single unit. To obtain a single region, you can specify a number greater or equal to the size of the output buffer. |
| PhBool phAsyncPollUpdatedFrameRegion | ( | PhUInt64 | engineId, |
| PhFrameRegionInfo * | out_regionInfo ) |
Polls for a single changed region during engine runtime.
| PhSize phAsyncPollUpdatedFrameRegions | ( | PhUInt64 | engineId, |
| PhUInt64 | bufferId, | ||
| PhFrameRegionInfo * | out_regionInfos, | ||
| PhSize | maxRegionInfos ) |
Polls for multiple changed regions during engine runtime.
| void phConfigRendererResourceDirectory | ( | const PhChar *const | directory | ) |
| void phCreateBuffer | ( | PhUInt64 *const | out_bufferId | ) |
Creates an engine.
| void phDeleteBuffer | ( | const PhUInt64 | bufferId | ) |
| void phDeleteEngine | ( | const PhUInt64 | engineId | ) |
| void phDeleteFrame | ( | const PhUInt64 | frameId | ) |
| PhBool phExit | ( | ) |
| void phFrameOpAbsDifference | ( | const PhUInt64 | frameAId, |
| const PhUInt64 | frameBId, | ||
| const PhUInt64 | resultFrameId ) |
| void phGetBufferBytes | ( | const PhUInt64 | bufferId, |
| const PhUChar **const | out_bytesPtr, | ||
| PhSize *const | out_numBytes ) |
| void phGetFrameDimension | ( | const PhUInt64 | frameId, |
| PhUInt32 *const | out_widthPx, | ||
| PhUInt32 *const | out_heightPx ) |
| void phGetObservableRenderData | ( | const PhUInt64 | engineId, |
| struct PHObservableRenderData *const | out_data ) |
| void phGetRenderDimension | ( | const PhUInt64 | engineId, |
| PhUInt32 *const | out_widthPx, | ||
| PhUInt32 *const | out_heightPx ) |
| PhBool phInit | ( | ) |
| void phRender | ( | const PhUInt64 | engineId | ) |
| PhBool phSaveFrame | ( | const PhUInt64 | frameId, |
| const PhChar * | filePath, | ||
| const PhFrameSaveInfo * | saveInfo ) |
Save a frame to the filesystem.
| PhBool phSaveFrameToBuffer | ( | PhUInt64 | frameId, |
| PhUInt64 | bufferId, | ||
| PhBufferFormat | format, | ||
| const PhFrameSaveInfo * | saveInfo ) |
Save a frame to a buffer.
| saveInBigEndian | If applicable to the format, specifies whether the result is saved in big endian. This is useful, for example, transferring the data through the Internet, where big-endian is the standard byte order. |
| void phUpdate | ( | const PhUInt64 | engineId | ) |