代码优化

This commit is contained in:
MaxKey
2024-01-13 21:48:32 +08:00
parent 47c725624c
commit a1213a7539
64 changed files with 341 additions and 144 deletions

View File

@@ -48,6 +48,7 @@ public class LightNoise extends Configurable implements NoiseProducer
* @param factorThree
* @param factorFour
*/
@Override
public void makeNoise(BufferedImage image, float factorOne,
float factorTwo, float factorThree, float factorFour)
{
@@ -100,8 +101,9 @@ public class LightNoise extends Configurable implements NoiseProducer
// for the maximum 3 point change the stroke and direction
for (i = 0; i < pts.length - 1; i++)
{
if (i < 3)
if (i < 3) {
graph.setStroke(new BasicStroke(0.7f * (2 - i)));
}
graph.drawLine((int) pts[i].getX(), (int) pts[i].getY(),
(int) pts[i + 1].getX(), (int) pts[i + 1].getY());
}

View File

@@ -37,6 +37,7 @@ public class Ripple extends Configurable implements GimpyEngine
* @param baseImage the base image
* @return the distorted image
*/
@Override
public BufferedImage getDistortedImage(BufferedImage baseImage)
{
NoiseProducer noiseProducer = getConfig().getNoiseImpl();

View File

@@ -49,6 +49,7 @@ public class RandomColorWordRenderer extends Configurable implements WordRendere
* The height of the image to be created.
* @return The BufferedImage created from the word.
*/
@Override
public BufferedImage renderWord(String word, int width, int height)
{
int fontSize = getConfig().getTextProducerFontSize();