xdsopl / robot36

Decode SSTV encoded audio signals to images
https://sites.google.com/view/xdsopl/robot36
BSD Zero Clause License
294 stars 31 forks source link

Request: Add information overlay to saved pictures #24

Open xdsopl opened 2 weeks ago

xdsopl commented 2 weeks ago

Add option to add a text overlay, needed for competitions:

ropucyka commented 1 week ago
  • time in UTC

Internet needed for it? Local time?

  • locator

So, image sender can overlay his GPS into picture? Will be cool. Many devices have several system modes like: GPS, GLONASS, Beidou, Galileo

locator = time in UTC Ahh, ok.

xdsopl commented 1 week ago

@ropucyka No internet needed for UTC time, as it can be simply converted from local time if the local timezone is correctly setup. The system clock runs on UTC anyway on Android (Linux) AFAIK, so it should even work on a device with a wrongly setup local timezone. Using UTC for the filename instead of local time would be a neat change in itself.

Locator could be implemented using GPS but that would need additional permissions and a lot more code to maintain. A simple string should be enough for the first implementation and would have a lesser chance of failure IMHO.

So all we need is just another menu option and a dialog where the operator can enter two strings: callsign and locator.

ropucyka commented 1 week ago

A simple string should be enough for the first implementation and would have a lesser chance of failure IMHO

I think same- simple - better. In everything.

xdsopl commented 3 days ago

In case someone is working on this, here an example of some text lines drawn into a Bitmap:

bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
Canvas canvas = new Canvas(bitmap);
Paint outlinePaint = new Paint();
outlinePaint.setColor(Color.BLACK);
outlinePaint.setStyle(Paint.Style.STROKE);
outlinePaint.setStrokeWidth(5);
outlinePaint.setTextSize(32);
outlinePaint.setAntiAlias(true);
Paint fillPaint = new Paint();
fillPaint.setColor(Color.WHITE);
fillPaint.setStyle(Paint.Style.FILL);
fillPaint.setTextSize(32);
fillPaint.setAntiAlias(true);
Paint.FontMetrics fontMetrics = fillPaint.getFontMetrics();
float lineHeight = fontMetrics.bottom - fontMetrics.top;
Date date = new Date();
SimpleDateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
utcFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String utcTime = utcFormat.format(date);
String callsign = "XDSOPL";
String locator = "475X+88 Gilching";
String[] lines = { callsign, locator, utcTime };
float x = 10, y = 10;
for (String line : lines) {
    canvas.drawText(line, x, y - fontMetrics.top, outlinePaint);
    canvas.drawText(line, x, y - fontMetrics.top, fillPaint);
    y += lineHeight;
}

Then you get something like that: 20241123_175044 Now all left to do is to draw the rest of the owl.

ropucyka commented 2 days ago

Overlay this info from sender (SSTV Encoder) will be more more useful i think. Or what..

xdsopl commented 2 days ago

Some competitions require burning the data of the contestant into the received picture before uploading the proof of reception. Including that feature would avoid another detour to an image manipulation program. Agility is very important in those competitions.

xdsopl commented 1 day ago

Here the requirements for the ARISS SSTV award: https://docs.google.com/document/d/1yXhBHZ1qPt_-VSSWtWf15fU8kbfBSvu7RN2Pm5P1ADI