Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jimi.core.vmem
Class BytePageMapper

    java.lang.Object
      |
      +--com.sun.jimi.core.vmem.PageMapper
            |
            +--com.sun.jimi.core.vmem.BytePageMapper

public class BytePageMapper
extends PageMapper

Page mapper extension mapping byte-based rectangle and pixel operations onto page-sized operations which are performed through page frames.

Field Summary
`protected int` | `height` logical dimensions
`protected int` | `heightInPages` dimensions measured in pages rather than pixels
`protected BytePageFrame[]` | `pageFrames` array of page frames
`protected int` | `pageHeight` individual page dimensions
`protected int` | `pageWidth` individual page dimensions
`protected static int` | `SIZEOF_BYTE` size in bytes of a java "byte"
`protected int` | `width` logical dimensions
`protected int` | `widthInPages` dimensions measured in pages rather than pixels

Fields inherited from class com.sun.jimi.core.vmem.PageMapper
`input, logicalSize, numberOfPageFrames, output, pageDimensions, pageFaults, pageFrameMemory, storage`

Constructor Summary
`BytePageMapper(RandomAccessStorage storage, java.awt.Dimension logicalDimensions, int pageFrameMemory)` Create an page mapper with specified page frame size and count.

Method Summary
`int` | `getLogicalPageNumberForLocation(int x, int y)` Find out which logical page contains a given point.
`java.awt.Dimension` | `getPageDimensions()`
`PageFrame[]` | `getPageFrames()` Get the page frames being used for buffering.
`int` | `getPageSize()` Get the size in bytes of a page.
`byte` | `getPixel(int x, int y)` Get a pixel value at a specified logical location.
`protected int` | `getPixelSize()`
`void` | `getRectangle(int x, int y, int width, int height, byte[] buffer, int offset, int scansize)` Load a rectangular area of data into a memory buffer.
`void` | `setPixel(int x, int y, byte value)` Set a single value at a specified logical location.
`void` | `setRectangle(int x, int y, int width, int height, byte[] buffer, int offset, int scansize)` Load a rectangular area of data into a memory buffer.

Methods inherited from class com.sun.jimi.core.vmem.PageMapper
`commitPage, configurePageFrames, getLogicalSize, getPageFrame, getPageFrameForReading, getPageFrameForWriting, howManyPageFaults, readPageIntoFrame, resetPageFaultCount`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SIZEOF_BYTE

    protected static final int SIZEOF_BYTE

  size in bytes of a java "byte"

### pageFrames

    protected BytePageFrame[] pageFrames

  array of page frames

### width

    protected int width

  logical dimensions

### height

    protected int height

  logical dimensions

### pageWidth

    protected int pageWidth

  individual page dimensions

### pageHeight

    protected int pageHeight

  individual page dimensions

### widthInPages

    protected int widthInPages

  dimensions measured in pages rather than pixels

### heightInPages

    protected int heightInPages

  dimensions measured in pages rather than pixels

Constructor Detail

### BytePageMapper

    public BytePageMapper(RandomAccessStorage storage,
                          java.awt.Dimension logicalDimensions,
                          int pageFrameMemory)

  Create an page mapper with specified page frame size and count.
  Parameters:
    `width` - the width of the logical space
    `height` - the height of the logical space
    `pageWidth` - the width of each page frame
    `pageHeight` - the height of each page frame
    `numberOfFrames` - the number of page frames

Method Detail

### getPixel

    public byte getPixel(int x,
                         int y)
                  throws java.io.IOException

  Get a pixel value at a specified logical location.
  Parameters:
    `x` - the x-coordinate
    `y` - the y-coordinate

### setPixel

    public void setPixel(int x,
                         int y,
                         byte value)
                  throws java.io.IOException

  Set a single value at a specified logical location.
  Parameters:
    `x` - the x-coordinate
    `y` - the y-coordinate
    `value` - the value for the location

### getRectangle

    public void getRectangle(int x,
                             int y,
                             int width,
                             int height,
                             byte[] buffer,
                             int offset,
                             int scansize)
                      throws java.io.IOException

  Load a rectangular area of data into a memory buffer.
  Parameters:
    `x` - the logical x-coordinate
    `y` - the logical y-coordinate
    `width` - the logical width
    `height` - the logical height
    `buffer` - the buffer to copy into
    `offset` - the index in the buffer to start copying at

### setRectangle

    public void setRectangle(int x,
                             int y,
                             int width,
                             int height,
                             byte[] buffer,
                             int offset,
                             int scansize)
                      throws java.io.IOException

  Load a rectangular area of data into a memory buffer.
  Parameters:
    `x` - the logical x-coordinate
    `y` - the logical y-coordinate
    `width` - the logical width
    `height` - the logical height
    `buffer` - the buffer to copy into
    `offset` - the index in the buffer to start copying at

### getLogicalPageNumberForLocation

    public int getLogicalPageNumberForLocation(int x,
                                               int y)

  Find out which logical page contains a given point.

### getPageSize

    public int getPageSize()

  Get the size in bytes of a page.
  Returns:
    the size
  Overrides:
    getPageSize in class PageMapper

### getPixelSize

    protected int getPixelSize()

  Overrides:
    getPixelSize in class PageMapper

### getPageFrames

    public PageFrame[] getPageFrames()

  Get the page frames being used for buffering.
  Returns:
    the array of page frames
  Overrides:
    getPageFrames in class PageMapper

### getPageDimensions

    public java.awt.Dimension getPageDimensions()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD