|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.CS<CSGeneric>
codesimian.DefaultCS
codesimian.ThisComputersScreen
public class ThisComputersScreen
Get my value as a java.awt.Image to create a new Image
whose pixels are the same as whats displayed on your computer monitor right now.
The image does not change as your screen changes.
TODO: write more about this... Execute this object in certain ways to get the next Image.
WARNING: Getting the screen as an image is SLOW and takes MEGABYTES OF MEMORY
and may be prevented by your computer's security software
or (when more code is finished) prevented by CodeSimian's options.
There can be 0 or 1 params. If at least 1 param, P(0) will be set to the Image when
this object is executed, even if this object is not executed as an Image.
If 0 params and you execute this object as an Image, it returns that Image.
If 0 params and you execute this object as a number, it returns the Image's width in pixels.
If 0 params and you execute as anything else, I dont know what it will return.
The Image is often used to set the value of an ImagePixels object,
which represents each pixel as a number between 0 and (2^24)-1.
Some ImagePixels objects may instead use numbers between 0.0 and 1.0
and/or only represent red, green, or blue, or any other division (instead of all colors).
Its a 1-dimensional array. To get its width as an int, execute the ImagePixels object.
By combining ThisComputerScreen and ImagePixels, CodeSimian can view your screen the same way you do.
Later, use the system clock to prevent getting a new image capture if its sooner than 1/50 second
or a bigger fraction if the system is running too slow. Create some system to monitor
Codesimian's speed (if its too busy to respond right now) and to adjust numbers like that fraction
when CodeSimian's speed gets too low. See MemoryHog.java. Make a similar class for CPU speed,
or design more of codesimian's FUEL system.
Currently ThisComputerScreen does not allow you to SET its value as an Image,
but I'd like to be able to write an Image to the screen through this class.
Params 1-4 are XPIXEL YPIXEL XSIZE and YSIZE of the part of the screen the Image should be.
They can either be literal pixel numbers (example: x from 1.0001 to 1024, y from 1.0001 to 768)
or a fraction of the screen width or height (0.0 to 1.0).
Field Summary |
---|
Fields inherited from class codesimian.CS |
---|
DESCRIPTION, END, EXECPROXY, HEAP, JAVACODE, MYFUEL, NAME, NEWINSTANCE, NULL, PARENT, PARSEPRIORITY, PREV, TESTER, THIS |
Constructor Summary | |
---|---|
ThisComputersScreen()
|
Method Summary | |
---|---|
double |
DForProxy()
Execute this CS and cast to double. |
java.lang.String |
keyword()
For the CodeSimian language as a String. CodeSimian language keyword, like "+" "*" "max" ">" etc. Override this function if you want to specify a keyword other than how I derive them from the class name, like + for Add. Some CSs might never be intended to be used in the language by their keyword. The best example (4/05) is Num, because it is used in the language like "3.4" instead of "num()". |
java.lang.Object |
L(java.lang.Class type)
Optionally execute this CS, and definitely try to CAST it to the specified Java type. |
int |
maxP()
Maximum quantity of Params |
int |
minP()
For DForProxy(). Minimum number of parameters in param[] needed to call DForProxy(). Defines which indexs of param[] DForProxy() can use. Functions with a different number of parameters must override this. OVERRIDE THIS FUNCTION IF EXEC USES A DIFFERENT NUMBER OF PARAMETERS. Default is 1. |
int |
pixelInt(double pixelDouble,
int pixelsWide)
pixelDouble is a fraction, range 0 to 1, or if bigger than 1 then its wrapped around pixelsWide. |
java.awt.Rectangle |
subRectangle(java.awt.Rectangle biggerRectangle)
|
void |
updateImage()
|
Methods inherited from class codesimian.DefaultCS |
---|
B, C, countP, decrementMyFuel, deleteP, description, F, fuel, getExec, getObject, heap, I, indexP, indexPName, insertB, insertC, insertD, insertF, insertI, insertJ, insertL, insertL, insertL1, insertP, insertS, insertZ, J, javaCode, LForProxy, LForProxy, myFuel, name, newInstance, objectToCS, objectToCSArray, objectToCSArray, P, prevD, prevL, PType, S, setB, setC, setCountP, setD, setD, setExec, setF, setFuel, setI, setJ, setL, setL, setL, setL1, setMyFuel, setName, setObject, setP, setPrevExec, setPType, setS, setZ, start, toString, V, Z |
Methods inherited from class codesimian.CS |
---|
addB, addC, addD, addF, addI, addJ, addL, addP, addP, addP, addP, addP, addS, addZ, BForProxy, CForProxy, clone, cost, D, deleteP, FForProxy, GETB, GETC, GETD, GETF, GETI, GETJ, GETL, GETS, GETZ, IForProxy, isIllusion, JForProxy, L, L, L, L, maxD, minD, overwrites, parent, parsePriority, PB, PC, PD, PF, PI, PJ, PL, prevB, prevC, prevF, prevI, prevJ, prevS, prevZ, proxyOf, PS, PZ, reflect, reflect, reflect6, setB, SETB, setC, SETC, setCost, SETD, setDescription, setF, SETF, setHeap, setI, SETI, setJ, SETJ, SETL, setL, setL, setParent, setParsePriority, setProxyOf, setS, SETS, setTester, setZ, SETZ, SForProxy, tester, toJavaCode, VForProxy, voidReflect, ZForProxy |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ThisComputersScreen()
Method Detail |
---|
public double DForProxy()
CS
DForProxy
in class DefaultCS
public java.lang.Object L(java.lang.Class type)
CS
L
in class CS
CS.Z()
,
CS.B()
,
CS.C()
,
CS.S()
,
CS.I()
,
CS.J()
,
CS.F()
,
CS.D()
public int minP()
DefaultCS
minP
in class DefaultCS
public int maxP()
CS
maxP
in class CS
public java.lang.String keyword()
DefaultCS
keyword
in class DefaultCS
CS.parent()
,
CS.newInstance()
,
CS.name()
public void updateImage()
public java.awt.Rectangle subRectangle(java.awt.Rectangle biggerRectangle)
public int pixelInt(double pixelDouble, int pixelsWide)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |