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


Java BufferedImage.TYPE_USHORT_GRAY属性代码示例

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


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

示例1: getType

@Override
public int getType(boolean oneBand) {
    int nBand = getNBand();
    if (oneBand | nBand == 1) {
        //if (td.getTIFFField(BaselineTIFFTagSet.TAG_STRIP_BYTE_COUNTS).getAsInt(0) == 1) {
        //    return BufferedImage.TYPE_BYTE_GRAY;
        //} else if (td.getTIFFField(BaselineTIFFTagSet.TAG_STRIP_BYTE_COUNTS).getAsInt(0) == 2) {
        return BufferedImage.TYPE_USHORT_GRAY;
        //}
    } else if (nBand == 2) {
        return BufferedImage.TYPE_BYTE_GRAY;
    } else if (nBand == 3) {
        return BufferedImage.TYPE_INT_RGB;
    } else if (nBand == 4) {
        return BufferedImage.TYPE_INT_RGB;
    }
    return BufferedImage.TYPE_BYTE_GRAY;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:18,代码来源:GeotiffImage.java

示例2: createOverview

/**
 * create a quicklook image from the GeoImageReader
 * @param gir the source image
 * @param width the output width
 * @param height the output height
 * @return a BufferedImage representing the quicklook
 */
public static BufferedImage createOverview(GeoImageReader gir, int width, int height,int band){
    int nPass=gir.getHeight()/Constant.GEOIMAGE_TILE_SIZE;
    int xstep=gir.getWidth()/width;
    int ystep=gir.getHeight()/height;
    width=gir.getWidth()/xstep;
    height= gir.getHeight()/ystep;
    BufferedImage out=new BufferedImage(width,height, BufferedImage.TYPE_USHORT_GRAY);
    WritableRaster raster=out.getRaster();
    for(int i=0;i<nPass;i++){
        int[] t=gir.readTile(0, i*Constant.GEOIMAGE_TILE_SIZE, gir.getWidth(), Constant.GEOIMAGE_TILE_SIZE,band);
        for(int x=0;x<width;x++){
            for(int y=i*height/nPass;y<(i+1)*height/nPass;y++){
                raster.setSample(x, y, 0, t[x*xstep*(y-i*height/nPass)*ystep]);
            }
        }
    }
    return out;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:25,代码来源:GeoImageUtils.java

示例3: getType

@Override
public int getType(boolean oneBand) {
    int nBand = getNBand();
    /*if (oneBand | nBand == 1) {
        return BufferedImage.TYPE_USHORT_GRAY;
    } else if (nBand == 2) {
        return BufferedImage.TYPE_BYTE_GRAY;
    } else if (nBand == 3) {
        return BufferedImage.TYPE_INT_RGB;
    } else if (nBand == 4) {
        return BufferedImage.TYPE_INT_ARGB;
    }

    return BufferedImage.TYPE_USHORT_GRAY;*/
    if(oneBand || bands.size()<2) return BufferedImage.TYPE_USHORT_GRAY;
    else return BufferedImage.TYPE_INT_RGB;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:17,代码来源:TerrasarXImage.java

示例4: getImageTypeName

static String getImageTypeName(int type) {
    switch(type) {
        case BufferedImage.TYPE_INT_ARGB:
            return "TYPE_INT_ARGB";
        case BufferedImage.TYPE_INT_RGB:
            return "TYPE_INT_RGB";
        case BufferedImage.TYPE_INT_BGR:
            return "TYPE_INT_BGR";
        case BufferedImage.TYPE_INT_ARGB_PRE:
            return "TYPE_INT_ARGB_PRE";
        case BufferedImage.TYPE_3BYTE_BGR:
            return "TYPE_3BYTE_BGR";
        case BufferedImage.TYPE_4BYTE_ABGR:
            return "TYPE_4BYTE_ABGR";
        case BufferedImage.TYPE_4BYTE_ABGR_PRE:
            return "TYPE_4BYTE_ABGR_PRE";
        case BufferedImage.TYPE_BYTE_BINARY:
            return "TYPE_BYTE_BINARY";
        case BufferedImage.TYPE_BYTE_GRAY:
            return "TYPE_BYTE_GRAY";
        case BufferedImage.TYPE_BYTE_INDEXED:
            return "TYPE_BYTE_INDEXED";
        case BufferedImage.TYPE_USHORT_555_RGB:
            return "TYPE_USHORT_555_RGB";
        case BufferedImage.TYPE_USHORT_565_RGB:
            return "TYPE_USHORT_565_RGB";
        case BufferedImage.TYPE_USHORT_GRAY:
            return "TYPE_USHORT_GRAY";
    }
    return "UNKNOWN";
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:ColConvTest.java

示例5: getType

@Override
public int getType(boolean oneBand) {
	if (oneBand || polarizations.size() < 2)
		return BufferedImage.TYPE_USHORT_GRAY;
	else
		return BufferedImage.TYPE_INT_RGB;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:7,代码来源:GDALAlosCeos.java

示例6: getType

@Override
public int getType(boolean oneBand) {
    if (oneBand || bands.length < 2) {
        return BufferedImage.TYPE_USHORT_GRAY;
    } else {
        return BufferedImage.TYPE_INT_RGB;
    }
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:8,代码来源:Radarsat2Image_SLC.java

示例7: getType

@Override
public int getType(boolean oneBand) {
    //only one band
    if (numberOfBytes == 1) {
        return BufferedImage.TYPE_BYTE_GRAY;
    } else {
        return BufferedImage.TYPE_USHORT_GRAY;
    }
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:9,代码来源:Radarsat1Image.java

示例8: getType

@Override
public int getType(boolean oneBand) {
    ////if (oneBand || bands.length < 2) {
        return BufferedImage.TYPE_USHORT_GRAY;
    //} else {
    //    return BufferedImage.TYPE_INT_RGB;
    //}
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:8,代码来源:Radarsat2Image_SLCGDAL.java

示例9: getType

@Override
public int getType(boolean oneBand) {
    if(oneBand || polarizations.size()<2) return BufferedImage.TYPE_USHORT_GRAY;
    else return BufferedImage.TYPE_INT_RGB;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:5,代码来源:Sentinel1.java

示例10: getType

@Override
public int getType(boolean oneBand) {
    return BufferedImage.TYPE_USHORT_GRAY;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:4,代码来源:EnvisatImage.java

示例11: getType

@Override
public int getType(boolean oneBand) {
	if(oneBand || polarizations.size()<2) return BufferedImage.TYPE_USHORT_GRAY;
       else return BufferedImage.TYPE_INT_RGB;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:5,代码来源:Alos.java

示例12: getType

@Override
public int getType(boolean oneBand) {
    if(oneBand || bands.length<2) return BufferedImage.TYPE_USHORT_GRAY;
    else return BufferedImage.TYPE_INT_RGB;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:5,代码来源:Radarsat2Image.java

示例13: getType

public int getType(boolean oneBand) {
    return BufferedImage.TYPE_USHORT_GRAY;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:3,代码来源:AbstractCosmoSkymedImage.java

示例14: init

public static void init() {
    pixelroot = new Group("pixel", "Pixel Access Benchmarks");

    pixeloptroot = new Group(pixelroot, "opts", "Pixel Access Options");
    doRenderTo = new Option.Toggle(pixeloptroot, "renderto",
                                   "Render to Image before test",
                                   Option.Toggle.Off);
    doRenderFrom = new Option.Toggle(pixeloptroot, "renderfrom",
                                     "Render from Image before test",
                                     Option.Toggle.Off);

    // BufferedImage Sources
    bufimgsrcroot = new Group.EnableSet(pixelroot, "src",
                                        "BufferedImage Sources");
    new BufImg(BufferedImage.TYPE_BYTE_BINARY, 1);
    new BufImg(BufferedImage.TYPE_BYTE_BINARY, 2);
    new BufImg(BufferedImage.TYPE_BYTE_BINARY, 4);
    new BufImg(BufferedImage.TYPE_BYTE_INDEXED);
    new BufImg(BufferedImage.TYPE_BYTE_GRAY);
    new BufImg(BufferedImage.TYPE_USHORT_555_RGB);
    new BufImg(BufferedImage.TYPE_USHORT_565_RGB);
    new BufImg(BufferedImage.TYPE_USHORT_GRAY);
    new BufImg(BufferedImage.TYPE_3BYTE_BGR);
    new BufImg(BufferedImage.TYPE_4BYTE_ABGR);
    new BufImg(BufferedImage.TYPE_INT_RGB);
    new BufImg(BufferedImage.TYPE_INT_BGR);
    new BufImg(BufferedImage.TYPE_INT_ARGB);

    // BufferedImage Tests
    bufimgtestroot = new Group(pixelroot, "bimgtests",
                               "BufferedImage Tests");
    new BufImgTest.GetRGB();
    new BufImgTest.SetRGB();

    // Raster Tests
    rastertestroot = new Group(pixelroot, "rastests",
                               "Raster Tests");
    new RasTest.GetDataElements();
    new RasTest.SetDataElements();
    new RasTest.GetPixel();
    new RasTest.SetPixel();

    // DataBuffer Tests
    dbtestroot = new Group(pixelroot, "dbtests",
                           "DataBuffer Tests");
    new DataBufTest.GetElem();
    new DataBufTest.SetElem();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:48,代码来源:PixelTests.java

示例15: main

public static void main(String[] args) throws IOException {
    UshortOutOfMemoryTest t = new UshortOutOfMemoryTest(
            BufferedImage.TYPE_USHORT_GRAY);
    t.testGetAsTree();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:UshortOutOfMemoryTest.java


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