Examples of PixelType


Examples of ca.eandb.jmist.framework.loader.openexr.attribute.PixelType

            int sx = channel.getxSampling();
            int sy = channel.getySampling();

            if ((y % sy) == 0) {
              int numElem = 1 + (w - 1) / sx;
              PixelType pt = channel.getPixelType();
              switch (pt) {
              case UINT:
                {
                  IntBuffer chBuf = (IntBuffer) getChannelBuffer(name);
                  chBuf.position(((y - ymin) / sy) * numElem);
                  chBuf.put((IntBuffer) inBuf.asIntBuffer().limit(numElem));
                  break;
                }

              case HALF:
                {
                  ShortBuffer chBuf = (ShortBuffer) getChannelBuffer(name);
                  chBuf.position(((y - ymin) / sy) * numElem);
                  chBuf.put((ShortBuffer) inBuf.asShortBuffer().limit(numElem));
                  break;
                }

              case FLOAT:
                {
                  FloatBuffer chBuf = (FloatBuffer) getChannelBuffer(name);
                  chBuf.position(((y - ymin) / sy) * numElem);
                  chBuf.put((FloatBuffer) inBuf.asFloatBuffer().limit(numElem));
                  break;
                }

              } // switch (channel.getPixelType())

              inBuf.position(inBuf.position() + numElem * pt.getSampleSize());
            } // if ((y % sy) == 0)
          } // for (c)
        } // for (y)
      } // for (i)
    } // if (tiled)
View Full Code Here

Examples of ca.eandb.jmist.framework.loader.openexr.attribute.PixelType

      Box2i dataWindow = getDataWindow();
      int w = dataWindow.getXSize();
      int h = dataWindow.getYSize();
      int sx = 1 + (w - 1) / channel.getxSampling();
      int sy = 1 + (h - 1) / channel.getySampling();
      PixelType pt = channel.getPixelType();

      switch (pt) {
      case UINT:
        buf = IntBuffer.allocate(sx * sy);
        break;
View Full Code Here

Examples of ca.eandb.jmist.framework.loader.openexr.attribute.PixelType

    int x1 = tile.getXMax();
    int y1 = tile.getYMax();

    int size = 0;
    for (Channel channel : chlist.channels()) {
      PixelType type = channel.getPixelType();
      int sx = channel.getxSampling();
      int sy = channel.getySampling();
      int nx = 1 + (x1 - x0 - (x1 % sx)) / sx;
      int ny = 1 + (y1 - y0 - (y1 % sy)) / sy;
      size += nx * ny * type.getSampleSize();
    }
    return size;
  }
View Full Code Here

Examples of ca.eandb.jmist.framework.loader.openexr.attribute.PixelType

    int tw = tileSize.getX();
    int th = tileSize.getY();

    int size = 0;
    for (Channel channel : chlist.channels()) {
      PixelType type = channel.getPixelType();
      int sx = channel.getxSampling();
      int sy = channel.getySampling();
      int nx = 1 + (tw - 1) / sx;
      int ny = 1 + (th - 1) / sy;
      size += nx * ny * type.getSampleSize();
    }
    return size;
  }
View Full Code Here

Examples of ca.eandb.jmist.framework.loader.openexr.attribute.PixelType

          int sy = channel.getySampling();
          if (y % sy == 0) {
            int nx = 1 + (x1 - x0 - (x1 % sx)) / sx;
            int offset = ((y - ymin) / sy) * nx;
            Buffer chBuf = getChannelBuffer(name);
            PixelType pt = channel.getPixelType();

            switch (pt) {
            case UINT:
              bytes.asIntBuffer().put((IntBuffer)
                  ((IntBuffer) chBuf).duplicate().position(offset).limit(offset + nx));
              break;

            case HALF:
              bytes.asShortBuffer().put((ShortBuffer)
                  ((ShortBuffer) chBuf).duplicate().position(offset).limit(offset + nx));
              break;

            case FLOAT:
              bytes.asFloatBuffer().put((FloatBuffer)
                  ((FloatBuffer) chBuf).duplicate().position(offset).limit(offset + nx));
              break;

            default:
              throw new UnexpectedException("Invalid pixel type");
            }

            bytes.position(bytes.position() + nx * pt.getSampleSize());
          }
        }
      }

      buf.setData(blockData);
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.