首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >土壤图像大小

土壤图像大小
EN

Stack Overflow用户
提问于 2018-11-19 20:38:15
回答 1查看 160关注 0票数 1

我能以某种方式得到(任何土壤支撑的)图像大小吗?

我知道图像文件中有不同的标题来定义这些大小。但是,是否有任何功能,从土壤获得图像大小?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-11-20 02:42:24

SOIL_load_image()将使用图像的尺寸填充宽度/高度参数,尽管它会完成图像的满负荷操作:

代码语言:javascript
复制
/**
    Loads an image from disk into an array of unsigned chars.
    Note that *channels return the original channel count of the
    image.  If force_channels was other than SOIL_LOAD_AUTO,
    the resulting image has force_channels, but *channels may be
    different (if the original image had a different channel
    count).
    \return 0 if failed, otherwise returns 1
**/
unsigned char*
    SOIL_load_image
    (
        const char *filename,
        int *width, int *height, int *channels,
        int force_channels
    );

未加载完整映像的底层stb_image.h 有例程

代码语言:javascript
复制
// get image dimensions & components without fully decoding
STBIDEF int      stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp);
STBIDEF int      stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp);
STBIDEF int      stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len);
STBIDEF int      stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *clbk, void *user);

#ifndef STBI_NO_STDIO
STBIDEF int      stbi_info               (char const *filename,     int *x, int *y, int *comp);
STBIDEF int      stbi_info_from_file     (FILE *f,                  int *x, int *y, int *comp);
STBIDEF int      stbi_is_16_bit          (char const *filename);
STBIDEF int      stbi_is_16_bit_from_file(FILE *f);
#endif
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53382286

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档