Scroll to navigation

XAllocColor(3X11) XLIB FUNCTIONS XAllocColor(3X11)

̾??

XAllocColor, XAllocNamedColor, XAllocColorCells, XAllocColorPlanes, XFreeColors - ???γ??????ƤȲ???

????

Status XAllocColor(display, colormap, screen_in_out)
Display *display;
Colormap colormap;
XColor *screen_in_out;

Status XAllocNamedColor(display, colormap, color_name, screen_def_return, exact_def_return)
Display *display;
Colormap colormap;
char *color_name;
XColor *screen_def_return, *exact_def_return;

Status XAllocColorCells(display, colormap, contig, plane_masks_return, nplanes,
pixels_return, npixels)
Display *display;
Colormap colormap;
Bool contig;
unsigned long plane_masks_return[];
unsigned int nplanes;
unsigned long pixels_return[];
unsigned int npixels;

Status XAllocColorPlanes(display, colormap, contig, pixels_return, ncolors, nreds, ngreens,
nblues, rmask_return, gmask_return, bmask_return)
Display *display;
Colormap colormap;
Bool contig;
unsigned long pixels_return[];
int ncolors;
int nreds, ngreens, nblues;
unsigned long *rmask_return, *gmask_return, *bmask_return;

XFreeColors(display, colormap, pixels, npixels, planes)
Display *display;
Colormap colormap;
unsigned long pixels[];
int npixels;
unsigned long planes;

??????

???????ι?¤?Τ???????????̾???򼨤?ʸ????(?㤨?? red)?????ꤹ?롣
???顼?ޥåפ????ꤹ?롣
?ץ졼????Ϣ³?Ǥʤ????Фʤ??ʤ????ɤ????򼨤??????ͤ????ꤹ?롣
X ?????Фؤ???³?????ꤹ?롣
???Τ? RGB ?ͤ????ꤹ?롣
???? pixels_return ???֤??????ԥ??????ͤο??????ꤹ?롣
?ԥ??????ο??????ꤹ?롣
?ץ졼???ޥ????????????֤??????ץ졼???ޥ????ο??????ꤹ?롣



R, G, B ?Υץ졼???ο??????ꤹ?롣 ?????ͤ????Ǥ??äƤϤʤ??ʤ???
?ԥ??????ͤ??????????ꤹ?롣
?ԥ??????ͤ????????֤????롣
?ץ졼???ޥ????????????֤????롣
?????????ץ졼???????ꤹ?롣


R, G, B ?ץ졼?????Ф????ץ졼???ޥ??????֤????롣
?ϡ??ɥ????????󶡤??????Ǥ??ᤤ RGB ?ͤ??֤????롣
???顼?ޥåפǼºݤ˻??Ѥ??????ͤ????ꤹ?롣 ???뤤?ϡ????顼?ޥåפǼºݤ˻??Ѥ??????ͤ??֤????롣

????

?ؿ? XAllocColor ?ϥϡ??ɥ??????˥??ݡ??Ȥ????Ƥ????椫???Ǥ??ᤤ RGB ?ͤ??б????? ?ɤ߼??????ѤΥ??顼?ޥåץ????ȥ꡼?????????Ƥ롣 XAllocColor ?ϡ??ϡ??ɥ??????????ݡ??Ȥ??Ƥ??롢???ꤷ?? RGB ???Ǥ˺Ǥ??ᤤ???Υ? ???????ͤȡ??ºݤ˻??Ѥ????? RGB ?ͤ??֤??? ?б????륫?顼?ޥåץ??????ɤ߼??????ѤǤ??롣 ?ޤ??? XAllocColor ?????????ˤ? 0 ?Ǥʤ??ͤ??֤??????Ի??ˤ? 0 ???֤??? Ʊ???¸? RGB ?ͤ????᤿ʣ???Υ??饤?????Ȥˤϡ?Ʊ?????ɤ߼??????Ѥ? ?????ȥ꡼?????????Ƥ??????Τǡ????饤?????ȴ֤ǥ????ȥ꡼????ͭ???뤳 ?Ȥ??Ǥ??롣 ?Ǹ??Υ??饤?????Ȥ???ͭ???Ƥ??륻???????????????????Υ????ϼºݤ˲??? ?????롣 XAllocColor ?? XColor ??¤?Τ? flags ?????Фϻ??Ѥ??ʤ??????ͤ??ѹ??⤷?ʤ???

XAllocColor ?ϥ??顼 BadColor ?򵯤??????Ȥ????롣

