Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3c053ad
added video type ffmpeg
Apr 21, 2014
6a641e6
fixed ffmpeg jar name
Apr 22, 2014
beae26c
change bridj jar from unix-only to include windows, mac os x
Apr 26, 2014
17af44a
added media icon to make overlay in ffmpeg thumbnail tool work
Apr 27, 2014
d9fc634
Remove xuggler from source code.
Oct 24, 2014
831ba14
Merge remote-tracking branch 'upstream/master'
Nov 15, 2014
e0ff7ce
Fix merging problems.
Nov 16, 2014
804eb3c
Adjust start to use classpath in Linux
Dec 2, 2014
cba9834
New version ffmpeg 2.6.
Apr 22, 2015
da5b31a
Merge branch 'master' of github.com:OpenSourcePhysics/osp
Jul 12, 2015
85794ca
update to ffmpeg 2.7.2
Sep 1, 2015
3522d28
New version with lf line endings.
Sep 12, 2015
9f3be40
Convert line endings to lf.
Sep 12, 2015
392353b
Merge upstream 12.9.15.
Sep 12, 2015
5076dfc
Fix override errors.
Sep 12, 2015
d320688
Fix startup process.
Sep 13, 2015
44058de
update to ffmpeg 2.8
Sep 27, 2015
c8a6bbb
Merge branch 'master' of github.com:OpenSourcePhysics/osp
May 4, 2016
56de12d
fix some problems
May 5, 2016
7d25852
Merge remote-tracking branch 'upstream/master'
Sep 20, 2016
7511d43
fix some merging problems
Sep 20, 2016
1dd6689
Merge remote-tracking branch 'upstream/master'
Oct 3, 2016
8f25ea7
update to ffmpeg 3.2, try to use ffmpeg.jar unversioned
Dec 25, 2016
9f2e168
don't restart on Linux because libs are in ldconfig path
Jan 2, 2017
b30870e
update to ffmpeg-3.3
May 7, 2017
1c11135
Merge remote-tracking branch 'upstream/master'
Oct 5, 2017
226cc82
remove xuggle strings
Oct 5, 2017
2419e34
fix comment at end
Oct 5, 2017
5963a34
Merge branch 'master' of github.com:OpenSourcePhysics/osp
Oct 7, 2018
a872028
fix ffmpeg merging errors
Oct 7, 2018
3ec1bdb
double -> long (should be faster)
nickkolok Oct 16, 2018
fd78623
Minor optimization
nickkolok Dec 5, 2018
bdbb90d
Fitting Gaussian without creating some GUI elements
nickkolok Dec 5, 2018
bf42170
Refactoring of fitter - part 2
nickkolok Dec 5, 2018
e127f8a
Minor optimization
nickkolok Dec 7, 2018
408f690
Optimization: x3 for searching template in image, -0.001 for precision
nickkolok Dec 8, 2018
6de0792
Optimization: respecting convexity of the mask
nickkolok Dec 8, 2018
2cedb53
Alternative decimal separators - field and getter/setter
nickkolok Dec 9, 2018
e00204d
NumberField - support of additional decimal delimiters
nickkolok Dec 9, 2018
16672d2
Newline
nickkolok Dec 10, 2018
9bccc64
Support of reverse stepping
nickkolok Dec 10, 2018
1a44912
Reverse stepping - tip
nickkolok Dec 10, 2018
949927d
Cosmetics
nickkolok Dec 10, 2018
a7afb28
Building Gaussian fitter moved to static constructor
nickkolok Dec 10, 2018
dc73d9d
Minor refactoring
nickkolok Dec 10, 2018
b3d75b5
Renaming f to fGaussian
nickkolok Dec 10, 2018
06d6f72
Minor refactoring
nickkolok Dec 10, 2018
a122363
Minor fastenation
nickkolok Dec 10, 2018
32e8ec1
A bigmethod splitted to two smaller ones
nickkolok Dec 10, 2018
6388c9f
Just an annotation :)
nickkolok Dec 10, 2018
f3515c2
Better extrapolation of image diff
nickkolok Dec 11, 2018
5dbf805
Minor refactoring: duplicated code separated to a function
nickkolok Dec 12, 2018
eac5e20
Minor refactoring
nickkolok Dec 12, 2018
120fd29
Cosmetics
nickkolok Dec 12, 2018
dced1fa
Refactoring: gaussian estimation (duplicated code) separated to a method
nickkolok Dec 12, 2018
8edf0c9
Refactoring: gaussian fitting (duplicated code) separated to a method
nickkolok Dec 12, 2018
a40c600
BufferedImageUtils separated to a class
nickkolok Dec 12, 2018
8c1e8b1
Just an annotation
nickkolok Dec 13, 2018
22cb472
More BufferedImage utils
nickkolok Dec 13, 2018
d65a436
Onemoreredundant GUI call cleaned out
nickkolok Dec 13, 2018
f76ff15
moveRectIntoImage() - adapted as is from Autotracker with minimal cha…
nickkolok Dec 13, 2018
3432a67
Shifting the template in colorspace
nickkolok Dec 14, 2018
16bac29
Just a typo in documentation
nickkolok Dec 14, 2018
5891574
A GUI class extracted from Tracker
nickkolok Dec 14, 2018
5b29c87
Removed unused imports
nickkolok Dec 16, 2018
1be6b3b
Grid-like order when finding the difference between the template and …
nickkolok Dec 17, 2018
aefc7c9
Image magnification
nickkolok Dec 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed jars/osp.jar
Binary file not shown.
3 changes: 0 additions & 3 deletions src/org/opensourcephysics/controls/OSPLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -1079,9 +1079,6 @@ public void publish(LogRecord record) {
} else if(val==ConsoleLevel.OUT_CONSOLE.intValue()) {
if (msg.indexOf("ERROR org.ffmpeg")>-1) //$NON-NLS-1$
ospLog.firePropertyChange("ffmpeg_error", null, msg); //$NON-NLS-1$
else if (msg.indexOf("JNILibraryLoader")>-1) {//$NON-NLS-1$
ospLog.firePropertyChange("xuggle_error", null, msg); //$NON-NLS-1$
}
if (!OSPLog.logConsole) return;
style = OSPLog.gray;
} else if(val>=Level.WARNING.intValue()) {
Expand Down
34 changes: 27 additions & 7 deletions src/org/opensourcephysics/display/OSPRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ public class OSPRuntime {
/** The preferred decimal separator, if any */
private static String preferredDecimalSeparator;

/** The additional decimal separators to be replaced with preferredDecimalSeparator, if any */
private static String additionalDecimalSeparators;

/** File Chooser starting directory. */
public static String chooserDir;

Expand Down Expand Up @@ -859,20 +862,37 @@ public static void setDefaultDecimalSeparator(char c) {
* @param separator a decimal separator
*/
public static void setPreferredDecimalSeparator(String separator) {
if (separator==null || COMMA_DECIMAL_SEPARATOR.equals(separator) || PERIOD_DECIMAL_SEPARATOR.equals(separator)) {
preferredDecimalSeparator = separator;
}
if (separator == null || COMMA_DECIMAL_SEPARATOR.equals(separator) || PERIOD_DECIMAL_SEPARATOR.equals(separator)) {
preferredDecimalSeparator = separator;
}
}

/**
* Sets the additional decimal separators.
*
* @param separator a decimal separator
*/
public static void setAdditionalDecimalSeparators(String separator) {
additionalDecimalSeparators = separator;
}

/**
* Gets the preferred decimal separator. May return null.
*
* @return the separator, if any
*/
public static String getPreferredDecimalSeparator() {
return preferredDecimalSeparator;
public static String getPreferredDecimalSeparator() {
return preferredDecimalSeparator;
}

/**
* Gets the string containing additional decimal separators. May return null.
*
* @return the separators, if any
*/
public static String getAdditionalDecimalSeparators() {
return additionalDecimalSeparators;
}

/**
* Gets the default search paths, typically used for autoloading.
* Search paths are platform-specific "appdata", user home and code base, in that order.
Expand Down
3 changes: 0 additions & 3 deletions src/org/opensourcephysics/display/ResizableIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public ResizableIcon(Icon icon) {
baseHeight = h = icon.getIconHeight();
}

@Override
public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
if (icon == null) {
return;
Expand All @@ -67,12 +66,10 @@ public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
g.drawImage(baseImage, x, y, w, h, c);
}

@Override
public int getIconWidth() {
return w;
}

@Override
public int getIconHeight() {
return h;
}
Expand Down
91 changes: 91 additions & 0 deletions src/org/opensourcephysics/display/TextLineLabel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package org.opensourcephysics.display;

import javax.swing.*;
import java.awt.*;

/**
* A DrawingPanel that mimics the look of a JLabel but can display subscripts.
*/
public class TextLineLabel extends DrawingPanel {
DrawableTextLine textLine;
JLabel label;
int w;

/**
* Constructor
*/
public TextLineLabel() {
textLine = new DrawableTextLine("", 0, -4.5); //$NON-NLS-1$
textLine.setJustification(TextLine.CENTER);
addDrawable(textLine);
label = new JLabel();
textLine.setFont(label.getFont());
textLine.setColor(label.getForeground());
}

/**
* Constructor with initial text
*/
public TextLineLabel(String text) {
this();
setText(text);
}

/**
* Sets the text to be displayed. Accepts subscript notation eg v_{x}.
*
* @param text the text
*/
public void setText(String text) {
if (text == null) text = ""; //$NON-NLS-1$
if (text.equals(textLine.getText())) return;
w = -1;
textLine.setText(text);
if (text.contains("_{")) { //$NON-NLS-1$
text = TeXParser.removeSubscripting(text);
}
// use label to set initial preferred size
label.setText(text);
java.awt.Dimension dim = label.getPreferredSize();
dim.width += 4;
setPreferredSize(dim);
}

@Override
public Font getFont() {
if (textLine != null) return textLine.getFont();
return super.getFont();
}

@Override
public void setFont(Font font) {
if (textLine != null) {
textLine.setFont(font);
w = -1;
} else super.setFont(font);
}

@Override
public void paintComponent(Graphics g) {
setPixelScale(); // sets the pixel scale and the world-to-pixel AffineTransform
((Graphics2D) g).setRenderingHint(
RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
textLine.draw(this, g);
if (w == -1) {
// check preferred size and adjust if needed
w = textLine.getWidth(g);
Dimension dim = getPreferredSize();
if (dim.width > w + 4 || dim.width < w + 4) {
dim.width = w + 4;
setPreferredSize(dim);
processParent(getParent());
}
}
}

public void processParent(Container c){
/*To be overridden*/
}

}
47 changes: 4 additions & 43 deletions src/org/opensourcephysics/media/core/BrightnessFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.image.BufferedImage;

import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JLabel;
Expand All @@ -52,10 +51,8 @@
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import org.opensourcephysics.controls.XML;
import org.opensourcephysics.controls.XMLControl;
import org.opensourcephysics.controls.XMLControlElement;

/**
* This is a Filter that changes the brightness and contrast of a source image.
Expand Down Expand Up @@ -97,12 +94,6 @@ public BrightnessFilter() {
* @param contrast the contrast.
*/
public void setContrast(double contrast) {
if (previousState==null) {
previousState = new XMLControlElement(this).toXML();
previousBrightness = brightness;
previousContrast = contrast;
}
changed = changed || this.contrast!=contrast;
Double prev = new Double(this.contrast);
this.contrast = contrast;
updateFactors();
Expand All @@ -124,12 +115,6 @@ public double getContrast() {
* @param brightness the brightness.
*/
public void setBrightness(int brightness) {
if (previousState==null) {
previousState = new XMLControlElement(this).toXML();
previousBrightness = this.brightness;
previousContrast = this.contrast;
}
changed = changed || this.brightness!=brightness;
Integer prev = new Integer(this.brightness);
this.brightness = brightness;
updateFactors();
Expand All @@ -145,18 +130,6 @@ public int getBrightness() {
return brightness;
}

/**
* Determines if the filter settings have changed.
*
* @return true if changed
*/
@Override
public boolean isChanged() {
if (!changed) return false;
// changes have occurred so compare final and initial states
return previousBrightness!=brightness || previousContrast!=contrast;
}

/**
* Applies the filter to a source image and returns the result.
*
Expand Down Expand Up @@ -217,6 +190,10 @@ public void refresh() {
brightnessSlider.setToolTipText(MediaRes.getString("Filter.Brightness.ToolTip.Brightness")); //$NON-NLS-1$
contrastLabel.setText(MediaRes.getString("Filter.Brightness.Label.Contrast")); //$NON-NLS-1$
contrastSlider.setToolTipText(MediaRes.getString("Filter.Brightness.ToolTip.Contrast")); //$NON-NLS-1$
if(inspector!=null) {
inspector.setTitle(MediaRes.getString("Filter.Brightness.Title")); //$NON-NLS-1$
inspector.pack();
}
boolean enabled = isEnabled();
brightnessLabel.setEnabled(enabled);
brightnessSlider.setEnabled(enabled);
Expand Down Expand Up @@ -323,17 +300,6 @@ public Inspector() {
*/
void createGUI() {
setTitle(MediaRes.getString("Filter.Brightness.Title")); //$NON-NLS-1$
addWindowFocusListener(new java.awt.event.WindowAdapter() {
@Override
public void windowLostFocus(java.awt.event.WindowEvent e) {
if (isChanged() && previousState!=null) {
changed = false;
support.firePropertyChange("filterChanged", previousState, BrightnessFilter.this); //$NON-NLS-1$
previousState = null;
}
}
});

// create brightness components
brightnessLabel = new JLabel();
brightnessField = new IntegerField(3);
Expand Down Expand Up @@ -524,11 +490,6 @@ public Object loadObject(XMLControl control, Object obj) {
}
filter.inspectorX = control.getInt("inspector_x"); //$NON-NLS-1$
filter.inspectorY = control.getInt("inspector_y"); //$NON-NLS-1$
filter.previousState = null;
filter.changed = false;
if (filter.inspector!=null) {
filter.inspector.updateDisplay();
}
return obj;
}

Expand Down
Loading