zoukankan      html  css  js  c++  java
  • write_image

    static void write_image(const void *data, const int size, int width, int height,
                           const char *name)
    {
        char filename[80];
        static unsigned int count = 0;
        size_t bytes;
        FILE *fp;
        snprintf(filename, sizeof(filename), "/data/shen/dump_%d_%d_%03u_%s", width,
                     height, count, name); 
        fp = fopen (filename, "w+");
        if (fp == NULL) {
            LOGE ("open file %s failed %s", filename, strerror (errno));
            return ;
        }
        LOGD ("shen Begin write image %s", filename);
        if ((bytes = fwrite (data, size, 1, fp)) < (size_t)size)
            LOGD ("shen Write less raw bytes to %s: %d, %d", filename, size, bytes);
        count++;
        fclose (fp);
    }
     
  • 相关阅读:
    HDU 1686 Oulipo(kmp)
    openstack介绍以及流程
    openstack组件介绍
    linux之sort
    linux-ls命令
    CSRF-跨域访问保护
    WEB聊天
    python之路-Django进阶
    python之路-Django
    python之路-jQuery
  • 原文地址:https://www.cnblogs.com/wangxianzhen/p/3009368.html
Copyright © 2011-2022 走看看