Package org.apache.sanselan.palette

Examples of org.apache.sanselan.palette.PaletteFactory


        {
            Object firstKey = params.keySet().iterator().next();
            throw new ImageWriteException("Unknown parameter: " + firstKey);
        }

        final PaletteFactory paletteFactory = new PaletteFactory();
        final SimplePalette palette = paletteFactory.makePaletteSimple(src, 256);
        final int bitCount;
        final boolean hasTransparency = paletteFactory.hasTransparency(src);
        if (palette == null)
        {
            if (hasTransparency)
                bitCount = 32;
            else
View Full Code Here


        params = rawParams;

        int width = src.getWidth();
        int height = src.getHeight();

        boolean hasAlpha = new PaletteFactory().hasTransparency(src);
        if (verbose)
            Debug.debug("hasAlpha", hasAlpha);
        // int transparency = new PaletteFactory().getTransparency(src);

        boolean isGrayscale = new PaletteFactory().isGrayscale(src);
        if (verbose)
            Debug.debug("isGrayscale", isGrayscale);

        byte colorType;
        {
View Full Code Here

        {
            Object firstKey = params.keySet().iterator().next();
            throw new ImageWriteException("Unknown parameter: " + firstKey);
        }

        final SimplePalette palette = new PaletteFactory().makePaletteSimple(
                src, 256);

        BMPWriter writer = null;
        if (palette == null)
            writer = new BMPWriterRGB();
View Full Code Here

        }

        int width = src.getWidth();
        int height = src.getHeight();

        boolean hasAlpha = new PaletteFactory().hasTransparency(src);

        int max_colors = hasAlpha ? 255 : 256;

        Palette palette2 = new PaletteFactory().makePaletteSimple(src,
                max_colors);
        // int palette[] = new PaletteFactory().makePaletteSimple(src, 256);
        // Map palette_map = paletteToMap(palette);

        if (palette2 == null)
        {
            palette2 = new PaletteFactory().makePaletteQuantized(src,
                    max_colors);
            if (verbose)
                System.out.println("quantizing");
        } else if (verbose)
            System.out.println("exact palette");
View Full Code Here

        {
            Object firstKey = params.keySet().iterator().next();
            throw new ImageWriteException("Unknown parameter: " + firstKey);
        }

        PaletteFactory paletteFactory = new PaletteFactory();
        boolean hasTransparency = false;
        if (paletteFactory.hasTransparency(src, 1))
            hasTransparency = true;
        SimplePalette palette = null;
        int maxColors = writePalette.length;
        int charsPerPixel = 1;
        for (; palette == null; )
        {
            palette = paletteFactory.makePaletteSimple(src,
                    hasTransparency ? maxColors - 1 : maxColors);
            if (palette == null)
            {
                maxColors *= writePalette.length;
                charsPerPixel++;
View Full Code Here

    }

    public void writeImage(BufferedImage src, OutputStream os)
            throws ImageWriteException, IOException
    {
        final PaletteFactory paletteFactory = new PaletteFactory();
        final SimplePalette palette = paletteFactory.makePaletteSimple(src, 256);
        BinaryOutputStream bos = new BinaryOutputStream(os, BinaryOutputStream.BYTE_ORDER_INTEL);
        if (palette == null || bitDepth == 24 || bitDepth == 32)
        {
            if (bitDepth == 32)
                write32BppPCX(src, bos);
View Full Code Here

    {
      Object firstKey = params.keySet().iterator().next();
      throw new ImageWriteException("Unknown parameter: " + firstKey);
    }

    SimplePalette palette = new PaletteFactory()
        .makePaletteSimple(src, 256);

    BMPWriter writer = null;
    if (palette == null)
      writer = new BMPWriterRGB();
View Full Code Here

    }

    int width = src.getWidth();
    int height = src.getHeight();

    boolean hasAlpha = new PaletteFactory().hasTransparency(src);

    int max_colors = hasAlpha ? 255 : 256;

    Palette palette2 = new PaletteFactory().makePaletteSimple(src,
        max_colors);
    // int palette[] = new PaletteFactory().makePaletteSimple(src, 256);
    // Map palette_map = paletteToMap(palette);

    if (palette2 == null)
    {
      palette2 = new PaletteFactory().makePaletteQuantized(src,
          max_colors);
      if (verbose)
        System.out.println("quantizing");
    } else if (verbose)
      System.out.println("exact palette");
View Full Code Here

    params = rawParams;

    int width = src.getWidth();
    int height = src.getHeight();

    boolean hasAlpha = new PaletteFactory().hasTransparency(src);
    if (verbose)
      Debug.debug("hasAlpha", hasAlpha);
    // int transparency = new PaletteFactory().getTransparency(src);

    boolean isGrayscale = new PaletteFactory().isGrayscale(src);
    if (verbose)
      Debug.debug("isGrayscale", isGrayscale);

    byte colorType;
    {
View Full Code Here

    }

    int width = src.getWidth();
    int height = src.getHeight();

    boolean hasAlpha = new PaletteFactory().hasTransparency(src);

    int max_colors = hasAlpha ? 255 : 256;

    Palette palette2 = new PaletteFactory().makePaletteSimple(src,
        max_colors);
    // int palette[] = new PaletteFactory().makePaletteSimple(src, 256);
    // Map palette_map = paletteToMap(palette);

    if (palette2 == null)
    {
      palette2 = new PaletteFactory().makePaletteQuantized(src,
          max_colors);
      if (verbose)
        System.out.println("quantizing");
    } else if (verbose)
      System.out.println("exact palette");
View Full Code Here

TOP

Related Classes of org.apache.sanselan.palette.PaletteFactory

Copyright © 2018 www.massapicom. 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.