当前位置: 首页>>代码示例>>Java>>正文


Java Raster.getMinX方法代码示例

本文整理汇总了Java中java.awt.image.Raster.getMinX方法的典型用法代码示例。如果您正苦于以下问题:Java Raster.getMinX方法的具体用法?Java Raster.getMinX怎么用?Java Raster.getMinX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.image.Raster的用法示例。


在下文中一共展示了Raster.getMinX方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDataElements

import java.awt.image.Raster; //导入方法依赖的package包/类
/**
     * Stores the Raster data at the specified location.
     * @param dstX The absolute X coordinate of the destination pixel
     * that will receive a copy of the upper-left pixel of the
     * inRaster
     * @param dstY The absolute Y coordinate of the destination pixel
     * that will receive a copy of the upper-left pixel of the
     * inRaster
     * @param width      The number of pixels to store horizontally
     * @param height     The number of pixels to store vertically
     * @param inRaster   Raster of data to place at x,y location.
     */
    private void setDataElements(int dstX, int dstY,
                                 int width, int height,
                                 Raster inRaster) {
        // Assume bounds checking has been performed previously
        if (width <= 0 || height <= 0) {
            return;
        }

        int srcOffX = inRaster.getMinX();
        int srcOffY = inRaster.getMinY();
        Object tdata = null;

//      // REMIND: Do something faster!
//      if (inRaster instanceof ByteBandedRaster) {
//      }

        for (int startY=0; startY < height; startY++) {
            // Grab one scanline at a time
            tdata = inRaster.getDataElements(srcOffX, srcOffY+startY,
                                             width, 1, tdata);
            setDataElements(dstX, dstY+startY, width, 1, tdata);
        }
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:ByteBandedRaster.java

示例2: setDataElements

import java.awt.image.Raster; //导入方法依赖的package包/类
/**
 * Stores the Raster data at the specified location.
 * An ArrayIndexOutOfBounds exception will be thrown at runtime
 * if the pixel coordinates are out of bounds.
 * @param x          The X coordinate of the pixel location.
 * @param y          The Y coordinate of the pixel location.
 * @param inRaster   Raster of data to place at x,y location.
 */
public void setDataElements(int x, int y, Raster inRaster) {
    // Check if we can use fast code
    if (!(inRaster instanceof BytePackedRaster) ||
        ((BytePackedRaster)inRaster).pixelBitStride != pixelBitStride) {
        super.setDataElements(x, y, inRaster);
        return;
    }

    int srcOffX = inRaster.getMinX();
    int srcOffY = inRaster.getMinY();
    int dstOffX = srcOffX + x;
    int dstOffY = srcOffY + y;
    int width = inRaster.getWidth();
    int height = inRaster.getHeight();
    if ((dstOffX < this.minX) || (dstOffY < this.minY) ||
        (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {
        throw new ArrayIndexOutOfBoundsException
            ("Coordinate out of bounds!");
    }
    setDataElements(dstOffX, dstOffY,
                    srcOffX, srcOffY,
                    width, height,
                    (BytePackedRaster)inRaster);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:33,代码来源:BytePackedRaster.java

示例3: setDataElements

import java.awt.image.Raster; //导入方法依赖的package包/类
/**
     * Stores the Raster data at the specified location.
     * @param dstX The absolute X coordinate of the destination pixel
     * that will receive a copy of the upper-left pixel of the
     * inRaster
     * @param dstY The absolute Y coordinate of the destination pixel
     * that will receive a copy of the upper-left pixel of the
     * inRaster
     * @param width      The number of pixels to store horizontally
     * @param height     The number of pixels to store vertically
     * @param inRaster   Raster of data to place at x,y location.
     */
    private void setDataElements(int dstX, int dstY,
                                 int width, int height,
                                 Raster inRaster) {
        // Assume bounds checking has been performed previously
        if (width <= 0 || height <= 0) {
            return;
        }

        // Write inRaster (minX, minY) to (dstX, dstY)

        int srcOffX = inRaster.getMinX();
        int srcOffY = inRaster.getMinY();
        Object tdata = null;

//      REMIND: Do something faster!
//      if (inRaster instanceof ShortInterleavedRaster) {
//      }

        for (int startY=0; startY < height; startY++) {
            // Grab one scanline at a time
            tdata = inRaster.getDataElements(srcOffX, srcOffY+startY,
                                             width, 1, tdata);
            setDataElements(dstX, dstY + startY, width, 1, tdata);
        }
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:ShortInterleavedRaster.java

示例4: setDataElements

import java.awt.image.Raster; //导入方法依赖的package包/类
/**
 * Stores the Raster data at the specified location.
 * An ArrayIndexOutOfBounds exception will be thrown at runtime
 * if the pixel coordinates are out of bounds.
 * @param x          The X coordinate of the pixel location.
 * @param y          The Y coordinate of the pixel location.
 * @param inRaster   Raster of data to place at x,y location.
 */
public void setDataElements(int x, int y, Raster inRaster) {
    int srcOffX = inRaster.getMinX();
    int srcOffY = inRaster.getMinY();
    int dstOffX = x + srcOffX;
    int dstOffY = y + srcOffY;
    int width  = inRaster.getWidth();
    int height = inRaster.getHeight();
    if ((dstOffX < this.minX) || (dstOffY < this.minY) ||
        (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {
        throw new ArrayIndexOutOfBoundsException
            ("Coordinate out of bounds!");
    }

    setDataElements(dstOffX, dstOffY, srcOffX, srcOffY,
                    width, height, inRaster);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:ByteInterleavedRaster.java

示例5: setDataElements

import java.awt.image.Raster; //导入方法依赖的package包/类
/**
 * Stores the Raster data at the specified location.
 * An ArrayIndexOutOfBounds exception will be thrown at runtime
 * if the pixel coordinates are out of bounds.
 * @param x          The X coordinate of the pixel location.
 * @param y          The Y coordinate of the pixel location.
 * @param inRaster   Raster of data to place at x,y location.
 */
public void setDataElements(int x, int y, Raster inRaster) {
    int dstOffX = inRaster.getMinX() + x;
    int dstOffY = inRaster.getMinY() + y;
    int width  = inRaster.getWidth();
    int height = inRaster.getHeight();
    if ((dstOffX < this.minX) || (dstOffY < this.minY) ||
        (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {
        throw new ArrayIndexOutOfBoundsException
            ("Coordinate out of bounds!");
    }

    setDataElements(dstOffX, dstOffY, width, height, inRaster);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:ByteComponentRaster.java

示例6: setDataElements

import java.awt.image.Raster; //导入方法依赖的package包/类
/**
 * Stores the Raster data at the specified location.
 * An ArrayIndexOutOfBounds exception will be thrown at runtime
 * if the pixel coordinates are out of bounds.
 * @param x          The X coordinate of the pixel location.
 * @param y          The Y coordinate of the pixel location.
 * @param inRaster   Raster of data to place at x,y location.
 */
public void setDataElements(int x, int y, Raster inRaster) {
    int dstOffX = x + inRaster.getMinX();
    int dstOffY = y + inRaster.getMinY();
    int width  = inRaster.getWidth();
    int height = inRaster.getHeight();
    if ((dstOffX < this.minX) || (dstOffY < this.minY) ||
        (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {
        throw new ArrayIndexOutOfBoundsException
            ("Coordinate out of bounds!");
    }

    setDataElements(dstOffX, dstOffY, width, height, inRaster);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:ShortComponentRaster.java

示例7: setDataElements

import java.awt.image.Raster; //导入方法依赖的package包/类
/**
 * Stores the Raster data at the specified location.
 * The transferType of the inputRaster must match this raster.
 * An ArrayIndexOutOfBoundsException will be thrown at runtime
 * if the pixel coordinates are out of bounds.
 * @param x          The X coordinate of the pixel location.
 * @param y          The Y coordinate of the pixel location.
 * @param inRaster   Raster of data to place at x,y location.
 */
public void setDataElements(int x, int y, Raster inRaster) {
    int dstOffX = x + inRaster.getMinX();
    int dstOffY = y + inRaster.getMinY();
    int width  = inRaster.getWidth();
    int height = inRaster.getHeight();
    if ((dstOffX < this.minX) || (dstOffY < this.minY) ||
        (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {
        throw new ArrayIndexOutOfBoundsException
            ("Coordinate out of bounds!");
    }

    setDataElements(dstOffX, dstOffY, width, height, inRaster);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:IntegerInterleavedRaster.java

示例8: setDataElements

import java.awt.image.Raster; //导入方法依赖的package包/类
/**
 * Stores the Raster data at the specified location.
 * The transferType of the inputRaster must match this raster.
 * An ArrayIndexOutOfBoundsException will be thrown at runtime
 * if the pixel coordinates are out of bounds.
 * @param x          The X coordinate of the pixel location.
 * @param y          The Y coordinate of the pixel location.
 * @param inRaster   Raster of data to place at x,y location.
 */
public void setDataElements(int x, int y, Raster inRaster) {
    int dstOffX = x + inRaster.getMinX();
    int dstOffY = y + inRaster.getMinY();
    int width  = inRaster.getWidth();
    int height = inRaster.getHeight();
    if ((dstOffX < this.minX) || (dstOffY < this.minY) ||
        (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {
        throw new ArrayIndexOutOfBoundsException
            ("Coordinate out of bounds!");
    }
    setDataElements(dstOffX, dstOffY, width, height, inRaster);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:IntegerComponentRaster.java

示例9: setDataElements

import java.awt.image.Raster; //导入方法依赖的package包/类
/**
 * Stores the Raster data at the specified location.
 * @param dstX The absolute X coordinate of the destination pixel
 * that will receive a copy of the upper-left pixel of the
 * inRaster
 * @param dstY The absolute Y coordinate of the destination pixel
 * that will receive a copy of the upper-left pixel of the
 * inRaster
 * @param width      The number of pixels to store horizontally
 * @param height     The number of pixels to store vertically
 * @param inRaster   Raster of data to place at x,y location.
 */
private void setDataElements(int dstX, int dstY,
                             int width, int height,
                             Raster inRaster) {
    // Assume bounds checking has been performed previously
    if (width <= 0 || height <= 0) {
        return;
    }

    // Write inRaster (minX, minY) to (dstX, dstY)

    int srcOffX = inRaster.getMinX();
    int srcOffY = inRaster.getMinY();
    int tdata[] = null;

    if (inRaster instanceof IntegerInterleavedRaster) {
        IntegerInterleavedRaster ict = (IntegerInterleavedRaster) inRaster;

        // Extract the raster parameters
        tdata    = ict.getDataStorage();
        int tss  = ict.getScanlineStride();
        int toff = ict.getDataOffset(0);

        int srcOffset = toff;
        int dstOffset = dataOffsets[0]+(dstY-minY)*scanlineStride+
                                       (dstX-minX);


        // Fastest case.  We can copy scanlines
        // Loop through all of the scanlines and copy the data
        for (int startY=0; startY < height; startY++) {
            System.arraycopy(tdata, srcOffset, data, dstOffset, width);
            srcOffset += tss;
            dstOffset += scanlineStride;
        }
        markDirty();
        return;
    }

    Object odata = null;
    for (int startY=0; startY < height; startY++) {
        // Grab one scanline at a time
        odata = inRaster.getDataElements(srcOffX, srcOffY+startY,
                                         width, 1, odata);
        setDataElements(dstX, dstY+startY, width, 1, odata);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:59,代码来源:IntegerInterleavedRaster.java


注:本文中的java.awt.image.Raster.getMinX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。