aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph/ui/shapes
Commit message (Collapse)AuthorAgeFilesLines
* GraphUI: Add HUDShape, a convenient HUD shape to be exposed in the scene ↵Sven Göthel2024-02-071-0/+262
| | | | using inner object size/pos, similar like TooltipShape
* GraphUI Cleanup: Use TreeTool directly (Reduce virtl-funcs); Fix typos; Use ↵Sven Göthel2024-02-042-4/+1
| | | | | | PointerListener for onClicked(), add onHover(); Subsequent commits will fix complete cleanup where code was changed mostly regarding other issues.
* Bug 1493: Enhance Text/ASS subtitle layout: Split too wide text into ↵Sven Göthel2024-02-041-8/+36
| | | | | | | | multiple lines (max 4) fitting into box, trimming it beforehand Not always are Text/ASS subtitles well formed with newline character. Use new StringUtil to re-layout if their width doesn't fit into the box, by trimming all whitespace and splitting them into up-to 4 lines.
* GraphUI Button: Fix API doc typoSven Göthel2024-02-041-1/+1
|
* GraphUI: Fix func-name, rename ↵Sven Göthel2024-02-041-2/+2
| | | | TexSeqButton.use{AspectRation->ARatio}Letterbox() matching TextureSequence
* Graph/GraphUI: Move getDefault*() to FontFactory and add ↵Sven Göthel2024-02-031-22/+26
| | | | {get,set}FallbackFont() + Font.getBestCoverage(..); Use fallback-font in MediaButton in case chosen font doesn't match (foreign languages, e.g. 'zho' Chinese .. )
* Bug 1493 - Text/ASS Subtitle via MediaButton/MediaPlayer Alignment defaults ↵Sven Göthel2024-02-021-19/+38
| | | | | | to CenterHoriz, also support Left. MediaButton: Also cleanup local vars in layout
* Bug 1494 - GLMediaPlayer/GraphUI: Support Displaying Bitmap'ed Subtitles ↵Sven Göthel2024-02-021-85/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (PGS ..) via FFMPEGFMediaPlayer/FFmpeg FFMPEGFMediaPlayer related changes: - Add libswscale (6th FFmpeg lib used) for sws_getCachedContext(), sws_scale() and sws_freeContext(), used natively to convert the palette'ed bitmap into RGBA colorspace -> GL texture - Handling AVSubtitleRect.type SUBTITLE_BITMAP -- only handled if libswscale is available -- config/adjust texture object -- sws_scale palette'ed bitmap to texture -- intermediate memory is cached, may be resized and free'ed at destroy -- texture objects are managed and passed from GLMediaPlayerImpl, as they are also forwarded to player client via SubBitmapEvent - Passing the AVCodecID to GLMediaPlayerImpl, converted to our CodecID enum. - Unifying creation and opening of AVCodecContext with 'createOpenedAVCodecContext(..)' +++ SubtitleEvent* - SubTextEvent now also handles ASS.Dialogue (FFmpeg 4) besides ASS.Event (FFmpeg 5, 6, ..). +++ GLMediaPlayerImpl - Added ringbuffer subTexFree, managing Texture for bitmap'ed subtitles -- Uses 1 bitmap-subtitle Texture per used textureCount in cache, as one bitmap-subtile can be displayed per frame. Could be potentially reduced to just 2 .. but resources used are relatively low here. - Validating subTexFree + videoFramesFree usage, use blocking get/put ringbuffer due to utilization from different threads. - Receives subtitle content from native getNextPacket0() via callback, creates SubtitleEvent instance and passes it to a SubtitleEventListener - if exists. (See MediaButton example) -- SubBitmapEvent also gets its special SubBitmapEvent.TextureOwner to handle client releasing the event and allowing us to put back the Texture resource to 'subTexFree'. This passing through of the Texture object is probably a weakness of this lifecycle and requires the client to ensure SubtitleEvent.release() gets called. See MediaButton example! - Exposing CodecID, allowing clients like MediaButton to handle SubtitleEvent content according to codec
* Bug 805: Graph/GraphUI TextureSequence Scale: Move ↵Sven Göthel2024-02-011-5/+30
| | | | | | | | | Region.COLORTEXTURE_LETTERBOX_RENDERING_BIT to TextureSequence and add enabling/disabling of aratio adjustment + letter-box back-color TextureSequence color-texture params fetched from Graph VBORegion* and fed into shader. This allows more flexibility in aspect-ratio adjustment as well as setting a clipping background color for the added letter-box space.
* GraphUI: Only issue Shape.mark*Dirty() if values were updated or data ↵Sven Göthel2024-01-313-8/+14
| | | | available; JOGL ImageSequence: Add addFrame(GL, TextureFrame), remove*Frame() and isSequenceAnimating()
* Utilize PTS.getCurrent() where applicableSven Göthel2024-01-311-1/+1
|
* GLMediaPlayer: Split GLMediaFrameListener (rarely used) from ↵Sven Göthel2024-01-311-5/+0
| | | | | | | | | | GLMediaEventListener, easing listener callbacks; Prepare SubtitleEventListener generalization (Bug 1494) Moves pushSound(), pushSubtitle*() from FFMPEGMediaPlayer to GLMediaPlayerImpl, as it is handled in a generic way - even though currently only called by native FFMPEGMediaPlayer implementation. Note: This patch is incomplete, i.e. not even compile clean. But choses as-is to semantically split the work to ease review.
* GraphUI MediaButton: Add blending below subtitle, allow setting ↵Sven Göthel2024-01-291-8/+26
| | | | color/blending and subLineDY; MediaPlayer: Add full infoLine toggle with click on infoBox
* FFMPEGMediaPlayer/GraphUI MediaButton: AVSubtitles's start/end are relative ↵Sven Göthel2024-01-281-20/+32
| | | | to pts [ms] (fixed); Use ASSEventLine packets within proper pts only.
* Cleanup GLMediaPlayer.EventMask.Bit handling in GLMediaEventListener ↵Sven Göthel2024-01-281-2/+1
| | | | implementations: Either Uninit, Init, Pause or Play (exclusive)
* GraphUI MediaButton: Clear cached subtitle data on uninit and init from ↵Sven Göthel2024-01-281-2/+12
| | | | GLMediaPlayer
* GraphUI MediaButton/MediaPlayer-Widget: Add working subtitle (text + ↵Sven Göthel2024-01-281-5/+153
| | | | ass/saa) support via GLMediaPlayer/FFMPEGMediaPlayer
* GraphUI GLButton: Filter out Region.AA_RENDERING_MASK in ctor, as ↵Sven Göthel2024-01-161-1/+2
| | | | GLEventListener renders into FBO at correct resolution.
* Graph/GraphUI AA-Quality + SampleCount (shader): Push params down to ↵Sven Göthel2024-01-165-9/+9
| | | | | | | | | | | | | | | | | | RegionRenderer's RenderState usually rarely set from top of user API, reducing complexity. Discussion: Alternative was to pass AA-Quality same as SampleCount from the top (e.g. GraphUI Scene), however, this convolutes the API even more. Both parameter modify the resulting shader code in pass2 rendering (only). The used 'renderMode' is still maintained within the Region, since it contains more dynamic states individual to each Region instance (color-texture, ..). This despite 'renderMode' also changes the RenderState's shader program. In the end, it really doesn't matter and is a choice of frequency - the pipeline is usually rendering from on OpenGL rendering thread sequentially. AA-Quality and SampleCount simply usually don't change that often and are set only once.
* Graph Clipping: Initial Region impl of AABBox clipping using GLSL shader ↵Sven Göthel2024-01-091-0/+3
| | | | | | | | | | | | (Convenient using Graph/GraphUI produced AABBox) Simple demo, setting clip-bbox manually: - src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeClippingDemo00.java TODO: - GLSL: Add missing Mv-multiplication of vertex-position -> gcv_ClipBBoxCoord -- AABBox min/max should be set pre-multiplied w/ Mv covering an independent area, not per Shape/Region. -- This to properly work with moving/scaling of each Shape/Region etc
* GraphUI Rectangle: Remove dropping AA_RENDERING_MASK, i.e. allow ↵Sven Göthel2024-01-071-1/+1
| | | | | | | | | | VBAA_RENDERING_BIT again Dropping AA was added in commit eb99bfc27f9f49387cbb08471debcd4d61e4f745, but non-planar rectangles need AA to avoid stairs. Hence manually dropping some AA in MediaPlayer for blending rectangles. RangeSlider already drops AA for its bars etc.
* GraphUI Button.setLabelColor(..): Add alpha channel and variant w/ Vec4f for ↵Sven Göthel2024-01-071-4/+14
| | | | flexibility
* GraphUI MediaPlayer / GLMediaPlayer: Add current chapter-title to info-fieldSven Göthel2024-01-071-1/+1
|
* GraphUI MediaButton: Add clearImpl(..), stopping and rewinding streamSven Gothel2023-12-301-0/+5
|
* GraphUI Shape Rectangle: Draw simple filled rect if lineWidth==0, drop ↵Sven Gothel2023-12-191-7/+8
| | | | AA_RENDERING_MASK from renderModes (not necessary for a rect)
* GraphUI MediaButton: Disable AA_RENDERING_MASK for GLMediaPlayer color ↵Sven Gothel2023-12-181-1/+2
| | | | | | | | | texture (effiency, less artifacts) 2-pass Graph-AA is not desired for video textures to enhance efficiency and reduce artifacts. Consider using 'mPlayer.setTextureMinMagFilter( new int[] { GL.GL_LINEAR, GL.GL_LINEAR } )' of passed GLMediaPlayer instance to use bilinear filtering for different sizes.
* GraphUI Shape: Rename [set|is]{Enabled -> Visible}(..) for claritySven Gothel2023-12-181-1/+1
| | | | | Note that invisible shapes are still considered for picking/activation. To completely mute the shape, issue {@link #setInteractive(boolean)} as well.
* Bug 1465 - Graph / GraphUI: Render a Region's ColorTexture in proper ↵Sven Gothel2023-09-304-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aspect-ratio, letter-boxed or zoomed (config) + Bug 1466 Fix color mixing Bug 1465: Region currently simply bloats a given texture to its region AABBox, which renders textures with the wrong aspect ratio. Add facility to program the texture-coordinates to either letter-box or scaled-up (and cut) true aspect-ratio. Default shall be zoom (scale-up and cut), but user shall be able to set a flag in the Region for letter-box. Have the shader clip texture coordinates properly, best w/o branching to soothe performance. See functions.glsl +++ Bug 1466: Current color mix: texture * color_channel * color_static is useless in GraphUI. color_static shall modulate the texture, which works. But in case of color_channel (attribute/varying) we want it to be mixed so it can become the more dominant color for e.g. a border. Desired is: color = vec4( mix( tex.rgb * gcu_ColorStatic.rgb, gcv_Color.rgb, gcv_Color.a ), mix( tex.a * gcu_ColorStatic.a, 1, gcv_Color.a) );
* GraphUI Button: Support toggle'ed labels and fixed font size scaling for ↵Sven Gothel2023-09-261-51/+155
| | | | | | | | | | | | | | | | | | | | | | | | | symbols (see setFixedLabelSize()), This allows convenient instantiation of a Button changing its text (or symbol) when toggled, e.g.: UISceneDemo03: + final Button button = new Button(options.renderModes, fontSymbols, + fontSymbols.getUTF16String("play_arrow"), fontSymbols.getUTF16String("pause"), + buttonWidth, buttonHeight, buttonZOffset); + button.setSpacing(symSpacing, fixedSymSize); +++ setFixedLabelSize(..): Sets fixed label font size clipped to range [0 .. 1], defaults to {@code 0, 0}. Use {@code w=0, h=1} when using single symbols from fixed sized symbol fonts! Use {@link #setSpacing(Vec2f, Vec2f)} to also set spacing. The fixed label font size is used as the denominator when scaling.{@code max(fixedLabelSize, fontLabelSize)}, hence reasonable values are either {@code 1} to enable using the given font-size for the axis or {@code 0} to scale up/down the font to match the button box less spacing for the axis.
* GraphUI Button: Increase default spacing a little: x .12 -> .20, y .42 -> .46Sven Gothel2023-09-261-2/+2
|
* Bug 1462 - Graph Font: Add name + codepoint to ID and Glyph mapping plus ↵Sven Gothel2023-09-242-20/+11
| | | | | | | | | traversing through all Glyphs See UISceneDemo03 new Button(options.renderModes, fontSymbols, " "+fontSymbols.getUTF16String("pause")+" ", buttonWidth, buttonHeight); // pause Unicode codepoint symbol is also contained in FontGlyph
* GraphUI Label: Condense getUnscaledGlyphBounds()Sven Gothel2023-09-241-4/+1
|
* GraphUI MediaButton: Return this for chaining on setterSven Gothel2023-09-241-2/+3
|
* GraphUI Button: Remove redundant ctors and methods. ZOffset shall be simply ↵Sven Gothel2023-09-241-68/+0
| | | | given, calculated by caller
* GraphUI Button.getSubString(): Expose labelZOffsetSven Gothel2023-09-231-1/+1
|
* GraphUI GlyphShape.addShapeToRegion(): In case the Font.Glyph has no shape, ↵Sven Gothel2023-09-201-0/+3
| | | | at least add an empty region to avoid an NPE
* Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit ↵Sven Gothel2023-09-204-12/+12
| | | | | | | | | | | | | | | | | | | | agnostic (PMVMatrix, Matrix4f, Vec4f, ..) Math functionality (PMVMatrix, Matrix4f, Vec4f, ..) - shall be used toolkit agnostic, e.g. independent from OpenGL - shall be reused within our upcoming Vulkan implementation - may also move outside of JOGL, i.e. GlueGen or within its own package to be reused for other purposed. The 'com.jogamp.opengl.util.PMVMatrix' currently also used to feed in GLUniformData via the toolkit agnostic SyncAction and SyncBuffer shall also be split to a toolkit agnostic variant. An OpenGL PMVMatrix specialization implementing GLMatrixFunc can still exist, being derived from the toolkit agnostic base implementation. +++ Initial commit .. compile clean, passing most unit tests.
* GraphUI Label: Add convenient methods getUnscaledGlyphBounds(..)Sven Gothel2023-09-171-0/+12
|
* GraphUI GlyphShape: Add copy-ctor variantSven Gothel2023-09-161-0/+17
|
* GraphUI: Button/Label: Complete String -> CharSequence type change for text, ↵Sven Gothel2023-09-042-5/+5
| | | | rename Button set{Label->Text}(..), adjust demo/text code
* GraphUI Enhance: API doc; Scene/Button Z-offset and -epsilon; Push temp ↵Sven Gothel2023-09-044-46/+225
| | | | AffineTransform to local method; Simplify BaseButton setCorner(0) -> setPerp(); Protected abstract ctor ..
* GraphUI Button: Add label bounds to own shape (adds used z-range)Sven Gothel2023-09-031-0/+2
|
* GraphUI Scene: Expose Z-Epsilon API for default and current PMVMatrixSetup ↵Sven Gothel2023-09-031-4/+30
| | | | values; Button add Z-Epsilon API for ctor and setLabelZOffset(..)
* Graph Font + Glyph: More robust detetection and API definition of ↵Sven Gothel2023-08-282-7/+6
| | | | | | non-contour/whitespace Glyphs (detect and allow to skip 'em) We also drop shapes for both, but for id 0 (unknown).
* GraphUI: Button: Reduce default DEFAULT_LABEL_ZOFFSET from 0.005f -> ↵Sven Gothel2023-08-271-1/+1
| | | | | | | | | 0.0001f, have to check if working on all platforms (TODO) Otherwise, we have to resolve the 'one Region' for the Button (backgroung shape + text on top) implementation with two OutlineShapes. As of now, we use the z-offset of the text above background to avoid z-fighting. This is like a manual application of glPolygonOffset(..) directly on the produced vertices.
* GraphUI: Group API doc + remove GlyphShape's redundant many getOrigPos() ↵Sven Gothel2023-08-251-37/+4
| | | | variants
* Texture ctor w/ external textureID: Pass `ownsTextureID` where true hands ↵Sven Gothel2023-08-131-6/+10
| | | | | | | | | over ownership and allows destroy() to delete it, otherwise not. Fixes GraphUI's GLButton. GraphUI's GLButton uses the offscreen's FBO texture and hence can't pass over ownership of the texture. Hence the Texture instance is created w/o handing over ownership! GLMediaPlayerImpl does hand over ownership of the generated and passed texture to the Texture ctor.
* GraphUI MediaButton: Expose AudioSinkSven Gothel2023-05-231-0/+3
|
* GLMediaPlayer: Replace GLMediaEventListener.EVENT_CHANGE_* 'int event_mask' ↵Sven Gothel2023-05-091-6/+6
| | | | with EventMask.Bit/EventMask
* GraphUI Colors: Use pure white modulation w/ color-channel on no-action for ↵Sven Gothel2023-04-284-13/+32
| | | | original color, adjust defaults accordingly