Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Letter clock effect #74

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Letter clock effect #74

wants to merge 15 commits into from

Conversation

Etua
Copy link

@Etua Etua commented Feb 2, 2022

No description provided.

@cahirwpz cahirwpz changed the title Added first working version of the letter clock effect Letter clock effect Feb 2, 2022
@Etua Etua marked this pull request as ready for review February 3, 2022 23:37
effects/letter-clock/letter-clock.c Outdated Show resolved Hide resolved
effects/letter-clock/letter-clock.c Outdated Show resolved Hide resolved
palette[21] = color(#00ff00);

// Experimental code:
String lines[] = loadStrings("background.txt");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you load the image directly and process it in a function? I don't want to keep in the repository intermediate conversion steps in obscure file format.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

background.txt is just a result of conversion with PNG2C with C-specific parts stripped. I wanted to use OCS for the prototype to be as "Amiga-like" as possible but AFAIK the image conversion code was not adapted for Processing.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could easily write a function that reads in PNG image and produces an array of bitplanes and a palette. That could be of great value for other people using ocs.pde for prototyping!

@Etua Etua requested a review from cahirwpz February 26, 2022 12:18
palette[21] = color(#00ff00);

// Experimental code:
String lines[] = loadStrings("background.txt");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could easily write a function that reads in PNG image and produces an array of bitplanes and a palette. That could be of great value for other people using ocs.pde for prototyping!

@@ -0,0 +1,11 @@
Converting the SVG to proper PNG is as follows:

Use InkScape 1.0 or newer and export PNG with antialiasing DISABLED
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have major problems reproducing clock-bg.png from background.svg file. I failed to do so using method you described in this file. Most likely it's due to use of fonts that are present only in your installation of system. Please list fonts with URLs (so I can fetch them) that are required by this file.

@@ -0,0 +1,9 @@
0b1000 0b10000 0b11000
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it'd be easier if you use csv file format - then you'd get parser for free. Please note you can use space as a separator. For clarity I'd add two words in the first line: orig and target.

lens_tab = [int(lens, base=2) for lens in f.readline().split()]
for line in f:
colour_line = [
[
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great opportunity to write small function that performs the task of constructing RGB color from string.

@@ -0,0 +1,57 @@
final int bitplane_n = 5;
final int plane_size = 320*256;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd pleased to see more named values instead of magic constants ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants