org.apache.harmony.awt.gl.Surface Maven / Gradle / Ivy
The newest version!
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
/**
* @author Igor V. Stolyarov
* Created on 10.11.2005
*
*/
package org.apache.harmony.awt.gl;
import java.util.ArrayList;
import org.apache.harmony.awt.gl.color.LUTColorConverter;
import com.google.code.appengine.awt.Image;
import com.google.code.appengine.awt.Rectangle;
import com.google.code.appengine.awt.Transparency;
import com.google.code.appengine.awt.color.ColorSpace;
import com.google.code.appengine.awt.image.BufferedImage;
import com.google.code.appengine.awt.image.ColorModel;
import com.google.code.appengine.awt.image.ComponentColorModel;
import com.google.code.appengine.awt.image.ComponentSampleModel;
import com.google.code.appengine.awt.image.DataBuffer;
import com.google.code.appengine.awt.image.DirectColorModel;
import com.google.code.appengine.awt.image.IndexColorModel;
import com.google.code.appengine.awt.image.MultiPixelPackedSampleModel;
import com.google.code.appengine.awt.image.SampleModel;
import com.google.code.appengine.awt.image.WritableRaster;
/**
* This class is super class for others types of Surfaces.
* Surface is storing data and data format description, that are using
* in blitting operations
*/
public abstract class Surface implements Transparency{
// Color Space Types
public static final int sRGB_CS = 1;
public static final int Linear_RGB_CS = 2;
public static final int Linear_Gray_CS = 3;
public static final int Custom_CS = 0;
// Color Model Types
public static final int DCM = 1; // Direct Color Model
public static final int ICM = 2; // Index Color Model
public static final int CCM = 3; // Component Color Model
// Sample Model Types
public static final int SPPSM = 1; // Single Pixel Packed Sample Model
public static final int MPPSM = 2; // Multi Pixel Packed Sample Model
public static final int CSM = 3; // Component Sample Model
public static final int PISM = 4; // Pixel Interleaved Sample Model
public static final int BSM = 5; // Banded Sample Model
// Surface Types
private static final int ALPHA_MASK = 0xff000000;
private static final int RED_MASK = 0x00ff0000;
private static final int GREEN_MASK = 0x0000ff00;
private static final int BLUE_MASK = 0x000000ff;
private static final int RED_BGR_MASK = 0x000000ff;
private static final int GREEN_BGR_MASK = 0x0000ff00;
private static final int BLUE_BGR_MASK = 0x00ff0000;
private static final int RED_565_MASK = 0xf800;
private static final int GREEN_565_MASK = 0x07e0;
private static final int BLUE_565_MASK = 0x001f;
private static final int RED_555_MASK = 0x7c00;
private static final int GREEN_555_MASK = 0x03e0;
private static final int BLUE_555_MASK = 0x001f;
protected int transparency = OPAQUE;
protected int width;
protected int height;
protected MultiRectArea dirtyRegions;
/**
* This list contains caches with the data of this surface that are valid at the moment.
* Surface should clear this list when its data is updated.
* Caches may check if they are still valid using isCacheValid method.
* When cache gets data from the surface, it should call addValidCache method of the surface.
*/
private final ArrayList
© 2015 - 2025 Weber Informatics LLC | Privacy Policy