Display
Display関連の関数は、画像を簡単かつ高速に表示する手段を提供します。 詳細...
データ構造
| struct | IC4_DISPLAY_STATS Displayの統計情報を格納する構造体です。 詳細... |
| struct | IC4_DISPLAY 画像表示に使用できるDisplayを表します。 詳細... |
マクロ
| #define | IC4_WINDOW_HANDLE_NULL platform_specific 無効なウィンドウハンドル値です。 |
型定義
| typedef platform_specific | IC4_WINDOW_HANDLE 親として使用するウィンドウハンドルです。 |
| typedef void(* | ic4_display_window_closed_handler) (struct IC4_DISPLAY *pDisplay, void *user_ptr) ウィンドウクローズハンドラ用の関数ポインタです。 |
| typedef void(* | ic4_display_window_closed_deleter) (void *user_ptr) デバイスロストのユーザーデータをクリーンアップするための関数ポインタです。 |
列挙
| enum | IC4_DISPLAY_TYPE { IC4_DISPLAY_DEFAULT
, IC4_DISPLAY_WIN32_OPENGL
} 使用可能なDisplayの種類を定義します。 詳細... |
| enum | IC4_DISPLAY_RENDER_POSITION { IC4_DISPLAY_RENDER_POSITION_TOPLEFT , IC4_DISPLAY_RENDER_POSITION_CENTER , IC4_DISPLAY_RENDER_POSITION_STRETCH_TOPLEFT , IC4_DISPLAY_RENDER_POSITION_STRETCH_CENTER , IC4_DISPLAY_RENDER_POSITION_CUSTOM } 使用可能なDisplayの配置およびストレッチモードを示します。 詳細... |
関数
| bool | ic4_display_create (enum IC4_DISPLAY_TYPE type, IC4_WINDOW_HANDLE parent, struct IC4_DISPLAY **ppDisplay) 新しいDisplayを作成します。 |
| bool | ic4_display_create_external_opengl (struct IC4_DISPLAY **ppDisplay) 新しい外部OpenGL Displayを作成します。 |
| struct IC4_DISPLAY * | ic4_display_ref (struct IC4_DISPLAY *pDisplay) Displayの内部参照カウントを1つ増やします。 |
| void | ic4_display_unref (struct IC4_DISPLAY *pDisplay) Displayの内部参照カウントを1つ減らします。 |
| bool | ic4_display_display_buffer (struct IC4_DISPLAY *pDisplay, const struct IC4_IMAGE_BUFFER *buffer) 特定のImageBufferを表示します。 |
| bool | ic4_display_get_stats (struct IC4_DISPLAY *pDisplay, struct IC4_DISPLAY_STATS *stats) Displayの統計情報を取得します。 |
| bool | ic4_display_set_render_position (struct IC4_DISPLAY *pDisplay, enum IC4_DISPLAY_RENDER_POSITION pos, int left, int top, int width, int height) Displayの画像スケーリングおよび配置オプションを設定します。 |
| bool | ic4_display_event_add_window_closed (struct IC4_DISPLAY *pDisplay, ic4_display_window_closed_handler handler, void *user_ptr, ic4_display_window_closed_deleter deleter) Displayが閉じられたときに呼び出されるコールバックを登録します。 |
| bool | ic4_display_event_remove_window_closed (struct IC4_DISPLAY *pDisplay, ic4_display_window_closed_handler handler, void *user_ptr) ic4_display_event_add_window_closed()で以前登録したDisplayクローズハンドラの登録を解除します。 |
| bool | ic4_display_external_opengl_initialize (struct IC4_DISPLAY *pDisplay) 外部OpenGL Displayを初期化します。 |
| bool | ic4_display_external_opengl_render (struct IC4_DISPLAY *pDisplay, int width, int height) 外部OpenGL Displayを利用可能な最新の画像で更新します。 |
| bool | ic4_display_external_opengl_notify_window_closed (struct IC4_DISPLAY *pDisplay) ウィンドウが閉じられたことを外部OpenGL Displayコンポーネントに通知します。 |
詳細説明
Display関連の関数は、画像を簡単かつ高速に表示する手段を提供します。
Displayを作成するには、ic4_display_create()を呼び出します。
マクロ定義ドキュメント
◆ IC4_WINDOW_HANDLE_NULL
| #define IC4_WINDOW_HANDLE_NULL platform_specific |
無効なウィンドウハンドル値です。
この値を関数に渡すと、親ウィンドウが設定されていないことを指定します。
IC4_WINDOW_HANDLE_NULLの値はプラットフォーム固有です。
型定義ドキュメント
◆ ic4_display_window_closed_deleter
| typedef void(* ic4_display_window_closed_deleter) (void *user_ptr) |
デバイスロストのユーザーデータをクリーンアップするための関数ポインタです。
- パラメータ
-
[in] user_ptr ic4_grabber_event_add_device_lost()の呼び出し時に指定したユーザーデータ
◆ ic4_display_window_closed_handler
| typedef void(* ic4_display_window_closed_handler) (struct IC4_DISPLAY *pDisplay, void *user_ptr) |
ウィンドウクローズハンドラ用の関数ポインタです。
- パラメータ
-
[in] pDisplay ウィンドウが閉じられたDisplayへのポインタ [in] user_ptr ic4_display_event_add_window_closed()の呼び出し時に指定したユーザーデータ
◆ IC4_WINDOW_HANDLE
| typedef platform_specific IC4_WINDOW_HANDLE |
親として使用するウィンドウハンドルです。
IC4_WINDOW_HANDLEの型はプラットフォーム固有です。
列挙型ドキュメント
◆ IC4_DISPLAY_RENDER_POSITION
使用可能なDisplayの配置およびストレッチモードを示します。
◆ IC4_DISPLAY_TYPE
| enum IC4_DISPLAY_TYPE |
関数ドキュメント
◆ ic4_display_create()
| bool ic4_display_create | ( | enum IC4_DISPLAY_TYPE | type, |
| IC4_WINDOW_HANDLE | parent, | ||
| struct IC4_DISPLAY ** | ppDisplay | ||
| ) |
新しいDisplayを作成します。
- パラメータ
-
[in] type 作成するDisplayの種類 [in] parent Displayを埋め込む親ウィンドウのハンドル。 [out] ppDisplay 新しいDisplayオブジェクトのハンドルを受け取るポインタ。
Displayが不要になったら、ic4_display_unref()を使用してオブジェクト参照を解放してください。
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
- 警告
- この関数はWindowsプラットフォームでのみ動作します。その他のプラットフォームではic4_display_create_external_opengl()を使用してください。
◆ ic4_display_create_external_opengl()
| bool ic4_display_create_external_opengl | ( | struct IC4_DISPLAY ** | ppDisplay | ) |
新しい外部OpenGL Displayを作成します。
- パラメータ
-
[out] ppDisplay 新しいDisplayオブジェクトのハンドルを受け取るポインタ。
Displayが不要になったら、ic4_display_unref()を使用してオブジェクト参照を解放してください。
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
- 備考
- 外部レンダラを使用するには、アプリケーションは次の手順に従う必要があります:
- 通常はアプリケーションのUIツールキットを使用してOpenGLウィンドウを作成します
- アクティブなスレッドでOpenGLコンテキストを有効にした状態でic4_display_external_opengl_initializeを呼び出します
- アクティブなスレッドでOpenGLコンテキストを有効にした状態でic4_display_external_opengl_renderを繰り返し呼び出します
◆ ic4_display_display_buffer()
| bool ic4_display_display_buffer | ( | struct IC4_DISPLAY * | pDisplay, |
| const struct IC4_IMAGE_BUFFER * | buffer | ||
| ) |
特定のImageBufferを表示します。
- パラメータ
-
[in] pDisplay Display [in] buffer 表示するバッファ
- 備考
- この関数を呼び出す必要は必ずしもありません。
ic4_grabber_set_display()を使用してDisplayをIC4_GRABBERに登録すると、画像は自動的に表示されます。
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
- 備考
- bufferが
NULLの場合、Displayはクリアされ、以前のバッファは表示されなくなります。
◆ ic4_display_event_add_window_closed()
| bool ic4_display_event_add_window_closed | ( | struct IC4_DISPLAY * | pDisplay, |
| ic4_display_window_closed_handler | handler, | ||
| void * | user_ptr, | ||
| ic4_display_window_closed_deleter | deleter | ||
| ) |
Displayが閉じられたときに呼び出されるコールバックを登録します。
- パラメータ
-
[in] pDisplay Display [in] handler Displayが閉じられたときに呼び出される関数 [in] user_ptr handlerの呼び出し時に渡されるユーザーデータ。 [in] deleter ハンドラの登録が解除され、user_ptrが不要になったときに呼び出される関数。
deleter関数は、user_ptrに関連付けられたデータを解放するために使用できます。
deleter関数は、Displayクローズハンドラの登録が解除されたとき、またはDisplayオブジェクト自体が破棄されたときに呼び出されます。
- 注意
- Displayクローズハンドラの登録を解除するには、ic4_display_event_remove_window_closed()を呼び出します。
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
◆ ic4_display_event_remove_window_closed()
| bool ic4_display_event_remove_window_closed | ( | struct IC4_DISPLAY * | pDisplay, |
| ic4_display_window_closed_handler | handler, | ||
| void * | user_ptr | ||
| ) |
ic4_display_event_add_window_closed()で以前登録したDisplayクローズハンドラの登録を解除します。
- パラメータ
-
[in] pDisplay コールバックが現在登録されているDisplay [in] handler 登録を解除する関数へのポインタ [in] user_ptr 関数が以前登録された際のユーザーデータ
- 注意
- handlerとuser_ptrのペアは、ic4_display_event_add_window_closed()の呼び出しで使用したパラメータと完全に一致する必要があります。
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
◆ ic4_display_external_opengl_initialize()
| bool ic4_display_external_opengl_initialize | ( | struct IC4_DISPLAY * | pDisplay | ) |
外部OpenGL Displayを初期化します。
- パラメータ
-
[in] pDisplay 外部OpenGL Display
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
- 備考
- この関数は、実行スレッドでOpenGLコンテキストを有効にした状態で呼び出す必要があります(例:
makeCurrent)。
◆ ic4_display_external_opengl_notify_window_closed()
| bool ic4_display_external_opengl_notify_window_closed | ( | struct IC4_DISPLAY * | pDisplay | ) |
ウィンドウが閉じられたことを外部OpenGL Displayコンポーネントに通知します。
- パラメータ
-
[in] pDisplay 外部OpenGL Display
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
◆ ic4_display_external_opengl_render()
| bool ic4_display_external_opengl_render | ( | struct IC4_DISPLAY * | pDisplay, |
| int | width, | ||
| int | height | ||
| ) |
外部OpenGL Displayを利用可能な最新の画像で更新します。
- パラメータ
-
[in] pDisplay 外部OpenGL Display [in] width Displayウィンドウの物理ピクセル単位の幅 [in] height Displayウィンドウの物理ピクセル単位の高さ
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
- 備考
- この関数は、実行スレッドでOpenGLコンテキストを有効にした状態で呼び出す必要があります(例:
makeCurrent)。
◆ ic4_display_get_stats()
| bool ic4_display_get_stats | ( | struct IC4_DISPLAY * | pDisplay, |
| struct IC4_DISPLAY_STATS * | stats | ||
| ) |
Displayの統計情報を取得します。
- パラメータ
-
[in] pDisplay Display [out] stats Displayの統計情報を受け取るIC4_DISPLAY_STATS構造体へのポインタ
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
◆ ic4_display_ref()
| struct IC4_DISPLAY * ic4_display_ref | ( | struct IC4_DISPLAY * | pDisplay | ) |
Displayの内部参照カウントを1つ増やします。
- パラメータ
-
[in] pDisplay Displayへのポインタ
- 戻り値
- pDisplayで渡されたポインタ
- 備考
- pDisplayが
NULLの場合、この関数はNULLを返します。エラー値は設定されません。
◆ ic4_display_set_render_position()
| bool ic4_display_set_render_position | ( | struct IC4_DISPLAY * | pDisplay, |
| enum IC4_DISPLAY_RENDER_POSITION | pos, | ||
| int | left, | ||
| int | top, | ||
| int | width, | ||
| int | height | ||
| ) |
Displayの画像スケーリングおよび配置オプションを設定します。
- パラメータ
-
[in] pDisplay Display [in] pos 使用するスケーリングおよび配置モード [in] left Displayウィンドウ内のターゲット矩形の左座標 [in] top Displayウィンドウ内のターゲット矩形の上座標 [in] width Displayウィンドウ内のターゲット矩形の幅 [in] height Displayウィンドウ内のターゲット矩形の高さ
- 備考
- left、top、width、heightの各パラメータは、posが
IC4_DISPLAY_RENDER_POSITION_CUSTOMでない限り無視されます。
- 戻り値
- 成功した場合は
true、それ以外の場合はfalse。
ic4_get_last_error()を使用してエラー情報を取得してください。
◆ ic4_display_unref()
| void ic4_display_unref | ( | struct IC4_DISPLAY * | pDisplay | ) |
Displayの内部参照カウントを1つ減らします。
参照カウントがゼロに達すると、オブジェクトは破棄されます。
- パラメータ
-
[in] pDisplay Displayへのポインタ
- 備考
- pDisplayが
NULLの場合、この関数は何も行いません。エラー値は設定されません。
- 関連項目
- ic4_display_ref


