Package com.lightcrafts.mediax.jai.util

Examples of com.lightcrafts.mediax.jai.util.Range


            JaiI18N.formatMsg("ParameterListDescriptorImpl5",
            new Object[] { paramNames[i] }));

        } else if (validParamValues[i] instanceof Range) {

      Range range = (Range)validParamValues[i];

      // If the validParamValues[i] is a Range, then
      // the Range's class must match with paramClass[i]
      if (!paramClasses[i].isAssignableFrom(
              range.getElementClass()))
          throw new IllegalArgumentException(
            JaiI18N.formatMsg("ParameterListDescriptorImpl6",
            new Object[]
        { range.getElementClass().getName(),
          paramClasses[i].getName(),
          paramNames[i] }));

        } else {
View Full Code Here


        switch (index) {
        case 1:
        case 2:
        case 4:
        case 5:
            return new Range(Integer.class, new Integer(1), null);
        }
        return null;
    }
View Full Code Here

    continue;

      if (validValues == null)
    validValues = new Object[numParams];

      validValues[i] = new Range(
        min.getClass(), (Comparable)min, (Comparable)max);
  }

  return validValues;
    }
View Full Code Here

  // or the element class doesn't match, negotiation fails
  if (!(other instanceof NegotiableNumericRange))
      return null;

  NegotiableNumericRange otherNNRange = (NegotiableNumericRange)other;
  Range otherRange = otherNNRange.getRange();

  // If the range is null, i.e there are no valid values, then
  // negotiation fails.
  if (otherRange == null)
      return null;

  // If the elementClass' don't match, negotiation fails.
  if (otherRange.getElementClass() != range.getElementClass())
      return null;

  Range result = range.intersect(otherRange);

  // If there are no valid values, negotiation failed.
  if (result.isEmpty())
      return null;

  return new NegotiableNumericRange(result);
    }
View Full Code Here

            int start_s_iy = s_iy;
            int start_ifracx = ifracx;
            int start_ifracy = ifracy;

            // Compute clipMinX, clipMinY
            Range clipRange =
    performScanlineClipping(src_rect_x1, src_rect_y1,
          // Last point in the source is
          // x2 = x1 + width - 1
          // y2 = y1 + height - 1
          src_rect_x2 - 1, src_rect_y2 - 1,
          s_ix, s_iy,
          ifracx, ifracy,
          dst_min_x, dst_max_x,
          0, 0, 0, 0);
            int clipMinX = ((Integer)clipRange.getMinValue()).intValue();
            int clipMaxX = ((Integer)clipRange.getMaxValue()).intValue();

            if(clipMinX > clipMaxX) continue;

            int destYOffset = (y - destTransY)*
                destScanlineStride + destDBOffset;
View Full Code Here

            int start_s_iy = s_iy;
            int start_ifracx = ifracx;
            int start_ifracy = ifracy;

            // Compute clipMinX, clipMinY
            Range clipRange =
    performScanlineClipping(src_rect_x1, src_rect_y1,
          // Last point in the source is
          // x2 = x1 + width - 1
          // y2 = y1 + height - 1
          src_rect_x2 - 1, src_rect_y2 - 1,
          s_ix, s_iy,
          ifracx, ifracy,
          dst_min_x, dst_max_x,
          0, 0, 0, 0);
            int clipMinX = ((Integer)clipRange.getMinValue()).intValue();
            int clipMaxX = ((Integer)clipRange.getMaxValue()).intValue();

            if(clipMinX > clipMaxX) continue;

            int destYOffset = (y - destTransY)*
                destScanlineStride + destDBOffset;
View Full Code Here

            int start_s_iy = s_iy;
            int start_ifracx = ifracx;
            int start_ifracy = ifracy;

            // Compute clipMinX, clipMinY
            Range clipRange =
    performScanlineClipping(src_rect_x1, src_rect_y1,
          // Last point in the source is
          // x2 = x1 + width - 1
          // y2 = y1 + height - 1
          src_rect_x2 - 1, src_rect_y2 - 1,
          s_ix, s_iy,
          ifracx, ifracy,
          dst_min_x, dst_max_x,
          0, 0, 0, 0);
            int clipMinX = ((Integer)clipRange.getMinValue()).intValue();
            int clipMaxX = ((Integer)clipRange.getMaxValue()).intValue();

            if(clipMinX > clipMaxX) continue;

            int destYOffset = (y - destTransY)*
                destScanlineStride + destDBOffset;
