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);
    }
     
  • 相关阅读:
    多姿多彩的线程
    字典操作
    字符串语法
    购物车
    列表常用语法
    整数划分问题
    计算N的阶层
    判断是否是素数
    快速排序
    冒泡排序
  • 原文地址:https://www.cnblogs.com/wangxianzhen/p/3009368.html
Copyright © 2011-2022 走看看