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


Java SampleModel.getHeight方法代码示例

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


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

示例1: getBandSize

import java.awt.image.SampleModel; //导入方法依赖的package包/类
public static long getBandSize(SampleModel sm) {
    int elementSize = DataBuffer.getDataTypeSize(sm.getDataType());

    if (sm instanceof ComponentSampleModel) {
        ComponentSampleModel csm = (ComponentSampleModel)sm;
        int pixelStride = csm.getPixelStride();
        int scanlineStride = csm.getScanlineStride();
        long size = Math.min(pixelStride, scanlineStride);

        if (pixelStride > 0)
            size += pixelStride * (sm.getWidth() - 1);
        if (scanlineStride > 0)
            size += scanlineStride * (sm.getHeight() - 1);
        return size * ((elementSize + 7) / 8);
    } else
        return getTileSize(sm);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:ImageUtil.java

示例2: prepareInsertEmpty

import java.awt.image.SampleModel; //导入方法依赖的package包/类
public void prepareInsertEmpty(int imageIndex,
                               ImageTypeSpecifier imageType,
                               int width,
                               int height,
                               IIOMetadata imageMetadata,
                               List<? extends BufferedImage> thumbnails,
                               ImageWriteParam param) throws IOException {
    checkParamsEmpty(imageType, width, height, thumbnails);

    this.isInsertingEmpty = true;

    SampleModel emptySM = imageType.getSampleModel();
    RenderedImage emptyImage =
        new EmptyImage(0, 0, width, height,
                       0, 0, emptySM.getWidth(), emptySM.getHeight(),
                       emptySM, imageType.getColorModel());

    insert(imageIndex, new IIOImage(emptyImage, null, imageMetadata),
           param, false);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:TIFFImageWriter.java

示例3: canEncodeImage

import java.awt.image.SampleModel; //导入方法依赖的package包/类
public boolean canEncodeImage(ImageTypeSpecifier type) {
    if (type == null) {
        throw new IllegalArgumentException("type == null!");
    }

    SampleModel sm = type.getSampleModel();
    ColorModel cm = type.getColorModel();

    boolean canEncode = sm.getNumBands() == 1 &&
        sm.getSampleSize(0) <= 8 &&
        sm.getWidth() <= 65535 &&
        sm.getHeight() <= 65535 &&
        (cm == null || cm.getComponentSize()[0] <= 8);

    if (canEncode) {
        return true;
    } else {
        return PaletteBuilder.canCreatePalette(type);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:GIFImageWriterSpi.java

示例4: ByteComponentRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a ByteComponentRaster with the given SampleModel
 * and DataBuffer.  The Raster's upper left corner is origin and
 * it is the same size as the SampleModel.  The DataBuffer is not
 * initialized and must be a DataBufferByte compatible with SampleModel.
 * SampleModel must be of type SinglePixelPackedSampleModel
 * or ComponentSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param dataBuffer      The DataBufferShort that contains the image data.
 * @param origin          The Point that specifies the origin.
 */
public ByteComponentRaster(SampleModel sampleModel,
                              DataBuffer dataBuffer,
                              Point origin) {
    this(sampleModel,
         dataBuffer,
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:ByteComponentRaster.java

示例5: IntegerInterleavedRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a IntegerInterleavedRaster with the given SampleModel
 * and DataBuffer.  The Raster's upper left corner is origin and
 * it is the same sizes the SampleModel.  The DataBuffer is not
 * initialized and must be a DataBufferInt compatible with SampleModel.
 * SampleModel must be of type SinglePixelPackedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param dataBuffer      The DataBufferInt that contains the image data.
 * @param origin          The Point that specifies the origin.
 */
public IntegerInterleavedRaster(SampleModel sampleModel,
                                DataBufferInt dataBuffer,
                                Point origin)
{
    this(sampleModel,
         dataBuffer,
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:IntegerInterleavedRaster.java

示例6: ShortInterleavedRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a ShortInterleavedRaster with the given SampleModel
 * and DataBuffer.  The Raster's upper left corner is origin and
 * it is the same sizes the SampleModel.  The DataBuffer is not
 * initialized and must be a DataBufferUShort compatible with SampleModel.
 * SampleModel must be of type PixelInterleavedSampleModel or
 * SinglePixelPackedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param dataBuffer      The DataBufferUShort that contains the image data.
 * @param origin          The Point that specifies the origin.
 */
public ShortInterleavedRaster(SampleModel sampleModel,
                              DataBufferUShort dataBuffer,
                              Point origin)
{
    this(sampleModel,
         dataBuffer,
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:ShortInterleavedRaster.java

示例7: ShortComponentRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 *  Constructs a ShortComponentRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  ComponentSampleModel or SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public ShortComponentRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:ShortComponentRaster.java

示例8: ShortBandedRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a ShortBandedRaster with the given SampleModel.
 * The Raster's upper left corner is origin and it is the same
 * size as the SampleModel.  A DataBuffer large enough to describe the
 * Raster is automatically created.  SampleModel must be of type
 * BandedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param origin          The Point that specified the origin.
 */
public ShortBandedRaster(SampleModel sampleModel,
                            Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:ShortBandedRaster.java

示例9: IntegerInterleavedRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 *  Constructs a IntegerInterleavedRaster with the given SampleModel.
 *  The Raster's upper left corner is origin and it is the same
 *  size as the SampleModel.  A DataBuffer large enough to describe the
 *  Raster is automatically created.  SampleModel must be of type
 *  SinglePixelPackedSampleModel.
 *  @param sampleModel     The SampleModel that specifies the layout.
 *  @param origin          The Point that specified the origin.
 */
public IntegerInterleavedRaster(SampleModel sampleModel,
                                 Point origin) {
    this(sampleModel,
         sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:IntegerInterleavedRaster.java

示例10: ShortComponentRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a ShortComponentRaster with the given SampleModel
 * and DataBuffer.  The Raster's upper left corner is origin and
 * it is the same sizes the SampleModel.  The DataBuffer is not
 * initialized and must be a DataBufferUShort compatible with SampleModel.
 * SampleModel must be of type ComponentSampleModel or
 * SinglePixelPackedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param dataBuffer      The DataBufferUShort that contains the image data.
 * @param origin          The Point that specifies the origin.
 */
public ShortComponentRaster(SampleModel sampleModel,
                            DataBufferUShort dataBuffer,
                            Point origin)
{
    this(sampleModel,
         dataBuffer,
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:ShortComponentRaster.java

示例11: BytePackedRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a BytePackedRaster with the given SampleModel.
 * The Raster's upper left corner is origin and it is the same
 * size as the SampleModel.  A DataBuffer large enough to describe the
 * Raster is automatically created.  SampleModel must be of type
 * MultiPixelPackedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param origin          The Point that specified the origin.
 */
public BytePackedRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         (DataBufferByte) sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:BytePackedRaster.java

示例12: ShortBandedRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a ShortBandedRaster with the given SampleModel.
 * The Raster's upper left corner is origin and it is the same
 * size as the SampleModel.  A DataBuffer large enough to describe the
 * Raster is automatically created.  SampleModel must be of type
 * BandedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param origin          The Point that specified the origin.
 */
public ShortBandedRaster(SampleModel sampleModel, Point origin) {
    this(sampleModel,
         (DataBufferUShort) sampleModel.createDataBuffer(),
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:ShortBandedRaster.java

示例13: ByteComponentRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a ByteComponentRaster with the given SampleModel
 * and DataBuffer.  The Raster's upper left corner is origin and
 * it is the same size as the SampleModel.  The DataBuffer is not
 * initialized and must be a DataBufferByte compatible with SampleModel.
 * SampleModel must be of type SinglePixelPackedSampleModel
 * or ComponentSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param dataBuffer      The DataBufferByte that contains the image data.
 * @param origin          The Point that specifies the origin.
 */
public ByteComponentRaster(SampleModel sampleModel,
                           DataBufferByte dataBuffer,
                           Point origin)
{
    this(sampleModel,
         dataBuffer,
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:ByteComponentRaster.java

示例14: IntegerComponentRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a IntegerComponentRaster with the given SampleModel
 * and DataBuffer.  The Raster's upper left corner is origin and
 * it is the same sizes the SampleModel.  The DataBuffer is not
 * initialized and must be a DataBufferInt compatible with SampleModel.
 * SampleModel must be of type SinglePixelPackedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param dataBuffer      The DataBufferInt that contains the image data.
 * @param origin          The Point that specifies the origin.
 */
public IntegerComponentRaster(SampleModel sampleModel,
                              DataBufferInt dataBuffer,
                              Point origin)
{
    this(sampleModel,
         dataBuffer,
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:IntegerComponentRaster.java

示例15: IntegerComponentRaster

import java.awt.image.SampleModel; //导入方法依赖的package包/类
/**
 * Constructs a IntegerComponentRaster with the given SampleModel
 * and DataBuffer.  The Raster's upper left corner is origin and
 * it is the same sizes the SampleModel.  The DataBuffer is not
 * initialized and must be a DataBufferInt compatible with SampleModel.
 * SampleModel must be of type SinglePixelPackedSampleModel.
 * @param sampleModel     The SampleModel that specifies the layout.
 * @param dataBuffer      The DataBufferInt that contains the image data.
 * @param origin          The Point that specifies the origin.
 */
public IntegerComponentRaster(SampleModel sampleModel,
                                 DataBuffer dataBuffer,
                                 Point origin) {
    this(sampleModel,
         dataBuffer,
         new Rectangle(origin.x,
                       origin.y,
                       sampleModel.getWidth(),
                       sampleModel.getHeight()),
         origin,
         null);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:IntegerComponentRaster.java


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