com.sun.jimi.core.vmem
Class IntPageMapper

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

public class IntPageMapper
extends PageMapper

Page mapper extension mapping int-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  IntPageFrame[] pageFrames
          array of page frames
protected  int pageHeight
          individual page dimensions
protected  int pageWidth
          individual page dimensions
protected static int SIZEOF_INT
          size in bytes of a java "int"
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
IntPageMapper(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.
 int 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, int[] buffer, int offset, int scansize)
          Load a rectangular area of data into a memory buffer.
 void setChannelRectangle(int channel, 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, int value)
          Set a single value at a specified logical location.
 void setRectangle(int x, int y, int width, int height, int[] 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_INT

protected static final int SIZEOF_INT
size in bytes of a java "int"

pageFrames

protected IntPageFrame[] 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

IntPageMapper

public IntPageMapper(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 int 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,
                     int 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,
                         int[] 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,
                         int[] 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

setChannelRectangle

public void setChannelRectangle(int channel,
                                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:
channel - which channel of data to set
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()