Returns the pixels of the image as an iterator.
<p>
The iterator is the most efficient way to lazily iterator over the pixels as the pixels will only
be fetched from the raster as needed.

@return the iterator
353237
public Iterator<Pixel> iterator() {
        return new Iterator<Pixel>() {

            private int k = 0;

            @Override
            public boolean hasNext() {
                return k < AwtImage.this.count();
            }

            @Override
            public Pixel next() {
                Coordinate coord = PixelTools.offsetToCoordinate(k++, width);
                int rgb = awt.getRGB(coord.getX(), coord.getY());
                return new Pixel(rgb);
            }
        };
    }
1297227
public static <E> EmptyIterator<E> get() {
		@SuppressWarnings("unchecked")
		EmptyIterator<E> iter = (EmptyIterator<E>) INSTANCE;
		return iter;
	}
983057
@Benchmark
  public int iter(IterState state)
  {
    ImmutableBitmap bitmap = state.bitmap;
    return iter(bitmap);
  }
1000344
public BufferedImage getNewImageInstance() {
        BufferedImage buf = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());
        buf.setData(image.getData());
        return buf;
    }
97632
public Iterator iterator()
   {
      if (tc.isEntryEnabled()) SibTr.entry(tc, "iterator");
      if (tc.isEntryEnabled()) SibTr.exit(tc, "iterator");

      return map.values().iterator();
   }
1124179
@Override
  public Iterator<Integer> iterator() {
    return new Iterator<Integer>() {
      int hs = 0;

      ShortIterator iter;

      int pos = 0;

      int x;

      @Override
      public boolean hasNext() {
        return pos < ImmutableRoaringBitmap.this.highLowContainer.size();
      }

      public Iterator<Integer> init() {
        if (pos < ImmutableRoaringBitmap.this.highLowContainer.size()) {
          iter = ImmutableRoaringBitmap.this.highLowContainer.getContainerAtIndex(pos)
              .getShortIterator();
          hs = BufferUtil
              .toIntUnsigned(ImmutableRoaringBitmap.this.highLowContainer.getKeyAtIndex(pos)) << 16;
        }
        return this;
      }

      @Override
      public Integer next() {
        x = iter.nextAsInt() | hs;
        if (!iter.hasNext()) {
          ++pos;
          init();
        }
        return x;
      }

      @Override
      public void remove() {
        throw new RuntimeException("Cannot modify.");
      }

    }.init();
  }
880475
@Override
    public Iterator<T> iterator() {
        return new Iterator<T>() {
            private int cursor = 0;

            @Override
            public boolean hasNext() {
                return size == INFINITE_SIZE || cursor < size;
            }

            @Override
            public T next() {
                if (!hasNext()) {
                    throw new NoSuchElementException();
                }
                cursor++;
                return generator.next();
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException("remove() operation is not supported");
            }
        };
    }
232007
public Pixel[] pixels() {
        Pixel[] pixels = new Pixel[count()];
        Point[] points = points();
        for (int k = 0; k < points.length; k++) {
            pixels[k] = pixel(points[k]);
        }
        return pixels;
    }
670642
public Iterator<T> iterator() {
        List<Iterator<T>> iters = new ArrayList<Iterator<T>>(sets.size());
        for (Set<T> s : sets)
            iters.add(s.iterator());
        return new CombinedIterator<T>(iters);
    }
328344
private static Raster getRaster(final RenderedImage image) {
        return image instanceof BufferedImage
               ? ((BufferedImage) image).getRaster()
               : image.getNumXTiles() == 1 && image.getNumYTiles() == 1
                 ? image.getTile(0, 0)
                 : image.getData();
    }
106934
public Iterator<RangeTombstone> rangeIterator()
    {
        return ranges == null ? Iterators.<RangeTombstone>emptyIterator() : ranges.iterator();
    }
772735
public Iterator getFilterIterator()
    {
        if (m_filter instanceof Map)
            return ((Map)m_filter).values().iterator();
        else if (m_filter != null)
            return new OneFilterIterator();
        else
            return null;    // Okay
    }
118457
public int[] getUnsignedPixelValues(WritableRaster raster) {
		short[] pixelValues = getPixelValues(raster);
		int[] unsignedPixelValues = getUnsignedPixelValues(pixelValues);
		return unsignedPixelValues;
	}
551921
private long next() {
        while(true) {
            final long index;
            synchronized (mTileAreas) {
                if(!mTileIndices.hasNext()) {
                    return -1;
                }
                index = mTileIndices.next();
            }
            final Drawable drawable = mCache.getMapTile(index);
            if (drawable == null) {
                return index;
            }
        }
    }
1315879
public int getImageSize() {
		int filePages = (int) header.get(FILE_PAGES);
		int lastPageSize = (int) header.get(LAST_PAGE_SIZE);

		int imageSize = (filePages - 1) * PAGE_SIZE + lastPageSize;
		if (lastPageSize == 0) {
			imageSize += PAGE_SIZE;
		}
		return imageSize;
	}
1007267
public BufferedImage getAsImage() {
        final BufferedImage IMAGE = UTIL.createImage(getWidth(), getHeight(), Transparency.TRANSLUCENT);
        final Graphics2D G2 = IMAGE.createGraphics();
        paintAll(G2);
        G2.dispose();
        return IMAGE;
    }
736757
public SkippableIterator getSkippableIterator() {
		return new SkippableIterator() {
			int pos = 0;
			int p = 0;

			public SkippableIterator init() {
				this.p = SparseBitmap.this.buffer.get(0);
				return this;
			}

			@Override
			public void advance() {
				this.pos += 2;
				if (this.pos < SparseBitmap.this.buffer.size())
					this.p += SparseBitmap.this.buffer.get(this.pos) + 1;
			}

			@Override
			public void advanceUntil(int min) {
				advance();
				while (hasValue() && (getCurrentWordOffset() < min)) {
					advance();
				}
			}

			@Override
			public int getCurrentWord() {
				return SparseBitmap.this.buffer.get(this.pos + 1);
			}

			@Override
			public int getCurrentWordOffset() {
				return this.p;
			}

			@Override
			public boolean hasValue() {
				return this.pos < SparseBitmap.this.buffer.size();
			}
		}.init();

	}