|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
| ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
| °³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå | ||||||||||
java.lang.Object
|
+--java.awt.image.ColorModel
|
+--java.awt.image.IndexColorModel
IndexColorModel Ŭ·¡½º´Â µðÆúÆ®ÀÇ sRGB ColorSpace ÀÇ °íÁ¤ Ä®¶ó MAP¿¡ ´ëÇÑ À妽ºÀÎ, ´ÜÀÏÀÇ »ùÇ÷κÎÅÍ µÇ´Â Çȼ¿Ä¡¸¦ Ãë±ÞÇÏ´Â ColorModel Ŭ·¡½ºÀÔ´Ï´Ù. Ä®¶ó MAP´Â Àû, ·Ï, ûÀÇ »ö¼ººÐ, ¹× °¢ À妽º¿¡ ´ëÀÀÇÏ´Â ÀÓÀÇÀÇ ¾ËÆÄ ¼ººÐÀ» ÁöÁ¤ÇÕ´Ï´Ù. ¼ººÐÀº ¸ðµÎ, Ä®¶ó MAP³»ÀÇ 8 ºñÆ®ÀÇ ºÎÈ£ ¾øÀ½ Á¤¼öÄ¡·Î¼ Ç¥ÇöµË´Ï´Ù. ¾ËÆÄ°¡ Á¸ÀçÇÏÁö ¾Ê´Â °æ¿ì´Â °¢ ¿£Æ®¸®·Î ºÒÅõ¸íÇÑ ¾ËÆÄ ¼ººÐ (¾ËÆÄ = 1.0)ÀÌ ÁöÁ¤µÇ¾ú´Ù°í º¸¿©Áý´Ï´Ù. ¿É¼ÇÀ¸·Î¼ Åõ¸í Çȼ¿ÀÇ °ªÀ» ÁöÁ¤ÇØ, ±× Çȼ¿Ä¡¿¡ ±â·ÏµÈ ¾ËÆÄ ¼ººÐÀÌ ¾î¶² °ÍÀ̾, ¿ÏÀüÇÏ°Ô Åõ¸íÇÑ Çȼ¿ÀÎ °ÍÀ» ³ªÅ¸³¾ ¼ö°¡ ÀÖ½À´Ï´Ù. IndexColorModel ¿ÀºêÁ§Æ®ÀÇ ¾ËÆÄÄ¡´Â ¹Ì¸® °ö¼ÀµÉ °ÍÀº ¾ø½À´Ï´Ù. ÀÌ Ä®¶ó ¸ðµ¨Àº X11 ÀÇ PseudoColor ¿Í °°Àº °ÍÀÔ´Ï´Ù.
Çȼ¿Ä¡·Î Ç¥ÇöµÇ´Â À妽º´Â ÀÌ Å¬·¡½ºÀÇ ¸Þ¼Òµå¿¡°Ô °Ç³×Áö´Â Çȼ¿ Ç¥ÇöÀÇ ÃÖÇÏÁ¤µµÀÇ n ºñÆ®¿¡ ÀúÀåµË´Ï´Ù. ´Ù¸¸, n ´Â ƯÁ¤ÀÇ IndexColorModel ¿ÀºêÁ§Æ®ÀÇ constructor À¸·Î ÁöÁ¤µÇ´Â Çȼ¿ »çÀÌÁî·Î, n ´Â 1 ~ 16 ÀÇ »çÀÌ·Î ÇÑÁ¤µË´Ï´Ù. Çȼ¿ Ç¥ÇöÀÇ »óÀ§ ºñÆ®´Â Á¦·Î·Î º¸¿©Áý´Ï´Ù. transferType ÇüÀÇ ¿ø½ÃÀû ¹è¿ÀÇ Çȼ¿ Ç¥ÇöÀ» »ç¿ëÇÏ´Â ¸Þ¼Òµå¿¡¼´Â ¹è¿ÀåÀº Ç×»ó 1 ÀÔ´Ï´Ù. ¼Æ÷Æ®µÇ´Â Àü¼ÛÇüÀº DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT ÀÔ´Ï´Ù. ÀÌ Å¬·¡½º¿¡¼ »ç¿ëÇÏ´Â Çȼ¿Ä¡´Â Ç×»ó ´ÜÀÏÀÇ int ·Î¼ Ç¥ÇöÇÒ ¼ö ÀÖÀ¸¹Ç·Î, ´ÜÀÏÀÇ int Çȼ¿ Ç¥ÇöÀº ÀÌ Å¬·¡½ºÀÇ ¸ðµç ¿ÀºêÁ§Æ®·Î À¯È¿ÇÕ´Ï´Ù. ÀÌ ¶§¹®¿¡, ÀÌ Ç¥ÇöÀ» »ç¿ëÇÏ´Â ¸Þ¼Òµå´Â ¹«È¿ÀÎ Çȼ¿Ä¡°¡ ÀÖ´Â °æ¿ìµµ IllegalArgumentException ¸¦ ½½·Î¿ì ÇÏÁö ¾Ê½À´Ï´Ù.
ÀÌ Å¬·¡½ºÀÇ ¸Þ¼ÒµåÀÇ »ó´ç¼ö´Â final ÀÔ´Ï´Ù. ±× ÀÌÀ¯´Â ÇÏÀ§ÀÇ ³×ÀÌÆ¼ºêÀÎ ±×·¡ÇȽºÀÇ Äڵ尡 ÀÌ Å¬·¡½ºÀÇ ¼³°è¿Í Á¶ÀÛ¿¡ °üÇÑ ÀüÁ¦°¡ µÇ¾î, ÀÌ·¯ÇÑ ÀüÁ¦°¡ ÀÌ Å¬·¡½º¿¡¼ final °¡ µÇ¾î ÀÖ´Â ¸Þ¼ÒµåÀÇ ±¸Çö¿¡ ¹Ý¿µµÇ°í Àֱ⠶§¹®ÀÔ´Ï´Ù. ÀÌ Å¬·¡½º¸¦ ´Ù¸¥ ÀÌÀ¯·Î½á ¼ºê Ŭ·¡½ºÈÇÒ ¼ö ÀÖ½À´Ï´Ù¸¸, final ÀÎ ¸Þ¼ÒµåÀÇ µ¿ÀÛÀ» ¿À¹ö¶óÀ̵å(override) Çϰųª º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù.
ColorModel ,
ColorSpace ,
DataBuffer | ÇʵåÀÇ °³¿ä |
| Ŭ·¡½º java.awt.image. ColorModel ¿¡¼ »ó¼Ó¹ÞÀº Çʵå |
pixel_bits , transferType |
| ÀÎÅÍÆäÀ̽º java.awt. Transparency ¿¡¼ »ó¼Ó¹ÞÀº Çʵå |
BITMASK , OPAQUE , TRANSLUCENT |
| »ý¼ºÀÚÀÇ °³¿ä | |
IndexColorModel (int bits,
int size,
byte[] r,
byte[] g,
byte[] b)
ÁöÁ¤µÈ Àû, ÃÊ·Ï, ÆÄ¶ûÀÇ »ö¼ººÐÀÇ ¹è¿·ÎºÎÅÍ IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
IndexColorModel (int bits,
int size,
byte[] r,
byte[] g,
byte[] b,
byte[] a)
ÁöÁ¤µÈ Àû, ·Ï, û, ¾ËÆÄÀÇ »ö¼ººÐÀÇ ¹è¿·ÎºÎÅÍ IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
IndexColorModel (int bits,
int size,
byte[] r,
byte[] g,
byte[] b,
int trans)
ÁöÁ¤µÈ Àû, ÃÊ·Ï, ÆÄ¶ûÀÇ »ö¼ººÐÀÇ ¹è¿·ÎºÎÅÍ IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
IndexColorModel (int bits,
int size,
byte[] cmap,
int start,
boolean hasalpha)
ÀΟ¸®ºêÈ Çü½Ä¿¡¼ ÀúÀåµÇ°í ÀÖ´Â Àû, ÃÊ·Ï, ÆÄ¶ûÀÇ »ö¼ººÐ, ¹× ¿É¼ÇÀÇ ¾ËÆÄ ¼ººÐÀ¸·ÎºÎÅÍ µÇ´Â 1 °³ÀÇ ¹è¿·ÎºÎÅÍ IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
IndexColorModel (int bits,
int size,
byte[] cmap,
int start,
boolean hasalpha,
int trans)
ÀΟ¸®ºêÈ Çü½Ä¿¡¼ ÀúÀåµÇ°í ÀÖ´Â Àû, ÃÊ·Ï, ÆÄ¶ûÀÇ »ö¼ººÐ, ¹× ¿É¼ÇÀÇ ¾ËÆÄ ¼ººÐÀ¸·ÎºÎÅÍ µÇ´Â 1 °³ÀÇ ¹è¿·ÎºÎÅÍ IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
IndexColorModel (int bits,
int size,
int[] cmap,
int start,
boolean hasalpha,
int trans,
int transferType)
int ÀÇ ¹è¿·ÎºÎÅÍ IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
IndexColorModel (int bits,
int size,
int[] cmap,
int start,
int transferType,
BigInteger validBits)
int ÀÇ ¹è¿·ÎºÎÅÍ IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
| ¸Þ¼ÒµåÀÇ °³¿ä | |
BufferedImage |
convertToIntDiscrete (Raster raster,
boolean forceARGB)
¼Ò½º Raster ÀÇ À妽º¸¦ Àü°³ÇØ °è»êÇÑ Çȼ¿ µ¥ÀÌÅÍ Ã·ºÎÀÇ Raster ¸¦ °¡Áö´Â TYPE_INT_ARGB ¶Ç´Â TYPE_INT_RGB ÀÇ »õ·Î¿î BufferedImage ¸¦, ÀÌ ColorModel ÀÇ »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿À» »ç¿ëÇØ µ¹·ÁÁÝ´Ï´Ù. |
SampleModel |
createCompatibleSampleModel (int w,
int h)
ÀÌ ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖ´Â µ¥ÀÌÅÍ ·¹À̾ƿôÀ» °¡Áö´Â ÁöÁ¤µÈ Æø°ú ³ôÀÌÀÇ SampleModel ¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
WritableRaster |
createCompatibleWritableRaster (int w,
int h)
ÁöÁ¤µÈ Æø°ú ³ôÀÌ·Î, ÀÌ ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖ´Â µ¥ÀÌÅÍ ·¹À̾ƿô SampleModel ¸¦ °¡Áö´Â WritableRaster ¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
void |
finalize ()
ÀÌ ColorModel °¡ ÂüÁ¶µÇÁö ¾Ê°Ô µÇ¾úÀ» ¶§¿¡, °ü·Ã system resource¸¦ ÆÄ±âÇÕ´Ï´Ù. |
int |
getAlpha (int pixel)
ÁöÁ¤µÈ Çȼ¿ÀÇ ¾ËÆÄ ¼ººÐÀ», 0 ~ 255 ÀÇ ¹üÀ§¿¡¼ ½½Ä¶¸µ ÇØ µ¹·ÁÁÝ´Ï´Ù. |
void |
getAlphas (byte[] a)
¾ËÆÄÀÇ Åõ¸í ¼ººÐÀÇ ¹è¿ÀÌ ÁöÁ¤µÈ ¹è¿¿¡ Ä«ÇÇÇÕ´Ï´Ù. |
int |
getBlue (int pixel)
ÁöÁ¤µÈ Çȼ¿ÀÇ ÆÄ¶ûÀÇ »ö¼ººÐÀ», µðÆúÆ®ÀÇ RGB ColorSpace, Áï sRGB ÀÇ 0 ~ 255 ÀÇ ¹üÀ§¿¡¼ ½½Ä¶¸µ ÇØ µ¹·ÁÁÝ´Ï´Ù. |
void |
getBlues (byte[] b)
ÆÄ¶ûÀÇ »ö¼ººÐÀÇ ¹è¿ÀÌ ÁöÁ¤µÈ ¹è¿¿¡ Ä«ÇÇÇÕ´Ï´Ù. |
int[] |
getComponents (int pixel,
int[] components,
int offset)
ÀÌ ColorModel ÀÇ ÁöÁ¤µÈ Çȼ¿¿¡ ´ëÇØ, Ç¥ÁØÈµÇ¾î ÀÖÁö ¾ÊÀº »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
int[] |
getComponents (Object pixel,
int[] components,
int offset)
ÀÌ ColorModel ÀÇ ÁöÁ¤µÈ Çȼ¿¿¡ ´ëÇØ, Ç¥ÁØÈµÇ¾î ÀÖÁö ¾ÊÀº »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
int[] |
getComponentSize ()
»ö¼ººÐÀ̳ª ¾ËÆÄ ¼ººÐ¿¡ ´ëÇØ 1 ¼ººÐ ±ÙóÀÇ ºñÆ®¼öÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
int |
getDataElement (int[] components,
int offset)
ÁöÁ¤µÈ, Ç¥ÁØÈµÇ¾î ÀÖÁö ¾ÊÀº »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿¿¡ ´ëÇØ, ÀÌ ColorModel ÀÇ int ·Î¼ Ç¥ÇöµÇ´Â Çȼ¿Ä¡¸¦ µ¹·ÁÁÝ´Ï´Ù. |
Object |
getDataElements (int[] components,
int offset,
Object pixel)
Ç¥ÁØÈµÇ¾î ÀÖÁö ¾ÊÀº »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀÇ ¹è¿À» ÁöÁ¤ÇØ, ÀÌ ColorModel ÀÇ Çȼ¿ÀÇ µ¥ÀÌÅÍ ¿ä¼Ò ¹è¿ Ç¥ÇöÀ» µ¹·ÁÁÝ´Ï´Ù. |
Object |
getDataElements (int rgb,
Object pixel)
ÁöÁ¤µÈ µðÆúÆ®ÀÇ RGB Ä®¶ó ¸ðµ¨ÀÇ Á¤¼ö Çȼ¿ Ç¥Çö¿¡ ´ëÇØ, ÀÌ ColorModel ÀÇ Çȼ¿ÀÇ µ¥ÀÌÅÍ ¿ä¼Ò ¹è¿ Ç¥ÇöÀ» µ¹·ÁÁÝ´Ï´Ù. |
int |
getGreen (int pixel)
ÁöÁ¤µÈ Çȼ¿ÀÇ ÃÊ·ÏÀÇ »ö¼ººÐÀ», µðÆúÆ®ÀÇ RGB ColorSpace, Áï sRGB ÀÇ 0 ~ 255 ÀÇ ¹üÀ§¿¡¼ ½½Ä¶¸µ ÇØ µ¹·ÁÁÝ´Ï´Ù. |
void |
getGreens (byte[] g)
ÃÊ·ÏÀÇ »ö¼ººÐÀÇ ¹è¿ÀÌ ÁöÁ¤µÈ ¹è¿¿¡ Ä«ÇÇÇÕ´Ï´Ù. |
int |
getMapSize ()
ÀÌ IndexColorModel ³»ÀÇ »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿ÀÇ Å©±â¸¦ µ¹·ÁÁÝ´Ï´Ù. |
int |
getRed (int pixel)
ÁöÁ¤µÈ Çȼ¿ÀÇ »¡°ÀÇ »ö¼ººÐÀ», µðÆúÆ®ÀÇ RGB ColorSpace, Áï sRGB ÀÇ 0 ~ 255 ÀÇ ¹üÀ§¿¡¼ ½½Ä¶¸µ ÇØ µ¹·ÁÁÝ´Ï´Ù. |
void |
getReds (byte[] r)
»¡°ÀÇ »ö¼ººÐÀÇ ¹è¿ÀÌ ÁöÁ¤µÈ ¹è¿¿¡ Ä«ÇÇÇÕ´Ï´Ù. |
int |
getRGB (int pixel)
Çȼ¿ÀÇ »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀ», µðÆúÆ®ÀÇ RGB Ä®¶ó ¸ðµ¨ Çü½Ä¿¡¼ µ¹·ÁÁÝ´Ï´Ù. |
void |
getRGBs (int[] rgb)
°¢ À妽ºÀÇ µ¥ÀÌÅ͸¦ »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿·ÎºÎÅÍ µðÆúÆ®ÀÇ RGB ColorModel Çü½ÄÀÇ int ·Î º¯È¯ÇØ, ±× °á°úÀÇ 32 ºñÆ® ARGB Ä¡°¡ ÁöÁ¤µÈ ¹è¿¿¡ Ä«ÇÇÇÕ´Ï´Ù. |
int |
getTransparency ()
Åõ¸íµµ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
int |
getTransparentPixel ()
ÀÌ IndexColorModel ³»ÀÇ Åõ¸í Çȼ¿ÀÇ À妽º¸¦ µ¹·ÁÁÝ´Ï´Ù. |
BigInteger |
getValidPixels ()
Ä®¶ó MAPÀÇ À¯È¿/¹«È¿ Çȼ¿À» ³ªÅ¸³»´Â BigInteger ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
boolean |
isCompatibleRaster (Raster raster)
raster °¡ ÀÌ ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖ´Â °æ¿ì¿¡´Â true ¸¦ µ¹·ÁÁÖ¾î, ±×·¸Áö ¾ÊÀº °æ¿ì¿¡´Â false ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
boolean |
isCompatibleSampleModel (SampleModel sm)
SampleModel °¡ ÀÌ ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖÀ»Áö ¾î¶³Áö¸¦ Á¶»çÇÕ´Ï´Ù. |
boolean |
isValid ()
¸ðµç Çȼ¿ÀÌ À¯È¿ÇѰ¡ ¾î¶²°¡¸¦ µ¹·ÁÁÝ´Ï´Ù. |
boolean |
isValid (int pixel)
Çȼ¿ÀÌ À¯È¿ÇѰ¡ ¾î¶²°¡¸¦ µ¹·ÁÁÝ´Ï´Ù. |
String |
toString ()
ÀÌ ColorModel ¿ÀºêÁ§Æ®ÀÇ ³»¿ëÀ» ³ªÅ¸³»´Â String ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
| Ŭ·¡½º java.awt.image. ColorModel ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
coerceData , equals , getAlpha , getAlphaRaster , getBlue , getColorSpace , getComponentSize , getDataElement , getDataElements , getGreen , getNormalizedComponents , getNormalizedComponents , getNumColorComponents , getNumComponents , getPixelSize , getRed , getRGB , getRGBdefault , getTransferType , getUnnormalizedComponents , hasAlpha , hashCode , isAlphaPremultiplied |
| Ŭ·¡½º java.lang. Object ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
clone , getClass , notify , notifyAll , wait , wait , wait |
| »ý¼ºÀÚÀÇ »ó¼¼ |
public IndexColorModel(int bits,
int size,
byte[] r,
byte[] g,
byte[] b)
IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. ÀÌ Ä®¶ó ¸ðµ¨¿¡ ÀÇÇØ ±â¼úµÇ´Â Çȼ¿Àº ¸ðµÎ, Á¤±ÔȵǾî ÀÖÁö ¾ÊÀº 255 (1.0 Ç¥ÁØÈ)ÀÇ ¾ËÆÄ ¼ººÐÀ» °¡Áý´Ï´Ù. Áï, ¿ÏÀüÇÏ°Ô ºÒÅõ¸íÇÕ´Ï´Ù. »ö¼ººÐÀ» ÁöÁ¤ÇÏ´Â ¸ðµç ¹è¿Àº Àû¾îµµ ÁöÁ¤µÈ ¿£Æ®¸®¼ö¸¦ °¡Áú Çʿ䰡 ÀÖ½À´Ï´Ù. ColorSpace ´Â µðÆúÆ®ÀÇ sRGB area°¡ µË´Ï´Ù. Åõ¸íµµÀÇ °ªÀº Transparency.OPAQUE °¡ µË´Ï´Ù. Àü¼ÛÇüÀº ´ÜÀÏÀÇ Çȼ¿À» ÀúÀåÇÒ ¼ö ÀÖ´Â DataBuffer.TYPE_BYTE, ¶Ç´Â DataBuffer.TYPE_USHORT ÀÇ ÃÖ¼ÒÀÇ °ÍÀÌ µË´Ï´Ù.
bits - 1 Çȼ¿ ±ÙóÀÇ ºñÆ®¼ösize - »ö¼ººÐÀÇ ¹è¿ÀÇ Å©±âr - Àû»ö ¼ººÐÀÇ ¹è¿g - ³ì»ö ¼ººÐÀÇ ¹è¿b - û»ö ¼ººÐÀÇ ¹è¿
IllegalArgumentException - bits °¡ 1 º¸´Ù ÀÛÀºÁö 16 º¸´Ù Å« °æ¿ì
IllegalArgumentException - size °¡ 1 ¹Ì¸¸ÀÇ °æ¿ì
public IndexColorModel(int bits,
int size,
byte[] r,
byte[] g,
byte[] b,
int trans)
IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. ÀÌ Ä®¶ó ¸ðµ¨¿¡ ÀÇÇØ ±â¼úµÇ´Â Çȼ¿Àº ¸ðµÎ, Á¤±ÔȵǾî ÀÖÁö ¾ÊÀº 255 (1.0 Á¤±ÔÈ)ÀÇ ¾ËÆÄ ¼ººÐÀ» °¡Áý´Ï´Ù. Áï, ÁöÁ¤µÈ Åõ¸í Çȼ¿ Àܴ̿ ¿ÏÀüÇÏ°Ô ºÒÅõ¸íÇÕ´Ï´Ù. »ö¼ººÐÀ» ÁöÁ¤ÇÏ´Â ¸ðµç ¹è¿Àº Àû¾îµµ ÁöÁ¤µÈ ¿£Æ®¸®¼ö¸¦ °¡Áú Çʿ䰡 ÀÖ½À´Ï´Ù. ColorSpace ´Â µðÆúÆ®ÀÇ sRGB area°¡ µË´Ï´Ù. Åõ¸íµµÀÇ °ªÀº Transparency.BITMASK °¡ µË´Ï´Ù. Àü¼ÛÇüÀº ´ÜÀÏÀÇ Çȼ¿À» ÀúÀåÇÒ ¼ö ÀÖ´Â DataBuffer.TYPE_BYTE, ¶Ç´Â DataBuffer.TYPE_USHORT ÀÇ ÃÖ¼ÒÀÇ °ÍÀÌ µË´Ï´Ù.
bits - 1 Çȼ¿ ±ÙóÀÇ ºñÆ®¼ösize - »ö¼ººÐÀÇ ¹è¿ÀÇ Å©±âr - Àû»ö ¼ººÐÀÇ ¹è¿g - ³ì»ö ¼ººÐÀÇ ¹è¿b - û»ö ¼ººÐÀÇ ¹è¿trans - Åõ¸í Çȼ¿ÀÇ À妽º
IllegalArgumentException - bits °¡ 1 º¸´Ù ÀÛÀºÁö 16 º¸´Ù Å« °æ¿ì
IllegalArgumentException - size °¡ 1 ¹Ì¸¸ÀÇ °æ¿ì
public IndexColorModel(int bits,
int size,
byte[] r,
byte[] g,
byte[] b,
byte[] a)
IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. ¼ººÐÀ» ÁöÁ¤ÇÏ´Â ¸ðµç ¹è¿Àº Àû¾îµµ, ÁöÁ¤µÈ ¼öÀÇ ¿£Æ®¸®¸¦ °¡ÁöÁö ¾ÊÀ¸¸é ¾ÈµË´Ï´Ù. ColorSpace ´Â µðÆúÆ®ÀÇ sRGB area°¡ µË´Ï´Ù. Åõ¸íµµÀÇ °ªÀº Transparency.TRANSLUCENT °¡ µË´Ï´Ù. Àü¼ÛÇüÀº ´ÜÀÏÀÇ Çȼ¿À» ÀúÀåÇÒ ¼ö ÀÖ´Â DataBuffer.TYPE_BYTE, ¶Ç´Â DataBuffer.TYPE_USHORT ÀÇ ÃÖ¼ÒÀÇ °ÍÀÌ µË´Ï´Ù.
bits - 1 Çȼ¿ ±ÙóÀÇ ºñÆ®¼ösize - »ö¼ººÐÀÇ ¹è¿ÀÇ Å©±âr - Àû»ö ¼ººÐÀÇ ¹è¿g - ³ì»ö ¼ººÐÀÇ ¹è¿b - û»ö ¼ººÐÀÇ ¹è¿a - ¾ËÆÄÄ¡ ¼ººÐÀÇ ¹è¿
IllegalArgumentException - bits °¡ 1 º¸´Ù ÀÛÀºÁö 16 º¸´Ù Å« °æ¿ì
IllegalArgumentException - size °¡ 1 ¹Ì¸¸ÀÇ °æ¿ì
public IndexColorModel(int bits,
int size,
byte[] cmap,
int start,
boolean hasalpha)
IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. ÀÌ ¹è¿ÀÇ °ªÀº ÁöÁ¤µÈ »çÀÌÁîÀÇ ¼ººÐ ¹è¿À» ¸ðµÎ ÃæºÐÈ÷ ä¿ì´Â ¼öÀÏ Çʿ䰡 ÀÖ½À´Ï´Ù. ColorSpace ´Â µðÆúÆ®ÀÇ sRGB area°¡ µË´Ï´Ù. Åõ¸íµµÀÇ °ªÀº hasAlpha °¡ true ÀÇ °æ¿ì¿¡´Â Transparency.TRANSLUCENT, ±×·¸Áö ¾ÊÀº °æ¿ì¿¡´Â Transparency.OPAQUE °¡ µË´Ï´Ù. Àü¼ÛÇüÀº ´ÜÀÏÀÇ Çȼ¿À» ÀúÀåÇÒ ¼ö ÀÖ´Â DataBuffer.TYPE_BYTE, ¶Ç´Â DataBuffer.TYPE_USHORT ÀÇ ÃÖ¼ÒÀÇ °ÍÀÌ µË´Ï´Ù.
bits - 1 Çȼ¿ ±ÙóÀÇ ºñÆ®¼ösize - »ö¼ººÐÀÇ ¹è¿ÀÇ Å©±âcmap - »ö¼ººÐÀÇ ¹è¿start - ÃÖÃÊÀÇ »ö¼ººÐÀÇ °³½Ã ¿ÀÇÁ¼Â(offset)hasalpha - cmap ¹è¿¿¡¼ÀÇ ¾ËÆÄÄ¡ÀÇ À¯¹«¸¦ ³ªÅ¸³½´Ù
IllegalArgumentException - bits °¡ 1 º¸´Ù ÀÛÀºÁö 16 º¸´Ù Å« °æ¿ì
IllegalArgumentException - size °¡ 1 ¹Ì¸¸ÀÇ °æ¿ì
public IndexColorModel(int bits,
int size,
byte[] cmap,
int start,
boolean hasalpha,
int trans)
IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. ÁöÁ¤µÈ Åõ¸í À妽º´Â ¾î´À ¾ËÆÄÄ¡°¡ ÁöÁ¤µÇ°í À־, ¿ÏÀüÈ÷ Åõ¸íÇÏ´Ù¶ó°í º¸¿©Áö´Â Çȼ¿À» Ç¥ÇöÇÕ´Ï´Ù. ÀÌ ¹è¿ÀÇ °ªÀº ÁöÁ¤µÈ »çÀÌÁîÀÇ ¼ººÐ ¹è¿À» ¸ðµÎ ÃæºÐÈ÷ ä¿ì´Â ¼öÀÏ Çʿ䰡 ÀÖ½À´Ï´Ù. ColorSpace ´Â µðÆúÆ®ÀÇ sRGB area°¡ µË´Ï´Ù. Åõ¸íµµÀÇ °ªÀº hasAlpha °¡ true ÀÇ °æ¿ì¿¡´Â Transparency.TRANSLUCENT °¡ µË´Ï´Ù. ±×·¸Áö ¾ÊÀº °æ¿ì,trans °¡ Ä®¶ó MAP¿¡ ´ëÇØ¼ À¯È¿ÇÑ À妽º (0 ~»çÀÌÁî - 1 ÀÇ ¹üÀ§) ¶§´Â Transparency.BITMASK,trans °¡ À¯È¿ÇÑ À妽º°¡ ¾Æ´Ò ¶§´Â Transparency.OPAQUE °¡ µË´Ï´Ù. Àü¼ÛÇüÀº ´ÜÀÏÀÇ Çȼ¿À» ÀúÀåÇÒ ¼ö ÀÖ´Â DataBuffer.TYPE_BYTE, ¶Ç´Â DataBuffer.TYPE_USHORT ÀÇ ÃÖ¼ÒÀÇ °ÍÀÌ µË´Ï´Ù.
bits - 1 Çȼ¿ ±ÙóÀÇ ºñÆ®¼ösize - »ö¼ººÐÀÇ ¹è¿ÀÇ Å©±âcmap - »ö¼ººÐÀÇ ¹è¿start - ÃÖÃÊÀÇ »ö¼ººÐÀÇ °³½Ã ¿ÀÇÁ¼Â(offset)hasalpha - cmap ¹è¿¿¡¼ÀÇ ¾ËÆÄÄ¡ÀÇ À¯¹«¸¦ ³ªÅ¸³»´Âtrans - ¿ÏÀüÇÑ Åõ¸í Çȼ¿ÀÇ À妽º
IllegalArgumentException - bits °¡ 1 º¸´Ù ÀÛÀºÁö 16 º¸´Ù Å« °æ¿ì
IllegalArgumentException - size °¡ 1 ¹Ì¸¸ÀÇ °æ¿ì
public IndexColorModel(int bits,
int size,
int[] cmap,
int start,
boolean hasalpha,
int trans,
int transferType)
IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. ´Ù¸¸, °¢ int ´Â µðÆúÆ®ÀÇ RGB Ä®¶ó ¸ðµ¨ Çü½ÄÀÇ Àû, ÃÊ·Ï, ÆÄ¶ûÀÇ »ö¼ººÐ, ¹× ÀÓÀÇÀÇ ¾ËÆÄ ¼ººÐÀ¸·ÎºÎÅÍ µË´Ï´Ù. ÁöÁ¤µÈ Åõ¸í À妽º´Â ¾î´À ¾ËÆÄÄ¡°¡ ÁöÁ¤µÇ°í À־, ¿ÏÀüÇÏ°Ô Åõ¸íÇÏ´Ù¶ó°í º¸¿©Áö´Â Çȼ¿À» Ç¥ÇöÇÕ´Ï´Ù. ÀÌ ¹è¿ÀÇ °ªÀº ÁöÁ¤µÈ »çÀÌÁîÀÇ ¼ººÐ ¹è¿À» ¸ðµÎ ÃæºÐÈ÷ ä¿ì´Â ¼öÀÏ Çʿ䰡 ÀÖ½À´Ï´Ù. ColorSpace ´Â µðÆúÆ®ÀÇ sRGB area°¡ µË´Ï´Ù. Åõ¸íµµÀÇ °ªÀº hasAlpha °¡ true ÀÇ °æ¿ì¿¡´Â Transparency.TRANSLUCENT °¡ µË´Ï´Ù. ±×·¸Áö ¾ÊÀº °æ¿ì´Â trans °¡ Ä®¶ó MAPÀÇ À¯È¿ÇÑ À妽º (0 ~»çÀÌÁî - 1 ÀÇ ¹üÀ§) ¶§´Â Transparency.BITMASK,trans °¡ À¯È¿ÇÑ À妽º°¡ ¾Æ´Ò ¶§´Â Transparency.OPAQUE °¡ µË´Ï´Ù.
bits - 1 Çȼ¿ ±ÙóÀÇ ºñÆ®¼ösize - »ö¼ººÐÀÇ ¹è¿ÀÇ Å©±âcmap - »ö¼ººÐÀÇ ¹è¿start - ÃÖÃÊÀÇ »ö¼ººÐÀÇ °³½Ã ¿ÀÇÁ¼Â(offset)hasalpha - cmap ¹è¿¿¡¼ÀÇ ¾ËÆÄÄ¡ÀÇ À¯¹«¸¦ ³ªÅ¸³»´Âtrans - ¿ÏÀüÇÑ Åõ¸í Çȼ¿ÀÇ À妽ºtransferType - Çȼ¿Ä¡¸¦ ³ªÅ¸³¾ ¶§ »ç¿ëÇÏ´Â ¹è¿ÀÇ µ¥ÀÌÅÍÇü. µ¥ÀÌÅÍÇüÀº DataBuffer.TYPE_BYTE ¶Ç´Â DataBuffer.TYPE_USHORT ÀÇ ¾î´À ÂÊÀÎÁö
IllegalArgumentException - bits °¡ 1 º¸´Ù ÀÛÀºÁö 16 º¸´Ù Å« °æ¿ì
IllegalArgumentException - size °¡ 1 ¹Ì¸¸ÀÇ °æ¿ì
IllegalArgumentException - transferType °¡ DataBuffer.TYPE_BYTE ¶Ç´Â DataBuffer.TYPE_USHORT °¡ ¾î´À Âʵµ ¾Æ´Ñ °æ¿ì
public IndexColorModel(int bits,
int size,
int[] cmap,
int start,
int transferType,
BigInteger validBits)
IndexColorModel ¸¦ ±¸ÃàÇÕ´Ï´Ù. ´Ù¸¸, °¢ int ´Â µðÆúÆ®ÀÇ RGB Ä®¶ó ¸ðµ¨ Çü½ÄÀÇ Àû, ÃÊ·Ï, ÆÄ¶ûÀÇ »ö¼ººÐ, ¹× ¾ËÆÄ ¼ººÐÀ¸·ÎºÎÅÍ µË´Ï´Ù. ÀÌ ¹è¿ÀÇ °ªÀº ÁöÁ¤µÈ »çÀÌÁîÀÇ ¼ººÐ ¹è¿À» ¸ðµÎ ÃæºÐÈ÷ ä¿ì´Â ¼öÀÏ Çʿ䰡 ÀÖ½À´Ï´Ù. ColorSpace ´Â µðÆúÆ®ÀÇ sRGB area°¡ µË´Ï´Ù. Àü¼ÛÇüÀº ´ÜÀÏÀÇ Çȼ¿À» ÀúÀåÇÒ ¼ö ÀÖ´Â DataBuffer.TYPE_BYTE , ¶Ç´Â DataBuffer.TYPE_USHORT ÀÇ ¾î´À ÂÊÀÎÁöÀÔ´Ï´Ù. BigInteger ¿ÀºêÁ§Æ®´Â cmap ¹è¿ÀÇ À¯È¿/¹«È¿ Çȼ¿À» ÁöÁ¤ÇÕ´Ï´Ù. Çȼ¿Àº ±× À妽ºÀÇ BigInteger Ä¡°¡ ¼³Á¤µÇ¾î ÀÖÀ¸¸é À¯È¿, ±× À妽ºÀÇ BigInteger ºñÆ®°¡ ¼³Á¤µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â ¹«È¿ÀÔ´Ï´Ù.
bits - 1 Çȼ¿ ±ÙóÀÇ ºñÆ®¼ösize - »ö¼ººÐÀÇ ¹è¿ÀÇ Å©±âcmap - »ö¼ººÐÀÇ ¹è¿start - ÃÖÃÊÀÇ »ö¼ººÐÀÇ °³½Ã ¿ÀÇÁ¼Â(offset)transferType - ÁöÁ¤µÈ µ¥ÀÌÅÍÇüvalidBits - BigInteger ÀÇ ¿ÀºêÁ§Æ®. ºñÆ®°¡ BigInteger ·Î ¼³Á¤µÇ¾î ÀÖ´Â °æ¿ì´Â À妽ºÀÇ Çȼ¿Àº À¯È¿. ºñÆ®°¡ ¼³Á¤µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â À妽ºÀÇ Çȼ¿Àº ¹«È¿¶ó°í º¸¿©Áø´Ù. null ÀÇ °æ¿ì´Â ¸ðµç Çȼ¿ÀÌ À¯È¿. Á¦·Î·ÎºÎÅÍ map_size ±îÁöÀÇ ºñÆ®¸¸ÀÌ °í·ÁµÈ´Ù
IllegalArgumentException - bits °¡ 1 º¸´Ù ÀÛÀºÁö 16 º¸´Ù Å« °æ¿ì
IllegalArgumentException - size °¡ 1 ¹Ì¸¸ÀÇ °æ¿ì
IllegalArgumentException - transferType °¡ DataBuffer.TYPE_BYTE ¶Ç´Â DataBuffer.TYPE_USHORT °¡ ¾î´À Âʵµ ¾Æ´Ñ °æ¿ì| ¸Þ¼ÒµåÀÇ »ó¼¼ |
public int getTransparency()
Transparency ³»ÀÇ getTransparency ColorModel ³»ÀÇ getTransparency IndexColorModel ÀÇ Åõ¸íµµTransparency.OPAQUE ,
Transparency.BITMASK ,
Transparency.TRANSLUCENT public int[] getComponentSize()
ColorModel ³»ÀÇ getComponentSize IndexColorModel ÀÇ »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐ¸¶´ÙÀÇ ºñÆ®¼öÀÇ ¹è¿public final int getMapSize()
IndexColorModel ³»ÀÇ »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿ÀÇ Å©±â¸¦ µ¹·ÁÁÝ´Ï´Ù.
public final int getTransparentPixel()
IndexColorModel ³»ÀÇ Åõ¸í Çȼ¿ÀÇ À妽º¸¦ µ¹·ÁÁÝ´Ï´Ù. ´Ù¸¸, Åõ¸í Çȼ¿ÀÌ ¾ø´Â °æ¿ì´Â -1 À» µ¹·ÁÁÝ´Ï´Ù.
IndexColorModel ÀÇ ¿ÀºêÁ§Æ®ÀÇ Åõ¸í Çȼ¿ÀÇ À妽º¸¦ µ¹·ÁÁÝ´Ï´Ù. ´Ù¸¸, Åõ¸í Çȼ¿ÀÌ ¾ø´Â °æ¿ì´Â -1 À» µ¹·ÁÁÝ´Ï´Ù. public final void getReds(byte[] r)
getMapSize ·Î ÁöÁ¤µÈ ¹è¿ÀÇ Ãʱ⠿£Æ®¸®¸¸ÀÌ ±âÀÔÇØÁý´Ï´Ù.
r - »¡°ÀÇ »ö¼ººÐÀÇ ¹è¿ ¿ä¼ÒÀÇ Ä«ÇÇó·Î¼ ÁöÁ¤µÇ´Â ¹è¿public final void getGreens(byte[] g)
getMapSize ·Î ÁöÁ¤µÈ ¹è¿ÀÇ Ãʱ⠿£Æ®¸®¸¸ÀÌ ±âÀÔÇØÁý´Ï´Ù.
g - ÃÊ·ÏÀÇ »ö¼ººÐÀÇ ¹è¿ ¿ä¼ÒÀÇ Ä«ÇÇó·Î¼ ÁöÁ¤µÇ´Â ¹è¿public final void getBlues(byte[] b)
getMapSize ·Î ÁöÁ¤µÈ ¹è¿ÀÇ Ãʱ⠿£Æ®¸®¸¸ÀÌ ±âÀÔÇØÁý´Ï´Ù.
b - ÆÄ¶ûÀÇ »ö¼ººÐÀÇ ¹è¿ ¿ä¼ÒÀÇ Ä«ÇÇó·Î¼ ÁöÁ¤µÇ´Â ¹è¿public final void getAlphas(byte[] a)
getMapSize ·Î ÁöÁ¤µÈ ¹è¿ÀÇ Ãʱ⠿£Æ®¸®¸¸ÀÌ ±âÀÔÇØÁý´Ï´Ù.
a - ¾ËÆÄ ¼ººÐÀÇ ¹è¿ ¿ä¼ÒÀÇ Ä«ÇÇó·Î¼ ÁöÁ¤µÇ´Â ¹è¿public final void getRGBs(int[] rgb)
getMapSize ·Î ÁöÁ¤µÈ ¹è¿ÀÇ Ãʱ⠿£Æ®¸®¸¸ÀÌ ±âÀÔÇØÁý´Ï´Ù.
rgb - ÀÌ »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐ ¹è¿·ÎºÎÅÍ º¯È¯ÇÑ ARGB Ä¡ÀÇ Ä«ÇÇó·Î¼ ÁöÁ¤µÇ´Â ¹è¿public final int getRed(int pixel)
ColorModel ³»ÀÇ getRed pixel - ÁöÁ¤µÈ Çȼ¿
public final int getGreen(int pixel)
ColorModel ³»ÀÇ getGreen pixel - ÁöÁ¤µÈ Çȼ¿
public final int getBlue(int pixel)
ColorModel ³»ÀÇ getBlue pixel - ÁöÁ¤µÈ Çȼ¿
public final int getAlpha(int pixel)
ColorModel ³»ÀÇ getAlpha pixel - ÁöÁ¤µÈ Çȼ¿
public final int getRGB(int pixel)
ColorModel ³»ÀÇ getRGB pixel - ÁöÁ¤µÈ Çȼ¿
ColorModel.getRGBdefault()
public Object getDataElements(int rgb,
Object pixel)
WritableRaster ¿ÀºêÁ§Æ®ÀÇ setDataElements ¸Þ¼Òµå¿¡°Ô °Ç³×Áý´Ï´Ù. pixel º¯¼ö°¡ null ÀÇ °æ¿ì´Â »õ·Î¿î ¹è¿À» ÇÒ´çÇÒ ¼ö ÀÖ½À´Ï´Ù. pixel °¡ null °¡ ¾Æ´Ñ °æ¿ì´Â transferType ÇüÀÇ ¿ø½ÃÀû ¹è¿ÀÏ Çʿ䰡 ÀÖ½À´Ï´Ù. ±×·¸Áö ¾ÊÀº °æ¿ì´Â ClassCastException °¡ ½½·Î¿ì µË´Ï´Ù. pixel °¡ ÀÌ ColorModel ÀÇ Çȼ¿Ä¡¸¦ ÀúÀåÇÒ ¼ö ÀÖÀ» ¸¸Å Å©Áö ¾ÊÀº °æ¿ì´Â ArrayIndexOutOfBoundsException °¡ ½½·Î¿ì µË´Ï´Ù. Çȼ¿ ¹è¿ÀÌ µ¹·ÁÁÖ¾îÁý´Ï´Ù.
IndexColorModel ´Â ¼ºê Ŭ·¡½ºÈÇÒ ¼ö ÀÖ±â (À§ÇØ)¶§¹®¿¡, ¼ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼ÒµåÀÇ ±¸ÇöÀ» °è½ÂÇÕ´Ï´Ù. ¼ºê Ŭ·¡½º°¡ ¿À¹ö¶óÀ̵å(override) ÇÏÁö ¾Ê´Â °æ¿ì, ¼Æ÷Æ®µÇ¾î ÀÖÁö ¾ÊÀº transferType ¸¦ »ç¿ëÇßÀ» °æ¿ì´Â ¿¹¿Ü¸¦ ½½·Î¿ì ÇÕ´Ï´Ù.
ColorModel ³»ÀÇ getDataElements rgb - µðÆúÆ® RGB Ä®¶ó ¸ðµ¨ÀÇ Á¤¼öÇü Çȼ¿ Ç¥Çöpixel - ÁöÁ¤µÈ Çȼ¿
IndexColorModel ÀÇ ÁöÁ¤µÈ Çȼ¿ÀÇ ¹è¿ Ç¥Çö
ClassCastException - pixel °¡ transferType ÇüÀÇ ¿ø½ÃÀû ¹è¿ÀÌ ¾Æ´Ñ °æ¿ì
ArrayIndexOutOfBoundsException - pixel °¡ ÀÌ ColorModel ÀÇ Çȼ¿Ä¡¸¦ º¸°ü À¯ÁöÇϴµ¥ ÃæºÐÇÑ Å©±â°¡ ¾Æ´Ñ °æ¿ì
UnsupportedOperationException - transferType °¡ ¹«È¿ÀÎ °æ¿ìWritableRaster.setDataElements(int, int, java.lang.Object) ,
SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)
public int[] getComponents(int pixel,
int[] components,
int offset)
ColorModel ÀÇ ÁöÁ¤µÈ Çȼ¿¿¡ ´ëÇØ, Ç¥ÁØÈµÇ¾î ÀÖÁö ¾ÊÀº »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. Çȼ¿Ä¡´Â int ·Î¼ ÁöÁ¤µË´Ï´Ù. ¼ººÐ ¹è¿ÀÌ null ÀÇ °æ¿ì, »õ·Î¿î ¹è¿À» ÇÒ´çÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼ººÐ ¹è¿ÀÌ µ¹·ÁÁÖ¾îÁý´Ï´Ù. »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀº offset ·ÎºÎÅÍ °³½ÃµÇ´Â ¼ººÐ ¹è¿¿¡ ÀúÀåµË´Ï´Ù. À̰ÍÀº ¹è¿ÀÌ ÀÌ ¸Þ¼Òµå·Î ÇÒ´çÇÒ ¼ö À־ ¹Ù²îÁö ¾Ê½À´Ï´Ù. ¼ººÐ ¹è¿ÀÌ null °¡ ¾Æ´Ï°í,offset ¸¦ °³½ÃÁ¡À¸·Î ÇßÀ» ¶§¿¡, »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¸ðµç °ÍÀ» ÀúÀåÇÒ ¼ö ÀÖÀ» ¸¸Å Å©Áö ¾ÊÀº °æ¿ì´Â ArrayIndexOutOfBoundsException °¡ ½½·Î¿ì µË´Ï´Ù.
ColorModel ³»ÀÇ getComponents pixel - ÁöÁ¤µÈ Çȼ¿components - ÁöÁ¤µÈ Çȼ¿ÀÇ »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀ» ¹Þ´Â ¹è¿offset - »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀÇ ÀúÀåÀ» °³½ÃÇÏ´Â components ¹è¿³»ÀÇ ¿ÀÇÁ¼Â(offset)
public int[] getComponents(Object pixel,
int[] components,
int offset)
ColorModel ÀÇ ÁöÁ¤µÈ Çȼ¿¿¡ ´ëÇØ, Ç¥ÁØÈµÇ¾î ÀÖÁö ¾ÊÀº »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. Çȼ¿Ä¡´Â ¿ÀºêÁ§Æ® ÂüÁ¶·Î¼ °Ç³×¹Þ´Â transferType ÇüÀÇ µ¥ÀÌÅÍ ¿ä¼ÒÀÇ ¹è¿¿¡ ÀÇÇØ ÁöÁ¤µË´Ï´Ù. pixel °¡ transferType ÇüÀÇ ¿ø½ÃÀû ¹è¿ÀÌ ¾Æ´Ñ °æ¿ì´Â ClassCastException °¡ ½½·Î¿ì µË´Ï´Ù. pixel °¡ ÀÌ ColorModel ÀÇ Çȼ¿Ä¡¸¦ ÀúÀåÇÒ ¼ö ÀÖÀ» ¸¸Å Å©Áö ¾ÊÀº °æ¿ì´Â ArrayIndexOutOfBoundsException °¡ ½½·Î¿ì µË´Ï´Ù. components ¹è¿ÀÌ null ÀÇ °æ¿ì´Â »õ·Î¿î ¹è¿À» ÇÒ´çÇÒ ¼ö ÀÖ½À´Ï´Ù. ±× components ¹è¿ÀÌ µ¹·ÁÁÖ¾îÁý´Ï´Ù. »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀº offset ·ÎºÎÅÍ ½ÃÀ۵Ǵ components ¹è¿¿¡ ÀúÀåµË´Ï´Ù. À̰ÍÀº ¹è¿ÀÌ ÀÌ ¸Þ¼Òµå·Î ÇÒ´çÇÒ ¼ö À־ ¹Ù²îÁö ¾Ê½À´Ï´Ù. components ¹è¿ÀÌ null °¡ ¾Æ´Ï°í,offset ¸¦ °³½ÃÁ¡À¸·Î ÇßÀ» °æ¿ì¿¡, »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¸ðµç °ÍÀ» ÀúÀåÇÒ ¼ö ÀÖÀ» ¸¸Å Å©Áö ¾ÊÀº °æ¿ì´Â ArrayIndexOutOfBoundsException °¡ ½½·Î¿ì µË´Ï´Ù.
IndexColorModel ´Â ¼ºê Ŭ·¡½ºÈÇÒ ¼ö ÀÖ±â (À§ÇØ)¶§¹®¿¡, ¼ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼ÒµåÀÇ ±¸ÇöÀ» °è½ÂÇÕ´Ï´Ù. ¼ºê Ŭ·¡½º°¡ ¿À¹ö¶óÀ̵å(override) ÇÏÁö ¾Ê´Â °æ¿ì, ¼Æ÷Æ®µÇ¾î ÀÖÁö ¾ÊÀº transferType ¸¦ »ç¿ëÇßÀ» °æ¿ì´Â ¿¹¿Ü¸¦ ½½·Î¿ì ÇÕ´Ï´Ù.
ColorModel ³»ÀÇ getComponents pixel - ÁöÁ¤µÈ Çȼ¿components - ÁöÁ¤µÈ Çȼ¿ÀÇ »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀ» ¹Þ´Â ¹è¿offset - ÁöÁ¤µÈ Çȼ¿ÀÇ »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀÇ ÀúÀåÀ» °³½ÃÇÏ´Â components ¹è¿³»ÀÇ À妽º
ArrayIndexOutOfBoundsException - pixel °¡ ÀÌ ColorModel ÀÇ Çȼ¿Ä¡¸¦ º¸°ü À¯ÁöÇϴµ¥ ÃæºÐÇÑ Å©±â°¡ ¾Æ´Ñ °æ¿ì, ȤÀº components ¹è¿ÀÌ null ´Â ¾Æ´Ï°í,offset ¸¦ °³½ÃÁ¡À¸·Î ÇßÀ» °æ¿ì¿¡, ¸ðµç »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀ» º¸°ü À¯ÁöÇϱ⿡ ÃæºÐÇÑ Å©±â°¡ ¾Æ´Ñ °æ¿ì
ClassCastException - pixel °¡ transferType ÇüÀÇ ¿ø½ÃÀû ¹è¿ÀÌ ¾Æ´Ñ °æ¿ì
UnsupportedOperationException - transferType °¡ ¼Æ÷Æ®µÇ°í ÀÖ´Â Àü¼ÛÇüÀÌ ¾Æ´Ñ °æ¿ì
public int getDataElement(int[] components,
int offset)
ColorModel ÀÇ int ·Î¼ Ç¥ÇöµÇ´Â Çȼ¿Ä¡¸¦ µ¹·ÁÁÝ´Ï´Ù. components ¹è¿ÀÌ »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐ (offset ·ÎºÎÅÍ ½ÃÀ۵ȴÙ)ÀÇ ¸ðµç °ÍÀ» ÀúÀåÇÒ ¼ö ÀÖÀ» ¸¸Å Å©Áö ¾ÊÀº °æ¿ì´Â ArrayIndexOutOfBoundsException °¡ ½½·Î¿ì µË´Ï´Ù. ColorModel ´Â ¼ºê Ŭ·¡½ºÈÇÒ ¼ö ÀÖ±â (À§ÇØ)¶§¹®¿¡, ¼ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼ÒµåÀÇ ±¸ÇöÀ» °è½ÂÇÕ´Ï´Ù. ¼ºê Ŭ·¡½º°¡ ¿À¹ö¶óÀ̵å(override) ÇÏÁö ¾Ê´Â °æ¿ì, ¼Æ÷Æ®µÇ¾î ÀÖÁö ¾ÊÀº transferType ¸¦ »ç¿ëÇßÀ» °æ¿ì´Â ¿¹¿Ü¸¦ ½½·Î¿ì ÇÕ´Ï´Ù.
ColorModel ³»ÀÇ getDataElement components - Ç¥ÁØÈµÇ¾î ÀÖÁö ¾ÊÀº »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀÇ ¹è¿offset - »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀÇ Ãëµæ °³½Ã À§Ä¡¸¦ ÁöÁ¤ÇÏ´Â components ³»ÀÇ À妽º
ColorModel ³»ÀÇ int Çȼ¿Ä¡
ArrayIndexOutOfBoundsException - components ¹è¿ÀÇ Å©±â°¡,offset ¸¦ °³½ÃÁ¡À¸·Î ÇßÀ» °æ¿ì, ¸ðµç »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀ» º¸°ü À¯ÁöÇϴµ¥ ÃæºÐÇÏÁö ¾ÊÀº °æ¿ì
UnsupportedOperationException - transferType °¡ ¹«È¿ÀÎ °æ¿ì
public Object getDataElements(int[] components,
int offset,
Object pixel)
ColorModel ÀÇ Çȼ¿ÀÇ µ¥ÀÌÅÍ ¿ä¼Ò ¹è¿ Ç¥ÇöÀ» µ¹·ÁÁÝ´Ï´Ù. ÀÌ ¹è¿Àº WritableRaster ¿ÀºêÁ§Æ®ÀÇ setDataElements ¸Þ¼Òµå¿¡ °Ç³×ÁÙ ¼ö°¡ ÀÖ½À´Ï´Ù. components ¹è¿ÀÌ,offset ¸¦ °³½ÃÁ¡À¸·Î ÇßÀ» °æ¿ì¿¡, ¸ðµç »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀ» ÀúÀåÇϴµ¥ ÃæºÐÇÑ Å©±â°¡ ¾Æ´Ñ °æ¿ì´Â ArrayIndexOutOfBoundsException °¡ ½½·Î¿ì µË´Ï´Ù. Çȼ¿ º¯¼ö°¡ null ÀÇ °æ¿ì´Â »õ·Î¿î ¹è¿À» ÇÒ´çÇÒ ¼ö ÀÖ½À´Ï´Ù. pixel °¡ null °¡ ¾Æ´Ñ °æ¿ì´Â transferType ÇüÀÇ ¿ø½ÃÀû ¹è¿ÀÏ Çʿ䰡 ÀÖ½À´Ï´Ù. ±×·¸Áö ¾ÊÀº °æ¿ì´Â ClassCastException °¡ ½½·Î¿ì µË´Ï´Ù. Çȼ¿ÀÌ ÀÌ ColorModel ÀÇ Çȼ¿Ä¡¸¦ ÀúÀåÇϴµ¥ ÃæºÐÇÑ Å©±â°¡ ¾Æ´Ñ °æ¿ì´Â ArrayIndexOutOfBoundsException °¡ ½½·Î¿ì µË´Ï´Ù.
IndexColorModel ´Â ¼ºê Ŭ·¡½ºÈÇÒ ¼ö ÀÖ±â (À§ÇØ)¶§¹®¿¡, ¼ºê Ŭ·¡½º´Â ÀÌ ¸Þ¼ÒµåÀÇ ±¸ÇöÀ» °è½ÂÇÕ´Ï´Ù. ¼ºê Ŭ·¡½º°¡ ¿À¹ö¶óÀ̵å(override) ÇÏÁö ¾Ê´Â °æ¿ì, ¼Æ÷Æ®µÇ¾î ÀÖÁö ¾ÊÀº transferType ¸¦ »ç¿ëÇßÀ» °æ¿ì´Â ¿¹¿Ü¸¦ ½½·Î¿ì ÇÕ´Ï´Ù.
ColorModel ³»ÀÇ getDataElements components - Ç¥ÁØÈµÇ¾î ÀÖÁö ¾ÊÀº »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀÇ ¹è¿offset - »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀÇ Ãëµæ °³½Ã À§Ä¡¸¦ ÁöÁ¤ÇÏ´Â components ³»ÀÇ À妽ºpixel - »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀÇ ¹è¿À» ³ªÅ¸³»´Â Object
Object
ClassCastException - pixel °¡ transferType ÇüÀÇ ¿ø½ÃÀû ¹è¿ÀÌ ¾Æ´Ñ °æ¿ì
ArrayIndexOutOfBoundsException - pixel °¡ ÀÌ ColorModel ÀÇ Çȼ¿Ä¡¸¦ º¸°ü À¯ÁöÇϴµ¥ ÃæºÐÇÑ Å©±â°¡ ¾Æ´Ñ °æ¿ì, ȤÀº components ¹è¿ÀÌ,offset ¸¦ °³½ÃÁ¡À¸·Î ÇßÀ» °æ¿ì, ¸ðµç »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐÀ» º¸°ü À¯ÁöÇϴµ¥ ÃæºÐÇÑ Å©±â°¡ ¾Æ´Ñ °æ¿ì
UnsupportedOperationException - transferType °¡ ¼Æ÷Æ®µÇ°í ÀÖ´Â Àü¼ÛÇüÀÌ ¾Æ´Ñ °æ¿ìWritableRaster.setDataElements(int, int, java.lang.Object) ,
SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)
public WritableRaster createCompatibleWritableRaster(int w,
int h)
ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖ´Â µ¥ÀÌÅÍ ·¹À̾ƿô SampleModel ¸¦ °¡Áö´Â WritableRaster ¸¦ ÀÛ¼ºÇÕ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â Çȼ¿¸¶´ÙÀÇ ºñÆ®°¡ 16 ÀÌÇÏÀÇ Ä®¶ó ¸ðµ¨ÀÇ °æ¿ì¿¡ ÇÑÁ¤ÇØ ±â´ÉÇÕ´Ï´Ù.
IndexColorModel ´Â ¼ºê Ŭ·¡½ºÈÇÒ ¼ö ÀÖ±â (À§ÇØ)¶§¹®¿¡, Çȼ¿¸¶´ÙÀÇ ºñÆ®¼ö°¡ 16 º¸´Ù Å« °æ¿ì¸¦ ¼Æ÷Æ®ÇÏ´Â ¸ðµç ¼ºê Ŭ·¡½º¿¡¼´Â ÀÌ ¸Þ¼Òµå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
ColorModel ³»ÀÇ createCompatibleWritableRaster w - »õ·Î¿î WritableRaster ¿¡ Àû¿ëµÇ´Â Æøh - »õ·Î¿î WritableRaster ¿¡ Àû¿ëµÇ´Â ³ôÀÌ
WritableRaster ¿ÀºêÁ§Æ®
UnsupportedOperationException - Çȼ¿ÀÇ ºñÆ®¼ö°¡ 16 º¸´Ù Å« °æ¿ìWritableRaster ,
SampleModel public boolean isCompatibleRaster(Raster raster)
raster °¡ ÀÌ ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖ´Â °æ¿ì¿¡´Â true ¸¦ µ¹·ÁÁÖ¾î, ±×·¸Áö ¾ÊÀº °æ¿ì¿¡´Â false ¸¦ µ¹·ÁÁÝ´Ï´Ù.
ColorModel ³»ÀÇ isCompatibleRaster raster - ȣȯ¼ºÀ» ÆÇÁ¤ÇÏ´Â Raster ¿ÀºêÁ§Æ®
raster °¡ ÀÌ ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖ´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
public SampleModel createCompatibleSampleModel(int w,
int h)
ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖ´Â µ¥ÀÌÅÍ ·¹À̾ƿôÀ» °¡Áö´Â ÁöÁ¤µÈ Æø°ú ³ôÀÌÀÇ SampleModel ¸¦ ÀÛ¼ºÇÕ´Ï´Ù.
ColorModel ³»ÀÇ createCompatibleSampleModel w - »õ·Î¿î SampleModel ¿¡ Àû¿ëµÇ´Â Æøh - »õ·Î¿î SampleModel ¿¡ Àû¿ëµÇ´Â ³ôÀÌ
SampleModel ¿ÀºêÁ§Æ®
IllegalArgumentException - w ¶Ç´Â h °¡ Á¦·Î ÀÌÇÏÀÇ °æ¿ìSampleModel public boolean isCompatibleSampleModel(SampleModel sm)
SampleModel °¡ ÀÌ ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖÀ»Áö ¾î¶³Áö¸¦ Á¶»çÇÕ´Ï´Ù. sm °¡ null ÀÇ °æ¿ì, ÀÌ ¸Þ¼Òµå´Â false ¸¦ µ¹·ÁÁÝ´Ï´Ù.
ColorModel ³»ÀÇ isCompatibleSampleModel sm - ÁöÁ¤µÈ SampleModel, ¶Ç´Â null
SampleModel °¡ ÀÌ ColorModel ¿Í ȣȯ¼ºÀÌ ÀÖ´Â °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â falseSampleModel
public BufferedImage convertToIntDiscrete(Raster raster,
boolean forceARGB)
Raster ÀÇ À妽º¸¦ Àü°³ÇØ °è»êÇÑ Çȼ¿ µ¥ÀÌÅÍ Ã·ºÎÀÇ Raster ¸¦ °¡Áö´Â TYPE_INT_ARGB ¶Ç´Â TYPE_INT_RGB ÀÇ »õ·Î¿î BufferedImage ¸¦, ÀÌ ColorModel ÀÇ »ö¼ººÐ°ú ¾ËÆÄ ¼ººÐÀÇ ¹è¿À» »ç¿ëÇØ µ¹·ÁÁÝ´Ï´Ù. forceARGB °¡ true ÀÇ °æ¿ì, ÀÌ ColorModel °¡ ¾ËÆÄ ¼ººÐ ¹è¿ ¶Ç´Â Åõ¸í Çȼ¿ÀÇ ¾î´À ÂÊÀ» °¡Áú±î¿¡ °ü°è¾øÀÌ, TYPE_INT_ARGB À̹ÌÁö°¡ µ¹·ÁÁÖ¾îÁý´Ï´Ù.
raster - ÁöÁ¤µÇ´Â RasterforceARGB - true ÀÇ °æ¿ì, µ¹·ÁÁÖ¾îÁö´Â BufferedImage ´Â TYPE_INT_ARGB, ±×·¸Áö ¾ÊÀº °æ¿ì´Â TYPE_INT_RGB
Raster ·Î ÀÛ¼ºÇÑ BufferedImage
IllegalArgumentException - raster Àμö°¡ ÀÌ IndexColorModel ¿Í ȣȯ¼ºÀÌ ¾ø´Â °æ¿ìpublic boolean isValid(int pixel)
pixel - ÁöÁ¤µÈ Çȼ¿Ä¡
pixel °¡ À¯È¿ÇÑ °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â falsepublic boolean isValid()
pixel °¡ À¯È¿ÇÑ °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â falsepublic BigInteger getValidPixels()
BigInteger ¸¦ µ¹·ÁÁÝ´Ï´Ù. BigInteger Ä¡°¡ ±× À妽º·Î ¼³Á¤µÇ¾î ÀÖ´Â °æ¿ì, ºñÆ®´Â À¯È¿,BigInteger °¡ ±× À妽º·Î ¼³Á¤µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â ¹«È¿ÀÔ´Ï´Ù. BigInteger ¼Ó¿¡¼ Á¶È¸ÇÒ ¼ö ÀÖ´Â À¯È¿Ä¡´Â Á¦·Î·ÎºÎÅÍ map_size ÀÇ ¹üÀ§ »ÓÀÔ´Ï´Ù.
BigIntegerpublic void finalize()
ColorModel °¡ ÂüÁ¶µÇÁö ¾Ê°Ô µÇ¾úÀ» ¶§¿¡, °ü·Ã system resource¸¦ ÆÄ±âÇÕ´Ï´Ù.
ColorModel ³»ÀÇ finalize public String toString()
ColorModel ¿ÀºêÁ§Æ®ÀÇ ³»¿ëÀ» ³ªÅ¸³»´Â String ¸¦ µ¹·ÁÁÝ´Ï´Ù.
ColorModel ³»ÀÇ toString ColorModel ¿ÀºêÁ§Æ®ÀÇ ³»¿ëÀ» ³ªÅ¸³»´Â String
|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
| ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
| °³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå | ||||||||||
Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ ÀÖ¾î¼ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.