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

fix: s/sheppard/shepard #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 11 additions & 10 deletions src/catppuccinifier-gui/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ async fn generate_image(
gaussian_sampling_std: f64,
gaussian_sampling_iterations: usize,
linear_nearest: usize,
sheppard_power: f64,
sheppard_nearest: usize,
shepard_power: f64,
shepard_nearest: usize,
) -> Result<String, String> {
let image_extension = Path::new(&image_path)
.extension()
Expand Down Expand Up @@ -64,8 +64,8 @@ async fn generate_image(
gaussian_sampling_std,
gaussian_sampling_iterations,
linear_nearest,
sheppard_power,
sheppard_nearest,
shepard_power,
shepard_nearest,
)
.await
{
Expand Down Expand Up @@ -97,8 +97,8 @@ async fn generate_image(
gaussian_sampling_std,
gaussian_sampling_iterations,
linear_nearest,
sheppard_power,
sheppard_nearest,
shepard_power,
shepard_nearest,
)
.await
{
Expand Down Expand Up @@ -127,8 +127,8 @@ async fn generate(
gaussian_sampling_std: f64,
gaussian_sampling_iterations: usize,
linear_nearest: usize,
sheppard_power: f64,
sheppard_nearest: usize,
shepard_power: f64,
shepard_nearest: usize,
) -> Result<String, String> {
let palette = match flavor.as_str() {
"mocha" => Palette::CatppuccinMocha.get(),
Expand All @@ -154,8 +154,9 @@ async fn generate(

"linear" => LinearRemapper::new(&palette, linear_nearest).generate_lut(hald_level),

"sheppard" => ShepardRemapper::new(&palette, sheppard_power, sheppard_nearest)
.generate_lut(hald_level),
"shepard" => {
ShepardRemapper::new(&palette, shepard_power, shepard_nearest).generate_lut(hald_level)
}

_ => NearestNeighborRemapper::new(&palette, SimpleColorSpace::default())
.generate_lut(hald_level),
Expand Down
38 changes: 19 additions & 19 deletions src/catppuccinifier-gui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const gaussianSamplingMean = ref(ConversionMethods.gaussian_sampling.properties.
const gaussianSamplingSTD = ref(ConversionMethods.gaussian_sampling.properties.std.default);
const gaussianSamplingIterations = ref(ConversionMethods.gaussian_sampling.properties.iterations.default);
const linearNearest = ref(ConversionMethods.linear.properties.nearest.default);
const sheppardPower = ref(ConversionMethods.sheppard.properties.power.default);
const sheppardNearest = ref(ConversionMethods.sheppard.properties.nearest.default);
const shepardPower = ref(ConversionMethods.shepard.properties.power.default);
const shepardNearest = ref(ConversionMethods.shepard.properties.nearest.default);
const selectedImageRawPath = ref("");
const selectedImagePath = ref("");
const showGeneratedGrids = ref(false);
Expand All @@ -49,8 +49,8 @@ function updateGaussianSamplingMean(v: number) { gaussianSamplingMean.value = v
function updateGaussianSamplingSTD(v: number) { gaussianSamplingSTD.value = v }
function updateGaussianSamplingIterations(v: number) { gaussianSamplingIterations.value = v }
function updateLinearNearest(v: number) { linearNearest.value = v }
function updateSheppardPower(v: number) { sheppardPower.value = v }
function updateSheppardNearest(v: number) { sheppardNearest.value = v }
function updateShepardPower(v: number) { shepardPower.value = v }
function updateShepardNearest(v: number) { shepardNearest.value = v }
function updateShowSideNav(v: boolean) { showSideNav.value = v }

watch(showAdvancedConversion, () => {
Expand All @@ -62,8 +62,8 @@ watch(showAdvancedConversion, () => {
gaussianSamplingSTD.value = ConversionMethods.gaussian_sampling.properties.std.default;
gaussianSamplingIterations.value = ConversionMethods.gaussian_sampling.properties.iterations.default;
linearNearest.value = ConversionMethods.linear.properties.nearest.default;
sheppardPower.value = ConversionMethods.sheppard.properties.power.default;
sheppardNearest.value = ConversionMethods.sheppard.properties.nearest.default;
shepardPower.value = ConversionMethods.shepard.properties.power.default;
shepardNearest.value = ConversionMethods.shepard.properties.nearest.default;
}
})

Expand Down Expand Up @@ -115,8 +115,8 @@ async function generateImages() {
gaussian_sampling_std: +gaussianSamplingSTD.value,
gaussian_sampling_iterations: +gaussianSamplingIterations.value,
linear_nearest: +linearNearest.value,
sheppard_power: +sheppardPower.value,
sheppard_nearest: +sheppardNearest.value
shepard_power: +shepardPower.value,
shepard_nearest: +shepardNearest.value
})
.then(path => {

Expand All @@ -136,8 +136,8 @@ async function generateImages() {
gaussian_sampling_std: +gaussianSamplingSTD.value,
gaussian_sampling_iterations: +gaussianSamplingIterations.value,
linear_nearest: +linearNearest.value,
sheppard_power: +sheppardPower.value,
sheppard_nearest: +sheppardNearest.value
shepard_power: +shepardPower.value,
shepard_nearest: +shepardNearest.value
})
.then(path => {

Expand All @@ -157,8 +157,8 @@ async function generateImages() {
gaussian_sampling_std: +gaussianSamplingSTD.value,
gaussian_sampling_iterations: +gaussianSamplingIterations.value,
linear_nearest: +linearNearest.value,
sheppard_power: +sheppardPower.value,
sheppard_nearest: +sheppardNearest.value
shepard_power: +shepardPower.value,
shepard_nearest: +shepardNearest.value
})
.then(path => {

Expand All @@ -178,8 +178,8 @@ async function generateImages() {
gaussian_sampling_std: +gaussianSamplingSTD.value,
gaussian_sampling_iterations: +gaussianSamplingIterations.value,
linear_nearest: +linearNearest.value,
sheppard_power: +sheppardPower.value,
sheppard_nearest: +sheppardNearest.value
shepard_power: +shepardPower.value,
shepard_nearest: +shepardNearest.value
})
.then(path => {

Expand All @@ -199,8 +199,8 @@ async function generateImages() {
gaussian_sampling_std: +gaussianSamplingSTD.value,
gaussian_sampling_iterations: +gaussianSamplingIterations.value,
linear_nearest: +linearNearest.value,
sheppard_power: +sheppardPower.value,
sheppard_nearest: +sheppardNearest.value
shepard_power: +shepardPower.value,
shepard_nearest: +shepardNearest.value
})
.then(path => {

Expand Down Expand Up @@ -291,9 +291,9 @@ function previewImage(flavor: string, path: string) {
@update:gaussian-sampling-s-t-d="updateGaussianSamplingSTD"
v-model:gaussian-sampling-iterations="gaussianSamplingIterations"
@update:gaussian-sampling-iterations="updateGaussianSamplingIterations" v-model:linear-nearest="linearNearest"
@update:linear-nearest="updateLinearNearest" v-model:sheppard-power="sheppardPower"
@update:sheppard-power="updateSheppardPower" v-model:sheppard-nearest="sheppardNearest"
@update:sheppard-nearest="updateSheppardNearest" :accent="accent" :generating-images="generatingImages"
@update:linear-nearest="updateLinearNearest" v-model:shepard-power="shepardPower"
@update:shepard-power="updateShepardPower" v-model:shepard-nearest="shepardNearest"
@update:shepard-nearest="updateShepardNearest" :accent="accent" :generating-images="generatingImages"
@function:select-image="selectImage" :selected-image-path="selectedImagePath"
@function:generate-images="generateImages" />
</div>
Expand Down
32 changes: 16 additions & 16 deletions src/catppuccinifier-gui/src/components/GenerateImageSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ defineEmits([
"update:gaussianSamplingSTD",
"update:gaussianSamplingIterations",
"update:linearNearest",
"update:sheppardPower",
"update:sheppardNearest",
"update:shepardPower",
"update:shepardNearest",
"function:selectImage",
"function:generateImages"
])
Expand Down Expand Up @@ -62,11 +62,11 @@ defineProps({
required: true,
type: Number
},
sheppardPower: {
shepardPower: {
required: true,
type: Number
},
sheppardNearest: {
shepardNearest: {
required: true,
type: Number

Expand Down Expand Up @@ -219,33 +219,33 @@ defineProps({
<div class="mt-2 border border-skin-surface0 rounded-xl">

<div class="flex items-center cursor-pointer p-2"
@click="$emit('update:conversionMethod', ConversionMethods.sheppard.codename)">
@click="$emit('update:conversionMethod', ConversionMethods.shepard.codename)">

<div class="flex-grow font-semibold">
{{ ConversionMethods.sheppard.name }}
{{ ConversionMethods.shepard.name }}
</div>

<input :checked="conversionMethod === ConversionMethods.sheppard.codename" type="radio"
<input :checked="conversionMethod === ConversionMethods.shepard.codename" type="radio"
class="radio radio-sm radio-primary" :data-theme="itemsAccent">
</div>


<div v-if="conversionMethod == ConversionMethods.sheppard.codename && showAdvancedConversion">
<div v-if="conversionMethod == ConversionMethods.shepard.codename && showAdvancedConversion">
<div class="p-2">

<div>Power - {{ sheppardPower }}</div>
<div>Power - {{ shepardPower }}</div>

<input class="range range-sm range-primary" type="range" :data-theme="itemsAccent" step="1"
:value="sheppardPower" :max="ConversionMethods.sheppard.properties.power.max"
:min="ConversionMethods.sheppard.properties.power.min"
@input="$emit('update:sheppardPower', ($event.target as HTMLInputElement).value)">
:value="shepardPower" :max="ConversionMethods.shepard.properties.power.max"
:min="ConversionMethods.shepard.properties.power.min"
@input="$emit('update:shepardPower', ($event.target as HTMLInputElement).value)">

<div>Nearest - {{ sheppardNearest }}</div>
<div>Nearest - {{ shepardNearest }}</div>

<input class="range range-sm range-primary" type="range" :data-theme="itemsAccent" step="1"
:value="sheppardNearest" :max="ConversionMethods.sheppard.properties.nearest.max"
:min="ConversionMethods.sheppard.properties.nearest.min"
@input="$emit('update:sheppardNearest', ($event.target as HTMLInputElement).value)">
:value="shepardNearest" :max="ConversionMethods.shepard.properties.nearest.max"
:min="ConversionMethods.shepard.properties.nearest.min"
@input="$emit('update:shepardNearest', ($event.target as HTMLInputElement).value)">
</div>
</div>
</div>
Expand Down