Here you can find the source of rotate90ToRight(BufferedImage inputImage)
Parameter | Description |
---|---|
inputImage | a parameter |
public static BufferedImage rotate90ToRight(BufferedImage inputImage)
//package com.java2s; /**//from w ww. jav a2 s . com * Copyright (c) 2013-2016 BITPlan GmbH * * http://www.bitplan.com * * This file is part of the Opensource project at: * https://github.com/BITPlan/com.bitplan.mjpegstreamer * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.awt.image.BufferedImage; public class Main { /** * rotate an Image 90 Degrees to the Right * * @param inputImage * @return the rotated image */ public static BufferedImage rotate90ToRight(BufferedImage inputImage) { int width = inputImage.getWidth(); int height = inputImage.getHeight(); BufferedImage returnImage = new BufferedImage(height, width, inputImage.getType()); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { returnImage.setRGB(height - y - 1, x, inputImage.getRGB(x, y)); } } return returnImage; } }