ailiaFormatConvert method
~japanese @brief 画像のフォーマットを変換します。 @param dst 変換後画像の格納先(numeric型、sizeof(float) * dst_width * dst_height * チャンネル数(解説参照)以上のサイズを確保すること) @param dst_width 変換後画像の横幅 @param dst_height 変換後画像の高さ @param dst_format 変換後画像の形式 (AILIA_NETWORK_IMAGE_FORMAT_) @param dst_channel 変換後画像のチャンネル順 (AILIA_NETWORK_IMAGE_CHANNEL_) @param dst_range 変換後画像のレンジ (AILIA_NETWORK_IMAGE_RANGE_) @param src 変換元画像の格納先(32bpp) @param src_stride 変換元画像のラインバイト数 @param src_width 変換元画像の横幅 @param src_height 変換元画像の高さ @param src_format 変換元画像の形式 (AILIA_IMAGE_FORMAT_) @return 成功した場合は \ref AILIA_STATUS_SUCCESS 、そうでなければエラーコードを返す。 @details 画像フォーマットを変更します。dst_formatが \ref AILIA_NETWORK_IMAGE_FORMAT_BGR もしくはAILIA_NETWORK_IMAGE_FORMAT_RGB の場合、チャンネル数は3, \ref AILIA_NETWORK_IMAGE_FORMAT_GRAY の場合チャンネル数は1となります。
~english @brief Converts image formats. @param dst The storage location of the image after conversion (numeric type; a size of sizeof(float)
- dst_width * dst_height * num_of_channel(See Description) or more must be allocated.) @param dst_width The width of the image after conversion @param dst_height The height of the image after conversion @param dst_format The format of the image after conversion (AILIA_NETWORK_IMAGE_FORMAT_) @param dst_channel The channel order of the image after conversion (AILIA_NETWORK_IMAGE_CHANNEL_) @param dst_range The range of the image after conversion (AILIA_NETWORK_IMAGE_RANGE_) @param src The storage location of the source image (32 bpp) @param src_stride The line byte number of the source image @param src_width The width of the source image @param src_height The height of the source image @param src_format The format of the source image (AILIA_IMAGE_FORMAT_) @return If this function is successful, it returns \ref AILIA_STATUS_SUCCESS , or an error code otherwise. @details This function converts image formats. If dst_format is set to \ref AILIA_NETWORK_IMAGE_FORMAT_BGR or \ref AILIA_NETWORK_IMAGE_FORMAT_RGB , the number of channels is 3, otherwise if set to \ref AILIA_NETWORK_IMAGE_FORMAT_GRAY , the number of channels is 1.
Implementation
int ailiaFormatConvert(
ffi.Pointer<ffi.Void> dst,
int dst_width,
int dst_height,
int dst_format,
int dst_channel,
int dst_range,
ffi.Pointer<ffi.Void> src,
int src_stride,
int src_width,
int src_height,
int src_format,
) {
return _ailiaFormatConvert(
dst,
dst_width,
dst_height,
dst_format,
dst_channel,
dst_range,
src,
src_stride,
src_width,
src_height,
src_format,
);
}