Package net.sourceforge.jiu.data

Examples of net.sourceforge.jiu.data.ShortChannelImage


        }
        break;
      }
      case(TIFFImageFileDirectory.TYPE_RGB48_INTERLEAVED):
      {
        ShortChannelImage image = (ShortChannelImage)codec.getImage();
        offset += leftPixels * 3;
        short[] triplet = new short[3];
        boolean littleEndian = codec.getByteOrder() == TIFFCodec.BYTE_ORDER_INTEL;
        for (int i = 0, x = getX1() - codec.getBoundsX1() + leftPixels; i < numPixels; i++, x++)
        {
          for (int j = 0; j < 3; j++, offset += 2)
          {
            if (littleEndian)
            {
              triplet[j] = ArrayConverter.getShortLE(data, offset);
            }
            else
            {
              triplet[j] = ArrayConverter.getShortBE(data, offset);
            }
          }
          image.putShortSample(RGBIndex.INDEX_RED, x, y, triplet[0]);
          image.putShortSample(RGBIndex.INDEX_GREEN, x, y, triplet[1]);
          image.putShortSample(RGBIndex.INDEX_BLUE, x, y, triplet[2]);
        }
        break;
      }
      case(TIFFImageFileDirectory.TYPE_LOGLUV32_INTERLEAVED):
      {
        if (getImageFileDirectory().getCompression() == TIFFConstants.COMPRESSION_SGI_LOG_RLE)
        {
          ByteChannelImage image = (ByteChannelImage)codec.getImage();
          int numSamples = ifd.getTileWidth();
          byte[] red = new byte[numSamples];
          byte[] green = new byte[numSamples];
          byte[] blue = new byte[numSamples];
          LogLuvConversion.convertLogLuv32InterleavedtoRGB24Planar(data, red, green, blue, numSamples);
          image.putByteSamples(RGBIndex.INDEX_RED, getX1() - codec.getBoundsX1() + leftPixels, y, numPixels, 1, red, leftPixels);
          image.putByteSamples(RGBIndex.INDEX_GREEN, getX1() - codec.getBoundsX1() + leftPixels, y, numPixels, 1, green, leftPixels);
          image.putByteSamples(RGBIndex.INDEX_BLUE, getX1() - codec.getBoundsX1() + leftPixels, y, numPixels, 1, blue, leftPixels);
        }
        else
        if (getImageFileDirectory().getCompression() == TIFFConstants.COMPRESSION_SGI_LOG_24_PACKED)
        {
          ByteChannelImage image = (ByteChannelImage)codec.getImage();
          int numSamples = ifd.getTileWidth();
          byte[] red = new byte[numSamples];
          byte[] green = new byte[numSamples];
          byte[] blue = new byte[numSamples];
          LogLuvConversion.convertLogLuv24InterleavedtoRGB24Planar(data, red, green, blue, numSamples);
          image.putByteSamples(RGBIndex.INDEX_RED, getX1() - codec.getBoundsX1() + leftPixels, y, numPixels, 1, red, leftPixels);
          image.putByteSamples(RGBIndex.INDEX_GREEN, getX1() - codec.getBoundsX1() + leftPixels, y, numPixels, 1, green, leftPixels);
          image.putByteSamples(RGBIndex.INDEX_BLUE, getX1() - codec.getBoundsX1() + leftPixels, y, numPixels, 1, blue, leftPixels);
        }
        break;
      }
      case(TIFFImageFileDirectory.TYPE_LOGL):
      {
        ByteChannelImage image = (ByteChannelImage)codec.getImage();
        int numSamples = ifd.getTileWidth();
        byte[] gray = new byte[numSamples];
        LogLuvConversion.convertLogL16toGray8(data, gray, numSamples);
        image.putByteSamples(0, getX1() - codec.getBoundsX1() + leftPixels, y, numPixels, 1, gray, leftPixels);
        break;
      }
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.jiu.data.ShortChannelImage

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.