Skip to content

Instantly share code, notes, and snippets.

View kanryu's full-sized avatar

KATO Kanryu kanryu

View GitHub Profile
@kanryu
kanryu / unfilter_gen.cpp
Last active January 16, 2019 02:33
Trying define PNG's unfilter with Halide
// Specification:
// https://www.w3.org/TR/PNG-Filters.html
#include "Halide.h"
using namespace Halide;
Expr none_unfilter(Expr raw) {
return raw;
}
@kanryu
kanryu / Japanese.txt
Created November 26, 2018 02:24
Sample text based translation for QLanguageSelector
; Language file was generated at Sun, 25 Nov 2018 21:09:55 +0900
; === COMMENTS ===
; This is a language file for QuickViewer. Lines beginning with ; are comments.
; Each language should have one language file in UTF-8 character set.
; When you change the text of this file, the notation of the application will be changed.
; If you make a new translation or modify an existing one,
; please post to Issue(https://github.com/kanryu/quickviewer/issues) or send an email to <k.kanryu@gmail.com>.
;
; Note 1: Use \n (backslash+n) instead of new line for each text, if you need.
; Note 2: 'hint' is a hint comment for each 'text'.
@kanryu
kanryu / build-verbose3.log
Created January 28, 2018 23:05
QuickViewer install log (failed get extensions by linuxdeployqt)
/home/kanryu/Qt5/5.9.1/gcc_64/bin/qmake -install qinstall -exe /home/kanryu/work/qvproject/build-QVproject-Desktop_Qt_5_9_1_GCC_64bit-Release/bin/QuickViewer /home/kanryu/work/qvproject/quickviewer/QuickViewer/../../QuickViewer-1.0.9-x64.AppDir/usr/bin/QuickViewer
strip /home/kanryu/work/qvproject/quickviewer/QuickViewer/../../QuickViewer-1.0.9-x64.AppDir/usr/bin/QuickViewer
/home/kanryu/Qt5/5.9.1/gcc_64/bin/qmake -install qinstall -exe /home/kanryu/work/qvproject/build-QVproject-Desktop_Qt_5_9_1_GCC_64bit-Release/lib/libfileloader.so.1 /home/kanryu/work/qvproject/quickviewer/QuickViewer/../../QuickViewer-1.0.9-x64.AppDir/usr/lib/libfileloader.so.1
strip /home/kanryu/work/qvproject/quickviewer/QuickViewer/../../QuickViewer-1.0.9-x64.AppDir/usr/lib/libfileloader.so.1
/home/kanryu/Qt5/5.9.1/gcc_64/bin/qmake -install qinstall -exe /home/kanryu/work/qvproject/build-QVproject-Desktop_Qt_5_9_1_GCC_64bit-Release/lib/lib7z.so /home/kanryu/work/qvproject/quickviewer/QuickViewer/../../QuickViewer-1.0.9-x64.AppDir/usr/l
@kanryu
kanryu / install.log
Created January 28, 2018 11:08
QuickViewer install log (failed get extensions by linuxdeployqt)
kanryu@kanryu-VirtualBox:~/work/qvproject/build-QVproject-Desktop_Qt_5_9_1_GCC_64bit-Release/QuickViewer$ make install
/home/kanryu/Qt5/5.9.1/gcc_64/bin/qmake -install qinstall -exe /home/kanryu/work/qvproject/build-QVproject-Desktop_Qt_5_9_1_GCC_64bit-Release/bin/QuickViewer /home/kanryu/work/qvproject/quickviewer/QuickViewer/../../QuickViewer-1.0.9-x64.AppDir/usr/bin/QuickViewer
strip /home/kanryu/work/qvproject/quickviewer/QuickViewer/../../QuickViewer-1.0.9-x64.AppDir/usr/bin/QuickViewer
/home/kanryu/Qt5/5.9.1/gcc_64/bin/qmake -install qinstall -exe /home/kanryu/work/qvproject/build-QVproject-Desktop_Qt_5_9_1_GCC_64bit-Release/lib/libfileloader.so.1 /home/kanryu/work/qvproject/quickviewer/QuickViewer/../../QuickViewer-1.0.9-x64.AppDir/usr/lib/libfileloader.so.1
strip /home/kanryu/work/qvproject/quickviewer/QuickViewer/../../QuickViewer-1.0.9-x64.AppDir/usr/lib/libfileloader.so.1
/home/kanryu/Qt5/5.9.1/gcc_64/bin/qmake -install qinstall -exe /home/kanryu/work/qvproject/build-QVproject-Desktop_Qt_5_9_1_GCC_
@kanryu
kanryu / build
Created January 26, 2018 17:12
ERROR: findDependencyInfo: "ldd: /usr/lib/../lib/..: not regular file\n"
Desktop file as first argument: "../../QuickViewer-1.0.9-x64.AppDir/QuickViewer.desktop"
desktopExecEntry: "QuickViewer"
desktopIconEntry: "quickviewer"
Found binary from desktop file: "/home/kanryu/work/qvproject/QuickViewer-1.0.9-x64.AppDir/usr/bin/QuickViewer"
FHS-like mode with PREFIX, fhsPrefix: "/home/kanryu/work/qvproject/QuickViewer-1.0.9-x64.AppDir/usr"
app-binary: "/home/kanryu/work/qvproject/QuickViewer-1.0.9-x64.AppDir/usr/bin/QuickViewer"
appDirPath: "/home/kanryu/work/qvproject/QuickViewer-1.0.9-x64.AppDir"
relativeBinPath: "usr/bin/QuickViewer"
Found icons from desktop file: ("/home/kanryu/work/qvproject/QuickViewer-1.0.9-x64.AppDir/quickviewer.png")
preExistingToplevelIcon: "/home/kanryu/work/qvproject/QuickViewer-1.0.9-x64.AppDir/quickviewer.png"
@kanryu
kanryu / halfshrink_gen.cpp
Created January 21, 2018 02:14
shrink a bitmap into half size with halide-lang
#include "Halide.h"
namespace {
class HalfShrink : public Halide::Generator<HalfShrink> {
public:
Input<Buffer<uint8_t>> input{ "input", 3 };
Output<Buffer<uint8_t>> halfshrink{ "output", 3 };
void generate() {
@kanryu
kanryu / luminor_gen.cpp
Created January 11, 2018 03:51
Halide function with reorder dimensions
#include "Halide.h"
#ifndef BUILD_RGBA
namespace {
class Luminor : public Halide::Generator<Luminor> {
public:
Input<Buffer<uint8_t>> input{ "input", 3 };
Input<float> b_sigma{ "brightness", 0.0 };
@kanryu
kanryu / luminor_gen2.py
Last active December 27, 2017 11:15
a sample for image processing with look-up-table(after memorized)
def get_luminorImpl(input, b_sigma, c_sigma, g_sigma, with_alpha):
"""
input: a Buffer as an bitmap image on memory
b_sigma: float value for brightness(default: 0.0, range: -255 to 255)
c_sigma: float value for contrast(default: 1.0, range: 0.1 to 10.0)
g_sigma: float value for gamma value(default: 1.0, range: 0.1 to 10.0)
"""
assert type(input) == ImageParam
assert input.dimensions() == 3
@kanryu
kanryu / luminor_gen.py
Last active December 27, 2017 11:15
a sample for image processing with look-up-table(before memorized)
def get_luminorImpl(input, b_sigma, c_sigma, g_sigma, with_alpha):
"""
input: a Buffer as an bitmap image on memory
b_sigma: float value for brightness(default: 0.0, range: -255 to 255)
c_sigma: float value for contrast(default: 1.0, range: 0.1 to 10.0)
g_sigma: float value for gamma value(default: 1.0, range: 0.1 to 10.0)
"""
assert type(input) == ImageParam
assert input.dimensions() == 3
@kanryu
kanryu / convertCMYKtoRGB.cpp
Last active September 15, 2017 06:57
Convert from CMYK to sRGB with ICC Profile(for Windows)
#include <Windows.h>
#include <Icm.h>
BOOL convertCMYKtoRGB(void *cmyk, void *rgb, DWORD w, DWORD h)
{
HPROFILE hProfiles[2] = { 0 };
PROFILE p = { 0 };
std::wstring woppath = L"RSWOP.icm";
p.dwType = PROFILE_FILENAME;