Christian Heimke commited on 2011-07-15 09:21:11
Showing 47 changed files, with 459 additions and 2018 deletions.
| ... | ... |
@@ -15,7 +15,7 @@ |
| 15 | 15 |
} |
| 16 | 16 |
</script> |
| 17 | 17 |
<body onLoad="Resize( );" onResize="Resize( );"> |
| 18 |
- <applet archive="Blimp.jar" code="Blimp.class" height="420" name="Blimp" width="560"> |
|
| 18 |
+ <applet archive="Blimp.jar" code="org.blinkenarea.Blimp.Blimp" height="420" name="Blimp" width="560"> |
|
| 19 | 19 |
</applet> |
| 20 | 20 |
</body> |
| 21 | 21 |
</html> |
| ... | ... |
@@ -1,371 +0,0 @@ |
| 1 |
-/* BlinkenLightsInteractiveMovieProgram |
|
| 2 |
- * version 1.2.1 date 2006-08-01 |
|
| 3 |
- * Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 |
- * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
|
| 5 |
- * a blinkenarea.org project |
|
| 6 |
- * powered by eventphone.de |
|
| 7 |
- */ |
|
| 8 |
- |
|
| 9 |
-import java.awt.*; |
|
| 10 |
- |
|
| 11 |
-public class BlinkenFrame |
|
| 12 |
-{
|
|
| 13 |
- |
|
| 14 |
- private int height; |
|
| 15 |
- private int width; |
|
| 16 |
- private int channels; |
|
| 17 |
- private int maxval; |
|
| 18 |
- private int duration; |
|
| 19 |
- private byte[][] data; |
|
| 20 |
- |
|
| 21 |
- BlinkenFrame( int height, int width, int channels, int maxval, int duration ) |
|
| 22 |
- {
|
|
| 23 |
- if( height < 1 ) height = 1; |
|
| 24 |
- if( height > 1024 ) height = 1024; |
|
| 25 |
- if( width < 1 ) width = 1; |
|
| 26 |
- if( width > 1024 ) width = 1024; |
|
| 27 |
- if( channels < 1 ) channels = 1; |
|
| 28 |
- if( channels > 16 ) channels = 16; |
|
| 29 |
- if( maxval < 1 ) maxval = 1; |
|
| 30 |
- if( maxval > 255 ) maxval = 255; |
|
| 31 |
- if( duration < 1 ) duration = 1; |
|
| 32 |
- if( duration > 65535 ) duration = 65535; |
|
| 33 |
- |
|
| 34 |
- this.height = height; |
|
| 35 |
- this.width = width; |
|
| 36 |
- this.channels = channels; |
|
| 37 |
- this.maxval = maxval; |
|
| 38 |
- this.duration = duration; |
|
| 39 |
- data = new byte[height][width * channels]; |
|
| 40 |
- } |
|
| 41 |
- |
|
| 42 |
- BlinkenFrame( BlinkenFrame frame ) |
|
| 43 |
- {
|
|
| 44 |
- int y, x, c, i; |
|
| 45 |
- height = frame.height; |
|
| 46 |
- width = frame.width; |
|
| 47 |
- channels = frame.channels; |
|
| 48 |
- maxval = frame.maxval; |
|
| 49 |
- duration = frame.duration; |
|
| 50 |
- data = new byte[height][width * channels]; |
|
| 51 |
- for( y = 0; y < height; y++ ) |
|
| 52 |
- for( x = 0, i = 0; x < width; x++ ) |
|
| 53 |
- for( c = 0; c < channels; c++, i++ ) |
|
| 54 |
- data[y][i] = frame.data[y][i]; |
|
| 55 |
- } |
|
| 56 |
- |
|
| 57 |
- public void clear( ) |
|
| 58 |
- {
|
|
| 59 |
- int x, y, c, i; |
|
| 60 |
- for( y = 0; y < height; y++ ) |
|
| 61 |
- for( x = 0, i = 0; x < width; x++ ) |
|
| 62 |
- for( c = 0; c < channels; c++, i++ ) |
|
| 63 |
- data[y][i] = 0; |
|
| 64 |
- } |
|
| 65 |
- |
|
| 66 |
- public int getHeight( ) |
|
| 67 |
- {
|
|
| 68 |
- return height; |
|
| 69 |
- } |
|
| 70 |
- |
|
| 71 |
- public int getWidth( ) |
|
| 72 |
- {
|
|
| 73 |
- return width; |
|
| 74 |
- } |
|
| 75 |
- |
|
| 76 |
- public int getChannels( ) |
|
| 77 |
- {
|
|
| 78 |
- return channels; |
|
| 79 |
- } |
|
| 80 |
- |
|
| 81 |
- public int getMaxval( ) |
|
| 82 |
- {
|
|
| 83 |
- return maxval; |
|
| 84 |
- } |
|
| 85 |
- |
|
| 86 |
- public int getDuration( ) |
|
| 87 |
- {
|
|
| 88 |
- return duration; |
|
| 89 |
- } |
|
| 90 |
- |
|
| 91 |
- public void setDuration( int duration ) |
|
| 92 |
- {
|
|
| 93 |
- if( duration < 1 ) duration = 1; |
|
| 94 |
- if( duration > 65535 ) duration = 65535; |
|
| 95 |
- this.duration = duration; |
|
| 96 |
- } |
|
| 97 |
- |
|
| 98 |
- public byte getPixel( int y, int x, int c ) |
|
| 99 |
- {
|
|
| 100 |
- if( y < 0 || y >= height || |
|
| 101 |
- x < 0 || x >= width || |
|
| 102 |
- c < 0 || c >= channels ) |
|
| 103 |
- return 0; |
|
| 104 |
- return data[y][x * channels + c]; |
|
| 105 |
- } |
|
| 106 |
- |
|
| 107 |
- public void setPixel( int y, int x, int c, byte val ) |
|
| 108 |
- {
|
|
| 109 |
- if( y < 0 || y >= height || |
|
| 110 |
- x < 0 || x >= width || |
|
| 111 |
- c < 0 || c >= channels ) |
|
| 112 |
- return; |
|
| 113 |
- if( val > maxval ) |
|
| 114 |
- val = (byte)maxval; |
|
| 115 |
- data[y][x * channels + c] = val; |
|
| 116 |
- } |
|
| 117 |
- |
|
| 118 |
- public Color getColor( int y, int x ) |
|
| 119 |
- {
|
|
| 120 |
- if( y < 0 || y >= height || |
|
| 121 |
- x < 0 || x >= width || |
|
| 122 |
- channels < 1 ) |
|
| 123 |
- return new Color( 0, 0, 0 ); |
|
| 124 |
- if( channels == 1 ) |
|
| 125 |
- return new Color( (((int)data[y][x * 1 + 0] & 0xFF) * 255 + maxval / 2) / maxval, |
|
| 126 |
- (((int)data[y][x * 1 + 0] & 0xFF) * 255 + maxval / 2) / maxval, |
|
| 127 |
- (((int)data[y][x * 1 + 0] & 0xFF) * 255 + maxval / 2) / maxval ); |
|
| 128 |
- if( channels == 2 ) |
|
| 129 |
- return new Color( (((int)data[y][x * 2 + 0] & 0xFF) * 255 + maxval / 2) / maxval, |
|
| 130 |
- (((int)data[y][x * 2 + 1] & 0xFF) * 255 + maxval / 2) / maxval, 0 ); |
|
| 131 |
- int i = x * channels; |
|
| 132 |
- return new Color( (((int)data[y][i + 0] & 0xFF) * 255 + maxval / 2) / maxval, |
|
| 133 |
- (((int)data[y][i + 1] & 0xFF) * 255 + maxval / 2) / maxval, |
|
| 134 |
- (((int)data[y][i + 2] & 0xFF) * 255 + maxval / 2) / maxval ); |
|
| 135 |
- } |
|
| 136 |
- |
|
| 137 |
- public void setColor( int y, int x, Color color ) |
|
| 138 |
- {
|
|
| 139 |
- int alpha, alpha_, c; |
|
| 140 |
- if( y < 0 || y >= height || |
|
| 141 |
- x < 0 || x >= width ) |
|
| 142 |
- return; |
|
| 143 |
- int i = x * channels; |
|
| 144 |
- alpha = color.getAlpha( ); |
|
| 145 |
- alpha_ = 255 - alpha; |
|
| 146 |
- if( channels >= 1 ) |
|
| 147 |
- data[y][i + 0] = (byte)(( ((color.getRed( ) * maxval + 127) / 255) * alpha |
|
| 148 |
- + ((int)data[y][i + 0] & 0xFF) * alpha_ |
|
| 149 |
- ) / 255); |
|
| 150 |
- if( channels >= 2 ) |
|
| 151 |
- data[y][i + 1] = (byte)(( ((color.getGreen( ) * maxval + 127) / 255) * alpha |
|
| 152 |
- + ((int)data[y][i + 1] & 0xFF) * alpha_ |
|
| 153 |
- ) / 255); |
|
| 154 |
- if( channels >= 3 ) |
|
| 155 |
- data[y][i + 2] = (byte)(( ((color.getBlue( ) * maxval + 127) / 255) * alpha |
|
| 156 |
- + ((int)data[y][i + 2] & 0xFF) * alpha_ |
|
| 157 |
- ) / 255); |
|
| 158 |
- for( c = 3; c < channels; c++ ) |
|
| 159 |
- data[y][i + c] = (byte)(( 0 |
|
| 160 |
- + ((int)data[y][i + c] & 0xFF) * alpha_ |
|
| 161 |
- ) / 255); |
|
| 162 |
- } |
|
| 163 |
- |
|
| 164 |
- public void resize( int height, int width, int channels, int maxval ) |
|
| 165 |
- {
|
|
| 166 |
- byte[][] data; |
|
| 167 |
- int y, x, c, i; |
|
| 168 |
- int emptyY, emptyX, skipY, skipX, rangeY, rangeX, val, div; |
|
| 169 |
- |
|
| 170 |
- if( height < 1 ) height = 1; |
|
| 171 |
- if( height > 1024 ) height = 1024; |
|
| 172 |
- if( width < 1 ) width = 1; |
|
| 173 |
- if( width > 1024 ) width = 1024; |
|
| 174 |
- if( channels < 1 ) channels = 1; |
|
| 175 |
- if( channels > 16 ) channels = 16; |
|
| 176 |
- if( maxval < 1 ) maxval = 1; |
|
| 177 |
- if( maxval > 255 ) maxval = 255; |
|
| 178 |
- |
|
| 179 |
- if( height == this.height && |
|
| 180 |
- width == this.width && |
|
| 181 |
- channels == this.channels && |
|
| 182 |
- maxval == this.maxval ) |
|
| 183 |
- return; |
|
| 184 |
- |
|
| 185 |
- //allocate new data array |
|
| 186 |
- data = new byte[height][width * channels]; |
|
| 187 |
- for( y = 0; y < height; y++ ) |
|
| 188 |
- for( x = 0, i = 0; x < width; x++ ) |
|
| 189 |
- for( c = 0; c < channels; c++, i++ ) |
|
| 190 |
- data[y][i] = 0; |
|
| 191 |
- |
|
| 192 |
- //get number of pixels to skip / to leave empty in X and Y direction |
|
| 193 |
- if( height > this.height ) |
|
| 194 |
- {
|
|
| 195 |
- emptyY = (height - this.height) / 2; |
|
| 196 |
- skipY = 0; |
|
| 197 |
- rangeY = this.height; |
|
| 198 |
- } |
|
| 199 |
- else |
|
| 200 |
- {
|
|
| 201 |
- emptyY = 0; |
|
| 202 |
- skipY = (this.height - height) / 2; |
|
| 203 |
- rangeY = height; |
|
| 204 |
- } |
|
| 205 |
- if( width > this.width ) |
|
| 206 |
- {
|
|
| 207 |
- emptyX = (width - this.width) / 2; |
|
| 208 |
- skipX = 0; |
|
| 209 |
- rangeX = this.width; |
|
| 210 |
- } |
|
| 211 |
- else |
|
| 212 |
- {
|
|
| 213 |
- emptyX = 0; |
|
| 214 |
- skipX = (this.width - width) / 2; |
|
| 215 |
- rangeX = width; |
|
| 216 |
- } |
|
| 217 |
- |
|
| 218 |
- //resize frame with help of calculated parameters |
|
| 219 |
- for( y = 0; y < rangeY; y++ ) |
|
| 220 |
- {
|
|
| 221 |
- for( x = 0; x < rangeX; x++ ) |
|
| 222 |
- {
|
|
| 223 |
- int srcI = (skipX + x) * this.channels; |
|
| 224 |
- int destI = (emptyX + x) * channels; |
|
| 225 |
- if( channels >= this.channels ) //add channels: copy last channel into new channels |
|
| 226 |
- {
|
|
| 227 |
- for( c = 0; c < this.channels; c++ ) |
|
| 228 |
- data[emptyY + y][destI + c] = (byte)((((int)this.data[skipY + y][srcI + c] & 0xFF) * maxval + this.maxval / 2) / this.maxval); |
|
| 229 |
- for( ; c < channels; c++ ) |
|
| 230 |
- data[emptyY + y][destI + c] = data[emptyY + y][destI + this.channels - 1]; |
|
| 231 |
- } |
|
| 232 |
- else //remove channels: merge leftover channels with last kept channel |
|
| 233 |
- {
|
|
| 234 |
- val = 0; |
|
| 235 |
- for( c = 0; c < channels - 1; c++ ) |
|
| 236 |
- data[emptyY + y][destI + c] = (byte)((((int)this.data[skipY + y][srcI + c] & 0xFF) * maxval + this.maxval / 2) / this.maxval); |
|
| 237 |
- for( c = channels - 1; c < this.channels; c++ ) |
|
| 238 |
- val += (int)this.data[skipY + y][srcI + c] & 0xFF; |
|
| 239 |
- div = this.maxval * (this.channels - channels + 1); |
|
| 240 |
- data[emptyY + y][destI + channels - 1] = (byte)((val * maxval + div / 2) / div); |
|
| 241 |
- } |
|
| 242 |
- } |
|
| 243 |
- } |
|
| 244 |
- |
|
| 245 |
- this.height = height; |
|
| 246 |
- this.width = width; |
|
| 247 |
- this.channels = channels; |
|
| 248 |
- this.maxval = maxval; |
|
| 249 |
- this.data = data; |
|
| 250 |
- } |
|
| 251 |
- |
|
| 252 |
- public void scale( int height, int width ) |
|
| 253 |
- {
|
|
| 254 |
- byte[][] data; |
|
| 255 |
- double scaleHor, scaleVer, ox, oy, ox1, oy1, val; |
|
| 256 |
- int c, nx, nx_c, ny, x, x_c, y, oxi, oxi_c, oyi, ox1i, ox1i_c, oy1i; |
|
| 257 |
- |
|
| 258 |
- if( height < 1 ) height = 1; |
|
| 259 |
- if( height > 1024 ) height = 1024; |
|
| 260 |
- if( width < 1 ) width = 1; |
|
| 261 |
- if( width > 1024 ) width = 1024; |
|
| 262 |
- |
|
| 263 |
- if( height == this.height && |
|
| 264 |
- width == this.width ) |
|
| 265 |
- return; |
|
| 266 |
- |
|
| 267 |
- scaleHor = (double)width / (double)this.width; |
|
| 268 |
- scaleVer = (double)height / (double)this.height; |
|
| 269 |
- |
|
| 270 |
- //allocate new data array |
|
| 271 |
- data = new byte[height][width * channels]; |
|
| 272 |
- |
|
| 273 |
- //scale every channel |
|
| 274 |
- for( c = 0; c < channels; c++ ) |
|
| 275 |
- {
|
|
| 276 |
- for( ny = 0; ny < height; ny++ ) |
|
| 277 |
- {
|
|
| 278 |
- for( nx = 0, nx_c = c; nx < width; nx++, nx_c += channels ) |
|
| 279 |
- {
|
|
| 280 |
- oy = (double)ny / scaleVer; //sub-pixel exact range in old picture |
|
| 281 |
- ox = (double)nx / scaleHor; |
|
| 282 |
- oy1 = (double)(ny + 1) / scaleVer - 0.000001; |
|
| 283 |
- ox1 = (double)(nx + 1) / scaleHor - 0.000001; |
|
| 284 |
- if( oy < 0 || ox < 0 || oy1 >= this.height || ox1 >= this.width) //out of old picture |
|
| 285 |
- data[ny][nx_c] = 0; |
|
| 286 |
- else |
|
| 287 |
- {
|
|
| 288 |
- oyi = (int)oy; |
|
| 289 |
- oxi = (int)ox; |
|
| 290 |
- oxi_c = oxi * channels + c; |
|
| 291 |
- oy1i = (int)oy1; |
|
| 292 |
- ox1i = (int)ox1; |
|
| 293 |
- ox1i_c = ox1i * channels + c; |
|
| 294 |
- if( oyi == oy1i ) |
|
| 295 |
- {
|
|
| 296 |
- if( oxi == ox1i) //one source pixel |
|
| 297 |
- {
|
|
| 298 |
- val = (double)((int)this.data[oyi][oxi_c] & 0xFF); |
|
| 299 |
- } |
|
| 300 |
- else //one line of source pixels |
|
| 301 |
- {
|
|
| 302 |
- val = (double)((int)this.data[oyi][oxi_c] & 0xFF) * (1 - ox + oxi) |
|
| 303 |
- + (double)((int)this.data[oyi][ox1i_c] & 0xFF) * (ox1 - ox1i); |
|
| 304 |
- for( x_c = oxi_c + channels; x_c < ox1i_c; x_c += channels ) |
|
| 305 |
- val += (double)((int)this.data[oyi][x_c] & 0xFF); |
|
| 306 |
- val /= ox1 - ox; |
|
| 307 |
- } |
|
| 308 |
- } |
|
| 309 |
- else //one column of source pixels |
|
| 310 |
- {
|
|
| 311 |
- if( oxi == ox1i ) |
|
| 312 |
- {
|
|
| 313 |
- val = (double)((int)this.data[oyi][oxi_c] & 0xFF) * (1 - oy + oyi) |
|
| 314 |
- + (double)((int)this.data[oy1i][oxi_c] & 0xFF) * (oy1 - oy1i); |
|
| 315 |
- for( y = oyi + 1; y < oy1i; y++ ) |
|
| 316 |
- val += (double)((int)this.data[y][oxi_c] & 0xFF); |
|
| 317 |
- val /= oy1 - oy; |
|
| 318 |
- } |
|
| 319 |
- else //rectangle of source pixels |
|
| 320 |
- {
|
|
| 321 |
- val = (double)((int)this.data[oyi][oxi_c] & 0xFF) * (1 - oy + oyi) * (1 - ox + oxi) |
|
| 322 |
- + (double)((int)this.data[oyi][ox1i_c] & 0xFF) * (1 - oy + oyi) * (ox1 - ox1i) |
|
| 323 |
- + (double)((int)this.data[oy1i][oxi_c] & 0xFF) * (oy1 - oy1i) * (1 - ox + oxi) |
|
| 324 |
- + (double)((int)this.data[oy1i][ox1i_c] & 0xFF) * (oy1 - oy1i) * (ox1 - ox1i); |
|
| 325 |
- for( y = oyi + 1; y < oy1i; y++ ) |
|
| 326 |
- {
|
|
| 327 |
- val += (double)((int)this.data[y][oxi_c] & 0xFF) * (1 - ox + oxi) |
|
| 328 |
- + (double)((int)this.data[y][ox1i_c] & 0xFF) * (ox1 - ox1i); |
|
| 329 |
- } |
|
| 330 |
- for( x_c = oxi_c + channels; x_c < ox1i_c; x_c += channels ) |
|
| 331 |
- {
|
|
| 332 |
- val += (double)((int)this.data[oyi][x_c] & 0xFF) * (1 - oy + oyi) |
|
| 333 |
- + (double)((int)this.data[oy1i][x_c] & 0xFF) * (oy1 - oy1i); |
|
| 334 |
- } |
|
| 335 |
- for( y = oyi + 1; y < oy1i; y++ ) |
|
| 336 |
- for( x_c = oxi_c + channels; x_c < ox1i_c; x_c += channels ) |
|
| 337 |
- val += (double)((int)this.data[y][x_c] & 0xFF); |
|
| 338 |
- val /= (oy1 - oy) * (ox1 - ox); |
|
| 339 |
- } |
|
| 340 |
- } |
|
| 341 |
- data[ny][nx_c] = (byte)(int)(val + 0.5); |
|
| 342 |
- } |
|
| 343 |
- } //for( nx ... |
|
| 344 |
- } //for( ny ... |
|
| 345 |
- } //for( c ... |
|
| 346 |
- |
|
| 347 |
- this.height = height; |
|
| 348 |
- this.width = width; |
|
| 349 |
- this.data = data; |
|
| 350 |
- } |
|
| 351 |
- |
|
| 352 |
- public String toString( ) |
|
| 353 |
- {
|
|
| 354 |
- String str = ""; |
|
| 355 |
- int h, w, c, i, val; |
|
| 356 |
- for( h = 0; h < height; h++ ) |
|
| 357 |
- {
|
|
| 358 |
- for( w = 0, i = 0; w < width; w++ ) |
|
| 359 |
- {
|
|
| 360 |
- val = 0; |
|
| 361 |
- for( val = 0, c = 0; c < channels; c++, i++ ) |
|
| 362 |
- val += ((int)data[h][i] & 0xFF); |
|
| 363 |
- val = val * 7 / maxval / channels; |
|
| 364 |
- str = str + " -+*%#&@".substring( val, val + 1); |
|
| 365 |
- } |
|
| 366 |
- str = str + "\n"; |
|
| 367 |
- } |
|
| 368 |
- return str + duration + " ms\n"; |
|
| 369 |
- } |
|
| 370 |
- |
|
| 371 |
-} //public class BlinkenFrame |
| ... | ... |
@@ -1,1197 +0,0 @@ |
| 1 |
-/* BlinkenLightsInteractiveMovieProgram |
|
| 2 |
- * version 1.2.1 date 2006-08-01 |
|
| 3 |
- * Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 |
- * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
|
| 5 |
- * a blinkenarea.org project |
|
| 6 |
- * powered by eventphone.de |
|
| 7 |
- */ |
|
| 8 |
- |
|
| 9 |
-import java.util.*; |
|
| 10 |
-import java.util.regex.*; |
|
| 11 |
-import java.io.*; |
|
| 12 |
- |
|
| 13 |
-public class BlinkenMovie |
|
| 14 |
-{
|
|
| 15 |
- |
|
| 16 |
- private int height; |
|
| 17 |
- private int width; |
|
| 18 |
- private int channels; |
|
| 19 |
- private int maxval; |
|
| 20 |
- private int infoCnt; |
|
| 21 |
- private String[][] infos; |
|
| 22 |
- private int frameCnt; |
|
| 23 |
- private BlinkenFrame[] frames; |
|
| 24 |
- |
|
| 25 |
- BlinkenMovie( int height, int width, int channels, int maxval ) |
|
| 26 |
- {
|
|
| 27 |
- if( height < 1 ) height = 1; |
|
| 28 |
- if( height > 1024 ) height = 1024; |
|
| 29 |
- if( width < 1 ) width = 1; |
|
| 30 |
- if( width > 1024 ) width = 1024; |
|
| 31 |
- if( channels < 1 ) channels = 1; |
|
| 32 |
- if( channels > 16 ) channels = 16; |
|
| 33 |
- if( maxval < 1 ) maxval = 1; |
|
| 34 |
- if( maxval > 255 ) maxval = 255; |
|
| 35 |
- |
|
| 36 |
- this.height = height; |
|
| 37 |
- this.width = width; |
|
| 38 |
- this.channels = channels; |
|
| 39 |
- this.maxval = maxval; |
|
| 40 |
- infoCnt = 0; |
|
| 41 |
- infos = new String[0][2]; |
|
| 42 |
- frameCnt = 0; |
|
| 43 |
- frames = new BlinkenFrame[0]; |
|
| 44 |
- } |
|
| 45 |
- |
|
| 46 |
- BlinkenMovie( BlinkenMovie movie ) |
|
| 47 |
- {
|
|
| 48 |
- int i; |
|
| 49 |
- |
|
| 50 |
- height = movie.height; |
|
| 51 |
- width = movie.width; |
|
| 52 |
- channels = movie.channels; |
|
| 53 |
- maxval = movie.maxval; |
|
| 54 |
- infoCnt = 0; |
|
| 55 |
- infos = new String[0][2]; |
|
| 56 |
- frameCnt = 0; |
|
| 57 |
- frames = new BlinkenFrame[0]; |
|
| 58 |
- |
|
| 59 |
- for( i = 0; i < movie.infoCnt; i++ ) |
|
| 60 |
- appendInfo( new String( movie.infos[i][0] ), new String( movie.infos[i][1] ) ); |
|
| 61 |
- |
|
| 62 |
- for( i = 0; i < movie.frameCnt; i++ ) |
|
| 63 |
- appendFrame( new BlinkenFrame( movie.frames[i] ) ); |
|
| 64 |
- } |
|
| 65 |
- |
|
| 66 |
- public int getHeight( ) |
|
| 67 |
- {
|
|
| 68 |
- return height; |
|
| 69 |
- } |
|
| 70 |
- |
|
| 71 |
- public int getWidth( ) |
|
| 72 |
- {
|
|
| 73 |
- return width; |
|
| 74 |
- } |
|
| 75 |
- |
|
| 76 |
- public int getChannels( ) |
|
| 77 |
- {
|
|
| 78 |
- return channels; |
|
| 79 |
- } |
|
| 80 |
- |
|
| 81 |
- public int getMaxval( ) |
|
| 82 |
- {
|
|
| 83 |
- return maxval; |
|
| 84 |
- } |
|
| 85 |
- |
|
| 86 |
- public int getDuration( ) |
|
| 87 |
- {
|
|
| 88 |
- int duration, i; |
|
| 89 |
- duration = 0; |
|
| 90 |
- for( i = 0; i < frameCnt; i++ ) |
|
| 91 |
- duration += frames[i].getDuration( ); |
|
| 92 |
- return duration; |
|
| 93 |
- } |
|
| 94 |
- |
|
| 95 |
- public int getInfoCnt( ) |
|
| 96 |
- {
|
|
| 97 |
- return infoCnt; |
|
| 98 |
- } |
|
| 99 |
- |
|
| 100 |
- public String getInfoType( int infoNo ) |
|
| 101 |
- {
|
|
| 102 |
- if( infoCnt < 1 ) return ""; |
|
| 103 |
- if( infoNo < 0 ) infoNo = 0; |
|
| 104 |
- if( infoNo >= infoCnt ) infoNo = infoCnt - 1; |
|
| 105 |
- return infos[infoNo][0]; |
|
| 106 |
- } |
|
| 107 |
- |
|
| 108 |
- public String getInfoData( int infoNo ) |
|
| 109 |
- {
|
|
| 110 |
- if( infoCnt < 1 ) return ""; |
|
| 111 |
- if( infoNo < 0 ) infoNo = 0; |
|
| 112 |
- if( infoNo >= infoCnt ) infoNo = infoCnt - 1; |
|
| 113 |
- return infos[infoNo][1]; |
|
| 114 |
- } |
|
| 115 |
- |
|
| 116 |
- public void setInfo( int infoNo, String infoType, String infoData ) |
|
| 117 |
- {
|
|
| 118 |
- if( infoNo < 0 || infoNo >= infoCnt ) |
|
| 119 |
- return; |
|
| 120 |
- infos[infoNo][0] = infoType; |
|
| 121 |
- infos[infoNo][1] = infoData; |
|
| 122 |
- } |
|
| 123 |
- |
|
| 124 |
- public void insertInfo( int infoNo, String infoType, String infoData ) |
|
| 125 |
- {
|
|
| 126 |
- String[][] infos; |
|
| 127 |
- int i; |
|
| 128 |
- |
|
| 129 |
- if( infoNo < 0 || infoNo > infoCnt ) |
|
| 130 |
- return; |
|
| 131 |
- |
|
| 132 |
- infos = new String[infoCnt+1][2]; |
|
| 133 |
- |
|
| 134 |
- for( i = 0; i < infoNo; i++ ) |
|
| 135 |
- {
|
|
| 136 |
- infos[i][0] = this.infos[i][0]; |
|
| 137 |
- infos[i][1] = this.infos[i][1]; |
|
| 138 |
- } |
|
| 139 |
- |
|
| 140 |
- infos[infoNo][0] = infoType; |
|
| 141 |
- infos[infoNo][1] = infoData; |
|
| 142 |
- |
|
| 143 |
- for( i = infoNo; i < infoCnt; i++ ) |
|
| 144 |
- {
|
|
| 145 |
- infos[i+1][0] = this.infos[i][0]; |
|
| 146 |
- infos[i+1][1] = this.infos[i][1]; |
|
| 147 |
- } |
|
| 148 |
- |
|
| 149 |
- this.infos = infos; |
|
| 150 |
- infoCnt++; |
|
| 151 |
- } |
|
| 152 |
- |
|
| 153 |
- public void appendInfo( String infoType, String infoData ) |
|
| 154 |
- {
|
|
| 155 |
- insertInfo( infoCnt, infoType, infoData ); |
|
| 156 |
- } |
|
| 157 |
- |
|
| 158 |
- public void deleteInfo( int infoNo ) |
|
| 159 |
- {
|
|
| 160 |
- String[][] infos; |
|
| 161 |
- int i; |
|
| 162 |
- |
|
| 163 |
- if( infoNo < 0 || infoNo >= infoCnt ) |
|
| 164 |
- return; |
|
| 165 |
- |
|
| 166 |
- infos = new String[infoCnt-1][2]; |
|
| 167 |
- |
|
| 168 |
- for( i = 0; i < infoNo; i++ ) |
|
| 169 |
- {
|
|
| 170 |
- infos[i][0] = this.infos[i][0]; |
|
| 171 |
- infos[i][1] = this.infos[i][1]; |
|
| 172 |
- } |
|
| 173 |
- |
|
| 174 |
- for( i = infoNo; i < infoCnt-1; i++ ) |
|
| 175 |
- {
|
|
| 176 |
- infos[i][0] = this.infos[i+1][0]; |
|
| 177 |
- infos[i][1] = this.infos[i+1][1]; |
|
| 178 |
- } |
|
| 179 |
- |
|
| 180 |
- this.infos = infos; |
|
| 181 |
- infoCnt--; |
|
| 182 |
- } |
|
| 183 |
- |
|
| 184 |
- public void deleteInfos( ) |
|
| 185 |
- {
|
|
| 186 |
- infos = new String[0][2]; |
|
| 187 |
- infoCnt = 0; |
|
| 188 |
- } |
|
| 189 |
- |
|
| 190 |
- public int getFrameCnt( ) |
|
| 191 |
- {
|
|
| 192 |
- return frameCnt; |
|
| 193 |
- } |
|
| 194 |
- |
|
| 195 |
- public BlinkenFrame getFrame( int frameNo ) |
|
| 196 |
- {
|
|
| 197 |
- BlinkenFrame frame; |
|
| 198 |
- if( frameCnt < 1 ) |
|
| 199 |
- {
|
|
| 200 |
- frame = new BlinkenFrame( height, width, channels, maxval, 0 ); |
|
| 201 |
- frame.clear( ); |
|
| 202 |
- return frame; |
|
| 203 |
- } |
|
| 204 |
- if( frameNo < 0 ) frameNo = 0; |
|
| 205 |
- if( frameNo >= frameCnt ) frameNo = frameCnt - 1; |
|
| 206 |
- return frames[frameNo]; |
|
| 207 |
- } |
|
| 208 |
- |
|
| 209 |
- public void setFrame( int frameNo, BlinkenFrame frame ) |
|
| 210 |
- {
|
|
| 211 |
- if( frameNo < 0 || frameNo >= frameCnt ) |
|
| 212 |
- return; |
|
| 213 |
- frame.resize( height, width, channels, maxval ); |
|
| 214 |
- frames[frameNo] = frame; |
|
| 215 |
- } |
|
| 216 |
- |
|
| 217 |
- public void insertFrame( int frameNo, BlinkenFrame frame ) |
|
| 218 |
- {
|
|
| 219 |
- BlinkenFrame[] frames; |
|
| 220 |
- int i; |
|
| 221 |
- |
|
| 222 |
- if( frameNo < 0 || frameNo > frameCnt ) |
|
| 223 |
- return; |
|
| 224 |
- |
|
| 225 |
- frames = new BlinkenFrame[frameCnt+1]; |
|
| 226 |
- |
|
| 227 |
- for( i = 0; i < frameNo; i++ ) |
|
| 228 |
- frames[i] = this.frames[i]; |
|
| 229 |
- |
|
| 230 |
- frame.resize( height, width, channels, maxval ); |
|
| 231 |
- frames[frameNo] = frame; |
|
| 232 |
- |
|
| 233 |
- for( i = frameNo; i < frameCnt; i++ ) |
|
| 234 |
- frames[i+1] = this.frames[i]; |
|
| 235 |
- |
|
| 236 |
- this.frames = frames; |
|
| 237 |
- frameCnt++; |
|
| 238 |
- } |
|
| 239 |
- |
|
| 240 |
- public void appendFrame( BlinkenFrame frame ) |
|
| 241 |
- {
|
|
| 242 |
- insertFrame( frameCnt, frame ); |
|
| 243 |
- } |
|
| 244 |
- |
|
| 245 |
- public void deleteFrame( int frameNo ) |
|
| 246 |
- {
|
|
| 247 |
- BlinkenFrame[] frames; |
|
| 248 |
- int i; |
|
| 249 |
- |
|
| 250 |
- if( frameNo < 0 || frameNo >= frameCnt ) |
|
| 251 |
- return; |
|
| 252 |
- |
|
| 253 |
- frames = new BlinkenFrame[frameCnt-1]; |
|
| 254 |
- |
|
| 255 |
- for( i = 0; i < frameNo; i++ ) |
|
| 256 |
- frames[i] = this.frames[i]; |
|
| 257 |
- |
|
| 258 |
- for( i = frameNo; i < frameCnt-1; i++ ) |
|
| 259 |
- frames[i] = this.frames[i+1]; |
|
| 260 |
- |
|
| 261 |
- this.frames = frames; |
|
| 262 |
- frameCnt--; |
|
| 263 |
- } |
|
| 264 |
- |
|
| 265 |
- public void deleteFrames( ) |
|
| 266 |
- {
|
|
| 267 |
- frames = new BlinkenFrame[0]; |
|
| 268 |
- frameCnt = 0; |
|
| 269 |
- } |
|
| 270 |
- |
|
| 271 |
- public void resize( int height, int width, int channels, int maxval ) |
|
| 272 |
- {
|
|
| 273 |
- int i; |
|
| 274 |
- |
|
| 275 |
- if( height < 1 ) height = 1; |
|
| 276 |
- if( height > 1024 ) height = 1024; |
|
| 277 |
- if( width < 1 ) width = 1; |
|
| 278 |
- if( width > 1024 ) width = 1024; |
|
| 279 |
- if( channels < 1 ) channels = 1; |
|
| 280 |
- if( channels > 16 ) channels = 16; |
|
| 281 |
- if( maxval < 1 ) maxval = 1; |
|
| 282 |
- if( maxval > 255 ) maxval = 255; |
|
| 283 |
- |
|
| 284 |
- this.height = height; |
|
| 285 |
- this.width = width; |
|
| 286 |
- this.channels = channels; |
|
| 287 |
- this.maxval = maxval; |
|
| 288 |
- |
|
| 289 |
- for( i = 0; i < frameCnt; i++ ) |
|
| 290 |
- frames[i].resize( height, width, channels, maxval ); |
|
| 291 |
- } |
|
| 292 |
- |
|
| 293 |
- public void scale( int height, int width ) |
|
| 294 |
- {
|
|
| 295 |
- int i; |
|
| 296 |
- |
|
| 297 |
- if( height < 1 ) height = 1; |
|
| 298 |
- if( height > 1024 ) height = 1024; |
|
| 299 |
- if( width < 1 ) width = 1; |
|
| 300 |
- if( width > 1024 ) width = 1024; |
|
| 301 |
- |
|
| 302 |
- this.height = height; |
|
| 303 |
- this.width = width; |
|
| 304 |
- |
|
| 305 |
- for( i = 0; i < frameCnt; i++ ) |
|
| 306 |
- frames[i].scale( height, width ); |
|
| 307 |
- } |
|
| 308 |
- |
|
| 309 |
- public String toString( ) |
|
| 310 |
- {
|
|
| 311 |
- String str = "BlinkenMovie " + width + "x" + height + "-" + channels + "/" + (maxval + 1) + "\n"; |
|
| 312 |
- int i; |
|
| 313 |
- for( i = 0; i < infoCnt; i++ ) |
|
| 314 |
- str += infos[i][0] + " = " + infos[i][1] + "\n"; |
|
| 315 |
- for( i = 0; i < frameCnt; i++ ) |
|
| 316 |
- str += "frame " + i + "\n" + frames[i].toString( ); |
|
| 317 |
- return str; |
|
| 318 |
- } |
|
| 319 |
- |
|
| 320 |
- public boolean loadBlm( String filename ) |
|
| 321 |
- {
|
|
| 322 |
- Pattern header, infoLine, startOfFrame, dataLine; |
|
| 323 |
- BufferedReader file; |
|
| 324 |
- String line, pixel; |
|
| 325 |
- Matcher matcher; |
|
| 326 |
- int width, height, duration, y, x, val; |
|
| 327 |
- BlinkenFrame frame; |
|
| 328 |
- |
|
| 329 |
- //initialize needed regexp patterns |
|
| 330 |
- header = Pattern.compile( "^ *# BlinkenLights Movie ([0-9]+)x([0-9]+)" ); |
|
| 331 |
- infoLine = Pattern.compile( "^ *# ?([A-Za-z0-9]+)(?: *= *|: *)(.*)" ); |
|
| 332 |
- startOfFrame = Pattern.compile( "^ *@([0-9]+)" ); |
|
| 333 |
- dataLine = Pattern.compile( " *([01])" ); |
|
| 334 |
- |
|
| 335 |
- //delete all frames |
|
| 336 |
- deleteInfos( ); |
|
| 337 |
- deleteFrames( ); |
|
| 338 |
- resize( 0, 0, 0, 0 ); |
|
| 339 |
- |
|
| 340 |
- //try to read file |
|
| 341 |
- try |
|
| 342 |
- {
|
|
| 343 |
- //open file |
|
| 344 |
- file = new BufferedReader( new FileReader( filename ) ); |
|
| 345 |
- |
|
| 346 |
- //read magic and size |
|
| 347 |
- if( (line = file.readLine( )) != null ) |
|
| 348 |
- {
|
|
| 349 |
- if( (matcher = header.matcher( line )).find( ) ) |
|
| 350 |
- {
|
|
| 351 |
- width = Integer.parseInt( matcher.group( 1 ) ); |
|
| 352 |
- height = Integer.parseInt( matcher.group( 2 ) ); |
|
| 353 |
- resize( height, width, 1, 1 ); |
|
| 354 |
- |
|
| 355 |
- //create unused dummy frame for beginning |
|
| 356 |
- frame = new BlinkenFrame( height, width, 1, 1, 0 ); |
|
| 357 |
- y = 0; |
|
| 358 |
- |
|
| 359 |
- //read frames |
|
| 360 |
- while( (line = file.readLine( )) != null ) |
|
| 361 |
- {
|
|
| 362 |
- |
|
| 363 |
- //info line |
|
| 364 |
- if( (matcher = infoLine.matcher( line )).find( ) ) |
|
| 365 |
- {
|
|
| 366 |
- appendInfo( matcher.group( 1 ), matcher.group( 2 ) ); |
|
| 367 |
- } |
|
| 368 |
- |
|
| 369 |
- //start of frame |
|
| 370 |
- else if( (matcher = startOfFrame.matcher( line )).find( ) ) |
|
| 371 |
- {
|
|
| 372 |
- duration = Integer.parseInt( matcher.group( 1 ) ); |
|
| 373 |
- //create new frame and append it to movie |
|
| 374 |
- frame = new BlinkenFrame( this.height, this.width, 1, 1, duration ); |
|
| 375 |
- frame.clear( ); |
|
| 376 |
- appendFrame( frame ); |
|
| 377 |
- y = 0; |
|
| 378 |
- } |
|
| 379 |
- |
|
| 380 |
- //data line |
|
| 381 |
- else if( (matcher = dataLine.matcher( line )).find( ) ) |
|
| 382 |
- {
|
|
| 383 |
- x = 0; |
|
| 384 |
- while( true ) |
|
| 385 |
- {
|
|
| 386 |
- pixel = matcher.group( 1 ); |
|
| 387 |
- val = Integer.parseInt( pixel ); |
|
| 388 |
- frame.setPixel( y, x, 0, (byte)val ); //set pixel |
|
| 389 |
- if( ! matcher.find( ) ) //get next pixel |
|
| 390 |
- break; |
|
| 391 |
- x++; //next pixel |
|
| 392 |
- } |
|
| 393 |
- y++; //next row |
|
| 394 |
- } |
|
| 395 |
- |
|
| 396 |
- } //while( (line = ... |
|
| 397 |
- } //if( matcher = header..matcher( ... |
|
| 398 |
- } //if( (line = ... |
|
| 399 |
- |
|
| 400 |
- //close file |
|
| 401 |
- file.close( ); |
|
| 402 |
- |
|
| 403 |
- //success |
|
| 404 |
- return true; |
|
| 405 |
- } |
|
| 406 |
- catch( IOException e ) { }
|
|
| 407 |
- |
|
| 408 |
- //some error |
|
| 409 |
- return false; |
|
| 410 |
- } |
|
| 411 |
- |
|
| 412 |
- public boolean loadBmm( String filename ) |
|
| 413 |
- {
|
|
| 414 |
- Pattern header, infoLine, startOfFrame, dataLine; |
|
| 415 |
- BufferedReader file; |
|
| 416 |
- String line, pixel; |
|
| 417 |
- Matcher matcher; |
|
| 418 |
- int width, height, duration, y, x, val; |
|
| 419 |
- BlinkenFrame frame; |
|
| 420 |
- |
|
| 421 |
- //initialize needed regexp patterns |
|
| 422 |
- header = Pattern.compile( "^ *# BlinkenMini Movie ([0-9]+)x([0-9]+)" ); |
|
| 423 |
- infoLine = Pattern.compile( "^ *# ?([A-Za-z0-9]+)(?: *= *|: *)(.*)" ); |
|
| 424 |
- startOfFrame = Pattern.compile( "^ *@([0-9]+)" ); |
|
| 425 |
- dataLine = Pattern.compile( " *(0x[0-9A-Fa-f]+|[0-9]+)" ); |
|
| 426 |
- |
|
| 427 |
- //delete all frames |
|
| 428 |
- deleteInfos( ); |
|
| 429 |
- deleteFrames( ); |
|
| 430 |
- resize( 0, 0, 0, 0 ); |
|
| 431 |
- |
|
| 432 |
- //try to read file |
|
| 433 |
- try |
|
| 434 |
- {
|
|
| 435 |
- //open file |
|
| 436 |
- file = new BufferedReader( new FileReader( filename ) ); |
|
| 437 |
- |
|
| 438 |
- //read magic and size |
|
| 439 |
- if( (line = file.readLine( )) != null ) |
|
| 440 |
- {
|
|
| 441 |
- if( (matcher = header.matcher( line )).find( ) ) |
|
| 442 |
- {
|
|
| 443 |
- width = Integer.parseInt( matcher.group( 1 ) ); |
|
| 444 |
- height = Integer.parseInt( matcher.group( 2 ) ); |
|
| 445 |
- resize( height, width, 1, 255 ); |
|
| 446 |
- |
|
| 447 |
- //create unused dummy frame for beginning |
|
| 448 |
- frame = new BlinkenFrame( height, width, 1, 255, 0 ); |
|
| 449 |
- y = 0; |
|
| 450 |
- |
|
| 451 |
- //read frames |
|
| 452 |
- while( (line = file.readLine( )) != null ) |
|
| 453 |
- {
|
|
| 454 |
- |
|
| 455 |
- //info line |
|
| 456 |
- if( (matcher = infoLine.matcher( line )).find( ) ) |
|
| 457 |
- {
|
|
| 458 |
- appendInfo( matcher.group( 1 ), matcher.group( 2 ) ); |
|
| 459 |
- } |
|
| 460 |
- |
|
| 461 |
- //start of frame |
|
| 462 |
- else if( (matcher = startOfFrame.matcher( line )).find( ) ) |
|
| 463 |
- {
|
|
| 464 |
- duration = Integer.parseInt( matcher.group( 1 ) ); |
|
| 465 |
- //create new frame and append it to movie |
|
| 466 |
- frame = new BlinkenFrame( this.height, this.width, 1, 255, duration ); |
|
| 467 |
- frame.clear( ); |
|
| 468 |
- appendFrame( frame ); |
|
| 469 |
- y = 0; |
|
| 470 |
- } |
|
| 471 |
- |
|
| 472 |
- //data line |
|
| 473 |
- else if( (matcher = dataLine.matcher( line )).find( ) ) |
|
| 474 |
- {
|
|
| 475 |
- x = 0; |
|
| 476 |
- while( true ) |
|
| 477 |
- {
|
|
| 478 |
- pixel = matcher.group( 1 ); |
|
| 479 |
- if( pixel.length( ) >= 2 && pixel.substring( 0, 2 ).equals( "0x" ) ) |
|
| 480 |
- val = Integer.parseInt( pixel.substring( 2 ), 0x10 ); |
|
| 481 |
- else |
|
| 482 |
- val = Integer.parseInt( pixel ); |
|
| 483 |
- frame.setPixel( y, x, 0, (byte)val ); //set pixel |
|
| 484 |
- if( ! matcher.find( ) ) //get next pixel |
|
| 485 |
- break; |
|
| 486 |
- x++; //next pixel |
|
| 487 |
- } |
|
| 488 |
- y++; //next row |
|
| 489 |
- } |
|
| 490 |
- |
|
| 491 |
- } //while( (line = ... |
|
| 492 |
- } //if( matcher = header..matcher( ... |
|
| 493 |
- } //if( (line = ... |
|
| 494 |
- |
|
| 495 |
- //close file |
|
| 496 |
- file.close( ); |
|
| 497 |
- |
|
| 498 |
- //success |
|
| 499 |
- return true; |
|
| 500 |
- } |
|
| 501 |
- catch( IOException e ) { }
|
|
| 502 |
- |
|
| 503 |
- //some error |
|
| 504 |
- return false; |
|
| 505 |
- } |
|
| 506 |
- |
|
| 507 |
- public boolean loadBml( String filename ) |
|
| 508 |
- {
|
|
| 509 |
- Pattern blmTag, blmHeight, blmWidth, blmChannels, blmBits; |
|
| 510 |
- Pattern infoTitle, infoDescription, infoGeneric, infoCreator, infoAuthor, infoEmail, infoUrl; |
|
| 511 |
- Pattern frameTag, frameDuration, rowTag, tag; |
|
| 512 |
- BufferedReader file; |
|
| 513 |
- String line, data, row; |
|
| 514 |
- boolean blmTagFound; |
|
| 515 |
- Matcher matcher, submatcher; |
|
| 516 |
- int height, width, channels, bits, maxval, chrs, duration, y, x, c, len, i, val; |
|
| 517 |
- BlinkenFrame frame; |
|
| 518 |
- |
|
| 519 |
- //initialize needed regexp patterns |
|
| 520 |
- blmTag = Pattern.compile( "^[^<]*<blm([^>]*)>" ); |
|
| 521 |
- blmHeight = Pattern.compile( "height=\"?([0-9]*)\"?" ); |
|
| 522 |
- blmWidth = Pattern.compile( "width=\"?([0-9]*)\"?" ); |
|
| 523 |
- blmChannels = Pattern.compile( "channels=\"?([0-9]*)\"?" ); |
|
| 524 |
- blmBits = Pattern.compile( "bits=\"?([0-9]*)\"?" ); |
|
| 525 |
- infoTitle = Pattern.compile( "^[^<]*<title>([^<]*)</title>" ); |
|
| 526 |
- infoDescription = Pattern.compile( "[^<]*<description>([^<]*)</description>" ); |
|
| 527 |
- infoGeneric = Pattern.compile( "^([A-Za-z0-9]+)(?: *= *|: *)(.*)" ); |
|
| 528 |
- infoCreator = Pattern.compile( "^[^<]*<creator>([^<]*)</creator>" ); |
|
| 529 |
- infoAuthor = Pattern.compile( "^[^<]*<author>([^<]*)</author>" ); |
|
| 530 |
- infoEmail = Pattern.compile( "^[^<]*<email>([^<]*)</email>" ); |
|
| 531 |
- infoUrl = Pattern.compile( "^[^<]*<url>([^<]*)</url>" ); |
|
| 532 |
- frameTag = Pattern.compile( "^[^<]*<frame([^>]*)>" ); |
|
| 533 |
- frameDuration = Pattern.compile( "duration=\"?([0-9]*)\"?" ); |
|
| 534 |
- rowTag = Pattern.compile( "^[^<]*<row>([0-9A-Fa-f]*)</row>" ); |
|
| 535 |
- tag = Pattern.compile( "^[^<]*<[^>]*>" ); |
|
| 536 |
- |
|
| 537 |
- //delete all frames |
|
| 538 |
- deleteInfos( ); |
|
| 539 |
- deleteFrames( ); |
|
| 540 |
- resize( 0, 0, 0, 0 ); |
|
| 541 |
- |
|
| 542 |
- //try to read file |
|
| 543 |
- try |
|
| 544 |
- {
|
|
| 545 |
- //open file |
|
| 546 |
- file = new BufferedReader( new FileReader( filename ) ); |
|
| 547 |
- |
|
| 548 |
- //create unused dummy frame for beginning |
|
| 549 |
- frame = new BlinkenFrame( 0, 0, 0, 0, 0 ); |
|
| 550 |
- y = 0; |
|
| 551 |
- chrs = 1; |
|
| 552 |
- |
|
| 553 |
- //read file |
|
| 554 |
- data = ""; |
|
| 555 |
- blmTagFound = false; |
|
| 556 |
- while( (line = file.readLine( )) != null ) |
|
| 557 |
- {
|
|
| 558 |
- data += " " + line; //add new line to data |
|
| 559 |
- |
|
| 560 |
- //match tags |
|
| 561 |
- while( true ) |
|
| 562 |
- {
|
|
| 563 |
- |
|
| 564 |
- //no blm tag yet |
|
| 565 |
- if( ! blmTagFound ) |
|
| 566 |
- {
|
|
| 567 |
- |
|
| 568 |
- //blm tag |
|
| 569 |
- if( (matcher = blmTag.matcher( data )).find( ) ) |
|
| 570 |
- {
|
|
| 571 |
- //remove matched part |
|
| 572 |
- data = data.substring( matcher.end( ) ); |
|
| 573 |
- //get attributes |
|
| 574 |
- width = 0; |
|
| 575 |
- height = 0; |
|
| 576 |
- channels = 1; |
|
| 577 |
- bits = 4; |
|
| 578 |
- maxval = 15; |
|
| 579 |
- if( (submatcher = blmHeight.matcher( matcher.group( 1 ) )).find( ) ) //height |
|
| 580 |
- height = Integer.parseInt( submatcher.group( 1 ) ); |
|
| 581 |
- if( (submatcher = blmWidth.matcher( matcher.group( 1 ) )).find( ) ) //width |
|
| 582 |
- width = Integer.parseInt( submatcher.group( 1 ) ); |
|
| 583 |
- if( (submatcher = blmChannels.matcher( matcher.group( 1 ) )).find( ) ) //channels |
|
| 584 |
- channels = Integer.parseInt( submatcher.group( 1 ) ); |
|
| 585 |
- if( (submatcher = blmBits.matcher( matcher.group( 1 ) )).find( ) ) //bits |
|
| 586 |
- maxval = (1 << (bits = Integer.parseInt( submatcher.group( 1 ) ))) - 1; |
|
| 587 |
- //remember that blm tag was found |
|
| 588 |
- blmTagFound = true; |
|
| 589 |
- //set movie size |
|
| 590 |
- resize( height, width, channels, maxval ); |
|
| 591 |
- //get number of characters per channel |
|
| 592 |
- chrs = (bits + 3) >> 2; |
|
| 593 |
- } |
|
| 594 |
- |
|
| 595 |
- //unknown tag |
|
| 596 |
- else if( (matcher = tag.matcher( data )).find( ) ) |
|
| 597 |
- //remove matched part |
|
| 598 |
- data = data.substring( matcher.end( ) ); |
|
| 599 |
- |
|
| 600 |
- //nothing matches |
|
| 601 |
- else |
|
| 602 |
- //end loop |
|
| 603 |
- break; |
|
| 604 |
- |
|
| 605 |
- } //if( ! blmTagFound ) |
|
| 606 |
- |
|
| 607 |
- //blm tag was already found |
|
| 608 |
- else |
|
| 609 |
- {
|
|
| 610 |
- |
|
| 611 |
- //title tag |
|
| 612 |
- if( (matcher = infoTitle.matcher( data )).find( ) ) |
|
| 613 |
- {
|
|
| 614 |
- //remove matched part |
|
| 615 |
- data = data.substring( matcher.end( ) ); |
|
| 616 |
- //add info to movie |
|
| 617 |
- appendInfo( "title", matcher.group( 1 ) ); |
|
| 618 |
- } |
|
| 619 |
- |
|
| 620 |
- //description tag |
|
| 621 |
- else if( (matcher = infoDescription.matcher( data )).find( ) ) |
|
| 622 |
- {
|
|
| 623 |
- //remove matched part |
|
| 624 |
- data = data.substring( matcher.end( ) ); |
|
| 625 |
- //check if generic info |
|
| 626 |
- if( (submatcher = infoGeneric.matcher( matcher.group( 1 ) )).find( ) ) |
|
| 627 |
- //add info to movie |
|
| 628 |
- appendInfo( submatcher.group( 1 ), submatcher.group( 2 ) ); |
|
| 629 |
- else |
|
| 630 |
- //add info to movie |
|
| 631 |
- appendInfo( "description", matcher.group( 1 ) ); |
|
| 632 |
- } |
|
| 633 |
- |
|
| 634 |
- //creator tag |
|
| 635 |
- else if( (matcher = infoCreator.matcher( data )).find( ) ) |
|
| 636 |
- {
|
|
| 637 |
- //remove matched part |
|
| 638 |
- data = data.substring( matcher.end( ) ); |
|
| 639 |
- //add info to movie |
|
| 640 |
- appendInfo( "creator", matcher.group( 1 ) ); |
|
| 641 |
- } |
|
| 642 |
- |
|
| 643 |
- //author tag |
|
| 644 |
- else if( (matcher = infoAuthor.matcher( data )).find( ) ) |
|
| 645 |
- {
|
|
| 646 |
- //remove matched part |
|
| 647 |
- data = data.substring( matcher.end( ) ); |
|
| 648 |
- //add info to movie |
|
| 649 |
- appendInfo( "author", matcher.group( 1 ) ); |
|
| 650 |
- } |
|
| 651 |
- |
|
| 652 |
- //email tag |
|
| 653 |
- else if( (matcher = infoEmail.matcher( data )).find( ) ) |
|
| 654 |
- {
|
|
| 655 |
- //remove matched part |
|
| 656 |
- data = data.substring( matcher.end( ) ); |
|
| 657 |
- //add info to movie |
|
| 658 |
- appendInfo( "email", matcher.group( 1 ) ); |
|
| 659 |
- } |
|
| 660 |
- |
|
| 661 |
- //url tag |
|
| 662 |
- else if( (matcher = infoUrl.matcher( data )).find( ) ) |
|
| 663 |
- {
|
|
| 664 |
- //remove matched part |
|
| 665 |
- data = data.substring( matcher.end( ) ); |
|
| 666 |
- //add info to movie |
|
| 667 |
- appendInfo( "url", matcher.group( 1 ) ); |
|
| 668 |
- } |
|
| 669 |
- |
|
| 670 |
- //frame tag |
|
| 671 |
- else if( (matcher = frameTag.matcher( data )).find( ) ) |
|
| 672 |
- {
|
|
| 673 |
- //remove matched part |
|
| 674 |
- data = data.substring( matcher.end( ) ); |
|
| 675 |
- //get attributes |
|
| 676 |
- duration = 0; |
|
| 677 |
- if( (submatcher = frameDuration.matcher( matcher.group( 1 ) )).find( ) ) //duration |
|
| 678 |
- duration = Integer.parseInt( submatcher.group( 1 ) ); |
|
| 679 |
- //create new frame and append it to movie |
|
| 680 |
- frame = new BlinkenFrame( this.height, this.width, this.channels, this.maxval, duration ); |
|
| 681 |
- frame.clear( ); |
|
| 682 |
- appendFrame( frame ); |
|
| 683 |
- y = 0; |
|
| 684 |
- } |
|
| 685 |
- |
|
| 686 |
- //row tag |
|
| 687 |
- else if( (matcher = rowTag.matcher( data )).find( ) ) |
|
| 688 |
- {
|
|
| 689 |
- //remove matched part |
|
| 690 |
- data = data.substring( matcher.end( ) ); |
|
| 691 |
- //parse row |
|
| 692 |
- row = matcher.group( 1 ); |
|
| 693 |
- len = row.length( ); |
|
| 694 |
- i = 0; |
|
| 695 |
- for( x = 0; x < this.width && i + chrs <= len; x++ ) |
|
| 696 |
- {
|
|
| 697 |
- for( c = 0; c < this.channels && i + chrs <= len; c++, i += chrs ) |
|
| 698 |
- {
|
|
| 699 |
- val = Integer.parseInt( row.substring( i, i + chrs ), 0x10 ); |
|
| 700 |
- frame.setPixel( y, x, c, (byte)val ); //set pixel |
|
| 701 |
- } |
|
| 702 |
- } |
|
| 703 |
- y++; //next row |
|
| 704 |
- } |
|
| 705 |
- |
|
| 706 |
- //unknown tag |
|
| 707 |
- else if( (matcher = tag.matcher( data )).find( ) ) |
|
| 708 |
- //remove matched part |
|
| 709 |
- data = data.substring( matcher.end( ) ); |
|
| 710 |
- |
|
| 711 |
- //nothing matches |
|
| 712 |
- else |
|
| 713 |
- //end loop |
|
| 714 |
- break; |
|
| 715 |
- |
|
| 716 |
- } //if( ! blmTagFound ) ... else |
|
| 717 |
- |
|
| 718 |
- } //while( true ) |
|
| 719 |
- |
|
| 720 |
- } //while( (line = ... |
|
| 721 |
- |
|
| 722 |
- //close file |
|
| 723 |
- file.close( ); |
|
| 724 |
- |
|
| 725 |
- //success |
|
| 726 |
- return true; |
|
| 727 |
- } |
|
| 728 |
- catch( IOException e ) { }
|
|
| 729 |
- |
|
| 730 |
- //some error |
|
| 731 |
- return false; |
|
| 732 |
- } |
|
| 733 |
- |
|
| 734 |
- public boolean loadBbm( String filename ) |
|
| 735 |
- {
|
|
| 736 |
- RandomAccessFile file; |
|
| 737 |
- byte[] header, subHeader, infoHeader, frameStartMarker, frameData; |
|
| 738 |
- int headerMagic, headerHeight, headerWidth, headerChannels, headerMaxval; |
|
| 739 |
- int headerFrameCnt, headerDuration, headerFramePtr; |
|
| 740 |
- int subHeaderMagic, subHeaderSize; |
|
| 741 |
- int frameStartMarkerMagic; |
|
| 742 |
- StringTokenizer tokenizer; |
|
| 743 |
- String infoType, infoData; |
|
| 744 |
- int fileLength, frameLength; |
|
| 745 |
- int duration, i, y, x, c; |
|
| 746 |
- BlinkenFrame frame; |
|
| 747 |
- |
|
| 748 |
- //delete all frames |
|
| 749 |
- deleteInfos( ); |
|
| 750 |
- deleteFrames( ); |
|
| 751 |
- resize( 0, 0, 0, 0 ); |
|
| 752 |
- |
|
| 753 |
- //try to read file |
|
| 754 |
- try |
|
| 755 |
- {
|
|
| 756 |
- //open file |
|
| 757 |
- file = new RandomAccessFile( filename, "r" ); |
|
| 758 |
- |
|
| 759 |
- //read header |
|
| 760 |
- header = new byte[24]; |
|
| 761 |
- file.readFully( header ); |
|
| 762 |
- headerMagic = ((int)header[0] & 0xFF) << 24 | ((int)header[1] & 0xFF) << 16 | ((int)header[2] & 0xFF) << 8 | ((int)header[3] & 0xFF); |
|
| 763 |
- headerHeight = ((int)header[4] & 0xFF) << 8 | ((int)header[5] & 0xFF); |
|
| 764 |
- headerWidth = ((int)header[6] & 0xFF) << 8 | ((int)header[7] & 0xFF); |
|
| 765 |
- headerChannels = ((int)header[8] & 0xFF) << 8 | ((int)header[9] & 0xFF); |
|
| 766 |
- headerMaxval = ((int)header[10] & 0xFF) << 8 | ((int)header[11] & 0xFF); |
|
| 767 |
- headerFrameCnt = ((int)header[12] & 0xFF) << 24 | ((int)header[13] & 0xFF) << 16 | ((int)header[14] & 0xFF) << 8 | ((int)header[15] & 0xFF); |
|
| 768 |
- headerDuration = ((int)header[16] & 0xFF) << 24 | ((int)header[17] & 0xFF) << 16 | ((int)header[18] & 0xFF) << 8 | ((int)header[19] & 0xFF); |
|
| 769 |
- headerFramePtr = ((int)header[20] & 0xFF) << 24 | ((int)header[21] & 0xFF) << 16 | ((int)header[22] & 0xFF) << 8 | ((int)header[23] & 0xFF); |
|
| 770 |
- //check magic |
|
| 771 |
- if( headerMagic == 0x23542666 ) |
|
| 772 |
- {
|
|
| 773 |
- |
|
| 774 |
- //adapt movie format |
|
| 775 |
- resize( headerHeight, headerWidth, headerChannels, headerMaxval ); |
|
| 776 |
- |
|
| 777 |
- //read subheaders |
|
| 778 |
- subHeader = new byte[6]; |
|
| 779 |
- while( file.getFilePointer( ) + 6 <= headerFramePtr ) |
|
| 780 |
- {
|
|
| 781 |
- file.readFully( subHeader ); |
|
| 782 |
- subHeaderMagic = ((int)subHeader[0] & 0xFF) << 24 | ((int)subHeader[1] & 0xFF) << 16 | ((int)subHeader[2] & 0xFF) << 8 | ((int)subHeader[3] & 0xFF); |
|
| 783 |
- subHeaderSize = ((int)subHeader[4] & 0xFF) << 8 | ((int)subHeader[5] & 0xFF); |
|
| 784 |
- |
|
| 785 |
- //header fits into gap to frame start |
|
| 786 |
- if( subHeaderSize >= 6 && file.getFilePointer( ) + subHeaderSize - 6 <= headerFramePtr ) |
|
| 787 |
- {
|
|
| 788 |
- //info header |
|
| 789 |
- if( subHeaderMagic == 0x696E666F ) //'i' 'n' 'f' 'o' |
|
| 790 |
- {
|
|
| 791 |
- //read rest of info header |
|
| 792 |
- infoHeader = new byte[subHeaderSize - 6]; |
|
| 793 |
- file.readFully( infoHeader ); |
|
| 794 |
- //parse information |
|
| 795 |
- tokenizer = new StringTokenizer( new String( infoHeader ), "\000" ); |
|
| 796 |
- if( tokenizer.countTokens( ) >= 2 ) |
|
| 797 |
- {
|
|
| 798 |
- infoType = tokenizer.nextToken(); |
|
| 799 |
- infoData = tokenizer.nextToken(); |
|
| 800 |
- appendInfo( infoType, infoData ); |
|
| 801 |
- } |
|
| 802 |
- } |
|
| 803 |
- |
|
| 804 |
- //unknown subHeader |
|
| 805 |
- else |
|
| 806 |
- //skip |
|
| 807 |
- file.skipBytes( subHeaderSize - 6 ); |
|
| 808 |
- |
|
| 809 |
- } //if( file.getFilePointer( ) ... |
|
| 810 |
- } //while( file.getFilePointer( ) ... |
|
| 811 |
- |
|
| 812 |
- //seek to start of frames |
|
| 813 |
- file.seek( headerFramePtr ); |
|
| 814 |
- |
|
| 815 |
- //read frame start marker |
|
| 816 |
- frameStartMarker = new byte[4]; |
|
| 817 |
- file.readFully( frameStartMarker ); |
|
| 818 |
- frameStartMarkerMagic = ((int)frameStartMarker[0] & 0xFF) << 24 | ((int)frameStartMarker[1] & 0xFF) << 16 | ((int)frameStartMarker[2] & 0xFF) << 8 | ((int)frameStartMarker[3] & 0xFF); |
|
| 819 |
- if( frameStartMarkerMagic == 0x66726D73 ) //'f' 'r' 'm' 's' |
|
| 820 |
- {
|
|
| 821 |
- |
|
| 822 |
- //read frames |
|
| 823 |
- fileLength = (int)file.length( ); |
|
| 824 |
- frameLength = 2 + headerHeight * headerWidth * headerChannels; |
|
| 825 |
- frameData = new byte[frameLength]; |
|
| 826 |
- while( file.getFilePointer( ) + frameLength <= fileLength ) |
|
| 827 |
- {
|
|
| 828 |
- //read frame |
|
| 829 |
- file.readFully( frameData ); |
|
| 830 |
- duration = ((int)frameData[0] & 0xFF) << 8 | ((int)frameData[1] & 0xFF); |
|
| 831 |
- //build frame and append it to movie |
|
| 832 |
- frame = new BlinkenFrame( this.height, this.width, this.channels, this.maxval, duration ); |
|
| 833 |
- i = 2; |
|
| 834 |
- for( y = 0; y < headerHeight; y++ ) |
|
| 835 |
- for( x = 0; x < headerWidth; x++ ) |
|
| 836 |
- for( c = 0; c < headerChannels; c++, i++ ) |
|
| 837 |
- frame.setPixel( y, x, c, frameData[i] ); |
|
| 838 |
- appendFrame( frame ); |
|
| 839 |
- |
|
| 840 |
- } //while( file.getFilePointer ... |
|
| 841 |
- |
|
| 842 |
- } //if( frameStartMarkerMagic ... |
|
| 843 |
- |
|
| 844 |
- } //if( headerMagic ... |
|
| 845 |
- |
|
| 846 |
- //close file |
|
| 847 |
- file.close( ); |
|
| 848 |
- |
|
| 849 |
- //success |
|
| 850 |
- return true; |
|
| 851 |
- } |
|
| 852 |
- catch( IOException e ) { }
|
|
| 853 |
- |
|
| 854 |
- //some error |
|
| 855 |
- return false; |
|
| 856 |
- } |
|
| 857 |
- |
|
| 858 |
- public boolean load( String filename ) |
|
| 859 |
- {
|
|
| 860 |
- if( filename.endsWith( ".blm" ) ) |
|
| 861 |
- return loadBlm( filename ); |
|
| 862 |
- if( filename.endsWith( ".bmm" ) ) |
|
| 863 |
- return loadBmm( filename ); |
|
| 864 |
- if( filename.endsWith( ".bml" ) ) |
|
| 865 |
- return loadBml( filename ); |
|
| 866 |
- if( filename.endsWith( ".bbm" ) ) |
|
| 867 |
- return loadBbm( filename ); |
|
| 868 |
- deleteFrames( ); |
|
| 869 |
- return false; |
|
| 870 |
- } |
|
| 871 |
- |
|
| 872 |
- public boolean saveBlm( String filename ) |
|
| 873 |
- {
|
|
| 874 |
- BlinkenMovie movie; |
|
| 875 |
- BufferedWriter file; |
|
| 876 |
- int cnt, i, y, x; |
|
| 877 |
- String line; |
|
| 878 |
- |
|
| 879 |
- //convert movie to suitable format |
|
| 880 |
- movie = new BlinkenMovie( this ); |
|
| 881 |
- movie.resize( movie.height, movie.width, 1, 1 ); |
|
| 882 |
- |
|
| 883 |
- try |
|
| 884 |
- {
|
|
| 885 |
- //open file |
|
| 886 |
- file = new BufferedWriter( new FileWriter( filename ) ); |
|
| 887 |
- |
|
| 888 |
- //write header line |
|
| 889 |
- file.write( "# BlinkenLights Movie " + movie.width + "x" + movie.height + "\n" ); |
|
| 890 |
- |
|
| 891 |
- //write information lines |
|
| 892 |
- cnt = movie.getInfoCnt( ); |
|
| 893 |
- for( i = 0; i < cnt; i++ ) |
|
| 894 |
- file.write( "# " + movie.getInfoType( i ) + " = " + movie.getInfoData( i ) + "\n" ); |
|
| 895 |
- |
|
| 896 |
- //write frames |
|
| 897 |
- cnt = movie.getFrameCnt( ); |
|
| 898 |
- for( i = 0; i < cnt; i++ ) |
|
| 899 |
- {
|
|
| 900 |
- file.write( "\n@" + movie.frames[i].getDuration( ) + "\n" ); |
|
| 901 |
- for( y = 0; y < movie.height; y++ ) |
|
| 902 |
- {
|
|
| 903 |
- line = ""; |
|
| 904 |
- for( x = 0; x < movie.width; x++ ) |
|
| 905 |
- {
|
|
| 906 |
- if( movie.frames[i].getPixel( y, x, 0 ) != 0 ) |
|
| 907 |
- line = line + "1"; |
|
| 908 |
- else |
|
| 909 |
- line = line + "0"; |
|
| 910 |
- } |
|
| 911 |
- file.write( line + "\n" ); |
|
| 912 |
- } |
|
| 913 |
- } |
|
| 914 |
- |
|
| 915 |
- //close file |
|
| 916 |
- file.close( ); |
|
| 917 |
- |
|
| 918 |
- //success |
|
| 919 |
- return true; |
|
| 920 |
- } |
|
| 921 |
- catch( IOException e ) { }
|
|
| 922 |
- |
|
| 923 |
- //some error |
|
| 924 |
- return false; |
|
| 925 |
- } |
|
| 926 |
- |
|
| 927 |
- public boolean saveBmm( String filename ) |
|
| 928 |
- {
|
|
| 929 |
- BlinkenMovie movie; |
|
| 930 |
- BufferedWriter file; |
|
| 931 |
- int cnt, i, y, x, val; |
|
| 932 |
- String line; |
|
| 933 |
- |
|
| 934 |
- //convert movie to suitable format |
|
| 935 |
- movie = new BlinkenMovie( this ); |
|
| 936 |
- movie.resize( movie.height, movie.width, 1, 255 ); |
|
| 937 |
- |
|
| 938 |
- try |
|
| 939 |
- {
|
|
| 940 |
- //open file |
|
| 941 |
- file = new BufferedWriter( new FileWriter( filename ) ); |
|
| 942 |
- |
|
| 943 |
- //write header line |
|
| 944 |
- file.write( "# BlinkenMini Movie " + movie.width + "x" + movie.height + "\n" ); |
|
| 945 |
- |
|
| 946 |
- //write information lines |
|
| 947 |
- cnt = movie.getInfoCnt( ); |
|
| 948 |
- for( i = 0; i < cnt; i++ ) |
|
| 949 |
- file.write( "# " + movie.getInfoType( i ) + " = " + movie.getInfoData( i ) + "\n" ); |
|
| 950 |
- |
|
| 951 |
- //write frames |
|
| 952 |
- cnt = movie.getFrameCnt( ); |
|
| 953 |
- for( i = 0; i < cnt; i++ ) |
|
| 954 |
- {
|
|
| 955 |
- file.write( "\n@" + movie.frames[i].getDuration( ) + "\n" ); |
|
| 956 |
- for( y = 0; y < movie.height; y++ ) |
|
| 957 |
- {
|
|
| 958 |
- line = ""; |
|
| 959 |
- for( x = 0; x < movie.width; x++ ) |
|
| 960 |
- {
|
|
| 961 |
- val = (int)movie.frames[i].getPixel( y, x, 0 ) & 0xFF; |
|
| 962 |
- if( val < 0x10 ) |
|
| 963 |
- line = line + " 0x0" + Integer.toHexString( val ).toUpperCase( ); |
|
| 964 |
- else |
|
| 965 |
- line = line + " 0x" + Integer.toHexString( val ).toUpperCase( ); |
|
| 966 |
- } |
|
| 967 |
- file.write( line.substring( 1 ) + "\n" ); |
|
| 968 |
- } |
|
| 969 |
- } |
|
| 970 |
- |
|
| 971 |
- //close file |
|
| 972 |
- file.close( ); |
|
| 973 |
- |
|
| 974 |
- //success |
|
| 975 |
- return true; |
|
| 976 |
- } |
|
| 977 |
- catch( IOException e ) { }
|
|
| 978 |
- |
|
| 979 |
- //some error |
|
| 980 |
- return false; |
|
| 981 |
- } |
|
| 982 |
- |
|
| 983 |
- public boolean saveBml( String filename ) |
|
| 984 |
- {
|
|
| 985 |
- BlinkenMovie movie; |
|
| 986 |
- BufferedWriter file; |
|
| 987 |
- int bits, cnt, i, y, x, c, val; |
|
| 988 |
- String infoType, infoData, line; |
|
| 989 |
- |
|
| 990 |
- //convert movie to suitable format |
|
| 991 |
- movie = new BlinkenMovie( this ); |
|
| 992 |
- val = movie.maxval; //get number of bits |
|
| 993 |
- for( bits = 0; val != 0; val >>= 1, bits++ ); |
|
| 994 |
- movie.resize( movie.height, movie.width, movie.channels, (1 << bits) - 1 ); |
|
| 995 |
- |
|
| 996 |
- try |
|
| 997 |
- {
|
|
| 998 |
- //open file |
|
| 999 |
- file = new BufferedWriter( new FileWriter( filename ) ); |
|
| 1000 |
- |
|
| 1001 |
- //write header line |
|
| 1002 |
- file.write( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ); |
|
| 1003 |
- |
|
| 1004 |
- //write blm start tag |
|
| 1005 |
- file.write( "<blm width=\"" + movie.width + "\" height=\"" + movie.height |
|
| 1006 |
- + "\" bits=\"" + bits + "\" channels=\"" + movie.channels + "\">\n" ); |
|
| 1007 |
- |
|
| 1008 |
- //write information lines |
|
| 1009 |
- file.write( "\t<header>\n" ); |
|
| 1010 |
- cnt = movie.getInfoCnt( ); |
|
| 1011 |
- for( i = 0; i < cnt; i++ ) |
|
| 1012 |
- {
|
|
| 1013 |
- infoType = movie.getInfoType( i ); |
|
| 1014 |
- infoData = movie.getInfoData( i ); |
|
| 1015 |
- if( infoType.equals( "title" ) ) |
|
| 1016 |
- file.write( "\t\t<title>" + infoData + "</title>\n" ); |
|
| 1017 |
- else if( infoType.equals( "description" ) ) |
|
| 1018 |
- file.write( "\t\t<description>" + infoData + "</description>\n" ); |
|
| 1019 |
- else if( infoType.equals( "creator" ) ) |
|
| 1020 |
- file.write( "\t\t<creator>" + infoData + "</creator>\n" ); |
|
| 1021 |
- else if( infoType.equals( "author" ) ) |
|
| 1022 |
- file.write( "\t\t<author>" + infoData + "</author>\n" ); |
|
| 1023 |
- else if( infoType.equals( "email" ) ) |
|
| 1024 |
- file.write( "\t\t<email>" + infoData + "</email>\n" ); |
|
| 1025 |
- else if( infoType.equals( "url" ) ) |
|
| 1026 |
- file.write( "\t\t<url>" + infoData + "</url>\n" ); |
|
| 1027 |
- else |
|
| 1028 |
- file.write( "\t\t<description>" + infoType + ": " + infoData + "</description>\n" ); |
|
| 1029 |
- } |
|
| 1030 |
- file.write( "\t</header>\n" ); |
|
| 1031 |
- |
|
| 1032 |
- //write frames |
|
| 1033 |
- cnt = movie.getFrameCnt( ); |
|
| 1034 |
- for( i = 0; i < cnt; i++ ) |
|
| 1035 |
- {
|
|
| 1036 |
- file.write( "\n\t<frame duration=\"" + movie.frames[i].getDuration( ) + "\">\n" ); |
|
| 1037 |
- for( y = 0; y < movie.height; y++ ) |
|
| 1038 |
- {
|
|
| 1039 |
- line = ""; |
|
| 1040 |
- for( x = 0; x < movie.width; x++ ) |
|
| 1041 |
- {
|
|
| 1042 |
- for( c = 0; c < movie.channels; c++ ) |
|
| 1043 |
- {
|
|
| 1044 |
- val = (int)movie.frames[i].getPixel( y, x, c ) & 0xFF; |
|
| 1045 |
- if( bits > 4 && val < 0x10 ) |
|
| 1046 |
- line = line + "0" + Integer.toHexString( val ).toUpperCase( ); |
|
| 1047 |
- else |
|
| 1048 |
- line = line + Integer.toHexString( val ).toUpperCase( ); |
|
| 1049 |
- } |
|
| 1050 |
- } |
|
| 1051 |
- file.write( "\t\t<row>" + line + "</row>\n" ); |
|
| 1052 |
- } |
|
| 1053 |
- file.write( "\t</frame>\n" ); |
|
| 1054 |
- } |
|
| 1055 |
- |
|
| 1056 |
- //write blm end tag |
|
| 1057 |
- file.write( "</blm>\n" ); |
|
| 1058 |
- |
|
| 1059 |
- //close file |
|
| 1060 |
- file.close( ); |
|
| 1061 |
- |
|
| 1062 |
- //success |
|
| 1063 |
- return true; |
|
| 1064 |
- } |
|
| 1065 |
- catch( IOException e ) { }
|
|
| 1066 |
- |
|
| 1067 |
- //some error |
|
| 1068 |
- return false; |
|
| 1069 |
- } |
|
| 1070 |
- |
|
| 1071 |
- public boolean saveBbm( String filename ) |
|
| 1072 |
- {
|
|
| 1073 |
- RandomAccessFile file; |
|
| 1074 |
- byte[] header, infoHeader, framePointer, frameStartMarker, frameData; |
|
| 1075 |
- int cnt, duration, i, j, len, y, x, c, val; |
|
| 1076 |
- String infoType, infoData, line; |
|
| 1077 |
- |
|
| 1078 |
- try |
|
| 1079 |
- {
|
|
| 1080 |
- //open file |
|
| 1081 |
- file = new RandomAccessFile( filename, "rw" ); |
|
| 1082 |
- |
|
| 1083 |
- //write header |
|
| 1084 |
- header = new byte[24]; |
|
| 1085 |
- header[0] = 0x23; //magic |
|
| 1086 |
- header[1] = 0x54; |
|
| 1087 |
- header[2] = 0x26; |
|
| 1088 |
- header[3] = 0x66; |
|
| 1089 |
- header[4] = (byte)(this.height >> 8); |
|
| 1090 |
- header[5] = (byte)this.height; |
|
| 1091 |
- header[6] = (byte)(this.width >> 8); |
|
| 1092 |
- header[7] = (byte)this.width; |
|
| 1093 |
- header[8] = (byte)(this.channels >> 8); |
|
| 1094 |
- header[9] = (byte)this.channels; |
|
| 1095 |
- header[10] = (byte)(this.maxval >> 8); |
|
| 1096 |
- header[11] = (byte)this.maxval; |
|
| 1097 |
- cnt = this.getFrameCnt( ); |
|
| 1098 |
- header[12] = (byte)(cnt >> 24); |
|
| 1099 |
- header[13] = (byte)(cnt >> 16); |
|
| 1100 |
- header[14] = (byte)(cnt >> 8); |
|
| 1101 |
- header[15] = (byte)cnt; |
|
| 1102 |
- duration = 0; |
|
| 1103 |
- for( i = 0; i < cnt; i++ ) |
|
| 1104 |
- duration += this.frames[i].getDuration( ); |
|
| 1105 |
- header[16] = (byte)(duration >> 24); |
|
| 1106 |
- header[17] = (byte)(duration >> 16); |
|
| 1107 |
- header[18] = (byte)(duration >> 8); |
|
| 1108 |
- header[19] = (byte)duration; |
|
| 1109 |
- header[20] = 0; //frame pointer is written later |
|
| 1110 |
- header[21] = 0; |
|
| 1111 |
- header[22] = 0; |
|
| 1112 |
- header[23] = 0; |
|
| 1113 |
- file.write( header ); |
|
| 1114 |
- |
|
| 1115 |
- //write information |
|
| 1116 |
- cnt = this.getInfoCnt( ); |
|
| 1117 |
- for( i = 0; i < cnt; i++ ) |
|
| 1118 |
- {
|
|
| 1119 |
- infoType = this.getInfoType( i ); |
|
| 1120 |
- if( infoType.length( ) > 32760 ) |
|
| 1121 |
- infoType = infoType.substring( 0, 32760 ); |
|
| 1122 |
- infoData = this.getInfoData( i ); |
|
| 1123 |
- if( infoData.length( ) > 32760 ) |
|
| 1124 |
- infoData = infoData.substring( 0, 32760 ); |
|
| 1125 |
- len = 8 + infoType.length( ) + infoData.length( ); |
|
| 1126 |
- infoHeader = new byte[6]; |
|
| 1127 |
- infoHeader[0] = 0x69; //'i' |
|
| 1128 |
- infoHeader[1] = 0x6E; //'n' |
|
| 1129 |
- infoHeader[2] = 0x66; //'f' |
|
| 1130 |
- infoHeader[3] = 0x6F; //'o' |
|
| 1131 |
- infoHeader[4] = (byte)(len >> 8); |
|
| 1132 |
- infoHeader[5] = (byte)len; |
|
| 1133 |
- file.write( infoHeader ); |
|
| 1134 |
- file.write( (infoType + "\000" + infoData + "\000").getBytes( ) ); |
|
| 1135 |
- } |
|
| 1136 |
- |
|
| 1137 |
- //write frame pointer |
|
| 1138 |
- framePointer = new byte[4]; |
|
| 1139 |
- val = (int)file.getFilePointer( ); |
|
| 1140 |
- framePointer[0] = (byte)(val >> 24); |
|
| 1141 |
- framePointer[1] = (byte)(val >> 16); |
|
| 1142 |
- framePointer[2] = (byte)(val >> 8); |
|
| 1143 |
- framePointer[3] = (byte)val; |
|
| 1144 |
- file.seek( 20 ); |
|
| 1145 |
- file.write( framePointer ); |
|
| 1146 |
- file.seek( val ); |
|
| 1147 |
- |
|
| 1148 |
- //write frame start marker |
|
| 1149 |
- frameStartMarker = new byte[4]; |
|
| 1150 |
- frameStartMarker[0] = 0x66; //'f' |
|
| 1151 |
- frameStartMarker[1] = 0x72; //'r' |
|
| 1152 |
- frameStartMarker[2] = 0x6D; //'m' |
|
| 1153 |
- frameStartMarker[3] = 0x73; //'s' |
|
| 1154 |
- file.write( frameStartMarker ); |
|
| 1155 |
- |
|
| 1156 |
- //write frames |
|
| 1157 |
- len = 2 + this.height * this.width * this.channels; |
|
| 1158 |
- frameData = new byte[len]; |
|
| 1159 |
- cnt = this.getFrameCnt( ); |
|
| 1160 |
- for( i = 0; i < cnt; i++ ) |
|
| 1161 |
- {
|
|
| 1162 |
- val = this.frames[i].getDuration( ); |
|
| 1163 |
- frameData[0] = (byte)(val >> 8); |
|
| 1164 |
- frameData[1] = (byte)val; |
|
| 1165 |
- for( j = 2, y = 0; y < this.height; y++ ) |
|
| 1166 |
- for( x = 0; x < this.width; x++ ) |
|
| 1167 |
- for( c = 0; c < this.channels; c++, j++ ) |
|
| 1168 |
- frameData[j] = this.frames[i].getPixel( y, x, c ); |
|
| 1169 |
- file.write( frameData ); |
|
| 1170 |
- } |
|
| 1171 |
- |
|
| 1172 |
- //close file |
|
| 1173 |
- file.close( ); |
|
| 1174 |
- |
|
| 1175 |
- //success |
|
| 1176 |
- return true; |
|
| 1177 |
- } |
|
| 1178 |
- catch( IOException e ) { }
|
|
| 1179 |
- |
|
| 1180 |
- //some error |
|
| 1181 |
- return false; |
|
| 1182 |
- } |
|
| 1183 |
- |
|
| 1184 |
- public boolean save( String filename ) |
|
| 1185 |
- {
|
|
| 1186 |
- if( filename.endsWith( ".blm" ) ) |
|
| 1187 |
- return saveBlm( filename ); |
|
| 1188 |
- if( filename.endsWith( ".bmm" ) ) |
|
| 1189 |
- return saveBmm( filename ); |
|
| 1190 |
- if( filename.endsWith( ".bml" ) ) |
|
| 1191 |
- return saveBml( filename ); |
|
| 1192 |
- if( filename.endsWith( ".bbm" ) ) |
|
| 1193 |
- return saveBbm( filename ); |
|
| 1194 |
- return false; |
|
| 1195 |
- } |
|
| 1196 |
- |
|
| 1197 |
-} //public class BlinkenMovie |
| ... | ... |
@@ -1,10 +1,16 @@ |
| 1 | 1 |
BlinkenLightsInteractiveMovieProgram |
| 2 |
-Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 2 |
+Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info> |
|
| 3 | 3 |
Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
| 4 | 4 |
a blinkenarea.org project |
| 5 | 5 |
powered by eventphone.de |
| 6 | 6 |
|
| 7 |
-version 1.2.1 date 2006-01-08 |
|
| 7 |
+version 1.3 date 2006-10-10 |
|
| 8 |
+--------------------------- |
|
| 9 |
+ - added support for aspect ratio |
|
| 10 |
+ - switched to use BlinkenLib |
|
| 11 |
+ - changed class path |
|
| 12 |
+ |
|
| 13 |
+version 1.2.1 date 2006-08-01 |
|
| 8 | 14 |
----------------------------- |
| 9 | 15 |
- added bluebox format (98x7-1/128) |
| 10 | 16 |
- done by STephan Kambor <st@blinkenarea.org> |
| ... | ... |
@@ -1,51 +1,63 @@ |
| 1 | 1 |
# BlinkenLightsInteractiveMovieProgram |
| 2 |
-# version 1.2.1 date 2006-08-01 |
|
| 3 |
-# Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 2 |
+# version 1.3 date 2006-10-10 |
|
| 3 |
+# Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 | 4 |
# Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
| 5 | 5 |
# a blinkenarea.org project |
| 6 | 6 |
# powered by eventphone.de |
| 7 | 7 |
|
| 8 |
+BLINKEN_LIB=../BlinkenLibJava/BlinkenLib.jar |
|
| 9 |
+ |
|
| 8 | 10 |
JAVAC=javac |
| 9 | 11 |
JAR=jar |
| 10 | 12 |
KEYTOOL=keytool |
| 11 | 13 |
JARSIGNER=jarsigner |
| 12 | 14 |
KEYPASS=BlinkenLightsInteractiveMovieProgram |
| 13 | 15 |
JAVA=java |
| 14 |
- |
|
| 15 |
-CLASS_FILES=BlinkenFileFilter.class BlinkenFrame.class BlinkenFrameDisplay.class \ |
|
| 16 |
- BlinkenFrameDisplayListener.class BlinkenFrameDisplayInterceptor.class \ |
|
| 17 |
- BlinkenFrameEditor.class BlinkenFrameEditorListener.class \ |
|
| 18 |
- BlinkenMovie.class Blimp.class |
|
| 19 |
- |
|
| 20 |
-IMAGE_FILES=images/ColorPicker.png images/Dot.png images/Line.png \ |
|
| 21 |
- images/Rectangle.png images/FilledRectangle.png \ |
|
| 22 |
- images/Circle.png images/FilledCircle.png \ |
|
| 23 |
- images/Copy.png images/Paste.png \ |
|
| 24 |
- images/Invert.png images/MirrorHor.png images/RollLeft.png \ |
|
| 25 |
- images/Rotate90.png images/MirrorVer.png images/RollRight.png \ |
|
| 26 |
- images/Rotate180.png images/MirrorDiag.png images/RollUp.png \ |
|
| 27 |
- images/Rotate270.png images/MirrorDiag2.png images/RollDown.png \ |
|
| 28 |
- images/Undo.png images/Redo.png \ |
|
| 29 |
- images/InsertFrame.png images/DuplicateFrame.png images/DeleteFrame.png |
|
| 16 |
+P=org/blinkenarea/Blimp |
|
| 17 |
+IMG=$(P)/images |
|
| 18 |
+ |
|
| 19 |
+CLASSPATH=.:$(BLINKEN_LIB) |
|
| 20 |
+CLASS_FILES=$(P)/BlinkenFileFilter.class $(P)/BlinkenFrameDisplay.class \ |
|
| 21 |
+ $(P)/BlinkenFrameDisplayListener.class $(P)/BlinkenFrameDisplayInterceptor.class \ |
|
| 22 |
+ $(P)/BlinkenFrameEditor.class $(P)/BlinkenFrameEditorListener.class \ |
|
| 23 |
+ $(P)/Blimp.class |
|
| 24 |
+ |
|
| 25 |
+IMAGE_FILES=$(IMG)/ColorPicker.png $(IMG)/Dot.png $(IMG)/Line.png \ |
|
| 26 |
+ $(IMG)/Rectangle.png $(IMG)/FilledRectangle.png \ |
|
| 27 |
+ $(IMG)/Circle.png $(IMG)/FilledCircle.png \ |
|
| 28 |
+ $(IMG)/Copy.png $(IMG)/Paste.png \ |
|
| 29 |
+ $(IMG)/Invert.png $(IMG)/MirrorHor.png $(IMG)/RollLeft.png \ |
|
| 30 |
+ $(IMG)/Rotate90.png $(IMG)/MirrorVer.png $(IMG)/RollRight.png \ |
|
| 31 |
+ $(IMG)/Rotate180.png $(IMG)/MirrorDiag.png $(IMG)/RollUp.png \ |
|
| 32 |
+ $(IMG)/Rotate270.png $(IMG)/MirrorDiag2.png $(IMG)/RollDown.png \ |
|
| 33 |
+ $(IMG)/Undo.png $(IMG)/Redo.png \ |
|
| 34 |
+ $(IMG)/InsertFrame.png $(IMG)/DuplicateFrame.png $(IMG)/DeleteFrame.png |
|
| 30 | 35 |
|
| 31 | 36 |
.phony: all clean jar run |
| 32 | 37 |
|
| 33 |
-all: $(CLASS_FILES) |
|
| 34 |
- |
|
| 35 |
-%.class: %.java |
|
| 36 |
- $(JAVAC) $< |
|
| 38 |
+all: jar |
|
| 37 | 39 |
|
| 38 | 40 |
clean: |
| 39 | 41 |
rm -f $(CLASS_FILES) Blimp.jar |
| 40 | 42 |
|
| 41 | 43 |
jar: Blimp.jar |
| 42 | 44 |
|
| 45 |
+run: Blimp.jar |
|
| 46 |
+ $(JAVA) -jar Blimp.jar |
|
| 47 |
+ |
|
| 48 |
+%.class: %.java |
|
| 49 |
+ $(JAVAC) -classpath $(CLASSPATH) $< |
|
| 50 |
+ |
|
| 43 | 51 |
Blimp.keystore: |
| 44 |
- $(KEYTOOL) -genkey -alias Blimp -keystore Blimp.keystore -keypass $(KEYPASS) -storepass $(KEYPASS) |
|
| 52 |
+ $(KEYTOOL) -genkey -alias Blimp -dname CN=Blimp,O=blinkenarea,C=org -keypass $(KEYPASS) -keystore Blimp.keystore -storepass $(KEYPASS) -validity 3652 |
|
| 45 | 53 |
|
| 46 | 54 |
Blimp.jar: Blimp.mf Blimp.keystore $(CLASS_FILES) $(IMAGE_FILES) |
| 47 | 55 |
$(JAR) cmf Blimp.mf Blimp.jar $(CLASS_FILES) $(IMAGE_FILES) |
| 56 |
+ rm -rf jar.tmp |
|
| 57 |
+ mkdir jar.tmp |
|
| 58 |
+ cat $(BLINKEN_LIB) | ( cd jar.tmp ; $(JAR) x ) |
|
| 59 |
+ rm -rf jar.tmp/META-INF |
|
| 60 |
+ $(JAR) uf Blimp.jar -C jar.tmp . |
|
| 61 |
+ rm -rf jar.tmp |
|
| 48 | 62 |
$(JARSIGNER) -keystore Blimp.keystore -storepass $(KEYPASS) Blimp.jar Blimp |
| 49 | 63 |
|
| 50 |
-run: $(CLASS_FILES) |
|
| 51 |
- $(JAVA) Blimp |
| ... | ... |
@@ -1,77 +0,0 @@ |
| 1 |
-<?xml version="1.0" encoding="UTF-8"?> |
|
| 2 |
-<blm width="26" height="20" bits="8" channels="3"> |
|
| 3 |
- <header> |
|
| 4 |
- <description>type1: info1</description> |
|
| 5 |
- <description>type2: info2</description> |
|
| 6 |
- <description>type2: info2</description> |
|
| 7 |
- </header> |
|
| 8 |
- |
|
| 9 |
- <frame duration="1000"> |
|
| 10 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 11 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 12 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 13 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 14 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 15 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 16 |
- <row>000000000000000000000000000000600000800000900000900000900000900000900000900000900000900000A00000A00000A00000A00000A00000A00000600000000000000000000000000000</row> |
|
| 17 |
- <row>000000000000000000000000000000A00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000800000000000000000000000000000</row> |
|
| 18 |
- <row>000000000000000000000000000000800000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000800000000000000000000000000000</row> |
|
| 19 |
- <row>000000000000000000000000000000800000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000800000000000000000000000000000</row> |
|
| 20 |
- <row>000000000000000000000000000000700000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000800000000000000000000000000000</row> |
|
| 21 |
- <row>000000000000000000000000000000500000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000800000000000000000000000000000</row> |
|
| 22 |
- <row>000000000000000000000000000000500000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000800000000000000000000000000000</row> |
|
| 23 |
- <row>000000000000000000000000000000400000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000800000000000000000000000000000</row> |
|
| 24 |
- <row>000000000000000000000000000000100000600000600000600000500000500000500000500000500000400000400000400000300000300000300000200000100000000000000000000000000000</row> |
|
| 25 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 26 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 27 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 28 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 29 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 30 |
- </frame> |
|
| 31 |
- |
|
| 32 |
- <frame duration="1000"> |
|
| 33 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 34 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 35 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 36 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 37 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 38 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 39 |
- <row>00000000000000000000000000000000600000800000B00000B00000B00000B00000B00000B00000B00000B00000A00000A00000A00000A00000A00000A000006000000000000000000000000000</row> |
|
| 40 |
- <row>00000000000000000000000000000000A00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000008000000000000000000000000000</row> |
|
| 41 |
- <row>00000000000000000000000000000000800000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000008000000000000000000000000000</row> |
|
| 42 |
- <row>00000000000000000000000000000000800000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000008000000000000000000000000000</row> |
|
| 43 |
- <row>00000000000000000000000000000000700000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000008000000000000000000000000000</row> |
|
| 44 |
- <row>00000000000000000000000000000000500000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000008000000000000000000000000000</row> |
|
| 45 |
- <row>00000000000000000000000000000000500000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000008000000000000000000000000000</row> |
|
| 46 |
- <row>00000000000000000000000000000000400000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000008000000000000000000000000000</row> |
|
| 47 |
- <row>000000000000000000000000000000001000006000006000006000005000005000005000005000005000004000004000004000003000003000003000002000001000000000000000000000000000</row> |
|
| 48 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 49 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 50 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 51 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 52 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 53 |
- </frame> |
|
| 54 |
- |
|
| 55 |
- <frame duration="500"> |
|
| 56 |
- <row>0000FFFF00FF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080</row> |
|
| 57 |
- <row>00FFFFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 58 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 59 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 60 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 61 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 62 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 63 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 64 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 65 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 66 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 67 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 68 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 69 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 70 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 71 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 72 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 73 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 74 |
- <row>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</row> |
|
| 75 |
- <row>0000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF</row> |
|
| 76 |
- </frame> |
|
| 77 |
-</blm> |
| ... | ... |
@@ -0,0 +1,30 @@ |
| 1 |
+#! /bin/sh |
|
| 2 |
+ |
|
| 3 |
+NAME=Blimp |
|
| 4 |
+VERSION_FILE=Makefile |
|
| 5 |
+ |
|
| 6 |
+VERSION=$(cat $VERSION_FILE | grep 'version [0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?' | sed 's/^.*version \([0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*$/\1/') |
|
| 7 |
+DATE=$(cat $VERSION_FILE | grep 'date [0-9]\+-[0-9]\+-[0-9]\+' | sed 's/^.*date \([0-9]\+-[0-9]\+-[0-9]\+\).*$/\1/') |
|
| 8 |
+ |
|
| 9 |
+PACK="${NAME}-${VERSION}_${DATE}"
|
|
| 10 |
+ |
|
| 11 |
+FILES="ChangeLog Makefile org/blinkenarea/Blimp/*.java org/blinkenarea/Blimp/images/* Blimp.mf Blimp.html mkpack.sh" |
|
| 12 |
+ |
|
| 13 |
+rm -rf $PACK |
|
| 14 |
+mkdir $PACK |
|
| 15 |
+ |
|
| 16 |
+for FILE in $FILES |
|
| 17 |
+do |
|
| 18 |
+ mkdir -p $(dirname $PACK/$FILE) |
|
| 19 |
+ cp $FILE $PACK/$FILE |
|
| 20 |
+done |
|
| 21 |
+ |
|
| 22 |
+ARCH=$PACK.tar.bz2 |
|
| 23 |
+if [ -f $ARCH ] |
|
| 24 |
+then |
|
| 25 |
+ ARCH=$ARCH.new |
|
| 26 |
+fi |
|
| 27 |
+ |
|
| 28 |
+tar jcf $ARCH $PACK |
|
| 29 |
+rm -rf $PACK |
|
| 30 |
+ |
| ... | ... |
@@ -1,11 +1,13 @@ |
| 1 | 1 |
/* BlinkenLightsInteractiveMovieProgram |
| 2 |
- * version 1.2.1 date 2006-08-01 |
|
| 3 |
- * Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 2 |
+ * version 1.3 date 2006-10-10 |
|
| 3 |
+ * Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 | 4 |
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
| 5 | 5 |
* a blinkenarea.org project |
| 6 | 6 |
* powered by eventphone.de |
| 7 | 7 |
*/ |
| 8 | 8 |
|
| 9 |
+package org.blinkenarea.Blimp; |
|
| 10 |
+ |
|
| 9 | 11 |
import java.applet.*; |
| 10 | 12 |
import java.awt.*; |
| 11 | 13 |
import java.awt.event.*; |
| ... | ... |
@@ -17,6 +19,7 @@ import java.io.*; |
| 17 | 19 |
import java.util.*; |
| 18 | 20 |
import java.util.regex.*; |
| 19 | 21 |
import java.net.*; |
| 22 |
+import org.blinkenarea.BlinkenLib.*; |
|
| 20 | 23 |
|
| 21 | 24 |
public class Blimp extends JApplet |
| 22 | 25 |
implements Runnable, WindowListener, ActionListener, |
| ... | ... |
@@ -27,6 +30,7 @@ public class Blimp extends JApplet |
| 27 | 30 |
static final int constColorCntX = 2, constColorCntY = 4; |
| 28 | 31 |
static final int constColorCnt = constColorCntX * constColorCntY; |
| 29 | 32 |
static final int defHeight = 8, defWidth = 8, defChannels = 1, defMaxval = 127, defDuration = 100; |
| 33 |
+ static final int ZoomAspectResolution = 30; |
|
| 30 | 34 |
|
| 31 | 35 |
//configuration variables |
| 32 | 36 |
boolean isFullApp = false; //if running as full application |
| ... | ... |
@@ -51,7 +55,10 @@ public class Blimp extends JApplet |
| 51 | 55 |
JPanel panelMiddleFrame, panelFrame, panelDuration, panelColors; |
| 52 | 56 |
JLabel labelStatus, labelFrames, labelSelFrames, labelFrameInfo, labelDuration; |
| 53 | 57 |
JScrollBar scrollFrames; |
| 54 |
- JSlider sliderFrameZoom; |
|
| 58 |
+ JPanel panelZoom, panelZoomName, panelAspect, panelAspectName; |
|
| 59 |
+ JLabel labelZoomName, labelZoom, labelAspectName, labelAspect; |
|
| 60 |
+ JSlider sliderZoom, sliderAspect; |
|
| 61 |
+ JTextField textZoom, textAspect; |
|
| 55 | 62 |
BlinkenFrameEditor frameEditor; |
| 56 | 63 |
JScrollPane scrollpaneFrame; |
| 57 | 64 |
JTextField textDuration; |
| ... | ... |
@@ -87,6 +94,9 @@ public class Blimp extends JApplet |
| 87 | 94 |
BlinkenFrame curFrame = null; //current frame |
| 88 | 95 |
int frameSelStart = -1, frameSelEnd = -1; //selected frames (none selected yet) |
| 89 | 96 |
|
| 97 |
+ //other variables |
|
| 98 |
+ boolean noRecurseZoomAspect = false; //set when changing zoom or aspect value per program to inhibit recursion triggered by events |
|
| 99 |
+ |
|
| 90 | 100 |
//constructor for applet |
| 91 | 101 |
public Blimp( ) |
| 92 | 102 |
{
|
| ... | ... |
@@ -150,7 +160,7 @@ public class Blimp extends JApplet |
| 150 | 160 |
labelStatus.setText( "new movie..." ); |
| 151 | 161 |
curFile = null; |
| 152 | 162 |
curMovie = new BlinkenMovie( defHeight, defWidth, defChannels, defMaxval ); |
| 153 |
- curMovie.insertInfo( 0, "creator", "Blimp (version 1.2.1 date 2006-08-01)" ); |
|
| 163 |
+ curMovie.insertInfo( 0, "creator", "Blimp (version 1.3 date 2006-10-10)" ); |
|
| 154 | 164 |
curMovie.insertFrame( 0, new BlinkenFrame( defHeight, defWidth, defChannels, defMaxval, defDuration ) ); |
| 155 | 165 |
curMovieChanged = false; |
| 156 | 166 |
|
| ... | ... |
@@ -472,16 +482,16 @@ public class Blimp extends JApplet |
| 472 | 482 |
//"Edit Insert Frame" was chosen from menu / Insert Frame button was pressed |
| 473 | 483 |
private void actionEditInsertFrame( ) |
| 474 | 484 |
{
|
| 475 |
- BlinkenFrame frame; |
|
| 485 |
+ BlinkenFrame newFrame; |
|
| 476 | 486 |
int frameCnt, frameNo; |
| 477 | 487 |
|
| 478 | 488 |
//create new empty frame |
| 479 |
- frame = new BlinkenFrame( curMovie.getHeight( ), curMovie.getWidth( ), |
|
| 489 |
+ newFrame = new BlinkenFrame( curMovie.getHeight( ), curMovie.getWidth( ), |
|
| 480 | 490 |
curMovie.getChannels( ), curMovie.getMaxval( ), defDuration ); |
| 481 |
- frame.clear( ); |
|
| 491 |
+ newFrame.clear( ); |
|
| 482 | 492 |
//copy duration if there is a current frame |
| 483 | 493 |
if( curFrame != null ) |
| 484 |
- frame.setDuration( curFrame.getDuration( ) ); |
|
| 494 |
+ newFrame.setDuration( curFrame.getDuration( ) ); |
|
| 485 | 495 |
|
| 486 | 496 |
//insert frame behind current position |
| 487 | 497 |
frameCnt = curMovie.getFrameCnt( ); |
| ... | ... |
@@ -490,7 +500,7 @@ public class Blimp extends JApplet |
| 490 | 500 |
frameNo = 0; |
| 491 | 501 |
if( frameNo > frameCnt ) |
| 492 | 502 |
frameNo = frameCnt; |
| 493 |
- curMovie.insertFrame( frameNo, frame ); |
|
| 503 |
+ curMovie.insertFrame( frameNo, newFrame ); |
|
| 494 | 504 |
curMovieChanged = true; |
| 495 | 505 |
|
| 496 | 506 |
//update controls |
| ... | ... |
@@ -500,7 +510,7 @@ public class Blimp extends JApplet |
| 500 | 510 |
//"Edit Duplicate Frame" was chosen from menu / Duplicate Frame button was pressed |
| 501 | 511 |
private void actionEditDuplicateFrame( ) |
| 502 | 512 |
{
|
| 503 |
- BlinkenFrame frame; |
|
| 513 |
+ BlinkenFrame newFrame; |
|
| 504 | 514 |
int frameCnt, frameNo; |
| 505 | 515 |
|
| 506 | 516 |
//do nothing if there is no current frame |
| ... | ... |
@@ -508,7 +518,7 @@ public class Blimp extends JApplet |
| 508 | 518 |
return; |
| 509 | 519 |
|
| 510 | 520 |
//duplicate current frame |
| 511 |
- frame = new BlinkenFrame( curFrame ); |
|
| 521 |
+ newFrame = new BlinkenFrame( curFrame ); |
|
| 512 | 522 |
|
| 513 | 523 |
//insert frame behind current position |
| 514 | 524 |
frameCnt = curMovie.getFrameCnt( ); |
| ... | ... |
@@ -517,7 +527,7 @@ public class Blimp extends JApplet |
| 517 | 527 |
frameNo = 0; |
| 518 | 528 |
if( frameNo > frameCnt ) |
| 519 | 529 |
frameNo = frameCnt; |
| 520 |
- curMovie.insertFrame( frameNo, frame ); |
|
| 530 |
+ curMovie.insertFrame( frameNo, newFrame ); |
|
| 521 | 531 |
curMovieChanged = true; |
| 522 | 532 |
|
| 523 | 533 |
//update controls |
| ... | ... |
@@ -551,7 +561,7 @@ public class Blimp extends JApplet |
| 551 | 561 |
ImageIcon icon; |
| 552 | 562 |
Image image; |
| 553 | 563 |
BufferedImage bufferedImage; |
| 554 |
- BlinkenFrame frame; |
|
| 564 |
+ BlinkenFrame newFrame; |
|
| 555 | 565 |
int width, height, x, y, i, frameCnt, frameNo; |
| 556 | 566 |
|
| 557 | 567 |
//show file select dialog |
| ... | ... |
@@ -590,19 +600,19 @@ public class Blimp extends JApplet |
| 590 | 600 |
bufferedImage.getGraphics( ).drawImage( image, 0, 0, width, height, null ); |
| 591 | 601 |
|
| 592 | 602 |
//create new empty frame |
| 593 |
- frame = new BlinkenFrame( height, width, |
|
| 603 |
+ newFrame = new BlinkenFrame( height, width, |
|
| 594 | 604 |
curMovie.getChannels( ), curMovie.getMaxval( ), defDuration ); |
| 595 |
- height = frame.getHeight( ); //dimensions might have been invalid and thus been adapted |
|
| 596 |
- width = frame.getWidth( ); |
|
| 597 |
- frame.clear( ); |
|
| 605 |
+ height = newFrame.getHeight( ); //dimensions might have been invalid and thus been adapted |
|
| 606 |
+ width = newFrame.getWidth( ); |
|
| 607 |
+ newFrame.clear( ); |
|
| 598 | 608 |
//copy duration if there is a current frame |
| 599 | 609 |
if( curFrame != null ) |
| 600 |
- frame.setDuration( curFrame.getDuration( ) ); |
|
| 610 |
+ newFrame.setDuration( curFrame.getDuration( ) ); |
|
| 601 | 611 |
|
| 602 | 612 |
//put pixels of image into frame |
| 603 | 613 |
for( y = 0; y < height; y++ ) |
| 604 | 614 |
for( x = 0; x < width; x++ ) |
| 605 |
- frame.setColor( y, x, new Color( bufferedImage.getRGB( x, y ) ) ); |
|
| 615 |
+ newFrame.setColor( y, x, new Color( bufferedImage.getRGB( x, y ) ) ); |
|
| 606 | 616 |
|
| 607 | 617 |
//insert frame behind current position |
| 608 | 618 |
frameCnt = curMovie.getFrameCnt( ); |
| ... | ... |
@@ -611,7 +621,7 @@ public class Blimp extends JApplet |
| 611 | 621 |
frameNo = 0; |
| 612 | 622 |
if( frameNo > frameCnt ) |
| 613 | 623 |
frameNo = frameCnt; |
| 614 |
- curMovie.insertFrame( frameNo, frame ); //this resizes the frame to fit the movie dimensions |
|
| 624 |
+ curMovie.insertFrame( frameNo, newFrame ); //this resizes the frame to fit the movie dimensions |
|
| 615 | 625 |
curMovieChanged = true; |
| 616 | 626 |
|
| 617 | 627 |
//show status message |
| ... | ... |
@@ -627,7 +637,7 @@ public class Blimp extends JApplet |
| 627 | 637 |
{
|
| 628 | 638 |
JFileChooser fileChooser; |
| 629 | 639 |
BlinkenMovie movie; |
| 630 |
- BlinkenFrame frame; |
|
| 640 |
+ BlinkenFrame newFrame; |
|
| 631 | 641 |
int frameCnt, frameNo, cnt, i; |
| 632 | 642 |
|
| 633 | 643 |
//show file select dialog |
| ... | ... |
@@ -659,8 +669,8 @@ public class Blimp extends JApplet |
| 659 | 669 |
cnt = movie.getFrameCnt( ); |
| 660 | 670 |
for( i = 0; i < cnt; i++ ) |
| 661 | 671 |
{
|
| 662 |
- frame = new BlinkenFrame( movie.getFrame( i ) ); |
|
| 663 |
- curMovie.insertFrame( frameNo + i, frame ); //this resizes the frame to fit the movie dimensions |
|
| 672 |
+ newFrame = new BlinkenFrame( movie.getFrame( i ) ); |
|
| 673 |
+ curMovie.insertFrame( frameNo + i, newFrame ); //this resizes the frame to fit the movie dimensions |
|
| 664 | 674 |
} |
| 665 | 675 |
curMovieChanged = true; |
| 666 | 676 |
|
| ... | ... |
@@ -946,8 +956,8 @@ public class Blimp extends JApplet |
| 946 | 956 |
{
|
| 947 | 957 |
JOptionPane.showMessageDialog( dialogParent, |
| 948 | 958 |
"BlinkenLightsInteractiveMovieProgram\n" + |
| 949 |
- "version 1.2.1 date 2006-08-01\n" + |
|
| 950 |
- "Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info>\n" + |
|
| 959 |
+ "version 1.3 date 2006-10-10\n" + |
|
| 960 |
+ "Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info>\n" + |
|
| 951 | 961 |
"Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html\n" + |
| 952 | 962 |
"a blinkenarea.org project\n" + |
| 953 | 963 |
"powered by eventphone.de", |
| ... | ... |
@@ -1061,11 +1071,165 @@ public class Blimp extends JApplet |
| 1061 | 1071 |
menuFrameSelDelete.setEnabled( valid ); |
| 1062 | 1072 |
} |
| 1063 | 1073 |
|
| 1064 |
- //frame zoom changed |
|
| 1065 |
- private void stateFrameZoom( ) |
|
| 1074 |
+ //set zoom and aspect value of frame |
|
| 1075 |
+ private void setZoomAspect( ) |
|
| 1066 | 1076 |
{
|
| 1077 |
+ //get new zoom value |
|
| 1078 |
+ double zoom = Math.pow( 2.0, (double)sliderZoom.getValue( ) / (double)ZoomAspectResolution ); |
|
| 1079 |
+ |
|
| 1080 |
+ //get new aspect value |
|
| 1081 |
+ double aspect = Math.pow( 2.0, (double)sliderAspect.getValue( ) / (double)ZoomAspectResolution ); |
|
| 1082 |
+ |
|
| 1067 | 1083 |
//update frame |
| 1068 |
- frameEditor.setZoom( sliderFrameZoom.getValue( ) ); |
|
| 1084 |
+ frameEditor.setZoomAspect( zoom, aspect ); |
|
| 1085 |
+ |
|
| 1086 |
+ //update zoom value |
|
| 1087 |
+ String txtZoom = new Double( frameEditor.getZoom( ) ).toString( ); |
|
| 1088 |
+ if( txtZoom.length( ) > 4 ) |
|
| 1089 |
+ txtZoom = txtZoom.substring( 0, 4 ); |
|
| 1090 |
+ labelZoom.setText( txtZoom ); |
|
| 1091 |
+ |
|
| 1092 |
+ //update aspect value |
|
| 1093 |
+ String txtAspect = new Double( frameEditor.getAspect( ) ).toString( ); |
|
| 1094 |
+ if( txtAspect.length( ) > 4 ) |
|
| 1095 |
+ txtAspect = txtAspect.substring( 0, 4 ); |
|
| 1096 |
+ labelAspect.setText( txtAspect ); |
|
| 1097 |
+ } |
|
| 1098 |
+ |
|
| 1099 |
+ //show zoom value |
|
| 1100 |
+ private void showZoom( ) |
|
| 1101 |
+ {
|
|
| 1102 |
+ if( noRecurseZoomAspect ) |
|
| 1103 |
+ return; |
|
| 1104 |
+ |
|
| 1105 |
+ //get zoom value |
|
| 1106 |
+ double zoom = Math.pow( 2.0, (double)sliderZoom.getValue( ) / (double)ZoomAspectResolution ); |
|
| 1107 |
+ |
|
| 1108 |
+ //convert zoom value to string |
|
| 1109 |
+ String txtZoom = new Double( zoom ).toString( ); |
|
| 1110 |
+ if( txtZoom.length( ) > 4 ) |
|
| 1111 |
+ txtZoom = txtZoom.substring( 0, 4 ); |
|
| 1112 |
+ |
|
| 1113 |
+ //show zoom value without triggering events |
|
| 1114 |
+ noRecurseZoomAspect = true; |
|
| 1115 |
+ textZoom.setText( txtZoom ); |
|
| 1116 |
+ noRecurseZoomAspect = false; |
|
| 1117 |
+ } |
|
| 1118 |
+ |
|
| 1119 |
+ //new zoom value is being entered |
|
| 1120 |
+ private void changeZoom( ) |
|
| 1121 |
+ {
|
|
| 1122 |
+ if( noRecurseZoomAspect ) |
|
| 1123 |
+ return; |
|
| 1124 |
+ |
|
| 1125 |
+ try |
|
| 1126 |
+ {
|
|
| 1127 |
+ //get new zoom value |
|
| 1128 |
+ double zoom = Double.parseDouble( textZoom.getText( ) ); |
|
| 1129 |
+ |
|
| 1130 |
+ //set new zoom value without triggering events |
|
| 1131 |
+ noRecurseZoomAspect = true; |
|
| 1132 |
+ sliderZoom.setValue( (int)((Math.log( zoom ) / Math.log( 2.0 )) * (double)ZoomAspectResolution + 0.5) ); |
|
| 1133 |
+ noRecurseZoomAspect = false; |
|
| 1134 |
+ |
|
| 1135 |
+ //set zoom and aspect value of frame |
|
| 1136 |
+ setZoomAspect( ); |
|
| 1137 |
+ } |
|
| 1138 |
+ catch( NumberFormatException e ) { }
|
|
| 1139 |
+ } |
|
| 1140 |
+ |
|
| 1141 |
+ //new zoom value was entered |
|
| 1142 |
+ private void validateZoom( ) |
|
| 1143 |
+ {
|
|
| 1144 |
+ if( noRecurseZoomAspect ) |
|
| 1145 |
+ return; |
|
| 1146 |
+ |
|
| 1147 |
+ //process changes made zoom value |
|
| 1148 |
+ changeZoom( ); |
|
| 1149 |
+ |
|
| 1150 |
+ //redisplay new zoom value |
|
| 1151 |
+ showZoom( ); |
|
| 1152 |
+ } |
|
| 1153 |
+ |
|
| 1154 |
+ //zoom value changed |
|
| 1155 |
+ private void stateZoom( ) |
|
| 1156 |
+ {
|
|
| 1157 |
+ if( noRecurseZoomAspect ) |
|
| 1158 |
+ return; |
|
| 1159 |
+ |
|
| 1160 |
+ //set zoom and aspect value of frame |
|
| 1161 |
+ setZoomAspect( ); |
|
| 1162 |
+ |
|
| 1163 |
+ //redisplay new zoom value |
|
| 1164 |
+ showZoom( ); |
|
| 1165 |
+ } |
|
| 1166 |
+ |
|
| 1167 |
+ //show aspect value |
|
| 1168 |
+ private void showAspect( ) |
|
| 1169 |
+ {
|
|
| 1170 |
+ if( noRecurseZoomAspect ) |
|
| 1171 |
+ return; |
|
| 1172 |
+ |
|
| 1173 |
+ //get aspect value |
|
| 1174 |
+ double aspect = Math.pow( 2.0, (double)sliderAspect.getValue( ) / (double)ZoomAspectResolution ); |
|
| 1175 |
+ |
|
| 1176 |
+ //convert aspect value to string |
|
| 1177 |
+ String txtAspect = new Double( aspect ).toString( ); |
|
| 1178 |
+ if( txtAspect.length( ) > 4 ) |
|
| 1179 |
+ txtAspect = txtAspect.substring( 0, 4 ); |
|
| 1180 |
+ |
|
| 1181 |
+ //show aspect value without triggering events |
|
| 1182 |
+ noRecurseZoomAspect = true; |
|
| 1183 |
+ textAspect.setText( txtAspect ); |
|
| 1184 |
+ noRecurseZoomAspect = false; |
|
| 1185 |
+ } |
|
| 1186 |
+ |
|
| 1187 |
+ //new aspect value is being entered |
|
| 1188 |
+ private void changeAspect( ) |
|
| 1189 |
+ {
|
|
| 1190 |
+ if( noRecurseZoomAspect ) |
|
| 1191 |
+ return; |
|
| 1192 |
+ |
|
| 1193 |
+ try |
|
| 1194 |
+ {
|
|
| 1195 |
+ //get new aspect value |
|
| 1196 |
+ double aspect = Double.parseDouble( textAspect.getText( ) ); |
|
| 1197 |
+ |
|
| 1198 |
+ //set new aspect value without triggering events |
|
| 1199 |
+ noRecurseZoomAspect = true; |
|
| 1200 |
+ sliderAspect.setValue( (int)((Math.log( aspect ) / Math.log( 2.0 )) * (double)ZoomAspectResolution + 0.5) ); |
|
| 1201 |
+ noRecurseZoomAspect = false; |
|
| 1202 |
+ |
|
| 1203 |
+ //set zoom and aspect value of frame |
|
| 1204 |
+ setZoomAspect( ); |
|
| 1205 |
+ } |
|
| 1206 |
+ catch( NumberFormatException e ) { }
|
|
| 1207 |
+ } |
|
| 1208 |
+ |
|
| 1209 |
+ //new aspect value was entered |
|
| 1210 |
+ private void validateAspect( ) |
|
| 1211 |
+ {
|
|
| 1212 |
+ if( noRecurseZoomAspect ) |
|
| 1213 |
+ return; |
|
| 1214 |
+ |
|
| 1215 |
+ //process changes made aspect value |
|
| 1216 |
+ changeAspect( ); |
|
| 1217 |
+ |
|
| 1218 |
+ //redisplay new aspect value |
|
| 1219 |
+ showAspect( ); |
|
| 1220 |
+ } |
|
| 1221 |
+ |
|
| 1222 |
+ //aspect value changed |
|
| 1223 |
+ private void stateAspect( ) |
|
| 1224 |
+ {
|
|
| 1225 |
+ if( noRecurseZoomAspect ) |
|
| 1226 |
+ return; |
|
| 1227 |
+ |
|
| 1228 |
+ //set zoom and aspect value of frame |
|
| 1229 |
+ setZoomAspect( ); |
|
| 1230 |
+ |
|
| 1231 |
+ //redisplay new aspect value |
|
| 1232 |
+ showAspect( ); |
|
| 1069 | 1233 |
} |
| 1070 | 1234 |
|
| 1071 | 1235 |
//show duration |
| ... | ... |
@@ -1463,6 +1627,10 @@ public class Blimp extends JApplet |
| 1463 | 1627 |
actionPlayTimer( ); |
| 1464 | 1628 |
else if( e.getSource( ) == menuHelpAbout ) |
| 1465 | 1629 |
actionHelpAbout( ); |
| 1630 |
+ else if( e.getSource( ) == textZoom ) |
|
| 1631 |
+ validateZoom( ); |
|
| 1632 |
+ else if( e.getSource( ) == textAspect ) |
|
| 1633 |
+ validateAspect( ); |
|
| 1466 | 1634 |
else if( e.getSource( ) == textDuration ) |
| 1467 | 1635 |
validateDuration( ); |
| 1468 | 1636 |
else if( e.getSource( ) == buttonToolsNone ) |
| ... | ... |
@@ -1545,8 +1713,10 @@ public class Blimp extends JApplet |
| 1545 | 1713 |
//some GUI state changed |
| 1546 | 1714 |
public void stateChanged( ChangeEvent e ) |
| 1547 | 1715 |
{
|
| 1548 |
- if( e.getSource( ) == sliderFrameZoom ) |
|
| 1549 |
- stateFrameZoom( ); |
|
| 1716 |
+ if( e.getSource( ) == sliderZoom ) |
|
| 1717 |
+ stateZoom( ); |
|
| 1718 |
+ else if( e.getSource( ) == sliderAspect ) |
|
| 1719 |
+ stateAspect( ); |
|
| 1550 | 1720 |
else if( e.getSource( ) == sliderColorsAlpha ) |
| 1551 | 1721 |
stateColorsAlpha( ); |
| 1552 | 1722 |
} |
| ... | ... |
@@ -1559,7 +1729,11 @@ public class Blimp extends JApplet |
| 1559 | 1729 |
//a control lost the focus |
| 1560 | 1730 |
public void focusLost( FocusEvent e ) |
| 1561 | 1731 |
{
|
| 1562 |
- if( e.getSource( ) == textDuration ) |
|
| 1732 |
+ if( e.getSource( ) == textZoom ) |
|
| 1733 |
+ validateZoom( ); |
|
| 1734 |
+ else if( e.getSource( ) == textAspect ) |
|
| 1735 |
+ validateAspect( ); |
|
| 1736 |
+ else if( e.getSource( ) == textDuration ) |
|
| 1563 | 1737 |
validateDuration( ); |
| 1564 | 1738 |
else if( e.getSource( ) == textColorsColor ) |
| 1565 | 1739 |
validateColorsColor( ); |
| ... | ... |
@@ -1570,7 +1744,11 @@ public class Blimp extends JApplet |
| 1570 | 1744 |
//something was changed in a document |
| 1571 | 1745 |
public void changedUpdate( DocumentEvent e ) |
| 1572 | 1746 |
{
|
| 1573 |
- if( e.getDocument( ) == textDuration.getDocument( ) ) |
|
| 1747 |
+ if( e.getDocument( ) == textZoom.getDocument( ) ) |
|
| 1748 |
+ changeZoom( ); |
|
| 1749 |
+ else if( e.getDocument( ) == textAspect.getDocument( ) ) |
|
| 1750 |
+ changeAspect( ); |
|
| 1751 |
+ else if( e.getDocument( ) == textDuration.getDocument( ) ) |
|
| 1574 | 1752 |
changeDuration( ); |
| 1575 | 1753 |
else if( e.getDocument( ) == textColorsColor.getDocument( ) ) |
| 1576 | 1754 |
changeColorsColor( ); |
| ... | ... |
@@ -1581,7 +1759,11 @@ public class Blimp extends JApplet |
| 1581 | 1759 |
//something was inserted into a document |
| 1582 | 1760 |
public void insertUpdate( DocumentEvent e ) |
| 1583 | 1761 |
{
|
| 1584 |
- if( e.getDocument( ) == textDuration.getDocument( ) ) |
|
| 1762 |
+ if( e.getDocument( ) == textZoom.getDocument( ) ) |
|
| 1763 |
+ changeZoom( ); |
|
| 1764 |
+ else if( e.getDocument( ) == textAspect.getDocument( ) ) |
|
| 1765 |
+ changeAspect( ); |
|
| 1766 |
+ else if( e.getDocument( ) == textDuration.getDocument( ) ) |
|
| 1585 | 1767 |
changeDuration( ); |
| 1586 | 1768 |
} |
| 1587 | 1769 |
|
| ... | ... |
@@ -1639,7 +1821,7 @@ public class Blimp extends JApplet |
| 1639 | 1821 |
//initialize current movie, frame |
| 1640 | 1822 |
curDir = new File( "." ); |
| 1641 | 1823 |
curMovie = new BlinkenMovie( defHeight, defWidth, defChannels, defMaxval ); |
| 1642 |
- curMovie.insertInfo( 0, "creator", "Blimp (version 1.2.1 date 2006-08-01)" ); |
|
| 1824 |
+ curMovie.insertInfo( 0, "creator", "Blimp (version 1.3 date 2006-10-10)" ); |
|
| 1643 | 1825 |
curMovie.insertFrame( 0, new BlinkenFrame( defHeight, defWidth, defChannels, defMaxval, defDuration ) ); |
| 1644 | 1826 |
curFrame = null; |
| 1645 | 1827 |
|
| ... | ... |
@@ -1885,14 +2067,48 @@ public class Blimp extends JApplet |
| 1885 | 2067 |
//frame panel |
| 1886 | 2068 |
panelFrame = new JPanel( new BorderLayout( 5, 5 ) ); |
| 1887 | 2069 |
panelMiddleFrame.add( panelFrame, BorderLayout.CENTER ); |
| 1888 |
- sliderFrameZoom = new JSlider( JSlider.VERTICAL, 0, 6, 3 ); |
|
| 1889 |
- sliderFrameZoom.setSnapToTicks( true ); |
|
| 1890 |
- sliderFrameZoom.setInverted( true ); |
|
| 1891 |
- sliderFrameZoom.addChangeListener( this ); |
|
| 1892 |
- sliderFrameZoom.setToolTipText( "Zoom" ); |
|
| 1893 |
- panelFrame.add( sliderFrameZoom, BorderLayout.EAST ); |
|
| 2070 |
+ panelZoom = new JPanel( new BorderLayout( 5, 5 ) ); |
|
| 2071 |
+ panelFrame.add( panelZoom, BorderLayout.EAST ); |
|
| 2072 |
+ panelZoomName = new JPanel( new GridLayout( 2, 1, 0, 0 ) ); |
|
| 2073 |
+ panelZoom.add( panelZoomName, BorderLayout.NORTH ); |
|
| 2074 |
+ labelZoomName = new JLabel( "zoom", JLabel.CENTER ); |
|
| 2075 |
+ panelZoomName.add( labelZoomName ); |
|
| 2076 |
+ labelZoom = new JLabel( "", JLabel.CENTER ); |
|
| 2077 |
+ panelZoomName.add( labelZoom ); |
|
| 2078 |
+ sliderZoom = new JSlider( JSlider.VERTICAL, 0, 6 * ZoomAspectResolution, 3 * ZoomAspectResolution ); |
|
| 2079 |
+ sliderZoom.setSnapToTicks( true ); |
|
| 2080 |
+ sliderZoom.setInverted( true ); |
|
| 2081 |
+ sliderZoom.addChangeListener( this ); |
|
| 2082 |
+ sliderZoom.setToolTipText( "zoom" ); |
|
| 2083 |
+ panelZoom.add( sliderZoom, BorderLayout.CENTER ); |
|
| 2084 |
+ labelZoom.setLabelFor( sliderZoom ); |
|
| 2085 |
+ textZoom = new JTextField( 4 ); |
|
| 2086 |
+ textZoom.setHorizontalAlignment( JTextField.CENTER ); |
|
| 2087 |
+ textZoom.getDocument( ).addDocumentListener( this ); |
|
| 2088 |
+ textZoom.addActionListener( this ); |
|
| 2089 |
+ textZoom.addFocusListener( this ); |
|
| 2090 |
+ panelZoom.add( textZoom, BorderLayout.SOUTH ); |
|
| 2091 |
+ panelAspect = new JPanel( new BorderLayout( 5, 5 ) ); |
|
| 2092 |
+ panelFrame.add( panelAspect, BorderLayout.WEST ); |
|
| 2093 |
+ panelAspectName = new JPanel( new GridLayout( 2, 1, 0, 0 ) ); |
|
| 2094 |
+ panelAspect.add( panelAspectName, BorderLayout.NORTH ); |
|
| 2095 |
+ labelAspectName = new JLabel( "aspect", JLabel.CENTER ); |
|
| 2096 |
+ panelAspectName.add( labelAspectName ); |
|
| 2097 |
+ labelAspect = new JLabel( "", JLabel.CENTER ); |
|
| 2098 |
+ panelAspectName.add( labelAspect ); |
|
| 2099 |
+ sliderAspect = new JSlider( JSlider.VERTICAL, -3 * ZoomAspectResolution, 3 * ZoomAspectResolution, 0 ); |
|
| 2100 |
+ sliderAspect.setSnapToTicks( true ); |
|
| 2101 |
+ sliderAspect.addChangeListener( this ); |
|
| 2102 |
+ sliderAspect.setToolTipText( "aspect" ); |
|
| 2103 |
+ panelAspect.add( sliderAspect, BorderLayout.CENTER ); |
|
| 2104 |
+ labelAspect.setLabelFor( sliderAspect ); |
|
| 2105 |
+ textAspect = new JTextField( 4 ); |
|
| 2106 |
+ textAspect.setHorizontalAlignment( JTextField.CENTER ); |
|
| 2107 |
+ textAspect.getDocument( ).addDocumentListener( this ); |
|
| 2108 |
+ textAspect.addActionListener( this ); |
|
| 2109 |
+ textAspect.addFocusListener( this ); |
|
| 2110 |
+ panelAspect.add( textAspect, BorderLayout.SOUTH ); |
|
| 1894 | 2111 |
frameEditor = new BlinkenFrameEditor( ); |
| 1895 |
- frameEditor.setZoom( sliderFrameZoom.getValue( ) ); |
|
| 1896 | 2112 |
scrollpaneFrame = new JScrollPane( frameEditor ); |
| 1897 | 2113 |
panelFrame.add( scrollpaneFrame, BorderLayout.CENTER ); |
| 1898 | 2114 |
labelFrameInfo = new JLabel( "", JLabel.CENTER ); |
| ... | ... |
@@ -2159,7 +2375,10 @@ public class Blimp extends JApplet |
| 2159 | 2375 |
timerPlay.setRepeats( false ); |
| 2160 | 2376 |
timerPlay.stop( ); |
| 2161 | 2377 |
|
| 2162 |
- //update controls |
|
| 2378 |
+ //update display and controls |
|
| 2379 |
+ setZoomAspect( ); |
|
| 2380 |
+ showZoom( ); |
|
| 2381 |
+ showAspect( ); |
|
| 2163 | 2382 |
updateFrames( 0 ); |
| 2164 | 2383 |
|
| 2165 | 2384 |
//running as full application |
| ... | ... |
@@ -2222,8 +2441,8 @@ public class Blimp extends JApplet |
| 2222 | 2441 |
|
| 2223 | 2442 |
//running as command line tool |
| 2224 | 2443 |
System.out.println( "BlinkenLightsInteractiveMovieProgram\n" + |
| 2225 |
- "version 1.2.1 date 2006-08-01\n" + |
|
| 2226 |
- "Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info>\n" + |
|
| 2444 |
+ "version 1.3 date 2006-10-10\n" + |
|
| 2445 |
+ "Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info>\n" + |
|
| 2227 | 2446 |
"Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html\n" + |
| 2228 | 2447 |
"a blinkenarea.org project\n" + |
| 2229 | 2448 |
"powered by eventphone.de\n" ); |
| ... | ... |
@@ -2234,7 +2453,7 @@ public class Blimp extends JApplet |
| 2234 | 2453 |
|
| 2235 | 2454 |
//get initial movie |
| 2236 | 2455 |
movie = new BlinkenMovie( defHeight, defWidth, defChannels, defMaxval ); |
| 2237 |
- movie.insertInfo( 0, "creator", "Blimp (version 1.2.1 date 2006-08-01)" ); |
|
| 2456 |
+ movie.insertInfo( 0, "creator", "Blimp (version 1.3 date 2006-10-10)" ); |
|
| 2238 | 2457 |
movie.insertFrame( 0, new BlinkenFrame( defHeight, defWidth, defChannels, defMaxval, defDuration ) ); |
| 2239 | 2458 |
|
| 2240 | 2459 |
//process parameters |
| ... | ... |
@@ -1,11 +1,13 @@ |
| 1 | 1 |
/* BlinkenLightsInteractiveMovieProgram |
| 2 |
- * version 1.2.1 date 2006-08-01 |
|
| 3 |
- * Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 2 |
+ * version 1.3 date 2006-10-10 |
|
| 3 |
+ * Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 | 4 |
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
| 5 | 5 |
* a blinkenarea.org project |
| 6 | 6 |
* powered by eventphone.de |
| 7 | 7 |
*/ |
| 8 | 8 |
|
| 9 |
+package org.blinkenarea.Blimp; |
|
| 10 |
+ |
|
| 9 | 11 |
import java.io.*; |
| 10 | 12 |
|
| 11 | 13 |
public class BlinkenFileFilter extends javax.swing.filechooser.FileFilter |
| ... | ... |
@@ -1,22 +1,25 @@ |
| 1 | 1 |
/* BlinkenLightsInteractiveMovieProgram |
| 2 |
- * version 1.2.1 date 2006-08-01 |
|
| 3 |
- * Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 2 |
+ * version 1.3 date 2006-10-10 |
|
| 3 |
+ * Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 | 4 |
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
| 5 | 5 |
* a blinkenarea.org project |
| 6 | 6 |
* powered by eventphone.de |
| 7 | 7 |
*/ |
| 8 | 8 |
|
| 9 |
+package org.blinkenarea.Blimp; |
|
| 10 |
+ |
|
| 9 | 11 |
import java.awt.*; |
| 10 | 12 |
import java.awt.event.*; |
| 11 | 13 |
import java.awt.image.*; |
| 12 | 14 |
import javax.swing.*; |
| 15 |
+import org.blinkenarea.BlinkenLib.*; |
|
| 13 | 16 |
|
| 14 | 17 |
public class BlinkenFrameDisplay extends JLabel |
| 15 | 18 |
implements Scrollable, MouseListener, MouseMotionListener |
| 16 | 19 |
{
|
| 17 | 20 |
BlinkenFrame frame = null; |
| 18 | 21 |
int height = 0, width = 0, channels = 1, maxval = 1; |
| 19 |
- int zoom = 8; |
|
| 22 |
+ int zoomX = 8, zoomY = 8; |
|
| 20 | 23 |
Dimension dimension = new Dimension( 0, 0 ); |
| 21 | 24 |
ImageIcon icon = null; |
| 22 | 25 |
Image image = null; |
| ... | ... |
@@ -64,43 +67,43 @@ public class BlinkenFrameDisplay extends JLabel |
| 64 | 67 |
public void mouseClicked( MouseEvent e ) |
| 65 | 68 |
{
|
| 66 | 69 |
if( displayListener != null ) |
| 67 |
- displayListener.blinkenFrameDisplayClicked( e.getY( ) / zoom, e.getX( ) / zoom, height, width ); |
|
| 70 |
+ displayListener.blinkenFrameDisplayClicked( e.getY( ) / zoomY, e.getX( ) / zoomX, height, width ); |
|
| 68 | 71 |
} |
| 69 | 72 |
|
| 70 | 73 |
public void mouseEntered( MouseEvent e ) |
| 71 | 74 |
{
|
| 72 | 75 |
if( displayListener != null ) |
| 73 |
- displayListener.blinkenFrameDisplayEntered( e.getY( ) / zoom, e.getX( ) / zoom, height, width ); |
|
| 76 |
+ displayListener.blinkenFrameDisplayEntered( e.getY( ) / zoomY, e.getX( ) / zoomX, height, width ); |
|
| 74 | 77 |
} |
| 75 | 78 |
|
| 76 | 79 |
public void mouseExited( MouseEvent e ) |
| 77 | 80 |
{
|
| 78 | 81 |
if( displayListener != null ) |
| 79 |
- displayListener.blinkenFrameDisplayExited( e.getY( ) / zoom, e.getX( ) / zoom, height, width ); |
|
| 82 |
+ displayListener.blinkenFrameDisplayExited( e.getY( ) / zoomY, e.getX( ) / zoomX, height, width ); |
|
| 80 | 83 |
} |
| 81 | 84 |
|
| 82 | 85 |
public void mousePressed( MouseEvent e ) |
| 83 | 86 |
{
|
| 84 | 87 |
if( displayListener != null ) |
| 85 |
- displayListener.blinkenFrameDisplayPressed( e.getY( ) / zoom, e.getX( ) / zoom, height, width ); |
|
| 88 |
+ displayListener.blinkenFrameDisplayPressed( e.getY( ) / zoomY, e.getX( ) / zoomX, height, width ); |
|
| 86 | 89 |
} |
| 87 | 90 |
|
| 88 | 91 |
public void mouseReleased( MouseEvent e ) |
| 89 | 92 |
{
|
| 90 | 93 |
if( displayListener != null ) |
| 91 |
- displayListener.blinkenFrameDisplayReleased( e.getY( ) / zoom, e.getX( ) / zoom, height, width ); |
|
| 94 |
+ displayListener.blinkenFrameDisplayReleased( e.getY( ) / zoomY, e.getX( ) / zoomX, height, width ); |
|
| 92 | 95 |
} |
| 93 | 96 |
|
| 94 | 97 |
public void mouseDragged( MouseEvent e ) |
| 95 | 98 |
{
|
| 96 | 99 |
if( displayListener != null ) |
| 97 |
- displayListener.blinkenFrameDisplayDragged( e.getY( ) / zoom, e.getX( ) / zoom, height, width ); |
|
| 100 |
+ displayListener.blinkenFrameDisplayDragged( e.getY( ) / zoomY, e.getX( ) / zoomX, height, width ); |
|
| 98 | 101 |
} |
| 99 | 102 |
|
| 100 | 103 |
public void mouseMoved( MouseEvent e ) |
| 101 | 104 |
{
|
| 102 | 105 |
if( displayListener != null ) |
| 103 |
- displayListener.blinkenFrameDisplayMoved( e.getY( ) / zoom, e.getX( ) / zoom, height, width ); |
|
| 106 |
+ displayListener.blinkenFrameDisplayMoved( e.getY( ) / zoomY, e.getX( ) / zoomX, height, width ); |
|
| 104 | 107 |
} |
| 105 | 108 |
|
| 106 | 109 |
public void setFrame( BlinkenFrame newFrame ) |
| ... | ... |
@@ -130,26 +133,49 @@ public class BlinkenFrameDisplay extends JLabel |
| 130 | 133 |
updateDisplay( ); |
| 131 | 134 |
} |
| 132 | 135 |
|
| 133 |
- public void setZoom( int zoomExp ) |
|
| 136 |
+ public void setZoomAspect( double zoom, double aspect ) |
|
| 134 | 137 |
{
|
| 135 |
- //get new zoom factor |
|
| 136 |
- if( zoomExp < 0 ) |
|
| 137 |
- zoomExp = 0; |
|
| 138 |
- if( zoomExp > 6 ) |
|
| 139 |
- zoomExp = 6; |
|
| 140 |
- zoom = 1 << zoomExp; |
|
| 138 |
+ //correct new zoom factor |
|
| 139 |
+ if( zoom < 1.0 ) |
|
| 140 |
+ zoom = 1.0; |
|
| 141 |
+ if( zoom > 64.0 ) |
|
| 142 |
+ zoom = 64.0; |
|
| 143 |
+ |
|
| 144 |
+ //correct new ascpect factor |
|
| 145 |
+ if( aspect < 0.2 ) |
|
| 146 |
+ aspect = 0.2; |
|
| 147 |
+ if( aspect > 5.0 ) |
|
| 148 |
+ aspect = 5.0; |
|
| 149 |
+ |
|
| 150 |
+ //get new axis zoom factors |
|
| 151 |
+ zoomX = (int)(zoom * Math.sqrt( aspect ) + 0.5); |
|
| 152 |
+ if( zoomX <= 0 ) |
|
| 153 |
+ zoomX = 1; |
|
| 154 |
+ zoomY = (int)(zoom / Math.sqrt( aspect ) + 0.5); |
|
| 155 |
+ if( zoomY <= 0 ) |
|
| 156 |
+ zoomY = 1; |
|
| 141 | 157 |
|
| 142 | 158 |
updateDisplay( ); |
| 143 | 159 |
} |
| 144 | 160 |
|
| 161 |
+ public double getZoom( ) |
|
| 162 |
+ {
|
|
| 163 |
+ return Math.sqrt( (double)zoomX * (double)zoomY ); |
|
| 164 |
+ } |
|
| 165 |
+ |
|
| 166 |
+ public double getAspect( ) |
|
| 167 |
+ {
|
|
| 168 |
+ return (double)zoomX / (double)zoomY; |
|
| 169 |
+ } |
|
| 170 |
+ |
|
| 145 | 171 |
public void updateDisplay( ) |
| 146 | 172 |
{
|
| 147 | 173 |
int h, w, y, yy, x, xx; |
| 148 | 174 |
boolean sizeChanged, newIcon; |
| 149 | 175 |
|
| 150 | 176 |
//calculate pixel dimensions |
| 151 |
- h = height * zoom; |
|
| 152 |
- w = width * zoom; |
|
| 177 |
+ h = height * zoomY; |
|
| 178 |
+ w = width * zoomX; |
|
| 153 | 179 |
sizeChanged = dimension.height != h || dimension.width != w; |
| 154 | 180 |
|
| 155 | 181 |
//update size |
| ... | ... |
@@ -184,18 +210,18 @@ public class BlinkenFrameDisplay extends JLabel |
| 184 | 210 |
} |
| 185 | 211 |
|
| 186 | 212 |
//create image from frame |
| 187 |
- for( y = 0, yy = 0; y < height; y++, yy += zoom ) |
|
| 213 |
+ for( y = 0, yy = 0; y < height; y++, yy += zoomY ) |
|
| 188 | 214 |
{
|
| 189 |
- for( x = 0, xx = 0; x < width; x++, xx += zoom ) |
|
| 215 |
+ for( x = 0, xx = 0; x < width; x++, xx += zoomX ) |
|
| 190 | 216 |
{
|
| 191 | 217 |
graphics.setColor( frame.getColor( y, x ) ); |
| 192 |
- graphics.fillRect( xx, yy, zoom, zoom ); |
|
| 218 |
+ graphics.fillRect( xx, yy, zoomX, zoomY ); |
|
| 193 | 219 |
} |
| 194 | 220 |
} |
| 195 | 221 |
|
| 196 | 222 |
//call interceptor |
| 197 | 223 |
if( displayInterceptor != null ) |
| 198 |
- displayInterceptor.blinkenFrameDisplayNewImage( height, width, zoom, graphics ); |
|
| 224 |
+ displayInterceptor.blinkenFrameDisplayNewImage( height, width, zoomX, zoomY, graphics ); |
|
| 199 | 225 |
|
| 200 | 226 |
//update image |
| 201 | 227 |
if( newIcon ) |
| ... | ... |
@@ -1,14 +1,16 @@ |
| 1 | 1 |
/* BlinkenLightsInteractiveMovieProgram |
| 2 |
- * version 1.2.1 date 2006-08-01 |
|
| 3 |
- * Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 2 |
+ * version 1.3 date 2006-10-10 |
|
| 3 |
+ * Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 | 4 |
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
| 5 | 5 |
* a blinkenarea.org project |
| 6 | 6 |
* powered by eventphone.de |
| 7 | 7 |
*/ |
| 8 | 8 |
|
| 9 |
+package org.blinkenarea.Blimp; |
|
| 10 |
+ |
|
| 9 | 11 |
import java.awt.*; |
| 10 | 12 |
|
| 11 | 13 |
public interface BlinkenFrameDisplayInterceptor |
| 12 | 14 |
{
|
| 13 |
- public void blinkenFrameDisplayNewImage( int height, int width, int zoom, Graphics graphics ); |
|
| 15 |
+ public void blinkenFrameDisplayNewImage( int height, int width, int zoomX, int zoomY, Graphics graphics ); |
|
| 14 | 16 |
} |
| ... | ... |
@@ -1,11 +1,13 @@ |
| 1 | 1 |
/* BlinkenLightsInteractiveMovieProgram |
| 2 |
- * version 1.2.1 date 2006-08-01 |
|
| 3 |
- * Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 2 |
+ * version 1.3 date 2006-10-10 |
|
| 3 |
+ * Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 | 4 |
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
| 5 | 5 |
* a blinkenarea.org project |
| 6 | 6 |
* powered by eventphone.de |
| 7 | 7 |
*/ |
| 8 | 8 |
|
| 9 |
+package org.blinkenarea.Blimp; |
|
| 10 |
+ |
|
| 9 | 11 |
public interface BlinkenFrameDisplayListener |
| 10 | 12 |
{
|
| 11 | 13 |
public void blinkenFrameDisplayClicked( int y, int x, int height, int width ); |
| ... | ... |
@@ -1,13 +1,16 @@ |
| 1 | 1 |
/* BlinkenLightsInteractiveMovieProgram |
| 2 |
- * version 1.2.1 date 2006-08-01 |
|
| 3 |
- * Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 2 |
+ * version 1.3 date 2006-10-10 |
|
| 3 |
+ * Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 | 4 |
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
| 5 | 5 |
* a blinkenarea.org project |
| 6 | 6 |
* powered by eventphone.de |
| 7 | 7 |
*/ |
| 8 | 8 |
|
| 9 |
+package org.blinkenarea.Blimp; |
|
| 10 |
+ |
|
| 9 | 11 |
import java.awt.*; |
| 10 | 12 |
import java.awt.image.*; |
| 13 |
+import org.blinkenarea.BlinkenLib.*; |
|
| 11 | 14 |
|
| 12 | 15 |
public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 13 | 16 |
implements BlinkenFrameDisplayListener, BlinkenFrameDisplayInterceptor |
| ... | ... |
@@ -25,8 +28,8 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 25 | 28 |
toolPaste = 9; |
| 26 | 29 |
|
| 27 | 30 |
//configuration variables |
| 28 |
- BlinkenFrameDisplayListener displayListener = null; |
|
| 29 |
- BlinkenFrameDisplayInterceptor displayInterceptor = null; |
|
| 31 |
+ BlinkenFrameDisplayListener exDisplayListener = null; |
|
| 32 |
+ BlinkenFrameDisplayInterceptor exDisplayInterceptor = null; |
|
| 30 | 33 |
BlinkenFrameEditorListener editorListener = null; |
| 31 | 34 |
int tool = toolNone; |
| 32 | 35 |
Color color = Color.white; |
| ... | ... |
@@ -78,8 +81,8 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 78 | 81 |
updateDisplay( ); |
| 79 | 82 |
updateInfo( ); |
| 80 | 83 |
|
| 81 |
- if( displayListener != null ) |
|
| 82 |
- displayListener.blinkenFrameDisplayClicked( y, x, height, width ); |
|
| 84 |
+ if( exDisplayListener != null ) |
|
| 85 |
+ exDisplayListener.blinkenFrameDisplayClicked( y, x, height, width ); |
|
| 83 | 86 |
} |
| 84 | 87 |
|
| 85 | 88 |
//mouse was dragged in the frame display |
| ... | ... |
@@ -113,8 +116,8 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 113 | 116 |
updateDisplay( ); |
| 114 | 117 |
updateInfo( ); |
| 115 | 118 |
|
| 116 |
- if( displayListener != null ) |
|
| 117 |
- displayListener.blinkenFrameDisplayDragged( y, x, height, width ); |
|
| 119 |
+ if( exDisplayListener != null ) |
|
| 120 |
+ exDisplayListener.blinkenFrameDisplayDragged( y, x, height, width ); |
|
| 118 | 121 |
} |
| 119 | 122 |
|
| 120 | 123 |
//mouse entered the frame display |
| ... | ... |
@@ -127,8 +130,8 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 127 | 130 |
updateDisplay( ); |
| 128 | 131 |
updateInfo( ); |
| 129 | 132 |
|
| 130 |
- if( displayListener != null ) |
|
| 131 |
- displayListener.blinkenFrameDisplayEntered( y, x, height, width ); |
|
| 133 |
+ if( exDisplayListener != null ) |
|
| 134 |
+ exDisplayListener.blinkenFrameDisplayEntered( y, x, height, width ); |
|
| 132 | 135 |
} |
| 133 | 136 |
|
| 134 | 137 |
//mouse exited the frame display |
| ... | ... |
@@ -139,8 +142,8 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 139 | 142 |
updateDisplay( ); |
| 140 | 143 |
updateInfo( ); |
| 141 | 144 |
|
| 142 |
- if( displayListener != null ) |
|
| 143 |
- displayListener.blinkenFrameDisplayExited( y, x, height, width ); |
|
| 145 |
+ if( exDisplayListener != null ) |
|
| 146 |
+ exDisplayListener.blinkenFrameDisplayExited( y, x, height, width ); |
|
| 144 | 147 |
} |
| 145 | 148 |
|
| 146 | 149 |
//mouse was moved in the frame display |
| ... | ... |
@@ -154,8 +157,8 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 154 | 157 |
updateDisplay( ); |
| 155 | 158 |
updateInfo( ); |
| 156 | 159 |
|
| 157 |
- if( displayListener != null ) |
|
| 158 |
- displayListener.blinkenFrameDisplayMoved( y, x, height, width ); |
|
| 160 |
+ if( exDisplayListener != null ) |
|
| 161 |
+ exDisplayListener.blinkenFrameDisplayMoved( y, x, height, width ); |
|
| 159 | 162 |
} |
| 160 | 163 |
|
| 161 | 164 |
//mouse button was pressed in the frame display |
| ... | ... |
@@ -208,8 +211,8 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 208 | 211 |
updateDisplay( ); |
| 209 | 212 |
updateInfo( ); |
| 210 | 213 |
|
| 211 |
- if( displayListener != null ) |
|
| 212 |
- displayListener.blinkenFrameDisplayPressed( y, x, height, width ); |
|
| 214 |
+ if( exDisplayListener != null ) |
|
| 215 |
+ exDisplayListener.blinkenFrameDisplayPressed( y, x, height, width ); |
|
| 213 | 216 |
} |
| 214 | 217 |
|
| 215 | 218 |
//mouse button was released in the frame display |
| ... | ... |
@@ -407,11 +410,11 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 407 | 410 |
updateDisplay( ); |
| 408 | 411 |
updateInfo( ); |
| 409 | 412 |
|
| 410 |
- if( displayListener != null ) |
|
| 411 |
- displayListener.blinkenFrameDisplayReleased( y, x, height, width ); |
|
| 413 |
+ if( exDisplayListener != null ) |
|
| 414 |
+ exDisplayListener.blinkenFrameDisplayReleased( y, x, height, width ); |
|
| 412 | 415 |
} |
| 413 | 416 |
|
| 414 |
- public void blinkenFrameDisplayNewImage( int height, int width, int zoom, Graphics graphics ) |
|
| 417 |
+ public void blinkenFrameDisplayNewImage( int height, int width, int zoomX, int zoomY, Graphics graphics ) |
|
| 415 | 418 |
{
|
| 416 | 419 |
int y1, y2, x1, x2, y, x, xx, yy; |
| 417 | 420 |
long rx2, ry2, z, zx, zy, z1, z2, z3, z1a, z2a, z3a; |
| ... | ... |
@@ -425,7 +428,7 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 425 | 428 |
if( cur ) |
| 426 | 429 |
{
|
| 427 | 430 |
graphics.setColor( color ); |
| 428 |
- graphics.drawRect( zoom * curX, zoom * curY, zoom - 1, zoom - 1 ); |
|
| 431 |
+ graphics.drawRect( zoomX * curX, zoomY * curY, zoomX - 1, zoomY - 1 ); |
|
| 429 | 432 |
} |
| 430 | 433 |
break; |
| 431 | 434 |
case toolLine: |
| ... | ... |
@@ -441,10 +444,10 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 441 | 444 |
{
|
| 442 | 445 |
if( inv ) |
| 443 | 446 |
for( x = 0; x <= x2; x++ ) |
| 444 |
- graphics.drawRect( zoom * (x1 + x2 - x), zoom * (y1 + x), zoom - 1, zoom - 1 ); |
|
| 447 |
+ graphics.drawRect( zoomX * (x1 + x2 - x), zoomY * (y1 + x), zoomX - 1, zoomY - 1 ); |
|
| 445 | 448 |
else |
| 446 | 449 |
for( x = 0; x <= x2; x++ ) |
| 447 |
- graphics.drawRect( zoom * (x1 + x), zoom * (y1 + x), zoom - 1, zoom - 1 ); |
|
| 450 |
+ graphics.drawRect( zoomX * (x1 + x), zoomY * (y1 + x), zoomX - 1, zoomY - 1 ); |
|
| 448 | 451 |
} |
| 449 | 452 |
else if( x2 > y2 ) |
| 450 | 453 |
{
|
| ... | ... |
@@ -452,13 +455,13 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 452 | 455 |
for( x = 0; x <= x2; x++ ) |
| 453 | 456 |
{
|
| 454 | 457 |
y = (x * y2 + x2 / 2) / x2; |
| 455 |
- graphics.drawRect( zoom * (x1 + x2 - x), zoom * (y1 + y), zoom - 1, zoom - 1 ); |
|
| 458 |
+ graphics.drawRect( zoomX * (x1 + x2 - x), zoomY * (y1 + y), zoomX - 1, zoomY - 1 ); |
|
| 456 | 459 |
} |
| 457 | 460 |
else |
| 458 | 461 |
for( x = 0; x <= x2; x++ ) |
| 459 | 462 |
{
|
| 460 | 463 |
y = (x * y2 + x2 / 2) / x2; |
| 461 |
- graphics.drawRect( zoom * (x1 + x), zoom * (y1 + y), zoom - 1, zoom - 1 ); |
|
| 464 |
+ graphics.drawRect( zoomX * (x1 + x), zoomY * (y1 + y), zoomX - 1, zoomY - 1 ); |
|
| 462 | 465 |
} |
| 463 | 466 |
} |
| 464 | 467 |
else |
| ... | ... |
@@ -467,20 +470,20 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 467 | 470 |
for( y = 0; y <= y2; y++ ) |
| 468 | 471 |
{
|
| 469 | 472 |
x = (y * x2 + y2 / 2) / y2; |
| 470 |
- graphics.drawRect( zoom * (x1 + x), zoom * (y1 + y2 - y), zoom - 1, zoom - 1 ); |
|
| 473 |
+ graphics.drawRect( zoomX * (x1 + x), zoomY * (y1 + y2 - y), zoomX - 1, zoomY - 1 ); |
|
| 471 | 474 |
} |
| 472 | 475 |
else |
| 473 | 476 |
for( y = 0; y <= y2; y++ ) |
| 474 | 477 |
{
|
| 475 | 478 |
x = (y * x2 + y2 / 2) / y2; |
| 476 |
- graphics.drawRect( zoom * (x1 + x), zoom * (y1 + y), zoom - 1, zoom - 1 ); |
|
| 479 |
+ graphics.drawRect( zoomX * (x1 + x), zoomY * (y1 + y), zoomX - 1, zoomY - 1 ); |
|
| 477 | 480 |
} |
| 478 | 481 |
} |
| 479 | 482 |
} |
| 480 | 483 |
else if( cur ) |
| 481 | 484 |
{
|
| 482 | 485 |
graphics.setColor( color ); |
| 483 |
- graphics.drawRect( zoom * curX, zoom * curY, zoom - 1, zoom - 1 ); |
|
| 486 |
+ graphics.drawRect( zoomX * curX, zoomY * curY, zoomX - 1, zoomY - 1 ); |
|
| 484 | 487 |
} |
| 485 | 488 |
break; |
| 486 | 489 |
case toolRect: |
| ... | ... |
@@ -492,20 +495,20 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 492 | 495 |
x1 = Math.min( pressX, curX ); |
| 493 | 496 |
x2 = Math.max( pressX, curX ); |
| 494 | 497 |
for( y = y1; y <= y2; y++ ) |
| 495 |
- graphics.drawRect( zoom * x1, zoom * y, zoom - 1, zoom - 1 ); |
|
| 498 |
+ graphics.drawRect( zoomX * x1, zoomY * y, zoomX - 1, zoomY - 1 ); |
|
| 496 | 499 |
if( x1 != x2 ) |
| 497 | 500 |
for( y = y1; y <= y2; y++ ) |
| 498 |
- graphics.drawRect( zoom * x2, zoom * y, zoom - 1, zoom - 1 ); |
|
| 501 |
+ graphics.drawRect( zoomX * x2, zoomY * y, zoomX - 1, zoomY - 1 ); |
|
| 499 | 502 |
for( x = x1 + 1; x < x2; x++ ) |
| 500 |
- graphics.drawRect( zoom * x, zoom * y1, zoom - 1, zoom - 1 ); |
|
| 503 |
+ graphics.drawRect( zoomX * x, zoomY * y1, zoomX - 1, zoomY - 1 ); |
|
| 501 | 504 |
if( y1 != y2 ) |
| 502 | 505 |
for( x = x1 + 1; x < x2; x++ ) |
| 503 |
- graphics.drawRect( zoom * x, zoom * y2, zoom - 1, zoom - 1 ); |
|
| 506 |
+ graphics.drawRect( zoomX * x, zoomY * y2, zoomX - 1, zoomY - 1 ); |
|
| 504 | 507 |
} |
| 505 | 508 |
else if( cur ) |
| 506 | 509 |
{
|
| 507 | 510 |
graphics.setColor( color ); |
| 508 |
- graphics.drawRect( zoom * curX, zoom * curY, zoom - 1, zoom - 1 ); |
|
| 511 |
+ graphics.drawRect( zoomX * curX, zoomY * curY, zoomX - 1, zoomY - 1 ); |
|
| 509 | 512 |
} |
| 510 | 513 |
break; |
| 511 | 514 |
case toolFilledRect: |
| ... | ... |
@@ -518,12 +521,12 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 518 | 521 |
x2 = Math.max( pressX, curX ); |
| 519 | 522 |
for( y = y1; y <= y2; y++ ) |
| 520 | 523 |
for( x = x1; x <= x2; x++ ) |
| 521 |
- graphics.drawRect( zoom * x, zoom * y, zoom - 1, zoom - 1 ); |
|
| 524 |
+ graphics.drawRect( zoomX * x, zoomY * y, zoomX - 1, zoomY - 1 ); |
|
| 522 | 525 |
} |
| 523 | 526 |
else if( cur ) |
| 524 | 527 |
{
|
| 525 | 528 |
graphics.setColor( color ); |
| 526 |
- graphics.drawRect( zoom * curX, zoom * curY, zoom - 1, zoom - 1 ); |
|
| 529 |
+ graphics.drawRect( zoomX * curX, zoomY * curY, zoomX - 1, zoomY - 1 ); |
|
| 527 | 530 |
} |
| 528 | 531 |
break; |
| 529 | 532 |
case toolCircle: |
| ... | ... |
@@ -538,14 +541,14 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 538 | 541 |
ry2 = (long)y2 * (long)y2; |
| 539 | 542 |
for( x = x2, y = 0, z = 0; x >= 0 && y <= y2; ) |
| 540 | 543 |
{
|
| 541 |
- graphics.drawRect( zoom * (x1 + x), zoom * (y1 + y), zoom - 1, zoom - 1 ); |
|
| 544 |
+ graphics.drawRect( zoomX * (x1 + x), zoomY * (y1 + y), zoomX - 1, zoomY - 1 ); |
|
| 542 | 545 |
if( y != 0 ) |
| 543 |
- graphics.drawRect( zoom * (x1 + x), zoom * (y1 - y), zoom - 1, zoom - 1 ); |
|
| 546 |
+ graphics.drawRect( zoomX * (x1 + x), zoomY * (y1 - y), zoomX - 1, zoomY - 1 ); |
|
| 544 | 547 |
if( x != 0 ) |
| 545 | 548 |
{
|
| 546 |
- graphics.drawRect( zoom * (x1 - x), zoom * (y1 + y), zoom - 1, zoom - 1 ); |
|
| 549 |
+ graphics.drawRect( zoomX * (x1 - x), zoomY * (y1 + y), zoomX - 1, zoomY - 1 ); |
|
| 547 | 550 |
if( y != 0 ) |
| 548 |
- graphics.drawRect( zoom * (x1 - x), zoom * (y1 - y), zoom - 1, zoom - 1 ); |
|
| 551 |
+ graphics.drawRect( zoomX * (x1 - x), zoomY * (y1 - y), zoomX - 1, zoomY - 1 ); |
|
| 549 | 552 |
} |
| 550 | 553 |
zy = (long)(2 * y + 1) * rx2; |
| 551 | 554 |
zx = (long)(2 * x - 1) * ry2; |
| ... | ... |
@@ -560,7 +563,7 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 560 | 563 |
else if( cur ) |
| 561 | 564 |
{
|
| 562 | 565 |
graphics.setColor( color ); |
| 563 |
- graphics.drawRect( zoom * curX, zoom * curY, zoom - 1, zoom - 1 ); |
|
| 566 |
+ graphics.drawRect( zoomX * curX, zoomY * curY, zoomX - 1, zoomY - 1 ); |
|
| 564 | 567 |
} |
| 565 | 568 |
break; |
| 566 | 569 |
case toolFilledCircle: |
| ... | ... |
@@ -578,10 +581,10 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 578 | 581 |
if( y != yy ) //do not draw a line twice (if two pixels of circle are left/right to each other) |
| 579 | 582 |
{
|
| 580 | 583 |
for( xx = x1 - x; xx <= x1 + x; xx++ ) |
| 581 |
- graphics.drawRect( zoom * xx, zoom * (y1 + y), zoom - 1, zoom - 1 ); |
|
| 584 |
+ graphics.drawRect( zoomX * xx, zoomY * (y1 + y), zoomX - 1, zoomY - 1 ); |
|
| 582 | 585 |
if( y != 0 ) |
| 583 | 586 |
for( xx = x1 - x; xx <= x1 + x; xx++ ) |
| 584 |
- graphics.drawRect( zoom * xx, zoom * (y1 - y), zoom - 1, zoom - 1 ); |
|
| 587 |
+ graphics.drawRect( zoomX * xx, zoomY * (y1 - y), zoomX - 1, zoomY - 1 ); |
|
| 585 | 588 |
yy = y; |
| 586 | 589 |
} |
| 587 | 590 |
zy = (long)(2 * y + 1) * rx2; |
| ... | ... |
@@ -597,7 +600,7 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 597 | 600 |
else if( cur ) |
| 598 | 601 |
{
|
| 599 | 602 |
graphics.setColor( color ); |
| 600 |
- graphics.drawRect( zoom * curX, zoom * curY, zoom - 1, zoom - 1 ); |
|
| 603 |
+ graphics.drawRect( zoomX * curX, zoomY * curY, zoomX - 1, zoomY - 1 ); |
|
| 601 | 604 |
} |
| 602 | 605 |
break; |
| 603 | 606 |
case toolCopy: |
| ... | ... |
@@ -608,12 +611,12 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 608 | 611 |
y2 = Math.max( pressY, curY ) - y1 + 1; |
| 609 | 612 |
x1 = Math.min( pressX, curX ); |
| 610 | 613 |
x2 = Math.max( pressX, curX ) - x1 + 1; |
| 611 |
- graphics.drawRect( zoom * x1, zoom * y1, zoom * x2 - 1, zoom * y2 - 1 ); |
|
| 614 |
+ graphics.drawRect( zoomX * x1, zoomY * y1, zoomX * x2 - 1, zoomY * y2 - 1 ); |
|
| 612 | 615 |
} |
| 613 | 616 |
else if( cur ) |
| 614 | 617 |
{
|
| 615 | 618 |
graphics.setColor( color ); |
| 616 |
- graphics.drawRect( zoom * curX, zoom * curY, zoom - 1, zoom - 1 ); |
|
| 619 |
+ graphics.drawRect( zoomX * curX, zoomY * curY, zoomX - 1, zoomY - 1 ); |
|
| 617 | 620 |
} |
| 618 | 621 |
break; |
| 619 | 622 |
case toolPaste: |
| ... | ... |
@@ -628,14 +631,14 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 628 | 631 |
for( x = 0; x < x2; x++ ) |
| 629 | 632 |
{
|
| 630 | 633 |
graphics.setColor( clipboard.getColor( y, x ) ); |
| 631 |
- graphics.drawRect( zoom * (x1 + x), zoom * (y1 + y), zoom - 1, zoom - 1 ); |
|
| 634 |
+ graphics.drawRect( zoomX * (x1 + x), zoomY * (y1 + y), zoomX - 1, zoomY - 1 ); |
|
| 632 | 635 |
} |
| 633 | 636 |
} |
| 634 | 637 |
} |
| 635 | 638 |
} |
| 636 | 639 |
|
| 637 |
- if( displayInterceptor != null ) |
|
| 638 |
- displayInterceptor.blinkenFrameDisplayNewImage( height, width, zoom, graphics ); |
|
| 640 |
+ if( exDisplayInterceptor != null ) |
|
| 641 |
+ exDisplayInterceptor.blinkenFrameDisplayNewImage( height, width, zoomX, zoomY, graphics ); |
|
| 639 | 642 |
} |
| 640 | 643 |
|
| 641 | 644 |
public void setFrame( BlinkenFrame newFrame ) |
| ... | ... |
@@ -1437,12 +1440,12 @@ public class BlinkenFrameEditor extends BlinkenFrameDisplay |
| 1437 | 1440 |
|
| 1438 | 1441 |
public void setDisplayListener( BlinkenFrameDisplayListener newDisplayListener ) |
| 1439 | 1442 |
{
|
| 1440 |
- displayListener = newDisplayListener; |
|
| 1443 |
+ exDisplayListener = newDisplayListener; |
|
| 1441 | 1444 |
} |
| 1442 | 1445 |
|
| 1443 | 1446 |
public void setDisplayInterceptor( BlinkenFrameDisplayInterceptor newDisplayInterceptor ) |
| 1444 | 1447 |
{
|
| 1445 |
- displayInterceptor = newDisplayInterceptor; |
|
| 1448 |
+ exDisplayInterceptor = newDisplayInterceptor; |
|
| 1446 | 1449 |
} |
| 1447 | 1450 |
|
| 1448 | 1451 |
public void setEditorListener( BlinkenFrameEditorListener newDisplayListener ) |
| ... | ... |
@@ -1,11 +1,13 @@ |
| 1 | 1 |
/* BlinkenLightsInteractiveMovieProgram |
| 2 |
- * version 1.2.1 date 2006-08-01 |
|
| 3 |
- * Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info> |
|
| 2 |
+ * version 1.3 date 2006-10-10 |
|
| 3 |
+ * Copyright (C) 2004-2006: Stefan Schuermans <1stein@schuermans.info> |
|
| 4 | 4 |
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html |
| 5 | 5 |
* a blinkenarea.org project |
| 6 | 6 |
* powered by eventphone.de |
| 7 | 7 |
*/ |
| 8 | 8 |
|
| 9 |
+package org.blinkenarea.Blimp; |
|
| 10 |
+ |
|
| 9 | 11 |
import java.awt.*; |
| 10 | 12 |
|
| 11 | 13 |
public interface BlinkenFrameEditorListener |
| ... | ... |
@@ -1,70 +0,0 @@ |
| 1 |
-# BlinkenLights Movie 26x20 |
|
| 2 |
-# type1 = info1 |
|
| 3 |
-# type2 = info2 |
|
| 4 |
-# type2 = info2 |
|
| 5 |
- |
|
| 6 |
-@100 |
|
| 7 |
-00000000000000000000000000 |
|
| 8 |
-00000000000000000000000000 |
|
| 9 |
-00000000000000000000000000 |
|
| 10 |
-00000000000000000000000000 |
|
| 11 |
-00000000000000000000000000 |
|
| 12 |
-00000000000000000000000000 |
|
| 13 |
-00000011111111111111100000 |
|
| 14 |
-00000111111111111111110000 |
|
| 15 |
-00000111111111111111110000 |
|
| 16 |
-00000111111111111111110000 |
|
| 17 |
-00000011111111111111110000 |
|
| 18 |
-00000011111111111111110000 |
|
| 19 |
-00000011111111111111110000 |
|
| 20 |
-00000011111111111111110000 |
|
| 21 |
-00000000000000000000000000 |
|
| 22 |
-00000000000000000000000000 |
|
| 23 |
-00000000000000000000000000 |
|
| 24 |
-00000000000000000000000000 |
|
| 25 |
-00000000000000000000000000 |
|
| 26 |
-00000000000000000000000000 |
|
| 27 |
- |
|
| 28 |
-@100 |
|
| 29 |
-00000000000000000000000000 |
|
| 30 |
-00000000000000000000000000 |
|
| 31 |
-00000000000000000000000000 |
|
| 32 |
-00000000000000000000000000 |
|
| 33 |
-00000000000000000000000000 |
|
| 34 |
-00000000000000000000000000 |
|
| 35 |
-00000011111111111111100000 |
|
| 36 |
-00000111111111111111110000 |
|
| 37 |
-00000111111111111111110000 |
|
| 38 |
-00000111111111111111110000 |
|
| 39 |
-00000011111111111111110000 |
|
| 40 |
-00000011111111111111110000 |
|
| 41 |
-00000011111111111111110000 |
|
| 42 |
-00000011111111111111110000 |
|
| 43 |
-00000000000000000000000000 |
|
| 44 |
-00000000000000000000000000 |
|
| 45 |
-00000000000000000000000000 |
|
| 46 |
-00000000000000000000000000 |
|
| 47 |
-00000000000000000000000000 |
|
| 48 |
-00000000000000000000000000 |
|
| 49 |
- |
|
| 50 |
-@500 |
|
| 51 |
-10000000000000000000000001 |
|
| 52 |
-00000000000000000000000000 |
|
| 53 |
-00000000000000000000000000 |
|
| 54 |
-00000000000000000000000000 |
|
| 55 |
-00000000000000000000000000 |
|
| 56 |
-00000000000000000000000000 |
|
| 57 |
-00000000000000000000000000 |
|
| 58 |
-00000000000000000000000000 |
|
| 59 |
-00000000000000000000000000 |
|
| 60 |
-00000000000000000000000000 |
|
| 61 |
-00000000000000000000000000 |
|
| 62 |
-00000000000000000000000000 |
|
| 63 |
-00000000000000000000000000 |
|
| 64 |
-00000000000000000000000000 |
|
| 65 |
-00000000000000000000000000 |
|
| 66 |
-00000000000000000000000000 |
|
| 67 |
-00000000000000000000000000 |
|
| 68 |
-00000000000000000000000000 |
|
| 69 |
-00000000000000000000000000 |
|
| 70 |
-10000000000000000000000001 |
| ... | ... |
@@ -1,77 +0,0 @@ |
| 1 |
-<?xml version="1.0" encoding="UTF-8"?> |
|
| 2 |
-<blm width="26" height="20" bits="8" channels="1"> |
|
| 3 |
- <header> |
|
| 4 |
- <description>type1: info1</description> |
|
| 5 |
- <description>type2: info2</description> |
|
| 6 |
- <description>type2: info2</description> |
|
| 7 |
- </header> |
|
| 8 |
- |
|
| 9 |
- <frame duration="100"> |
|
| 10 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 11 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 12 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 13 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 14 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 15 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 16 |
- <row>000000000060809090909090909090A0A0A0A0A0A06000000000</row> |
|
| 17 |
- <row>0000000000A0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 18 |
- <row>000000000080E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 19 |
- <row>000000000080E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 20 |
- <row>000000000070E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 21 |
- <row>000000000050E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 22 |
- <row>000000000050E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 23 |
- <row>000000000040E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 24 |
- <row>0000000000106060605050505050404040303030201000000000</row> |
|
| 25 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 26 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 27 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 28 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 29 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 30 |
- </frame> |
|
| 31 |
- |
|
| 32 |
- <frame duration="100"> |
|
| 33 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 34 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 35 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 36 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 37 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 38 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 39 |
- <row>00000000006080B0B0B0B0B0B0B0B0A0A0A0A0A0A06000000000</row> |
|
| 40 |
- <row>0000000000A0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 41 |
- <row>000000000080E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 42 |
- <row>000000000080E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 43 |
- <row>000000000070E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 44 |
- <row>000000000050E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 45 |
- <row>000000000050E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 46 |
- <row>000000000040E0E0E0E0E0E0E0E0E0E0E0E0E0E0E08000000000</row> |
|
| 47 |
- <row>0000000000106060605050505050404040303030201000000000</row> |
|
| 48 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 49 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 50 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 51 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 52 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 53 |
- </frame> |
|
| 54 |
- |
|
| 55 |
- <frame duration="500"> |
|
| 56 |
- <row>FF00000000000000000000000000000000000000000000000080</row> |
|
| 57 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 58 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 59 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 60 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 61 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 62 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 63 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 64 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 65 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 66 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 67 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 68 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 69 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 70 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 71 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 72 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 73 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 74 |
- <row>0000000000000000000000000000000000000000000000000000</row> |
|
| 75 |
- <row>80000000000000000000000000000000000000000000000000FF</row> |
|
| 76 |
- </frame> |
|
| 77 |
-</blm> |
| ... | ... |
@@ -1,71 +0,0 @@ |
| 1 |
-# BlinkenMini Movie 26x20 |
|
| 2 |
-# type1 = info1 |
|
| 3 |
-# type2 = info2 |
|
| 4 |
-# type2 = info2 |
|
| 5 |
- |
|
| 6 |
-@100 |
|
| 7 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 8 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 9 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 10 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 11 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 12 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 13 |
-0x00 0x00 0x00 0x00 0x00 0x60 0x80 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0xA0 0xA0 0xA0 0xA0 0xA0 0xA0 0x60 0x00 0x00 0x00 0x00 |
|
| 14 |
-0x00 0x00 0x00 0x00 0x00 0xA0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0x80 0x00 0x00 0x00 0x00 |
|
| 15 |
-0x00 0x00 0x00 0x00 0x00 0x80 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0x80 0x00 0x00 0x00 0x00 |
|
| 16 |
-0x00 0x00 0x00 0x00 0x00 0x80 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0x80 0x00 0x00 0x00 0x00 |
|
| 17 |
-0x00 0x00 0x00 0x00 0x00 0x70 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0x80 0x00 0x00 0x00 0x00 |
|
| 18 |
-0x00 0x00 0x00 0x00 0x00 0x50 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0x80 0x00 0x00 0x00 0x00 |
|
| 19 |
-0x00 0x00 0x00 0x00 0x00 0x50 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0x80 0x00 0x00 0x00 0x00 |
|
| 20 |
-0x00 0x00 0x00 0x00 0x00 0x40 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0xE0 0x80 0x00 0x00 0x00 0x00 |
|
| 21 |
-0x00 0x00 0x00 0x00 0x00 0x10 0x60 0x60 0x60 0x50 0x50 0x50 0x50 0x50 0x40 0x40 0x40 0x30 0x30 0x30 0x20 0x10 0x00 0x00 0x00 0x00 |
|
| 22 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 23 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 24 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 25 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 26 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 27 |
- |
|
| 28 |
-@100 |
|
| 29 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 30 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 31 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 32 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 33 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 34 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 35 |
-0 0 0 0 0 96 128 176 176 176 176 176 176 176 176 160 160 160 160 160 160 96 0 0 0 0 |
|
| 36 |
-0 0 0 0 0 160 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 128 0 0 0 0 |
|
| 37 |
-0 0 0 0 0 128 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 128 0 0 0 0 |
|
| 38 |
-0 0 0 0 0 128 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 128 0 0 0 0 |
|
| 39 |
-0 0 0 0 0 112 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 128 0 0 0 0 |
|
| 40 |
-0 0 0 0 0 80 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 128 0 0 0 0 |
|
| 41 |
-0 0 0 0 0 80 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 128 0 0 0 0 |
|
| 42 |
-0 0 0 0 0 64 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 128 0 0 0 0 |
|
| 43 |
-0 0 0 0 0 16 96 96 96 80 80 80 80 80 64 64 64 48 48 48 32 16 0 0 0 0 |
|
| 44 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 45 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 46 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 47 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 48 |
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
| 49 |
- |
|
| 50 |
-@500 |
|
| 51 |
-0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 |
|
| 52 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 53 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 54 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 55 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 56 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 57 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 58 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 59 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 60 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 61 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 62 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 63 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 64 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 65 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 66 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 67 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 68 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 69 |
-0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
|
| 70 |
-0x80 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF |
|
| 71 |
- |
|
| 72 | 0 |