タイトル通りなのですがHEICファイルを.jpeg jpg,pngファイル等の形式に変更して保存するにはどうすればいいのでしょうか?リファレンスサイトなどの情報がヒットせずやり方が一切わかりません。提示サイトですがAPIの部分に少しだけ説明がりますがファイルの保存等のやり方が乗っていないのでわかりません。
知りたいこと
HEICファイルを.jpeg jpg,pngファイル等の形式に変更して保存のに使う関数類
README.md: https://github.com/strukturag/libheif/blob/master/README.md
関数リファレンス?: https://cykooz.github.io/libheif-sys/libheif_sys/
関数リファレンス?: https://www.digikam.org/api/heif_8h.html
Githu検索: https://github.com/search?l=C%2B%2B&q=org%3Astrukturag+libheif&type=Code
cpp
1#include <SDL2/SDL.h> 2#include <libheif/heif.h> 3 4int main(int argc,char* argv[]) 5{ 6 heif_context* ctx = heif_context_alloc(); 7 heif_context_read_from_file(ctx, "IMG.HEIC", nullptr); 8 9 // get a handle to the primary image 10 heif_image_handle* handle; 11 heif_context_get_primary_image_handle(ctx, &handle); 12 13 // decode the image and convert colorspace to RGB, saved as 24bit interleaved 14 heif_image* img; 15 heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_RGB, nullptr); 16 17 int stride = 0; 18 const uint8_t* data = heif_image_get_plane_readonly(img, heif_channel_interleaved, &stride); 19 20 //heif_context_write_to_file(context, "output.heic"); 21 22 23 return 0; 24 25}
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。