This repository has been archived by the owner on Nov 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to separate channels and merge them back together. Seem…
…s to work.
- Loading branch information
Showing
8 changed files
with
561 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
using CSharpImageLibrary; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Media.Imaging; | ||
using UsefulThings.WPF; | ||
|
||
namespace UI_Project | ||
{ | ||
public class MergeChannelsImage : ViewModelBase | ||
{ | ||
#region Properties | ||
public byte[] Pixels { get; private set; } | ||
public string FilePath { get; private set; } | ||
|
||
public string DisplayName | ||
{ | ||
get | ||
{ | ||
return Path.GetFileNameWithoutExtension(FilePath); | ||
} | ||
} | ||
|
||
bool isRed = false; | ||
public bool IsRed | ||
{ | ||
get | ||
{ | ||
return isRed; | ||
} | ||
set | ||
{ | ||
SetProperty(ref isRed, value); | ||
} | ||
} | ||
|
||
bool isGreen = false; | ||
public bool IsGreen | ||
{ | ||
get | ||
{ | ||
return isGreen; | ||
} | ||
set | ||
{ | ||
SetProperty(ref isGreen, value); | ||
} | ||
} | ||
|
||
bool isBlue = false; | ||
public bool IsBlue | ||
{ | ||
get | ||
{ | ||
return isBlue; | ||
} | ||
set | ||
{ | ||
SetProperty(ref isBlue, value); | ||
} | ||
} | ||
|
||
bool isAlpha = false; | ||
public bool IsAlpha | ||
{ | ||
get | ||
{ | ||
return isAlpha; | ||
} | ||
set | ||
{ | ||
SetProperty(ref isAlpha, value); | ||
} | ||
} | ||
|
||
public BitmapSource Thumbnail { get; private set; } | ||
|
||
public int Height { get; private set; } | ||
public int Width { get; private set; } | ||
#endregion Properties | ||
|
||
|
||
public MergeChannelsImage(string mainPath) | ||
{ | ||
FilePath = mainPath; | ||
|
||
using (var img = new ImageEngineImage(mainPath)) | ||
{ | ||
Thumbnail = img.GetWPFBitmap(128); | ||
Width = img.Width; | ||
Height = img.Height; | ||
Pixels = img.MipMaps[0].Pixels; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.