Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
generative_art_cartoon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Finn Bear
generative_art_cartoon
Commits
d284adab
Commit
d284adab
authored
2 years ago
by
Finn Bear
Browse files
Options
Downloads
Patches
Plain Diff
Revisions/fixes to the slides.
parent
437a3ea9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/slide/s1_title.rs
+5
-2
5 additions, 2 deletions
src/slide/s1_title.rs
src/slide/s2_introduction.rs
+16
-4
16 additions, 4 deletions
src/slide/s2_introduction.rs
src/slide/s8_watercolor.rs
+1
-1
1 addition, 1 deletion
src/slide/s8_watercolor.rs
with
22 additions
and
7 deletions
src/slide/s1_title.rs
+
5
−
2
View file @
d284adab
...
...
@@ -2,10 +2,10 @@ use crate::component::image::Image;
use
crate
::
egui
::{
Align2
,
Context
};
use
crate
::
fade_in
::
fade_in
;
use
crate
::
slide
::
Slide
;
use
crate
::
window
::
WindowPosition
;
use
crate
::{
ctx_img
,
Margin
};
use
eframe
::
egui
::{
Frame
,
TextureHandle
,
Ui
,
Vec2
,
Window
};
use
eframe
::
emath
::
Pos2
;
use
crate
::
window
::
WindowPosition
;
/// The first slide in the cartoon.
#[derive(Default)]
...
...
@@ -64,7 +64,10 @@ impl Slide for Title {
for
(
i
,
example
)
in
self
.examples
.iter
()
.enumerate
()
{
let
row
=
i
/
COLUMNS
;
let
column
=
i
%
COLUMNS
;
let
position
=
Pos2
::
new
(
column
as
f32
*
available
.y
/
ROWS
as
f32
,
row
as
f32
*
available
.y
/
ROWS
as
f32
)
+
Vec2
::
new
(
62.0
,
16.0
);
let
position
=
Pos2
::
new
(
column
as
f32
*
available
.y
/
ROWS
as
f32
,
row
as
f32
*
available
.y
/
ROWS
as
f32
,
)
+
Vec2
::
new
(
62.0
,
16.0
);
Image
::
default
()
.height
(
available
.y
*
0.295
)
.position
(
WindowPosition
::
Global
(
position
))
...
...
This diff is collapsed.
Click to expand it.
src/slide/s2_introduction.rs
+
16
−
4
View file @
d284adab
#[allow(unused)]
use
crate
::
fade_in
::
fade_in
;
use
crate
::
slide
::
Slide
;
use
eframe
::
egui
::
style
::
Margin
;
...
...
@@ -5,10 +6,12 @@ use eframe::egui::{Context, Frame, Ui};
/// A slide that sets some expectations about generative art.
#[derive(Default)]
#[allow(unused)]
pub
struct
Introduction
{
state
:
IntroductionState
,
}
#[allow(unused)]
#[derive(Default)]
enum
IntroductionState
{
#[default]
...
...
@@ -20,7 +23,11 @@ enum IntroductionState {
}
impl
Slide
for
Introduction
{
#[rustfmt::skip]
#[allow(unused)]
fn
transition
(
&
mut
self
,
ctx
:
&
Context
)
->
bool
{
true
/*
match self.state {
IntroductionState::Weaknesses => {
self.state = IntroductionState::Strengths {
...
...
@@ -30,27 +37,32 @@ impl Slide for Introduction {
}
IntroductionState::Strengths { .. } => true,
}
*/
}
#[rustfmt::skip]
fn
show
(
&
mut
self
,
ui
:
&
mut
Ui
)
{
Frame
::
none
()
.margin
(
Margin
::
same
(
20.0
))
.show
(
ui
,
|
ui
|
{
ui
.heading
(
"Introduction to Artistic Algorithms"
);
ui
.add_space
(
8.0
);
/*
ui.label("Weaknesses");
ui.small(" ✖ Social context");
ui.small(" ✖ Human emotion");
ui.small(" ✖ Political commentary");
*/
if
let
IntroductionState
::
Strengths
{
transition_time
}
=
&
self
.state
{
fade_in
(
ui
,
*
transition_time
,
|
ui
|
{
//
if let IntroductionState::Strengths { transition_time } = &self.state {
//
fade_in(ui, *transition_time, |ui| {
ui
.add_space
(
10.0
);
ui
.label
(
"Strengths"
);
ui
.small
(
" ✔ Following rules"
);
ui
.small
(
" ✔ Performing computation"
);
ui
.small
(
" ✔ Harnessing chaos and randomness"
);
ui
.small
(
" ✔ Guided exploration"
);
});
}
//
});
//
}
});
}
}
This diff is collapsed.
Click to expand it.
src/slide/s8_watercolor.rs
+
1
−
1
View file @
d284adab
...
...
@@ -73,7 +73,7 @@ impl Default for Watercolor {
};
Self
{
image
:
img!
(
"test/
mud
0.png"
),
image
:
img!
(
"test/
squirrel
0.png"
),
texture
:
None
,
grid
,
state
:
WatercolorState
::
default
(),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment