亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rgb.txt

?? RGB圖形編程模式介紹
?? TXT
字號:
  			    Draft version  0.97  			The SGI Image File Format  			     Paul Haeberli  			      paul@sgi.com  		    Silicon Graphics Computer Systems    This is the definitive document describing the SGI image file format.  This  is a low level spec that describes the actual byte level format of SGI image files.  On SGI machines the preferred way of reading and writing SGI image files is to use the image library -limage.  This library provides a set of functions that make it easy to read and write SGI images.  If you are  on an SGI workstation you can get info on -limage by doing:      % man 4 rgb  A note on byte order of values in the SGI image files      In the following description a notation like bits[7..0] is used to denote     a range of bits in a binary value.   Bit 0 is the lowest order bit in     the value.      All short values are represented by 2 bytes.  The first byte stores the     high order 8 bits of the value: bits[15..8].  The second byte stores     the low order 8 bits of the value: bits[7..0].    	So, this function will read a short value from the file:  	    unsigned short getshort(inf) 	    FILE *inf; 	    { 		unsigned char buf[2];  		fread(buf,2,1,inf); 		return (buf[0]<<8)+(buf[1]<<0); 	    }      All long values are represented by 4 bytes.  The first byte stores the     high order 8 bits of the value: bits[31..24].  The second byte stores     bits[23..16].  The third byte stores bits[15..8]. The forth byte stores     the low order 8 bits of the value: bits[7..0].    	So, this function will read a long value from the file:  	    static long getlong(inf) 	    FILE *inf; 	    { 		unsigned char buf[4];  		fread(buf,4,1,inf); 		return (buf[0]<<24)+(buf[1]<<16)+(buf[2]<<8)+(buf[3]<<0); 	    }   The general structure of an SGI image file is as shown below:      The header indicates whether the image is run length encoded (RLE).      If the image is not run length encoded, this is the structure:  	The Header 	The Image Data      If the image is run length encoded, this is the structure:  	The Header 	The Offset Tables  	The Image Data   The Header      The header consists of the following:         Size  | Type   | Name      | Description          2 bytes | short  | MAGIC     | IRIS image file magic number      1 byte  | char   | STORAGE   | Storage format      1 byte  | char   | BPC       | Number of bytes per pixel channel       2 bytes | ushort | DIMENSION | Number of dimensions      2 bytes | ushort | XSIZE     | X size in pixels       2 bytes | ushort | YSIZE     | Y size in pixels       2 bytes | ushort | ZSIZE     | Number of channels      4 bytes | long   | PIXMIN    | Minimum pixel value      4 bytes | long   | PIXMAX    | Maximum pixel value      4 bytes | char   | DUMMY     | Ignored     80 bytes | char   | IMAGENAME | Image name      4 bytes | long   | COLORMAP  | Colormap ID    404 bytes | char   | DUMMY     | Ignored       Here is a description of each field in the image file header:  	MAGIC - This is the decimal value 474 saved as a short. This 	identifies the file as an SGI image file.  	STORAGE - specifies whether the image is stored using run 	length encoding (RLE) or not (VERBATIM).   If RLE is used, the value         of this byte will be 1.  Otherwise the value of this byte will be 0. 	The only allowed values for this field are 0 or 1.  	BPC - describes the precision that is used to store each 	channel of an image.  This is the number of bytes per pixel 	component.  The majority of SGI image files use 1 byte per  	pixel component, giving 256 levels.  Some SGI image files use  	2 bytes per component.  The only allowed values for this field  	are 1 or 2.  	DIMENSION - described the number of dimensions in the data stored 	in the image file.  The only allowed values are 1, 2, or 3.  If 	this value is 1, the image file consists of only 1 channel and  	only 1 scanline (row).  The length of this scanline is given by the  	value of XSIZE below.  If this value is 2, the file consists of a  	single channel with a number of scanlines. The width and height 	of the image are given by the values of XSIZE and YSIZE below. 	If this value is 3, the file consists of a number of channels. 	The width and height of the image are given by the values of  	XSIZE and YSIZE below.  The number of channels is given by the  	value of ZSIZE below.    	XSIZE - The width of the image in pixels  	YSIZE - The height of the image in pixels  	ZSIZE - The number of channels in the image.  B/W (greyscale) images  	are stored as 2 dimensional images with a ZSIZE or 1.  RGB color  	images are stored as 3 dimensional images with a ZSIZE of 3.  An RGB  	image with an ALPHA channel is stored as a 3 dimensional image with  	a ZSIZE of 4.  There are no inherent limitations in the SGI image  	file format that would preclude the creation of image files with more  	than 4 channels.  	PINMIN - The minimum pixel value in the image.  The value of 	0 may be used if no pixel has a value that is smaller than 0.  	PINMAX - The maximum pixel value in the image.  The value of 	255 may be used if no pixel has a value that is greater than 255. 	This is the value that is considered to be full brightness in  	the image.    	DUMMY - This 4 bytes of data should be set to 0.   	IMAGENAME - An null terminated ascii string of up to 79 characters  	terminated by a null may be included here.  This is not commonly 	used.  	COLORMAP - This controls how the pixel values in the file should be 	interpreted.  It can have one of these four values:  	    0:  NORMAL - The data in the channels represent B/W values 		for images with 1 channel, RGB values for images with 3 		channels, and RGBA values for images with 4 channels. 		Almost all the SGI image files are of this type.   	    1:  DITHERED - The image will have only 1 channel of data. 		For each pixel, RGB data is packed into one 8 bit value. 		3 bits are used for red and green, while blue uses 2 bits. 		Red data is found in bits[2..0], green data in bits[5..3], 		and blue data in bits[7..6].  This format is obsolete.  	    2:  SCREEN - The image will have only 1 channel of data. 		This format was used to store color-indexed pixels. 		To convert the pixel values into RGB values a colormap 		must be used.  The appropriate color map varies from 		image to image.  This format is obsolete.  	    3:  COLORMAP - The image is used to store a color map from 		an SGI machine.  In this case the image is not displayable 		in the conventional sense.  	DUMMY - This 404 bytes of data should be set to 0. This makes the 	header exactly 512 bytes.    The Image Data (if not RLE)      If the image is stored verbatim (without RLE), then image data directly     follows the 512 byte header.  The data for each scanline of the first     channel is written first.  If the image has more than 1 channel, all     the data for the first channel is written, followed by the remaining     channels.  If the BPC value is 1, then each scanline is written as XSIZE     bytes.  If the BPC value is 2, then each scanline is written as XSIZE      shorts.  These shorts are stored in the byte order described above.   The Offset Tables (if RLE)      If the image is stored using run length encoding, offset tables     follow the header that describe what the file offsets are to the      RLE for each scanline.  This information only applies if the value      for STORAGE above is 1.              Size  | Type   | Name      | Description          tablen longs | long   | STARTTAB  | Start table      tablen longs | long   | LENGTHTAB | Length table      One entry in each table is needed for each scanline of RLE data.  The      total number of scanlines in the image (tablen) is determined by the     product of the YSIZE and ZSIZE.  There are two tables of longs that      are written. Each consists of tablen longs of data.  The first     table has the file offsets to the RLE data for each scanline in the     image.  In a file with more than 1 channel (ZSIZE > 1) this table first      has all the offsets for the scanlines in the first channel, followed     be offsets for the scanlines in the second channel, etc.  The second      table has the RLE data length for each scanline in the image.  In a      file with more than 1 channel (ZSIZE > 1) this table first has all the      RLE data lengths for the scanlines in the first channel, followed     be RLE data lengths for the scanlines in the second channel, etc.      To find the the file offset, and the number of bytes in the RLE data      for a particular scanline, these two arrays may be read in and indexed as     follows:   	To read in the tables:  	    unsigned long *starttab, *lengthtab;  	    tablen = YSIZE*ZSIZE*sizeof(long); 	    starttab = (unsigned long *)mymalloc(tablen); 	    lengthtab = (unsigned long *)mymalloc(tablen); 	    fseek(inf,512,SEEK_SET); 	    readlongtab(inf,starttab); 	    readlongtab(ing,lengthtab);   	To find the file offset and RLE data length for a scanline:  	    rowno is an integer in the range 0 to YSIZE-1 	    channo is an integer in the range 0 to ZSIZE-1  	    rleoffset = starttab[rowno+channo*YSIZE] 	    rlelength = lengthtab[rowno+channo*YSIZE]          It is possible for two identical rows (scanlines) to share compressed      data.  A completely white image could be written as a single compressed      row and having all table entries point to that row.  Another little hack      that should work is if you are writing out a RGB RLE file, and a      particular scanline is achromatic (greyscale), you could just make the      r, g and b rows point to the same data!!  The Image Data (if RLE)      This information only applies if the value for STORAGE above is 1.  If     the image is stored using run length encoding, the image data follows     the offset tables above.  The RLE data is not in any particular order.     The offset tables above are used to locate the rle data for any scanline.        The RLE data must be read in from the file and expanded into pixel      data in the following manner:      If BPC is 1, then there is one byte per pixel.  In this case the      RLE data should be read into an array of chars.  To expand     data, the low order seven bits of the first byte: bits[6..0]     are used to form a count.  If the high order bit of the first     byte is 1: bit[7], then the count is used to specify how many     bytes to copy from the RLE data buffer to the destination.     Otherwise, if the high order bit of the first byte is 0: bit[7],     then the count is used to specify how many times to repeat the      value of the following byte, in the destination.  This process     continues until a count of 0 is found.  This should decompress     exactly XSIZE pixels.    	Here is example code to decompress a scanline:  	    expandrow(optr,iptr,z) 	    unsigned char *optr, *iptr; 	    int z; 	    { 		unsigned char pixel, count; 	     		optr += z; 		while(1) { 		    pixel = *iptr++; 		    if ( !(count = (pixel & 0x7f)) ) 			return; 		    if(pixel & 0x80) { 			while(count--) { 			    *optr = *iptr++; 			    optr+=4; 			} 		    } else { 			pixel = *iptr++; 			while(count--) { 			    *optr = pixel; 			    optr+=4; 			} 		    } 		} 	    }      If BPC is 2, there is one short (2 bytes) per pixel.  In this      case the RLE data should be read into an array of shorts.  To      expand data, the low order seven bits of the first short: bits[6..0]     are used to form a count.  If bit[7] of the first short is 1, then      the count is used to specify how many shorts to copy from the RLE      data buffer to the destination.  Otherwise, if bit[7] of the first      short is 0, then the count is used to specify how many times to      repeat the value of the following short, in the destination.  This      process proceeds until a count of 0 is found.  This should decompress     exactly XSIZE pixels.  Note that the byte order of short data in     the input file should be used, as described above.   Implementation notes      Implementation of both RLE and VERBATIM format for images with     BPC of 1 is required since the great majority of SGI images are in     this format.  Support for images with a 2 BPC is encouraged.      If the ZSIZE of an image is 1, it is assumed to represent B/W     values.  If the ZSIZE is 3, it is assumed to represent RGB data,     and if ZSIZE is 4, it is assumed to contain RGB data with alpha.      The origin for all SGI images is the lower left hand corner.  The     first scanline (row 0) is always the bottom row of the image.     Naming Conventions      On SGI systems, SGI image files end with the extension .bw if     they are B/W images, they end in .rgb if they contain RGB image     data, and end in .rgba if they are RGB images with alpha channel.      Sometimes the .sgi extension is used as well.  An example This program will write out a valid B/W SGI image file: #include "stdio.h" #define IXSIZE      (23)#define IYSIZE      (15) putbyte(outf,val)FILE *outf;unsigned char val;{    unsigned char buf[1];     buf[0] = val;    fwrite(buf,1,1,outf);} putshort(outf,val)FILE *outf;unsigned short val;{    unsigned char buf[2];     buf[0] = (val>>8);    buf[1] = (val>>0);    fwrite(buf,2,1,outf);} static int putlong(outf,val)FILE *outf;unsigned long val;{    unsigned char buf[4];     buf[0] = (val>>24);    buf[1] = (val>>16);    buf[2] = (val>>8);    buf[3] = (val>>0);    return fwrite(buf,4,1,outf);} main(){    FILE *of;    char iname[80];    unsigned char outbuf[IXSIZE];    int i, x, y;     of = fopen("example.rgb","w");    if(!of) {        fprintf(stderr,"sgiimage: can't open output file\n");        exit(1);    }    putshort(of,474);       /* MAGIC                       */    putbyte(of,0);          /* STORAGE is VERBATIM         */    putbyte(of,1);          /* BPC is 1                    */    putshort(of,2);         /* DIMENSION is 2              */    putshort(of,IXSIZE);    /* XSIZE                       */    putshort(of,IYSIZE);    /* YSIZE                       */    putshort(of,1);         /* ZSIZE                       */    putlong(of,0);          /* PIXMIN is 0                 */    putlong(of,255);        /* PIXMAX is 255               */    for(i=0; i<4; i++)      /* DUMMY 4 bytes       */        putbyte(of,0);    strcpy(iname,"No Name");    fwrite(iname,80,1,of);  /* IMAGENAME           */    putlong(of,0);          /* COLORMAP is 0       */    for(i=0; i<404; i++)    /* DUMMY 404 bytes     */        putbyte(of,0);     for(y=0; y<IYSIZE; y++) {        for(x=0; x<IXSIZE; x++)             outbuf[x] = (255*x)/(IXSIZE-1);        fwrite(outbuf,IXSIZE,1,of);    }    fclose(of);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品电影在线播放| 国产成人精品免费视频网站| 欧美人妇做爰xxxⅹ性高电影| 一区二区不卡在线视频 午夜欧美不卡在 | 91视频观看免费| 中文字幕永久在线不卡| 色综合久久中文字幕| 亚洲成人中文在线| 精品少妇一区二区三区在线播放| 国产精品99久久久久久似苏梦涵| 国产三区在线成人av| 一本大道久久a久久精二百| 午夜精品福利一区二区三区av | xf在线a精品一区二区视频网站| 国内成人免费视频| 日本一区二区久久| 日本福利一区二区| 麻豆成人久久精品二区三区红 | 久久狠狠亚洲综合| 国产精品三级av在线播放| 91黄视频在线观看| 乱一区二区av| 成人欧美一区二区三区小说| 欧美日韩精品一区二区在线播放| 国产在线精品一区二区夜色| 1区2区3区国产精品| 91精品国产91热久久久做人人| 另类中文字幕网| 亚洲欧美日韩中文播放| 日韩精品一区二区三区视频| hitomi一区二区三区精品| 免费久久精品视频| 自拍偷拍国产亚洲| 亚洲精品一区二区三区四区高清| 色综合天天天天做夜夜夜夜做| 免费观看在线综合色| 亚洲日本韩国一区| 精品人在线二区三区| 在线国产电影不卡| 成人一区二区三区中文字幕| 日韩激情视频在线观看| 成人免费一区二区三区视频 | 日本色综合中文字幕| ●精品国产综合乱码久久久久| 日韩一区二区在线观看视频| 色婷婷综合久久久久中文一区二区 | 久久久国产午夜精品| 欧美日韩免费观看一区三区| 成人黄页在线观看| 精久久久久久久久久久| 亚洲一区二区三区国产| 国产精品美女久久久久av爽李琼 | 99国产精品国产精品毛片| 美女一区二区视频| 亚洲第一激情av| 亚洲视频一二三| 国产精品乱人伦| 久久久亚洲综合| 久久综合五月天婷婷伊人| 精品1区2区3区| 欧美日韩视频一区二区| 欧美伊人精品成人久久综合97| 成人高清视频免费观看| 国产成人亚洲综合a∨婷婷图片 | 成人午夜精品在线| 国产一区 二区| 国产福利电影一区二区三区| 国产精品亚洲第一| 国产高清在线精品| 国内精品久久久久影院薰衣草| 麻豆视频观看网址久久| 琪琪久久久久日韩精品| 青椒成人免费视频| 美日韩一级片在线观看| 久久精品国产亚洲a| 黑人巨大精品欧美黑白配亚洲| 免费观看在线色综合| 久草在线在线精品观看| 国产在线精品免费| 国产成人免费在线观看不卡| 国产成人在线观看免费网站| 成人综合在线观看| 91在线一区二区三区| 91黄色激情网站| 欧美日韩国产一级二级| 欧美绝品在线观看成人午夜影视| 欧美日产在线观看| 精品乱码亚洲一区二区不卡| 久久嫩草精品久久久精品一| 中文成人综合网| 最新国产の精品合集bt伙计| 一区二区三区成人在线视频| 天天av天天翘天天综合网 | 91麻豆精品国产91久久久| 欧美一区二区免费| 久久亚区不卡日本| 亚洲女同女同女同女同女同69| 亚洲一区二区四区蜜桃| 日韩国产欧美在线播放| 国产一区在线观看视频| 成人国产免费视频| 欧美性猛片aaaaaaa做受| 日韩视频在线永久播放| 欧美国产激情一区二区三区蜜月| 亚洲综合区在线| 久久av资源站| 99久久精品免费看国产| 欧美一区二区啪啪| 综合中文字幕亚洲| 日韩—二三区免费观看av| 国产成人综合在线播放| 91成人在线精品| 精品福利av导航| 亚洲色图视频网| 蜜臀精品一区二区三区在线观看 | 欧美aa在线视频| 99精品偷自拍| 精品国产凹凸成av人网站| 国产精品久久久久久久久搜平片| 亚洲午夜激情网页| 国产白丝网站精品污在线入口| 欧美人妇做爰xxxⅹ性高电影| 中文字幕不卡的av| 日韩主播视频在线| 本田岬高潮一区二区三区| 欧美一级一级性生活免费录像| 亚洲欧洲韩国日本视频 | 丁香一区二区三区| 51精品国自产在线| 亚洲欧美成aⅴ人在线观看| 久久国产综合精品| 欧美亚洲尤物久久| 国产精品污www在线观看| 蜜桃久久精品一区二区| 欧美在线影院一区二区| 国产精品色婷婷久久58| 韩国毛片一区二区三区| 91福利在线免费观看| 日本一区二区视频在线观看| 蜜乳av一区二区三区| 欧美日韩激情一区二区| **网站欧美大片在线观看| 国产精品一区在线| 欧美xxx久久| 蜜桃一区二区三区四区| 678五月天丁香亚洲综合网| 亚洲精品视频在线观看网站| 成人av先锋影音| 中文字幕二三区不卡| 紧缚捆绑精品一区二区| 欧美理论电影在线| 亚洲国产精品嫩草影院| 在线免费观看日韩欧美| 亚洲免费成人av| 色综合久久综合网欧美综合网| 国产女人18毛片水真多成人如厕| 久久99精品国产.久久久久 | 国产成人自拍高清视频在线免费播放 | 精品亚洲porn| 欧美r级在线观看| 美腿丝袜亚洲三区| 日韩久久久久久| 麻豆国产精品一区二区三区 | 国产精品区一区二区三区| 国产高清在线精品| 国产日本一区二区| www..com久久爱| 亚洲视频一区二区免费在线观看| av中文字幕在线不卡| 亚洲免费av观看| 欧美日韩不卡一区二区| 日韩av电影天堂| 日韩精品一区在线| 精东粉嫩av免费一区二区三区 | 中文字幕在线视频一区| 成人丝袜18视频在线观看| 中文乱码免费一区二区| 99麻豆久久久国产精品免费 | 欧美一区二区三区在线观看 | 亚洲欧美日韩在线| 欧美日韩一区二区三区在线看| 一区二区国产盗摄色噜噜| 欧美日韩一区久久| 精品一区二区三区免费视频| 国产日韩精品视频一区| 一本大道久久精品懂色aⅴ| 亚洲大片一区二区三区| 欧美一区二区三区免费| 国产成人综合在线播放| 亚洲精选视频免费看| 51精品秘密在线观看| 国产精品一区二区久激情瑜伽 | 国产夜色精品一区二区av| av在线播放一区二区三区| 亚洲福利一区二区| 欧美精品一区视频| 色综合久久久久网| 免费观看30秒视频久久| 国产精品拍天天在线| 欧美日韩一区二区欧美激情|