?ؿ? XAllocNamedColor ?ϻ??ꤷ?????顼?ޥåפ??б????륹???꡼???Τ????ơ?̾?????դ??????Ƥ? ?뿧???䤤???碌?롣 ???δؿ??ϥǡ????١????Ǥ????Τ??????ȥ????꡼?󤬥??ݡ??Ȥ??Ƥ????Ǥ? ?ᤤ???Ȥ?ξ?????֤??? ???????Ƥ??줿???顼???????ɤ߼??????ѤǤ??롣 ?ԥ??????ͤ? screen_def_return ???֤????롣 ????̾???Υ??󥳡??ǥ??󥰤??ۥ??ȥݡ????֥?ʸ?????󥳡??ǥ??󥰤Ǥʤ? ???硢???̤ϼ?????¸?Ǥ??롣 ??ʸ???Ⱦ?ʸ???Τ????????ȤäƤ????̤?Ʊ???Ǥ??롣 screen_def_return ?? exact_def_return ??Ʊ????¤?Τ??ؤ??Ƥ??????硢 pixel ?ե??????ɤ??????????ꤵ???뤬???????ͤ?̤?????Ǥ??롣 XAllocNamedColor ?ϥ??뤬???????Ƥ????Ƥ????????ˤ? 0 ?Ǥʤ??ͤ??֤????????Ǥʤ????? 0 ???֤???

XAllocNamedColor ?ϥ??顼 BadColor ?򵯤??????Ȥ????롣

?ؿ? XAllocColorCells ???ɤ߽񤭲?ǽ?ʥ??顼?????????????Ƥ롣 ???ο????????ͤǤʤ????Фʤ餺???ץ졼???ο??? 0 ?ʾ??Ǥʤ????Фʤ??? ?????????Ǥʤ??????? BadValue ???顼?Ȥʤ롣 ncolors ?? nplanes ???׵ᤵ?줿???硢ncolors ?ĤΥԥ??????? nplane ?? ?Υץ졼???ޥ??????֤????롣 ?????ޥ???????¾?Υޥ??????ԥ??????ȡ?1 ?????ꤵ?줿?ӥåȤ???ͭ???? ???ȤϤʤ??? 2nplanes distinct pixels can be produced. ?ƥԥ???????0?İʾ??Υޥ????Ȥ??????¤????뤳?Ȥˤ??äơ? ncolors * 2nplanes ?Ĥ??̡??Υԥ??????????뤳?Ȥ??Ǥ??롣 ???????????Ƥϡ??ꥯ?????Ȥˤ??äƽ񤭴????뤳?Ȥ??Ǥ????褦?˳??????? ?????롣 GrayScale ?? PseudoColor ???Ф??Ƥϡ??ƥޥ????Ϥ??礦??1?ӥåȤ??????????????????? 1 ?????ꤵ?? ?롣 DirectColor ???Ф??Ƥϡ??ƥޥ????Ϥ??礦??3?ӥåȤ??????????????Ϥ??٤? 1 ?????ꤵ ???롣 contig ?? True ?Ǥ??ꡢ???ƤΥޥ??????????¤????????Ƥ????????ˤϡ?1 ?????ꤵ???Ƥ? ??Ϣ³???Ƥ????ӥåȤν??ޤ?1?Ĥ? GrayScale ?? PseudoColor ???Ф??ƺ????졢1 ?????ꤵ???Ƥ???3?Ȥ?Ϣ³?????ӥåȤν??ޤ?(??pixel ???֥ե???????????1??)?? DirectColor ???Ф??ƺ??????롣 ???????Ƥ??줿?????ȥ꡼?? RGB ?ͤ?̤?????Ǥ??롣 XAllocColorCells ?????????ˤ? 0 ?Ǥʤ??ͤ??֤??????Ի??ˤ? 0 ???֤???

XAllocColorCells ?ϥ??顼 BadColor, BadValue ?򵯤??????Ȥ????롣

???ꤹ?? ncolors ???????ͤ?̵?????Фʤ餺??nreds, ngreens, nblues ?? 0 ?ʾ??Ǥʤ????Фʤ??ʤ????????Ǥʤ??????ˤϡ????顼 BadValue ?Ȥʤ롣 ncolors ?Ĥο???nreds ?Ĥ??֡?ngreeens ?Ĥ??С?nblues ?Ĥ??Ĥ??׵ᤵ?? ?????硢ncolors ?ĤΥԥ????뤬?֤????롣?ޤ????ޥ??????Ǥ? ngreens ?ġ? nreds ?ġ?nblues ?ĤΥӥåȤ????줾?? 1 ?????ꤵ???롣 contig ?? True ?ʤ??С??ƥޥ????? 1 ?????ꤵ?줿Ϣ³?ʥӥåȤν????Ȥʤ롣 ?????ޥ???????¾?Υޥ??????ԥ??????ȡ?1 ?????ꤵ?줿?ӥåȤ???ͭ???? ???ȤϤʤ??? DirectColor ???Ф??Ƥϡ??ƥޥ??????б??????ԥ????륵?֥ե????????????֤????롣 2(nreds+ngreens+nblues) distinct pixel values can be produced. ?ޥ????Υ??֥??åȤȳƥԥ??????ͤ??????¤????뤳?Ȥˤ??äơ? ncolors * 2(nreds+ngreens+nblues) ?Ĥθ??̤Υԥ??????ͤ????뤳 ?Ȥ??Ǥ??롣 ???????????Ƥϥꥯ?????Ȥˤ??äƳ??????Ƥ????롣 2nreds independent red entries, 2ngreens independent green entries, 2nblues independent blue entries. ???????????顼?ޥå????ˤ? ncolors * 2nreds ?Ĥ???Ω?? red ?????ȥ꡼?? ncolors * 2ngreens ?Ĥ???Ω?? green ?????ȥ꡼?? ncolors * 2blues ?Ĥ???Ω?? blue ?????ȥ꡼?????ʤ??? ?????? PseudoColor ?Ǥ??äƤ?Ʊ???Ǥ??롣 ?ԥ??????ͤΥ??顼?ޥåץ????ȥ꡼??( XStoreColors, XStoreColor, XStoreNamedColor ?λ??Ѥˤ???)?ѹ????줿?????ԥ??????ϥޥ????˽??ä?ʬ?򤵤졢?б????? ??Ω?????????ȥ꡼???????????롣 XAllocColorPlanes ?????????ˤ? 0 ?Ǥʤ??ͤ??֤??????Ի??ˤ? 0 ???֤???

