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

feat: Tonemapping, enhance exposure, gamma, saturation for HDR Images #8

Open
wants to merge 9 commits 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
1 change: 1 addition & 0 deletions buildapple.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
melos run build:apple
1 change: 1 addition & 0 deletions buildwin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dart pub global run melos run build:other
Binary file added packages/flutter_jxl/example/assets/testhdr2.jxl
Binary file not shown.
1 change: 1 addition & 0 deletions packages/flutter_jxl/example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions packages/flutter_jxl/example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions packages/flutter_jxl/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
97 changes: 72 additions & 25 deletions packages/flutter_jxl/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_jxl/flutter_jxl.dart';

Expand Down Expand Up @@ -42,32 +44,77 @@ class _MyHomePageState extends State<MyHomePage> {
),
body: Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
// JxlImage.asset(
// 'assets/testanim.jxl',
// ),
JxlImage.asset(
'assets/testanim2.jxl',
cropInfo:
const CropInfo(width: 100, height: 300, left: 10, top: 0),
),
JxlImage.network(
'https://raw.githubusercontent.com/libjxl/conformance/master/testcases/animation_icos4d/input.jxl',
),
JxlImage.asset(
'assets/testalpha.jxl',
),
JxlImage.asset(
'assets/jxlImage.jxl',
key: const Key('jxlImage'),
),
JxlImage.asset(
'assets/testhdr.jxl',
cropInfo:
const CropInfo(width: 1000, height: 1000, left: 10, top: 0),
child: Row(
children: [
Flexible(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
// JxlImage.asset(
// 'assets/testanim.jxl',
// ),
// JxlImage.asset(
// 'assets/testanim2.jxl',
// // cropInfo:
// // const CropInfo(width: 100, height: 300, left: 10, top: 0),
// ),
// JxlImage.network(
// 'https://raw.githubusercontent.com/libjxl/conformance/master/testcases/animation_icos4d/input.jxl',
// ),
// JxlImage.asset(
// 'assets/testalpha.jxl',
// ),
// JxlImage.asset(
// 'assets/jxlImage.jxl',
// key: const Key('jxlImage'),
// ),
JxlImage.asset(
'assets/testhdr.jxl',
// cropInfo:
// const CropInfo(width: 1000, height: 1000, left: 10, top: 0),
),
JxlImage.asset(
'assets/testhdr2.jxl',
),
],
),
),
if (Platform.isMacOS)
// macOS supports JXL natively so this is possible as Flutter
// fallbacks to the platform API for misc formats
Flexible(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
// Image.asset(
// 'assets/testanim.jxl',
// ),
// Image.asset(
// 'assets/testanim2.jxl',
// // cropInfo:
// // const CropInfo(width: 100, height: 300, left: 10, top: 0),
// ),
// Image.network(
// 'https://raw.githubusercontent.com/libjxl/conformance/master/testcases/animation_icos4d/input.jxl',
// ),
// Image.asset(
// 'assets/testalpha.jxl',
// ),
// Image.asset(
// 'assets/jxlImage.jxl',
// key: const Key('jxlImage'),
// ),
Image.asset(
'assets/testhdr.jxl',
// cropInfo:
// const CropInfo(width: 1000, height: 1000, left: 10, top: 0),
),
Image.asset(
'assets/testhdr2.jxl',
),
],
),
),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
43 changes: 43 additions & 0 deletions packages/flutter_jxl/example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
21 changes: 21 additions & 0 deletions packages/flutter_jxl/example/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PODS:
- flutter_jxl (0.0.1)
- FlutterMacOS (1.0.0)

DEPENDENCIES:
- flutter_jxl (from `Flutter/ephemeral/.symlinks/plugins/flutter_jxl/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)

EXTERNAL SOURCES:
flutter_jxl:
:path: Flutter/ephemeral/.symlinks/plugins/flutter_jxl/macos
FlutterMacOS:
:path: Flutter/ephemeral

SPEC CHECKSUMS:
flutter_jxl: f699fcabb4b4637c3eec29a5d5b9353e441db1d1
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24

PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367

COCOAPODS: 1.13.0
Loading
Loading