Package org.apache.sanselan.common

Examples of org.apache.sanselan.common.BinaryOutputStream.write4Bytes()


    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    BinaryOutputStream bos = new BinaryOutputStream(baos,
        BinaryOutputStream.BYTE_ORDER_BIG_ENDIAN);
    bos.write4Bytes(IcnsImageParser.ICNS_MAGIC);
    bos.write4Bytes(4 + 4 + 4 + 4 + 4*16*16);
    bos.write4Bytes(IcnsType.ICNS_16x16_32BIT_IMAGE.getType());
    bos.write4Bytes(4 + 4 + 4*16*16);
    for (int y = 0; y < 16; y++)
    {
      for (int x = 0; x < 16; x++)
      {
View Full Code Here


    BinaryOutputStream bos = new BinaryOutputStream(baos,
        BinaryOutputStream.BYTE_ORDER_BIG_ENDIAN);
    bos.write4Bytes(IcnsImageParser.ICNS_MAGIC);
    bos.write4Bytes(4 + 4 + 4 + 4 + 4*16*16);
    bos.write4Bytes(IcnsType.ICNS_16x16_32BIT_IMAGE.getType());
    bos.write4Bytes(4 + 4 + 4*16*16);
    for (int y = 0; y < 16; y++)
    {
      for (int x = 0; x < 16; x++)
      {
        // argb, a ignored
View Full Code Here

        byte[] bitmap = new GeneratorFor32BitBitmaps().generate32bitRGBABitmap(
                0xFFFF0000, 0xFFFFFFFF, 0, true);
        writeICONDIR(bos, 0, 1, 1);
        writeICONDIRENTRY(bos, 16, 16, 0, 0, 1, 32, 40 + bitmap.length);
        writeBITMAPINFOHEADER(bos, 16, 2*16, 1, 32, 3 /* BI_BITFIELDS */, 0, 0);
        bos.write4Bytes(0x000000FF); // red mask
        bos.write4Bytes(0x0000FF00); // green mask
        bos.write4Bytes(0x00FF0000); // blue mask
        bos.write(bitmap);
        bos.flush();
        writeAndReadImageData("16x16x32-bitfield-compressed", baos.toByteArray(),
View Full Code Here

                0xFFFF0000, 0xFFFFFFFF, 0, true);
        writeICONDIR(bos, 0, 1, 1);
        writeICONDIRENTRY(bos, 16, 16, 0, 0, 1, 32, 40 + bitmap.length);
        writeBITMAPINFOHEADER(bos, 16, 2*16, 1, 32, 3 /* BI_BITFIELDS */, 0, 0);
        bos.write4Bytes(0x000000FF); // red mask
        bos.write4Bytes(0x0000FF00); // green mask
        bos.write4Bytes(0x00FF0000); // blue mask
        bos.write(bitmap);
        bos.flush();
        writeAndReadImageData("16x16x32-bitfield-compressed", baos.toByteArray(),
                0xFF0000FF, 0xFFFFFFFF);
View Full Code Here

        writeICONDIR(bos, 0, 1, 1);
        writeICONDIRENTRY(bos, 16, 16, 0, 0, 1, 32, 40 + bitmap.length);
        writeBITMAPINFOHEADER(bos, 16, 2*16, 1, 32, 3 /* BI_BITFIELDS */, 0, 0);
        bos.write4Bytes(0x000000FF); // red mask
        bos.write4Bytes(0x0000FF00); // green mask
        bos.write4Bytes(0x00FF0000); // blue mask
        bos.write(bitmap);
        bos.flush();
        writeAndReadImageData("16x16x32-bitfield-compressed", baos.toByteArray(),
                0xFF0000FF, 0xFFFFFFFF);
    }
View Full Code Here

            bos.write3Bytes(background);
            bos.write(0);
            bos.write3Bytes(foreground);
            bos.write(0);
            for (int i = 2; i < paletteSize; i++)
                bos.write4Bytes(0);
            // Image
            for (int y = 15; y >= 0; y--)
            {
                for (int x = 0; x < 16; x += 8)
                {
View Full Code Here

    else
      throw new ImageWriteException("Invalid/unsupported source width " +
          src.getWidth() + " and height " + src.getHeight());

    BinaryOutputStream bos = new BinaryOutputStream(os, BYTE_ORDER_BIG_ENDIAN);
    bos.write4Bytes(ICNS_MAGIC);
    bos.write4Bytes(4 + 4 + 4 + 4 + 4*imageType.getWidth()*imageType.getHeight() +
        4 + 4 + imageType.getWidth()*imageType.getHeight());

    bos.write4Bytes(imageType.getType());
    bos.write4Bytes(4 + 4 + 4*imageType.getWidth()*imageType.getHeight());
 
View Full Code Here

      throw new ImageWriteException("Invalid/unsupported source width " +
          src.getWidth() + " and height " + src.getHeight());

    BinaryOutputStream bos = new BinaryOutputStream(os, BYTE_ORDER_BIG_ENDIAN);
    bos.write4Bytes(ICNS_MAGIC);
    bos.write4Bytes(4 + 4 + 4 + 4 + 4*imageType.getWidth()*imageType.getHeight() +
        4 + 4 + imageType.getWidth()*imageType.getHeight());

    bos.write4Bytes(imageType.getType());
    bos.write4Bytes(4 + 4 + 4*imageType.getWidth()*imageType.getHeight());
    for (int y = 0; y < src.getHeight(); y++)
View Full Code Here

    BinaryOutputStream bos = new BinaryOutputStream(os, BYTE_ORDER_BIG_ENDIAN);
    bos.write4Bytes(ICNS_MAGIC);
    bos.write4Bytes(4 + 4 + 4 + 4 + 4*imageType.getWidth()*imageType.getHeight() +
        4 + 4 + imageType.getWidth()*imageType.getHeight());

    bos.write4Bytes(imageType.getType());
    bos.write4Bytes(4 + 4 + 4*imageType.getWidth()*imageType.getHeight());
    for (int y = 0; y < src.getHeight(); y++)
    {
      for (int x = 0; x < src.getWidth(); x++)
      {
View Full Code Here

    bos.write4Bytes(ICNS_MAGIC);
    bos.write4Bytes(4 + 4 + 4 + 4 + 4*imageType.getWidth()*imageType.getHeight() +
        4 + 4 + imageType.getWidth()*imageType.getHeight());

    bos.write4Bytes(imageType.getType());
    bos.write4Bytes(4 + 4 + 4*imageType.getWidth()*imageType.getHeight());
    for (int y = 0; y < src.getHeight(); y++)
    {
      for (int x = 0; x < src.getWidth(); x++)
      {
        int argb = src.getRGB(x, y);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.