XAllocColorPlanes ?ϥ??顼 BadColor, BadValue ???֤????Ȥ????롣

?ؿ? XFreeColors ?ϡ??????β??????Ԥ????????????륻???ϡ??????ͤ? pixels ??????¸?ߤ??? ?????ԥ???????ɽ?????Ƥ??????ΤǤ??롣 ?????? planes ?ϡ????????Υԥ??????Ȥ? 1 ?????ꤵ?줿?ӥåȤ???ͭ???Ƥ? ?ʤ??ʤ??? ???ƤΥԥ??????ν????ϡ????ΰ????? planes ?Υ??֥??åȤȥԥ????????????? ?????뤳?ȤǺ??뤳?Ȥ??Ǥ??롣 ???Υꥯ?????Ȥ?( XAllocColor, XAllocNamedColor, XAllocColorCells, XAllocColorPlanes ?????Ѥ???) ???饤?????Ȥˤ??äƳ??????Ƥ??줿???????Υԥ??????????Ʋ??????롣 XAllocColorPlanes ?????????̤Υԥ??????????????Ƥ⡢?ºݤˤϴط??????ԥ??????????Ʋ????? ?????ޤǡ????????Υԥ??????Ϻ????ѤǤ??ʤ????Ȥ????դ??衣 Ʊ?ͤˡ??ɤ߼??????ѤΥ????ȥ꡼?????ƤΥ??饤?????Ȥ??????????????ޤ? ?ϼºݤ˲????????ʤ????ޤ??????饤?????Ȥ?Ʊ???ɤ߼??????ѤΥ????ȥ꡼ ??ʣ???????????Ƥ??????ϡ??????ȥ꡼?????????????ޤǤ˲??٤??????? ?Ԥ??ʤ????Фʤ??ʤ???

1?İʾ??Υԥ????뤬???顼?ȤʤäƤ??Ƥ⡢???ꤷ???ԥ??????? ???饤?????Ȥˤ??äƥ??顼?ޥå????˳??????Ƥ??줿???Τ????Ʋ????????롣 ???ꤷ???ԥ????뤬???顼?ޥåפؤ?ͭ???ʥ????ǥå????Ǥʤ??ä??????ˤϡ? ???顼 BadValue ?Ȥʤ롣 ???ꤷ???ԥ????뤬?????Υ??饤?????Ȥˤ??äƳ??????Ƥ????Ƥ??ʤ?(?? ?ޤꡢ???????Ƥ????Ƥ??ʤ??????̤Υ??饤?????Ȥˤ??äƤΤ߳??????Ƥ??? ?Ƥ???)?????䡢???顼?ޥåפ????ƤΥ????ȥ꡼???񤭹??߲?ǽ?Ǻ??? ???Ƥ???( XCreateColormap ?? AllocAll ???Ϥ??Ƥ???)?????ˤϡ? BadAccess ???顼?Ȥʤ롣 ʣ???Υԥ????뤬???顼?ξ??硢???顼?????Τ??????ԥ??????Ϥɤ줫?狼?? ?ʤ???

XFreeColors ?ϥ??顼 BadAccess, BadColor, BadValue ?򵯤??????Ȥ????롣

?֤???

???????Ƥ????Ƥ??ʤ??????ȥ꡼?򥯥饤?????Ȥ????????褦?Ȥ?????
???饤?????Ȥ??ɤ߼??????ѤΥ??顼?ޥåץ????ȥ꡼???ͤ????????褦?Ȥ? ????
?????? Colormap ???ͤ????????????Ƥ??? Colormap ???ؤ??Ƥ??ʤ???
???ꤵ?줿???ͤ????˥ꥯ?????Ȥε????ϰϤ??ۤ??Ƥ??????Τ????롣?????????? ???????????ϰϤ????ꤵ???Ƥ??ʤ??¤ꡢ???????η????????????Ƥ??????Ƥ??? ?Ϥ????????롣???????Ȥ????????????Ƥ??????????Ϥ??Υ??顼?򵯤??????Ȥ? ???롣

??Ϣ????

XCreateColormap(3X11), XQueryColor(3X11), XStoreColors(3X11)
Xlib - C Language X Interface

Release 6.5 X Version 11