org.encog.util.downsample
Class RGBDownsample
- java.lang.Object
-
- org.encog.util.downsample.RGBDownsample
-
- All Implemented Interfaces:
- Downsample
- Direct Known Subclasses:
- SimpleIntensityDownsample
public class RGBDownsample extends java.lang.Object implements Downsample
Downsample an image keeping the RGB colors.
-
-
Constructor Summary
Constructors Constructor and Description RGBDownsample()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]downSample(java.awt.Image image, int height, int width)Called to downsample the image and store it in the down sample component.voiddownSampleRegion(int x, int y)Called to downsample a region of the image.voidfindBounds()This method is called to automatically crop the image so that whitespace is removed.intgetCurrentBlue()intgetCurrentGreen()intgetCurrentRed()intgetDownSampleBottom()intgetDownSampleLeft()intgetDownSampleRight()intgetDownSampleTop()intgetImageHeight()intgetImageWidth()int[]getPixelMap()doublegetRatioX()doublegetRatioY()voidprocessImage(java.awt.Image image)Process the image and prepare it to be downsampled.voidsetCurrentBlue(int currentBlue)Set the current blue average.voidsetCurrentGreen(int currentGreen)Set the current green average.voidsetCurrentRed(int currentRed)Set the current red average.voidsetPixelMap(int[] pixelMap)Set the pixel map.voidvalidate(int height, int width)
-
-
-
Method Detail
-
downSample
public double[] downSample(java.awt.Image image, int height, int width)Called to downsample the image and store it in the down sample component.- Specified by:
downSamplein interfaceDownsample- Parameters:
image- The image to downsample.height- The height to downsample to.width- THe width to downsample to.- Returns:
- The downsampled image.
-
downSampleRegion
public void downSampleRegion(int x, int y)Called to downsample a region of the image.- Parameters:
x- The x coordinate of the resulting downsample.y- The y coordinate of the resulting downsample.
-
findBounds
public void findBounds()
This method is called to automatically crop the image so that whitespace is removed.- Specified by:
findBoundsin interfaceDownsample
-
getCurrentBlue
public int getCurrentBlue()
-
getCurrentGreen
public int getCurrentGreen()
-
getCurrentRed
public int getCurrentRed()
-
getDownSampleBottom
public int getDownSampleBottom()
- Specified by:
getDownSampleBottomin interfaceDownsample- Returns:
- the downSampleBottom
-
getDownSampleLeft
public int getDownSampleLeft()
- Specified by:
getDownSampleLeftin interfaceDownsample- Returns:
- the downSampleLeft
-
getDownSampleRight
public int getDownSampleRight()
- Specified by:
getDownSampleRightin interfaceDownsample- Returns:
- the downSampleRight
-
getDownSampleTop
public int getDownSampleTop()
- Specified by:
getDownSampleTopin interfaceDownsample- Returns:
- the downSampleTop
-
getImageHeight
public int getImageHeight()
- Specified by:
getImageHeightin interfaceDownsample- Returns:
- the imageHeight
-
getImageWidth
public int getImageWidth()
- Specified by:
getImageWidthin interfaceDownsample- Returns:
- the imageWidth
-
getPixelMap
public int[] getPixelMap()
- Specified by:
getPixelMapin interfaceDownsample- Returns:
- the pixelMap
-
getRatioX
public double getRatioX()
- Specified by:
getRatioXin interfaceDownsample- Returns:
- the ratioX
-
getRatioY
public double getRatioY()
- Specified by:
getRatioYin interfaceDownsample- Returns:
- the ratioY
-
processImage
public void processImage(java.awt.Image image)
Process the image and prepare it to be downsampled.- Specified by:
processImagein interfaceDownsample- Parameters:
image- The image to downsample.
-
setCurrentBlue
public void setCurrentBlue(int currentBlue)
Set the current blue average.- Parameters:
currentBlue- The current blue average.
-
setCurrentGreen
public void setCurrentGreen(int currentGreen)
Set the current green average.- Parameters:
currentGreen- The current green average.
-
setCurrentRed
public void setCurrentRed(int currentRed)
Set the current red average.- Parameters:
currentRed- The current red average.
-
setPixelMap
public void setPixelMap(int[] pixelMap)
Set the pixel map.- Parameters:
pixelMap- The pixel map.
-
validate
public void validate(int height, int width)
-
-
DMelt 3.0 © DataMelt by jWork.ORG