0077 core

_ metaballs example dies when using box()
_   long string of exceptions, which are also missing their newlines

_ when running externally, applets don't always get placed properly
_   if size is never set, then doesn't always layout
_   problem is in gl and in core, and is inconsistent
_   move more logic for layout into PApplet.. maybe a static method?
_   this way can avoid duplicating / breaking things

_ depth() shouldn't be needed for opengl unless actually 3D
_   right now the camera doesn't get set up unless you call depth()

_ don't show applet frame until first frame
_   but don't do it if it's a subclass, ie opengl..

_ how to handle full screen (opengl especially) or no screen (for scripts)
_ implement fullsize().. this takes over the screen as best it can
_   or should it be more like present mode?
_   that if applet is 500x500, centers on a 800x600 window
_   though how do you get the screen size? 
_     screen.width and screen.height? 

_ resolve ARGB versus RGBA versus just A issues for fonts
_   make sure that current scenario works identically on mac
_   if so, just switch the image code to expect alpha in the high bits
_   fonts probably need to be RGBA, not ALPHA style images
_   there's nothing really ALPHA about them?

_ fix non-bound textures from mangling everything else
_ fix enable/disable textures for some objects
_ fix endian ordering issues so that things work properly
_ figure out min/max texture sizes when binding to avoid problems
_   minimum texture size may be 64x64
_   might need to enforce it as a minimum
_ what should the update image function be called?

_ get loop, noLoop, redraw, and framerate all working in opengl
_   needs custom animator thread..

_ basic sample audio playback needed for p5
_   make separate java 1.1 and java 1.3 classes

_ be consistent about getXxx() methods


//

0076

_ image loading bug is huge

_ add gzipInput and gzipOutput

_ should image i/o and sound i/o be moved into PImage and PSound?
_   how to load external encoders/decoders


_ image(String name) and textFont(String name)
_   do we change to font(arial, 12) ?

scripting
_ document the use of "die" 
_   can override the method to do your own handling
_ on exceptions, use die to just kill the applet
_ make the file i/o stuff work more cleanly
_   if people want to use their own file i/o they can do that too
_ how to make a long setup() sleep so that things don't lock way up
_   this could also be contributing to the hanging bug
_ make properly exit after things are finished
_ static applets need to be able to resize themselves on 'play'
_ figure out what to do with static apps exported as application
_   needs to just hang there
_ scripts (w/ no graphics) will need to call exit() explicitly
_   actually.. just override the default draw() to say exit()
_ may need a fileOutput() and fileInput() function
_   to take care of exception handling
_ or maybe scripts are just handled with a different method? (yech)
_   or maybe setup() can actually throw and Exception?
_   but that's inserted by the parser, and hidden from the user?
_ implement size(0, 0) -> just doesn't bother doing a frame.show();
_   too abstract, just have draw() call exit by default
_   so if nothing inside draw, just quits

documentation
_ must call depth() for 3D applications
_ lights cannot be enabled/disabled throughout 
_   lighting will be based on what's left at endFrame()
_ images should be a power of 2, or call modified()

_ need to make sure that components can be resized properly via size()
_   or that it properly responds to a setBounds() call

_ also when drawing an image, sense whether drawn rotated
_   specifically, if drawn rotated 90 in either direction, or 180
_   if just rotate/translate, then can use SCREEN_SPACE for fonts
_ bring screen space and font size settings back in to PGraphics
_   causing too much trouble to be stuck down in PFont

_ explicitly state depth()/nodepth()
_   don't allocate zbuffer & stencil until depth() is called

_ massive graphics engine changes
_   move to new graphics engine
_     test with rgb cube, shut off smoothing
_   make sure line artifacts are because of smoothing
_   implement 2x oversampling for anti-aliasing
_ before graphics engine change, attach jogl stuff
_   need to try jogl to make sure no further changes
_   and the illustrator stuff

postscript
_ how to hook into curve rendering so that curve segments are drawn
_   maybe lines are rendered and sorted, 
_   but they point to an original version of the curve geometry 
_   that can be re-rendered 
_   also integrate catmull-rom -> bezier inverse matrices
_   even with the general catmull-rom, to render via ai beziers

random tasks
_ someone to figure out a good model for adaptive sizing of circles
_   also goes for arcs, though will be weighted based on arc size
_ figure out why tiff images won't open with after effects
_   open with photoshop, resave, see which tags change
_   particularly of those that are included in the original image
_   perhaps something gets corrected? 

_ arc with stroke only draws the arc shape itself
_   may need a 'wedge' function to draw a stroke around the whole thing

_ need timer in as part of the api
_   or at least include an example that uses it

_ depth testing of lines vs text is problematic
_   probably need to patch in an older version of the line code
_   use depth()/noDepth() to handle depth test

