Inheritance diagram for CanvasCorbaImage::
Public Methods | |
CanvasCorbaImage (HxCorba.ImageDataOperations im) | |
Construct an empty image. More... | |
CanvasCorbaImage (HxCorba.ImageDataOperations im, String displayMode) | |
Construct from a Corba Image. More... | |
void | draw (Graphics g) |
Draw CanvasObject on 'g', using internal CCS values. More... | |
HxCorba.ImageDataOperations | getStub () |
BufferedImage | getBuffer () |
String | getDisplayMode () |
void | setDisplayMode (String displayMode) |
Color | getPixel (int x, int y) |
void | setPixel (int x, int y, Color c) |
int[] | getPixels (int x, int y, int w, int h) |
BufferedImage | getSubImage (int x, int y, int w, int h) |
String[] | getPixelStrings (int x, int y, int w, int h) |
void | refreshPixels () |
void | refreshPixels (HxCorba.ImageDataOperations im) |
Vector | getVisualChangeMethods () |
Overrides CanvasObject interface. More... | |
Protected Methods | |
void | initImage (HxCorba.ImageDataOperations im, String displayMode) |
TODO : extend this with additional parameters like in CanvasHxImage.
|
Construct an empty image.
00053 { 00054 this(im, "Direct"); 00055 } |
|
Construct from a Corba Image.
00060 { 00061 super(Converter.ICS_ORIGIN, Converter.ICS_ORIGIN, 00062 (double) im.dimensionSize(1), (double) im.dimensionSize(2)); 00063 setInputSource(INP_SASYSTEM); 00064 initImage(im, displayMode); 00065 } |
|
Draw CanvasObject on 'g', using internal CCS values.
Reimplemented from CanvasObject.
00069 { 00070 setupDrawMode(g); 00071 if (!getTransformOK()) { 00072 transformICStoCCS(); 00073 } 00074 g.drawImage(_bufIm, getX1Ccs(), getY1Ccs(), getWidthCcs(), getHeightCcs(), null); 00075 } |
|
00089 { 00090 return _stubImg; 00091 } |
|
00094 { 00095 return _bufIm; 00096 } |
|
00100 { 00101 return _displayMode; 00102 } |
|
00106 { 00107 if (displayMode != _displayMode) { 00108 _displayMode = displayMode; 00109 refreshPixels(); 00110 } 00111 } |
|
00115 { 00116 return (new Color(_bufIm.getRGB(x, y))); 00117 } |
|
Reimplemented from CanvasImage.
00121 { 00122 _bufIm.setRGB(x, y, c.getRGB()); 00123 } |
|
00127 { 00128 return _bufIm.getRGB(x, y, w, h, null, 0, w); 00129 } |
|
Reimplemented from CanvasImage.
00133 { 00134 return _bufIm.getSubimage(x, y, w, h); 00135 } |
|
Reimplemented from CanvasImage.
00139 { 00140 String[] strs = new String[w*h]; 00141 int imWidth = _bufIm.getWidth(); 00142 int imHeight = _bufIm.getHeight(); 00143 for (int i=0; i<w; i++) { 00144 for (int j=0; j<h; j++) { 00145 if (x+i < 0 || y+j < 0 || x+i >= imWidth || y+j >= imHeight) { 00146 strs[i+j*w] = new String(""); 00147 } else { 00148 int pix = _bufIm.getRGB(x+i, y+j); 00149 Color c = new Color(pix); 00150 strs[i+j*w] = HX.colorToString(c); 00151 } 00152 } 00153 } 00154 return strs; 00155 } |
|
00158 { 00159 _bufIm.refreshData(); 00160 } |
|
00163 { 00164 //_stubImg.removeRef(); (ImageDataOperations is not ref count!!!) 00165 00166 _stubImg = im; 00167 refreshPixels(); 00168 } |
|
Overrides CanvasObject interface. Extends the list of callable functions obtained from the parent with the functions for this class. Reimplemented from CanvasObject.
00175 { 00176 Vector v = super.getVisualChangeMethods(); 00177 v.add(new CallableMethod("setDisplayMode", "String", "m", "rgb")); 00178 //v.add(new CallableMethod("setDisplayDimension", "int", "d", "int")); 00179 //v.add(new CallableMethod("setDisplayPlane", "int", "nr", "int")); 00180 //v.add(new CallableMethod("setResolution", "double", "r", "double")); 00181 //v.add(new CallableMethod("setInterpolationType", "int", "i", "HxGeoIntType")); 00182 return v; 00183 } |
|
00202 { 00203 _stubImg = im; 00204 00205 _bufIm = new CorbaBufferedImage(new ImageRgbSource(), im.dimensionSize(1), 00206 im.dimensionSize(2), im); 00207 _displayMode = displayMode; 00208 00209 refreshPixels(); 00210 } |