View Full Code Here

            clipMaxX = Math.min(clipMaxX, dx2);
        } else {
            // xdenom == 0, all points have same x coordinate as the first
            if (s_ix < src_rect_x1 || s_ix >= src_rect_x2) {
                clipMinX = clipMaxX = dst_min_x;
                return new Range(Integer.class,
                                 new Integer(clipMinX),
                                 new Integer(clipMaxX));
            }
        }

        long ydenom = incy*geom_frac_max + ifracdy;
        if (ydenom != 0) {
            long clipy1 = (long)src_rect_y1 + tpad;
            long clipy2 = (long)src_rect_y2 - bpad;

            long y1 = ((clipy1 - s_iy)*geom_frac_max - ifracy) +
                dst_min_x*ydenom;
            long y2 = ((clipy2 - s_iy)*geom_frac_max - ifracy) +
                dst_min_x*ydenom;

            // Moving backwards, switch roles of top and bottom edges
            if (ydenom < 0) {
                long tmp = y1;
                y1 = y2;
                y2 = tmp;
            }

            int dx1 = ceilRatio(y1, ydenom);
            clipMinX = Math.max(clipMinX, dx1);

            int dx2 = floorRatio(y2, ydenom) + 1;
            clipMaxX = Math.min(clipMaxX, dx2);
        } else {
            // ydenom == 0, all points have same y coordinate as the first
            if (s_iy < src_rect_y1 || s_iy >= src_rect_y2) {
                clipMinX = clipMaxX = dst_min_x;
            }
        }

        if (clipMinX > dst_max_x)
            clipMinX = dst_max_x;
        if (clipMaxX < dst_min_x)
            clipMaxX = dst_min_x;

        return new Range(Integer.class,
                         new Integer(clipMinX),
                         new Integer(clipMaxX));
    }
View Full Code Here

            int ifracx = (int) Math.floor(fracx * geom_frac_max);
            int ifracy = (int) Math.floor(fracy * geom_frac_max);

            // Compute clipMinX, clipMinY
            Range clipRange =
    performScanlineClipping(src_rect_x1, src_rect_y1,
          // Last point in the source is
          // x2 = x1 + width - 1
          // y2 = y1 + height - 1
          src_rect_x2 - 1, src_rect_y2 - 1,
          s_ix, s_iy,
          ifracx, ifracy,
          dst_min_x, dst_max_x,
          0, 0, 0, 0);
            int clipMinX = ((Integer)clipRange.getMinValue()).intValue();
            int clipMaxX = ((Integer)clipRange.getMaxValue()).intValue();

            // Advance s_ix, s_iy, ifracx, ifracy
            Point[] startPts = advanceToStartOfScanline(dst_min_x, clipMinX,
                                                        s_ix, s_iy,
                                                        ifracx, ifracy);
View Full Code Here

            int ifracx = (int) Math.floor(fracx * geom_frac_max);
            int ifracy = (int) Math.floor(fracy * geom_frac_max);

            // Compute clipMinX, clipMinY
            Range clipRange =
    performScanlineClipping(src_rect_x1, src_rect_y1,
          // Last point in the source is
          // x2 = x1 + width - 1
          // y2 = y1 + height - 1
          src_rect_x2 - 1, src_rect_y2 - 1,
          s_ix, s_iy,
          ifracx, ifracy,
          dst_min_x, dst_max_x,
          0, 0, 0, 0);
            int clipMinX = ((Integer)clipRange.getMinValue()).intValue();
            int clipMaxX = ((Integer)clipRange.getMaxValue()).intValue();

            // Advance s_ix, s_iy, ifracx, ifracy
            Point[] startPts = advanceToStartOfScanline(dst_min_x, clipMinX,
                                                        s_ix, s_iy,
                                                        ifracx, ifracy);
View Full Code Here

TOP

Related Classes of com.lightcrafts.mediax.jai.util.Range

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.