_ y2 position of rectangles not same as y2 position of lines
_   happens when the rectangle is flipped on the x or y axis
_   probably a hack that draws the "last" point differently

_ fishwick bug with text() and shapes
_   ellipses no longer completed when g.dimensions = 2 or 3,
_   or not even drawn.. what a mess.

_ only allocate stencil and zbuffer on first call to depth()
_   this will require changes to PTriangle and PLine inside their loops

_ break apart functions into local (placement) and override (blitting)
_   just have a "thin_flat_line" option in opengl code

_ image("blah.jpg"); 
_ loadImage() is broken on some machines
_   hacked for a fix in 72, but need to better coordinate with openStream()

_ renderers can plug in:
_   at direct api level
_     taking over all color() functions and vertex collection
_   at endShape() level
_     where vertices are collected by core and blit on endShape()
_     (takes polygons and lines)
_   at post tesselation level
_     takes only line segments and triangles to blit (dxf writer)

_ vertices max out at 512.. make it grow

_ go through and figure out what stuff to make public

_ screenX/Y aren't properly working for 2D points against a 3D matrix
_   (ryan alexander rounding bug)
_   Just to clarify, it works completely correctly with rounding
_   screenX/Y and also using the 3 arg version of translate - 
_   ie translate(hw,hh,0) instead of just translate(hw,hh). 

text issues
_ text() with \n is semi-broken
_ font encoding issues
_   java seems to force straight windows encoding.. (problem for pi fonts)
_   opentype/cff fonts don't work with live loading from the app
_   many (all?) opentype fonts won't show up or aren't supported
_     this may be only cff fonts that have trouble
_   when encoding with something besides the standard encoding, problematic
_     so sonata otf and sonata don't seem to have any chars at all
_ getAllFonts() not quite working for many fonts
_   i.e. Orator Std on windows.. macosx seems to be ok
_   is getFamilyNames() any different/better?
_   when did this break? 1.4.1? 1.4.x vs 1.3?
_   may be that cff fonts won't work?
_ textMode ALIGN_CENTER _LEFT _RIGHT -> CENTER, LEFT, RIGHT ? 
_ need to resolve SCREEN_SPACE vs OBJECT_SPACE
_   can this be auto-detected with noDepth()? 
_   how does rotated text work?
_     PFont.rotate(180) rotate(PI)
_     or can this be detected from the matrix?
_   does the font or PApplet control the size? (the font, ala java)
_   without setting the font, SCREEN_SPACE comes out weird
_   move SCREEN_SPACE into ScreenFont() class?
_     probably not, casey thinks screen space text is prolly more useful
_     that way can clear up some of the general confusion in the code
_   check into symbol font encoding with create font

text wish list
_ look into fixing the texture mapping to not squash fonts
_   NEW_GRAPHICS totally smashes everything
_ not having kerning really blows
_   could this be pulled from the OpenType font stuff? 
_   it could be placed at the end of the file
_ simple way to just use java text in p5 applets? 
_   the current text support is just so hokey

_ named colors.. have a method for a full color lookup table
_   addcolor("blah blah blah", colornum);
_   fill("blah blah blah");
_   maybe this is bad practice--too slow, should use variables

_ 404 error because first searches applet directory on zipdecode

_ write PApplet2, a full screen version of PApplet
_   this might be used for presentation mode

_ api for file-based renderers
_   need to work this out since it will affect other api changes
_   size(0, 0) and then ai.size(10000, 20000)
_     size 0 is code for internal to not show any window
_   saveFrame(PRenderer) or saveFrame("name", PRenderer)
_   saveFrame gets called at the beginning of loop()
_     or is just a message to save the next frame (problem for anim)
_ illustrator export / rendering mode
_   also postscript or pdf export?
_   update illustrator code to use core api
_     even if not actually working properly.. just in naming of things
_   sorting of polygons/lines on simple painters algorithm
_   better lighting model to show darkness at various depths
_     maybe just ultra-high res bitmaps from gl
_   version of BApplet that replaces g. with ai. or pdf.

_ figure out how to handle cached images, multiple images
_   MediaTracker blocking is prolly making jar download really slow
_   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1089914280;start=0

_ mkoser wish list
_   filled polygons working with smooth()
_   z-clipping

_ light(x, y, z, c1, c2, c3, TYPE)
_   also BLight with same constructor, and on() and off() fxn


////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////

GRAPHICS LIBRARY

A hybrid of OpenGL (3D Graphics) and some aspects of Postscript (Fill, Stroke)
The graphics library was formerly called Bagel, which is an internal name.


CORE / PApplet


