Expand description
Foreign Function Interface (FFI) bindings to LibRaw C API
This module provides safe Rust bindings to the LibRaw C library functions. LibRaw is a library for reading RAW files from digital cameras.
The bindings include:
- Core initialization and cleanup functions
- File opening and processing operations
- Thumbnail extraction functionality
- Memory management helpers
- Error code constants and utilities
Structs§
Enums§
Constants§
- LIBRAW_
BAD_ CROP - 错误的裁剪参数
- LIBRAW_
CANCELLED_ BY_ CALLBACK - 操作被回调取消
- LIBRAW_
DATA_ ERROR - 数据错误(损坏的文件)
- LIBRAW_
FILE_ UNSUPPORTED - 不支持的文件格式
- LIBRAW_
IMAGE_ BITMAP - 位图格式图像(未压缩的 RGB 数据)
- LIBRAW_
IMAGE_ JPEG - JPEG 格式图像
- LIBRAW_
INPUT_ CLOSED - 输入已关闭
- LIBRAW_
INSUFFICIENT_ MEMORY - 内存不足
- LIBRAW_
IO_ ERROR - I/O 错误(读写失败)
- LIBRAW_
MEMPOOL_ OVERFLOW - 内存池溢出
- LIBRAW_
NO_ THUMBNAIL - 没有缩略图
- LIBRAW_
OPIONS_ NO_ DATAERR_ CALLBACK - 禁用数据错误回调
- LIBRAW_
OPIONS_ NO_ MEMERR_ CALLBACK - 禁用内存错误回调
- LIBRAW_
OPTIONS_ NONE - 无特殊选项
- LIBRAW_
OUT_ OF_ ORDER_ CALL - 函数调用顺序错误
- LIBRAW_
REQUEST_ FOR_ NONEXISTENT_ IMAGE - 请求不存在的图像
- LIBRAW_
SUCCESS - 操作成功
- LIBRAW_
TOO_ BIG - 图像太大
- LIBRAW_
UNSPECIFIED_ ERROR - 未指定错误
- LIBRAW_
UNSUPPORTED_ THUMBNAIL - 不支持的缩略图格式
Functions§
- libraw_
close ⚠ - 关闭 LibRaw 实例并释放所有资源
- libraw_
dcraw_ ⚠clear_ mem - 释放由 libraw_dcraw_make_mem_* 分配的内存
- libraw_
dcraw_ ⚠make_ mem_ thumb - 从缩略图数据创建内存中的图像 errc: 输出参数,接收错误代码 返回: 指向处理后图像的指针,失败时返回 NULL
- libraw_
dcraw_ ⚠process - 处理 RAW 数据(去马赛克、色彩转换等)
- libraw_
init ⚠ - 初始化 LibRaw 实例 flags: 初始化标志,通常使用 LIBRAW_OPTIONS_NONE 返回: 指向 libraw_data_t 的指针,失败时返回 NULL
- libraw_
open_ ⚠file - 打开 RAW 文件 data: LibRaw 实例指针 filename: 文件名(UTF-8 字符串) 返回: LIBRAW_SUCCESS 表示成功,其他值表示错误
- libraw_
recycle ⚠ - 回收 LibRaw 实例的数据流,准备处理新文件 这比 libraw_close 更轻量级,不会释放所有内存
- libraw_
strerror ⚠ - 获取错误代码的描述字符串
- libraw_
unpack ⚠ - 解包 RAW 文件数据(解析文件头和基本信息)
- libraw_
unpack_ ⚠thumb - 解包缩略图数据
- libraw_
version ⚠ - 获取 LibRaw 版本字符串
- libraw_
version ⚠Number - 获取 LibRaw 版本号(整数格式)