Inheritance diagram for CanvasHxImageLarge::
Public Methods | |
CanvasHxImageLarge (String imName, String displayMode) | |
Constructor. More... | |
CanvasHxImageLarge (String imName, String displayMode, int displayDimension, int displayPlane, double resolution, int interpType) | |
Constructor. More... | |
void | draw (Graphics g) |
Draw CanvasObject on 'g', using internal CCS values. More... | |
void | setPixel (int x, int y, Color c) |
BufferedImage | getSubImage (int x, int y, int w, int h) |
Implementation CanvasImage interface. More... | |
String[] | getPixelStrings (int x, int y, int w, int h) |
Implementation CanvasImage interface. More... | |
String | getSaName () |
Overrides CanvasObject interface. More... | |
String | getDisplayMode () |
void | setDisplayMode (String displayMode) |
int | getDisplayDimension () |
void | setDisplayDimension (int displayDimension) |
int | getDisplayPlane () |
void | setDisplayPlane (int displayPlane) |
double | getResolution () |
void | setResolution (double resolution) |
int | getInterpolationType () |
void | setInterpolationType (int interpType) |
void | refreshPixels () |
int | getHxImageRepWidth () |
int | getHxImageRepHeight () |
int | getHxImageRepDepth () |
Vector | getVisualChangeMethods () |
Overrides CanvasObject interface. More... | |
Static Public Attributes | |
final int | TYPE_NEAREST = 0 |
final int | TYPE_LINEAR = 1 |
|
00033 { 00034 this(imName, displayMode, 3, 0, 1.0, TYPE_NEAREST); 00035 } |
|
|
|
Draw CanvasObject on 'g', using internal CCS values.
Reimplemented from CanvasObject.
00051 { 00052 setupDrawMode(g); 00053 if (!getTransformOK()) 00054 transformICStoCCS(); 00055 00056 Rectangle vp = g.getClipBounds(); 00057 if (vp == null) 00058 return; // don't know what to draw if clipping is not set 00059 if ((_bufIm == null) || (_bufImWidth != vp.width) 00060 || (_bufImHeight != vp.height)) 00061 newBufIm(vp.width, vp.height); 00062 updateBufIm(vp); 00063 if (DEBUG_OBJECTS) { 00064 OutputStreamArea.println("Draw HxImageLARGE called, image w: " + 00065 _bufIm.getWidth(null) + ", h: " + 00066 _bufIm.getHeight(null)); 00067 dump(); 00068 } 00069 g.drawImage(_bufIm, vp.x, vp.y, vp.width, vp.height, null); 00070 // g.drawImage(_bufIm, getX1Ccs(), getY1Ccs(), getWidthCcs(), 00071 // getHeightCcs(), null); 00072 } |
|
Reimplemented from CanvasImage.
00076 { 00077 // ignore 00078 } |
|
Implementation CanvasImage interface. Takes care of possible changes in resolution set by the user. Reimplemented from CanvasImage.
00085 { 00086 int nx = (int) Math.round(x * _resolution); 00087 int ny = (int) Math.round(y * _resolution); 00088 int nw = (int) Math.round(w * _resolution); 00089 int nh = (int) Math.round(h * _resolution); 00090 return _bufIm.getSubimage(nx, ny, nw, nh); 00091 } |
|
Implementation CanvasImage interface.
Reimplemented from CanvasImage.
00097 { 00098 String[] strs = new String[w*h]; 00099 String[] args = new String[3]; 00100 args[2] = new String("int 0"); 00101 for (int i=0; i<w; i++) { 00102 for (int j=0; j<h; j++) { 00103 if (x+i < 0 || y+j < 0 || x+i >= _dispImWidth || y+j >= _dispImHeight) { 00104 strs[i+j*w] = new String(""); 00105 } else { 00106 args[0] = new String("int ") + (x+i); 00107 args[1] = new String("int ") + (y+j); 00108 strs[i+j*w] = _mediator.callMethod("HxImageRep", _name, 00109 "getAt", "", args); 00110 } 00111 } 00112 } 00113 return strs; 00114 } |
|
Overrides CanvasObject interface.
Reimplemented from CanvasObject.
00120 { 00121 return _name; 00122 } |
|
00126 { 00127 return _displayMode; 00128 } |
|
00132 { 00133 if (displayMode != _displayMode) { 00134 updatePixels(displayMode, _displayDimension, _displayPlane, 00135 _resolution, _interpolationType); 00136 } 00137 } |
|
00141 { 00142 return _displayDimension; 00143 } |
|
00147 { 00148 if (displayDimension != _displayDimension) { 00149 updatePixels(_displayMode, displayDimension, _displayPlane, 00150 _resolution, _interpolationType); 00151 } 00152 } |
|
00156 { 00157 return _displayPlane; 00158 } |
|
00162 { 00163 if (displayPlane != _displayPlane) { 00164 updatePixels(_displayMode, _displayDimension, displayPlane, 00165 _resolution, _interpolationType); 00166 } 00167 } |
|
00171 { 00172 return _resolution; 00173 } |
|
00177 { 00178 if (resolution != _resolution) { 00179 updatePixels(_displayMode, _displayDimension, _displayPlane, 00180 resolution, _interpolationType); 00181 } 00182 } |
|
00186 { 00187 return _interpolationType; 00188 } |
|
00192 { 00193 if (interpType != _interpolationType) { 00194 updatePixels(_displayMode, _displayDimension, _displayPlane, 00195 _resolution, interpType); 00196 } 00197 } |
|
00201 { 00202 //long startTime = System.currentTimeMillis(); 00203 _mediator.hxImageGetPixels(_name, _pixels, _displayMode, _displayDimension, 00204 _displayPlane, _bufImWidth, _bufImHeight, 00205 _interpolationType); 00206 //long endTime = System.currentTimeMillis(); 00207 //endTime = endTime - startTime; 00208 //OutputStreamArea.println("display time: " + endTime); 00209 } |
|
00213 { 00214 String[] args = { "int 1" }; 00215 String result = _mediator.callMethod("HxImageRep", _name, 00216 "dimensionSize", "", args); 00217 return java.lang.Integer.parseInt(result); 00218 } |
|
00222 { 00223 String[] args = { "int 2" }; 00224 String result = _mediator.callMethod("HxImageRep", _name, 00225 "dimensionSize", "", args); 00226 return java.lang.Integer.parseInt(result); 00227 } |
|
00231 { 00232 String[] args = { "int 3" }; 00233 String result = _mediator.callMethod("HxImageRep", _name, 00234 "dimensionSize", "", args); 00235 return java.lang.Integer.parseInt(result); 00236 } |
|
Overrides CanvasObject interface. Extends the list of callable functions obtained from the parent with the functions for this class. Reimplemented from CanvasObject.
00244 { 00245 Vector v = super.getVisualChangeMethods(); 00246 v.add(new CallableMethod("setDisplayMode", "String", "m", "rgb")); 00247 v.add(new CallableMethod("setDisplayDimension", "int", "d", "int")); 00248 v.add(new CallableMethod("setDisplayPlane", "int", "nr", "int")); 00249 v.add(new CallableMethod("setResolution", "double", "r", "double")); 00250 v.add(new CallableMethod("setInterpolationType", "int", "i", "HxGeoIntType")); 00251 return v; 00252 } |
|
|
|
|