Examples of MemoryPaletted8Image


Examples of net.sourceforge.jiu.data.MemoryPaletted8Image

  private void mapImage()
  {
    RGB24Image in = (RGB24Image)getInputImage();
    Palette palette = createPalette();
    Paletted8Image out = new MemoryPaletted8Image(in.getWidth(), in.getHeight(), palette);
    int[] origRgb = new int[3];
    int[] quantizedRgb = new int[3];
    for (int y = 0; y < in.getHeight(); y++)
    {
      for (int x = 0; x < in.getWidth(); x++)
      {
        origRgb[INDEX_RED] = in.getSample(INDEX_RED, x, y);
        origRgb[INDEX_GREEN] = in.getSample(INDEX_GREEN, x, y);
        origRgb[INDEX_BLUE] = in.getSample(INDEX_BLUE, x, y);
        int index = map(origRgb, quantizedRgb);
        out.putSample(0, x, y, index);
      }
    }
    setOutputImage(out);
  }
View Full Code Here

Examples of net.sourceforge.jiu.data.MemoryPaletted8Image

      rgbImage = new MemoryRGB24Image(getBoundsWidth(), getBoundsHeight());
      image = rgbImage;
    }
    else
    {
      palettedImage = new MemoryPaletted8Image(getBoundsWidth(), getBoundsHeight(), palette);
      image = palettedImage;
    }
    /* only matters for uncompressed files;
       will be true if the number of bytes is odd;
       is computed differently for PBM and ILBM types
View Full Code Here

Examples of net.sourceforge.jiu.data.MemoryPaletted8Image

    {
      if (palette == null)
      {
        throw new InvalidFileStructureException("No palette found when trying to load indexed image.");
      }
      image = new MemoryPaletted8Image(w, h, palette);
    }
    else
    if (colorType == COLOR_TYPE_RGB || colorType == COLOR_TYPE_RGB_ALPHA)
    {
      if (precision == 8)
View Full Code Here

Examples of net.sourceforge.jiu.data.MemoryPaletted8Image

          break;
        }
        case(4):
        case(8):
        {
          setImage(new MemoryPaletted8Image(getBoundsWidth(), getBoundsHeight(), palette));
          break;
        }
        case(24):
        {
          setImage(new MemoryRGB24Image(getBoundsWidth(), getBoundsHeight()));
View Full Code Here

Examples of net.sourceforge.jiu.data.MemoryPaletted8Image

    if (palette != null)
    {
      // paletted image
      if (image == null)
      {
        image = new MemoryPaletted8Image(getBoundsWidth(), getBoundsHeight(), palette);
      }
      else
      {
        if (!(image instanceof Paletted8Image))
        {
View Full Code Here

Examples of net.sourceforge.jiu.data.MemoryPaletted8Image

      setImage(rgb24Image);
    }
    else
    if (channels == 1 && depth == 8 && colorMode == 2)
    {
      paletted8Image = new MemoryPaletted8Image(width, height, palette);
      setImage(paletted8Image);
    }
    else
    if (channels == 1 && depth == 8 && colorMode == COLOR_MODE_GRAYSCALE)
    {
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.