CORE / PImage

   b _ dynamically load code for png and others on loadImage/saveFrame?
   b _ updated png encoder
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Syntax;action=display;num=1083792994
   b _ more image file i/o.. more advanced in newer java
   b _   read uncompressed tiff, read uncompressed tga files.
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1081190619
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Tools;action=display;num=1066742994;start=15
   b _ loadImage() seems to be caching everything from the jar
   b _   make a note of how to disable this
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Programs;action=display;num=1078795681#8
   b _ get loadImage() to work properly with data folder
   b _   should probably use the code from loadStream
   b _   and the url stuff should be an alternate method altogether
   b _ BImage.smooth() ?
   b _ alpha not set on saveFrame, so can't be used in photoshop as a layer
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=general;action=display;num=1078441623;start=0
   b _ expose function to write tiff header in PImage (advanced)
   b _   helps with writing enormous images
   1 _ loadImage must be used inside or after setup
   1 _   either document this and/or provide a better error message
   1 _   http://processing.org/discourse/yabb/YaBB.cgi?board=Programs;action=display;num=1060879468;start=0
   b _ more blend() modes (the five listed on the thread below?)
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1082056702
   b _   figure out what the modes should actually be: 
   b _     photoshop: normal, dissolve; darken, multiply, color burn, 
   b _                linear burn; lighten, screen, color dodge, linear
   b _                dodge; overlay, soft light, hard light, vivid light, 
   b _                linear light, pin light, hard mix; difference, 
   b _                exclusion; hue, saturation, color, luminosity
   b _     illustrator: normal; darken, multiply, color burn; lighten,
   b _                  screen, color dodge; overlay, soft light, hard light; 
   b _                  difference, exclusion; hue, sat, color, luminosity
   b _     director: Copy, Transparent, Reverse, Ghost, Not copy, 
   b _               Not transparent, Not reverse, Not ghost, Matte, Mask;
   b _               (below seems more useful:
   b _               Blend, Add pin, Add, Subtract pin, Background transparent,
   b _               Lightest, Subtract, Darkest, Lighten, Darken
   b _     flash: 
   b _   DIFFERENCE: C = abs(A-B);
   b _   MULTIPLY: C = (A * B ) / 255
   b _   SCREEN: C= 255 - ( (255-A) * (255-B) / 255 )
   b _   OVERLAY: C = B < 128 ? (2*A*B/255) : 255-2*(255-A)*(255-B)/255
   b _   HARD_LIGHT: C = A < 128 ? (2*A*B/255) : 255-2*(255-A)*(255-B)/255
   b _   SOFT_LIGHT: C = B < 128 ? 2*((A>>1)+64)*B/255 : 255-(2*(255-((A>>1)+64))*(255-B)/255)


CORE / PGraphics

   b _ lines
   b _   z value hack for lines is causing trouble for 2D
   b _     http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1089737928;start=0
   b _   rewrite line and stroke code, it's a buggy mess
   b _     lines become 2 pixels thick after a 3D transform 
   b _     better handling of single-pixel special case
   b _       flat_line_retribution is a hack, can go away
   b _ lines are conflicting with type in 2D
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1094174791;start=0
   b _ mgorbet stroke transparency problem
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1076383048;start=0
   b _   make sure line() commands don't try to have a fill
   b _   box is not opaque
   b _     problem is that lines are drawn second
   b _     one pixel lines have no z value.. argh
   b _     bug re: 3d depth sorting on lines
   b _     http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1043894019;start=0
   b _     http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1042004618
   b _     translate(58, 48, 0); 
   b _     rotateY(0.5);
   b _     box(40);
   b _   line endcaps and line joins. strokeMode()
   b _     lower priority, but at least leave room
   b _ strokeWeight is still broken
   b _   setting stroke width on circle makes odd patterns
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1077013848;start=0
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1080347160
   b _ more weirdness with stroke on rect, prolly not alpha
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1085799526
   b _ rect is not getting it's stroke color set
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1073582391;start=0
   b _ weird problem with drawing/filling squares
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1077226984
   1 _ alpha of zero still draws boogers on screen
   1 _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1073329613;start=0
   1 _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1080342288;start=0
   1 _ color
   1 _   rounding errors on color conversion
   1 _   colorMode(RGB, 1.0); colorMode(255); println(red(color(0.5,1,1)));
   1 _   will return 127, instead of 128.

   1 _ ellipse problems
   1 _   weird ellipse bug with an alpha line in same image
   1 _     http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1083221401;start=0
   1 _   scaled ellipse showing up as a hexagon
   1 _     http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1083674213
   1 _     http://processing.org/discourse/yabb/YaBB.cgi?board=Syntax;action=display;num=1084652597;start=0
   1 _   problem with the fill
   1 _     http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1077834735
   1 _   z values not set properly on ellipses?
   1 _     http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1068752615
   1 _   ellipses are just plain ugly
   1 _     http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1073409011;start=0
   1 _   toxi ellipses don't adapt properly with transformations

   b _ lighting is completely buggy and broken
   b _   add a lighting object
   b _   simong wrote fixed lighting code

   b _ texture mapping
   b _   very odd, "doom era" stuff
   b _   would it be possible to have a 'slow but accurate' mode?

   b _ clipping planes
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1058491568;start=0
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1052313604;start=0
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1095170607;start=0
   b _   things are flying into the camera and halting apps
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1042699742
   b _   NullPointerException apparently when things way offscreen
   b _     i.e. glyphrot with scale set to 4
   b _     or at least that things get ridiculously slow
   b _     clipping issues here.. but also something in scan converter
   b _     not clipping areas from offscreen
   b _       huge geometry slows things way down

   b _ picking
   b _   what is the API for picking?
   b _   ability to write data other than image into the buffer
   b _   user can introduce new kinds of buffers at will (!)
   b _   lists of names of objects, or the 'line number' buffer
   b _   but how to determine *where* on object the hit occurs

   1 _ points
   1 _   point() being funneled through beginShape is terribly slow
   1 _     go the other way 'round

   1 _ add option to sort triangles back to front so alpha works
   1 _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1076660476;start=0

   1 _ colorMode(CMYK)
   1 _   just does 1-r/1-g/1-b inside 
   1 _   http://processing.org/discourse/yabb/YaBB.cgi?board=Tools;action=display;num=1082055374;start=0


CORE / Sound

   1 _ merge PSound and PSound2 via reflection?
   1 _   once debugged, merge these back together and use reflection
   1 _     (unless it's a messy disaster)


CORE / Details

   1 _ framerate(30) is still flickery and jumpy..
   1 _ fix param() to use a sketch.properties file when run as an app
   1 _   make this also be used in generating the html file
   1 _ fix link() to handle relative URLs
   1 _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1081710684;start=0
   1 _ put SecurityException things around file i/o for applets
   1 _   rather than checking online(), since applets might be signed
   1 _ saveFrame() at the end of a draw mode program is problematic
   1 _   app might exit before the file has finished writing to disk
   1 _   need to block other activity inside screenGrab until finished
   1 _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1081706752
   1 _ problems with defining fill(255) vs fill(0xff808080)
   1 _   http://processing.org/discourse/yabb/YaBB.cgi?board=Syntax;action=display;num=1083650609;start=0
   1 _   http://processing.org/discourse/yabb/YaBB.cgi?board=Syntax;action=display;num=1082481891;start=2
   1 _ what is the stroked version of a sphere? a circle?
   1 _ non-homogenous coloring for curve vertices
   1 _   properly interpolate
   1 _ too many push() will silently stop the applet inside a loop
   1 _ test winding polygons in different directions
   1 _ test lighting to see how it compares with gl
   1 _ better lockout inside beginShape() to keep other things from happening
   1 _ is quad strip broken or not behaving as expected?
   1 _   may be correct, it worked for nik
   1 _ inside draw() mode, delay() does nothing
   1 _   delay might be a good way to signal drawing to the screen/updating
   1 _ catch security exceptions around applet i/o calls
   1 _   not just for saving files, but provide better error msgs when
   1 _     attempting to download from another server
   1 _ array utilities on Object[] are worthless.. fix it with reflection?
   1 _   see if reflection will allow expand for all class types


CORE / main()

   b _ ed's thread re: fullscreen strategies
   b _   could add a new BApplet that uses BufferStrategy?
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Programs;action=display;num=1081335361;start=15


CORE / Documentation

   1 _ write documentation on general use of processing.core
   1 _   along with how to download from sourceforge (anonpass is blank)
   1 _   note that applet is itself a Component


CORE / Mac OS X

   b _ still some weirdness with thread flickering on the mac
   b _   and frenetic display updates on the pc
   b _ little window showing up on macosx when running
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1081284410
   b _ flicker happening on osx java 1.4, but not 1.3:
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1083184297;start=0
   b _ cursor() broken in applets on macosx?
   b _   or is it a java 1.4 versus java 1.3 problem?
   b _   http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1081645955


CORE / PFont


CORE / New Graphics
What the hell do we do with this code?

   1 _ stroke not set on flat_rect
   1 _ when drawing fonts w/ sami's code, left edge has problem
   1 _   8-bit (alpha) textures not blending 
   1 _ near-plane clipping currently disabled for triangles, enabled for lines
   1 _   (but culling offscreen triangles works.. but may have been
   1 _   commented out by carlos)
   1 _ hint(NEW_GRAPHICS) needs to be called before allocate()
   1 _   otherwise stencil buffer and 'triangle' object are null on first run
