⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmrgb.c

📁 MATSNL is a package of MATLAB M-files for computing wireless sensor node lifetime/power budget and
💻 C
字号:
/* * File:    cmRgb.c * *  Build the RGB Header  */#include <windows.h>#include "cmRgbHeader.h"/* * Function: cmRgbHdrBuild * * Description: Build an RGB (IRIS) Header * * * Input Parameters: * * Output Parameters: * * Returns: */int cmRgbHdrBuild (unsigned char *buf_in_p, int buf_in_len, unsigned char *buf_out_p, int *buf_out_len_p, int width, int height){    int status = 0;    cmRGBHeader_t header;        /* initialize the header */    memset (&header, 0, sizeof (cmRGBHeader_t));    header.magic = (short int)0xDA01;     /* IRIS */    header.storage = 0;     /* no compression */    header.bpc = 1;         /* bytes per pixel channel */    header.dimension = 0x0200;   /* single 2D image *///    header.xsize = width;   /* x size in pixels */    header.xsize = 0x8000;   /* x size in pixels *///    header.ysize = height;  /* y size in pixels */    header.ysize = 0x8000;  /* y size in pixels */    header.zsize = 0x0300;       /* Number of channesl  = RGB */    header.pixmin = 0;      /* min pixel value */    header.pixmax = 0xff000000;    /* max pixel value */    header.colormap = 0;    /* normal mode */    /* Copy the header into the output buffer */    memcpy (buf_out_p, &header, sizeof (cmRGBHeader_t));    *buf_out_len_p = sizeof (cmRGBHeader_t);    /* Copy the data into the output buffer */    memcpy ((buf_out_p+*buf_out_len_p), buf_in_p, buf_in_len);    *buf_out_len_p = *buf_out_len_p + buf_in_len;    return status;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -