|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.awt.image.RescaleOp
public class RescaleOp
ÀÌ Å¬·¡½º¿¡¼´Â Àü¼Û¿øÀ̹ÌÁöÀÇ µ¥ÀÌÅÍÀÇ Çȼ¿ ´ÜÀ§ÀÇ À罽͏µÀ» ½Ç½ÃÇÕ´Ï´Ù. °¢ Çȼ¿ÀÇ »ùÇÃÄ¡¿Í ½½Ä¶¸µ °è¼öÀÇ ÀûÀ» ¿ä±¸ÇØ ¿ÀÇÁ¼Â(offset)¸¦ °¡»êÇÕ´Ï´Ù. °è»êÀ¸·Î ¿ä±¸µÈ »ùÇÃÄ¡´Â Àü¼Ûó À̹ÌÁöÀÇ ÃÖ¼Ò ¹× ÃÖ´ë¿¡ Ŭ¸³º¸µå Àü¼Û µË´Ï´Ù.
À罽͏µ ¿¬»êÀÇ °¡»ó Äڵ带 ´ÙÀ½¿¡ ³ªÅ¸³À´Ï´Ù.
for each pixel from Source object { for each band/component of the pixel { dstElement = (srcElement*scaleFactor) + offset } }
RasterÀÎ °æ¿ì, À罽͏µÀº ¹êµå¸¦ ¿¬»êÇÕ´Ï´Ù. ½½Ä¶¸µ Á¤¼ö ¼¼Æ®°¡ 1°³ÀÇ °æ¿ì´Â °°Àº Á¤¼ö°¡ ¸ðµç ¹êµå¿¡ Àû¿ëµË´Ï´Ù. ½½Ä¶¸µ Á¤¼ö ¼¼Æ®°¡ º¹¼öÀÇ °æ¿ì, ±× ¼ö´Â Àü¼Û¿ø Raster ¹êµå¼ö·Î ÀÏÄ¡ÇÏÁö ¾ÊÀ¸¸é ¾ÈµË´Ï´Ù.
BufferedImageÀÎ °æ¿ì, À罽͏µÀº »ö°ú ¾ËÆÄ ¼ººÐÀ» ¿¬»êÇÕ´Ï´Ù. ½½Ä¶¸µ Á¤¼ö ¼¼Æ®°¡ 1°³ÀÇ °æ¿ì´Â °°Àº Á¤¼ö°¡ ¸ðµç »ö¼ººÐ¿¡ Àû¿ëµË´Ï´Ù¸¸, ¾ËÆÄ ¼ººÐ¿¡´Â Àû¿ëµÇÁö ¾Ê½À´Ï´Ù. ½½Ä¶¸µ Á¤¼ö ¼¼Æ®°¡ ´Ù¼ö ÀÖ¾î, ±× ¼ö°¡ Àü¼Û¿øÀÇ »ö¼ººÐ¼ö·Î ÀÏÄ¡ÇÏ´Â °æ¿ì, ¾ËÆÄ ¼ººÐÀÌ Á¸ÀçÇØµµ ±× À罽͏µÀº ½ÇÇàµÇÁö ¾Ê½À´Ï´Ù. ½½Ä¶¸µ Á¤¼ö ¼¼Æ®°¡ ´Ù¼ö ÀÖ¾î, ±× ¼ö°¡ Àü¼Û¿øÀÇ »ö¼ººÐ¼ö¿Í ¾ËÆÄ ¼ººÐ¼öÀÇ ÇÕ°è¿Í ÀÏÄ¡ÇÏ´Â °æ¿ì, ·è ¾÷Àº ¸ðµç »ö¼ººÐ ¹× ¾ËÆÄ ¼ººÐ¿¡ ´ëÇØ¼ ½ÇÇàµË´Ï´Ù.
À罽͏µ¿¡¼´Â ¹Ì¸® °ö¼ÀµÈ ¾ËÆÄ µ¥ÀÌÅ͸¦ °¡Áö´Â BufferedImage ¼Ò½º´Â ¹Ì¸® °ö¼ÀµÇ¾î ÀÖÁö ¾ÊÀº ¾ËÆÄ µ¥ÀÌÅÍ À̹ÌÁö¿Í °°°Ô ´Ù·ç¾îÁý´Ï´Ù. Áï, µ¥ÀÌÅͰ¡ ¹Ì¸® °ö¼ÀµÇ°í ÀÖ´Â °ÍÀ» °í·ÁÇÏÁö ¾Ê°í, BufferedImage ¼Ò½ºÀÇ raw µ¥ÀÌÅÍ¿¡ ´ëÇØ, ¹êµå ¸¶´Ù À罽͏µÀÌ ½ÇÇàµË´Ï´Ù. Àü¼ÛóÀÇ ColorModel ·Î »öÀÇ º¯È¯ÀÌ ÇÊ¿äÇÑ °æ¿ì, ÀÌ ½ºÅÜ¿¡¼´Â ¹Ì¸® °ö¼ÀµÇ°í ÀÖ´Â °ÍÀÌ Àü¼Û¿ø°ú Àü¼ÛóÀÇ ¾çÂÊ ¸ðµÎ·Î °í·ÁµË´Ï´Ù.
IndexColorModel¸¦ °¡Áö´Â À̹ÌÁö´Â À罽͏µ ÇÒ ¼ö ¾ø½À´Ï´Ù.
»ý¼ºÀÚ À¸·Î RenderingHints °´Ã¼°¡ ÁöÁ¤µÇ¾úÀ» °æ¿ì, »öº¯È¯ÀÌ ÇÊ¿äÇÑ ¶§¿¡ Ä÷¯ ·»´õ¸µ ÈùÆ® ¹× µðÀú¸µ ÈùÆ®¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
ÀÎÇÁ·¹À̽º Á¶ÀÛ (Àü¼Û¿ø°ú Àü¼Û ¸ÕÀú °°Àº °´Ã¼¸¦ ÁöÁ¤ÇÏ´Â °Í)ÀÌ Çã°¡µË´Ï´Ù.
RenderingHints.KEY_COLOR_RENDERING
,
RenderingHints.KEY_DITHERING
»ý¼ºÀÚ °³¿ä | |
---|---|
RescaleOp (float[] scaleFactors,
float[] offsets,
RenderingHints hints)
ÇÊ¿äÇÑ ½½Ä¶¸µ °è¼ö·Î ¿ÀÇÁ¼Â(offset)¸¦ °¡Áö´Â »õ·Î¿î RescaleOp¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
RescaleOp (float scaleFactor,
float offset,
RenderingHints hints)
ÇÊ¿äÇÑ ½½Ä¶¸µ °è¼ö·Î ¿ÀÇÁ¼Â(offset)¸¦ °¡Áö´Â »õ·Î¿î RescaleOp¸¦ ±¸ÃàÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
BufferedImage |
createCompatibleDestImage (BufferedImage src,
ColorModel destCM)
ÀûÀýÇÑ »çÀÌÁî ¹× ¹êµå¼ö·Î Á¦·ÎÈ µÈ Àü¼Ûó À̹ÌÁö¸¦ »ý¼ºÇÕ´Ï´Ù. |
WritableRaster |
createCompatibleDestRaster (Raster src)
ÁöÁ¤µÈ ¼Ò½º·Î ÀûÀýÇÑ »çÀÌÁî, ÀûÀýÇÑ ¼öÀÇ ¹êµå¸¦ °¡Áö´Â Á¦·ÎÈ µÈ Àü¼Ûó Raster ¸¦ »ý¼ºÇÕ´Ï´Ù. |
BufferedImage |
filter (BufferedImage src,
BufferedImage dst)
Àü¼Û¿ø BufferedImage À罽͏µÀ» ½Ç½ÃÇÕ´Ï´Ù. |
WritableRaster |
filter (Raster src,
WritableRaster dst)
Àü¼Û¿ø Raster Çȼ¿ µ¥ÀÌÅÍÀÇ À罽͏µÀ» ½Ç½ÃÇÕ´Ï´Ù. |
Rectangle2D |
getBounds2D (BufferedImage src)
À罽͏µ µÈ Àü¼Ûó À̹ÌÁöÀÇ ¹Ù¿îµù¹Ú½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Rectangle2D |
getBounds2D (Raster src)
À罽͏µ µÈ Àü¼Ûó Raster ¹Ù¿îµù¹Ú½º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getNumFactors ()
ÀÌ RescaleOp ½½Ä¶¸µ °è¼ö·Î ¿ÀÇÁ¼Â(offset)¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
float[] |
getOffsets (float[] offsets)
ÁöÁ¤µÈ ¹è¿ÀÇ ¿ÀÇÁ¼Â(offset)¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Point2D |
getPoint2D (Point2D srcPt,
Point2D dstPt)
ÁöÁ¤µÈ Àü¼Û¿øÀÇ Æ÷ÀÎÆ®¿¡ ´ëÀÀÇÏ´Â Àü¼ÛóÀÇ Æ÷ÀÎÆ®ÀÇ À§Ä¡¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
RenderingHints |
getRenderingHints ()
ÀÌ Á¶ÀÛÀÇ ·»´õ¸µ ÈùÆ®¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
float[] |
getScaleFactors (float[] scaleFactors)
ÁöÁ¤µÈ ¹è¿ÀÇ ½½Ä¶¸µ °è¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
»ý¼ºÀÚ »ó¼¼ |
---|
public RescaleOp(float[] scaleFactors, float[] offsets, RenderingHints hints)
scaleFactors
- ÁöÁ¤µÈ ½½Ä¶¸µ °è¼öoffsets
- ÁöÁ¤µÈ ¿ÀÇÁ¼Â(offset)hints
- ÁöÁ¤µÈ RenderingHints
, ¶Ç´Â null
public RescaleOp(float scaleFactor, float offset, RenderingHints hints)
scaleFactor
- ÁöÁ¤µÈ ½½Ä¶¸µ °è¼öoffset
- ÁöÁ¤µÈ ¿ÀÇÁ¼Â(offset)hints
- ÁöÁ¤µÈ RenderingHints
, ¶Ç´Â null
¸Þ¼µåÀÇ »ó¼¼ |
---|
public final float[] getScaleFactors(float[] scaleFactors)
scaleFactors
- ÀÌ RescaleOp
½½Ä¶¸µ °è¼ö¸¦ Æ÷ÇÔÇÑ ¹è¿
RescaleOp
½½Ä¶¸µ °è¼öpublic final float[] getOffsets(float[] offsets)
offsets
- ÀÌ RescaleOp
¿ÀÇÁ¼Â(offset)¸¦ Æ÷ÇÔÇÑ ¹è¿
RescaleOp
¿ÀÇÁ¼Â(offset)public final int getNumFactors()
RescaleOp
½½Ä¶¸µ °è¼ö¿Í ¿ÀÇÁ¼Â(offset)ÀÇ ¼öpublic final BufferedImage filter(BufferedImage src, BufferedImage dst)
BufferedImageOp
³»ÀÇ filter
src
- ÇÊÅÍ Ã³¸®µÇ´Â BufferedImage
dst
- ÇÊÅÍ Ã³¸® ´ë»óÀÇ Àü¼Ûó, ¶Ç´Â null
BufferedImage
IllegalArgumentException
- src
ColorModel
°¡ IndexColorModel
ÀÎ °æ¿ì, ¶Ç´Â ÀÌ RescaleOp
½½Ä¶¸µ °è¼ö ¹× ¿ÀÇÁ¼Â(offset)ÀÇ ¼ö°¡ Ŭ·¡½º ¼³¸íÀÇ ¿ä°ÇÀ» ä¿ìÁö ¾Ê´Â °æ¿ìpublic final WritableRaster filter(Raster src, WritableRaster dst)
RasterOp
³»ÀÇ filter
src
- ÇÊÅÍ Ã³¸®µÇ´Â Raster
dst
- ÇÊÅÍ Ã³¸® ´ë»óÀÇ Àü¼Ûó, ¶Ç´Â null
WritableRaster
IllegalArgumentException
- src
¿Í
dst
¹êµå¼ö°¡ ÀÏÄ¡ÇÏÁö ¾Ê´Â °æ¿ì, ¶Ç´Â ÀÌ RescaleOp
½½Ä¶¸µ °è¼ö ¹× ¿ÀÇÁ¼Â(offset)ÀÇ ¼ö°¡ Ŭ·¡½º ¼³¸íÀÇ ¿ä°ÇÀ» ä¿ìÁö ¾Ê´Â °æ¿ìpublic final Rectangle2D getBounds2D(BufferedImage src)
BufferedImageOp
³»ÀÇ getBounds2D
src
- ÇÊÅÍ Ã³¸®µÇ´Â BufferedImage
Rectangle2D
public final Rectangle2D getBounds2D(Raster src)
RasterOp
³»ÀÇ getBounds2D
src
- À罽͏µ µÈ Àü¼ÛóÀÇ Raster
Raster
°æ°èpublic BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM)
BufferedImageOp
³»ÀÇ createCompatibleDestImage
src
- ÇÊÅÍ ¿ÀÆÛ·¹À̼ÇÀÇ ¼Ò½º À̹ÌÁödestCM
- Àü¼ÛóÀÇ ColorModel. nullÀÎ °æ¿ì´Â ¼Ò½ºÀÇ ColorModel¸¦ »ç¿ë
public WritableRaster createCompatibleDestRaster(Raster src)
Raster
¸¦ »ý¼ºÇÕ´Ï´Ù.
RasterOp
³»ÀÇ createCompatibleDestRaster
src
- Àü¼Û¿øÀÇ Raster
Raster
public final Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
BufferedImageOp
³»ÀÇ getPoint2D
RasterOp
³»ÀÇ getPoint2D
srcPt
- Àü¼Û¿øÀ̹ÌÁöÀÇ Æ÷ÀÎÆ®dstPt
- Àü¼Ûó Æ÷ÀÎÆ®, ¶Ç´Â null
public final RenderingHints getRenderingHints()
BufferedImageOp
³»ÀÇ getRenderingHints
RasterOp
³»ÀÇ getRenderingHints
RescaleOp
·»´õ¸µ ÈùÆ®
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.