├── Android
├── VecodeKitExample
│ ├── app
│ │ ├── .gitignore
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── values
│ │ │ │ │ │ ├── strings.xml
│ │ │ │ │ │ ├── colors.xml
│ │ │ │ │ │ ├── dimens.xml
│ │ │ │ │ │ └── styles.xml
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── values-w820dp
│ │ │ │ │ │ └── dimens.xml
│ │ │ │ │ └── layout
│ │ │ │ │ │ ├── activity_preview.xml
│ │ │ │ │ │ ├── activity_main.xml
│ │ │ │ │ │ └── picture_item.xml
│ │ │ │ ├── java
│ │ │ │ │ └── com
│ │ │ │ │ │ ├── dumbduck
│ │ │ │ │ │ ├── vecodekitexample
│ │ │ │ │ │ │ ├── ListItem.java
│ │ │ │ │ │ │ ├── PreviewActivity.java
│ │ │ │ │ │ │ ├── PictureAdapter.java
│ │ │ │ │ │ │ └── MainActivity.java
│ │ │ │ │ │ └── pictures
│ │ │ │ │ │ │ └── PictureAllTest.java
│ │ │ │ │ │ └── vecodekit
│ │ │ │ │ │ ├── PictureContentMode.java
│ │ │ │ │ │ ├── GraphicsPictureView.java
│ │ │ │ │ │ └── GraphicsPicture.java
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── test
│ │ │ │ └── java
│ │ │ │ │ └── com
│ │ │ │ │ └── dumbduck
│ │ │ │ │ └── vecodekitexample
│ │ │ │ │ └── ExampleUnitTest.java
│ │ │ └── androidTest
│ │ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── dumbduck
│ │ │ │ └── vecodekitexample
│ │ │ │ └── ApplicationTest.java
│ │ ├── proguard-rules.pro
│ │ └── build.gradle
│ ├── settings.gradle
│ ├── .gitignore
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradlew.bat
│ └── gradlew
└── src
│ └── com
│ └── vecodekit
│ ├── PictureContentMode.java
│ ├── GraphicsPictureView.java
│ └── GraphicsPicture.java
├── test_swf
├── icons.swf
├── tiger.swf
├── world.swf
├── all_test.swf
├── river_man.swf
├── snow_woman.swf
└── out_svg
│ └── all_test.svg
├── images
├── example_mac.png
├── vecode_icon.png
└── example_android.png
├── iOS_Mac
├── QuartzPictureExample
│ ├── example-mac
│ │ ├── AppDelegate.h
│ │ ├── main.m
│ │ ├── PictureView.h
│ │ ├── AppMainView.h
│ │ ├── PictureView.m
│ │ ├── AppDelegate.m
│ │ ├── Assets.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ └── AppMainView.m
│ ├── pictures
│ │ ├── icons.h
│ │ ├── tiger.h
│ │ ├── world.h
│ │ ├── all_test.h
│ │ ├── river_man.h
│ │ ├── snow_woman.h
│ │ ├── all_test.c
│ │ └── all_test.swift
│ ├── example-ios
│ │ ├── AppDelegate.swift
│ │ ├── PictureViewController.swift
│ │ ├── Assets.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ ├── Base.lproj
│ │ │ └── LaunchScreen.storyboard
│ │ └── PictureListViewController.swift
│ └── QuartzPictureExample.xcodeproj
│ │ └── project.pbxproj
└── QuartzPicture
│ ├── objc
│ ├── VKQuartzPicture.h
│ └── VKQuartzPicture.m
│ └── swift
│ ├── VKQuartzPicture.swift
│ └── ext
│ ├── VKQuartzPictureImage.swift
│ └── VKQuartzPictureView.swift
├── .gitignore
├── LICENSE
└── README.md
/Android/VecodeKitExample/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/test_swf/icons.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/test_swf/icons.swf
--------------------------------------------------------------------------------
/test_swf/tiger.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/test_swf/tiger.swf
--------------------------------------------------------------------------------
/test_swf/world.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/test_swf/world.swf
--------------------------------------------------------------------------------
/images/example_mac.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/images/example_mac.png
--------------------------------------------------------------------------------
/images/vecode_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/images/vecode_icon.png
--------------------------------------------------------------------------------
/test_swf/all_test.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/test_swf/all_test.swf
--------------------------------------------------------------------------------
/test_swf/river_man.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/test_swf/river_man.swf
--------------------------------------------------------------------------------
/test_swf/snow_woman.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/test_swf/snow_woman.swf
--------------------------------------------------------------------------------
/images/example_android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/images/example_android.png
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | VecodeKitExample
3 |
4 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/Android/VecodeKitExample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-mac/AppDelegate.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #import
4 |
5 | @interface AppDelegate : NSObject
6 |
7 | @end
8 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-mac/main.m:
--------------------------------------------------------------------------------
1 |
2 | #import
3 |
4 | int main(int argc, const char* argv[])
5 | {
6 | return NSApplicationMain(argc, argv);
7 | }
8 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/Android/VecodeKitExample/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/Android/VecodeKitExample/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/Android/VecodeKitExample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/Android/VecodeKitExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DumbDuck/VecodeKit/HEAD/Android/VecodeKitExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-mac/PictureView.h:
--------------------------------------------------------------------------------
1 |
2 | #import "VKQuartzPicture.h"
3 | #import
4 |
5 | @interface PictureView : NSView {
6 | }
7 | @property (nonatomic, assign) VKQuartzPicture picture;
8 | @end
9 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Aug 25 10:11:46 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | *.xcworkspace
13 | !default.xcworkspace
14 | xcuserdata
15 | profile
16 | *.moved-aside
17 | DerivedData
18 | .idea/
19 | # Pods - for those of you who use CocoaPods
20 | Pods
21 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-mac/AppMainView.h:
--------------------------------------------------------------------------------
1 |
2 | #import "PictureView.h"
3 | #import
4 |
5 | @interface AppMainView : NSView {
6 | }
7 | @property (nonatomic, weak) IBOutlet NSView* scrollView;
8 | @property (nonatomic, weak) IBOutlet PictureView* previewView;
9 | @property (nonatomic, weak) IBOutlet NSTableView* tableView;
10 | @end
11 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/pictures/icons.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __VK_PICTURE_ICONS_H__
3 | #define __VK_PICTURE_ICONS_H__
4 |
5 | #include
6 |
7 | #ifndef __VKQUARTZPICTURE_STRUCT__
8 | #define __VKQUARTZPICTURE_STRUCT__
9 | typedef struct
10 | {
11 | CGRect bounds;
12 | void (*_Nullable drawer)(_Nonnull CGContextRef);
13 | } VKQuartzPicture;
14 | #endif
15 |
16 | CG_EXTERN VKQuartzPicture g_picture_icons;
17 |
18 | #endif
19 |
20 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/pictures/tiger.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __VK_PICTURE_TIGER_H__
3 | #define __VK_PICTURE_TIGER_H__
4 |
5 | #include
6 |
7 | #ifndef __VKQUARTZPICTURE_STRUCT__
8 | #define __VKQUARTZPICTURE_STRUCT__
9 | typedef struct
10 | {
11 | CGRect bounds;
12 | void (*_Nullable drawer)(_Nonnull CGContextRef);
13 | } VKQuartzPicture;
14 | #endif
15 |
16 | CG_EXTERN VKQuartzPicture g_picture_tiger;
17 |
18 | #endif
19 |
20 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/pictures/world.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __VK_PICTURE_WORLD_H__
3 | #define __VK_PICTURE_WORLD_H__
4 |
5 | #include
6 |
7 | #ifndef __VKQUARTZPICTURE_STRUCT__
8 | #define __VKQUARTZPICTURE_STRUCT__
9 | typedef struct
10 | {
11 | CGRect bounds;
12 | void (*_Nullable drawer)(_Nonnull CGContextRef);
13 | } VKQuartzPicture;
14 | #endif
15 |
16 | CG_EXTERN VKQuartzPicture g_picture_world;
17 |
18 | #endif
19 |
20 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/test/java/com/dumbduck/vecodekitexample/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.dumbduck.vecodekitexample;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/pictures/all_test.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __VK_PICTURE_ALL_TEST_H__
3 | #define __VK_PICTURE_ALL_TEST_H__
4 |
5 | #include
6 |
7 | #ifndef __VKQUARTZPICTURE_STRUCT__
8 | #define __VKQUARTZPICTURE_STRUCT__
9 | typedef struct
10 | {
11 | CGRect bounds;
12 | void (*_Nullable drawer)(_Nonnull CGContextRef);
13 | } VKQuartzPicture;
14 | #endif
15 |
16 | CG_EXTERN VKQuartzPicture g_picture_all_test;
17 |
18 | #endif
19 |
20 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/pictures/river_man.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __VK_PICTURE_RIVER_MAN_H__
3 | #define __VK_PICTURE_RIVER_MAN_H__
4 |
5 | #include
6 |
7 | #ifndef __VKQUARTZPICTURE_STRUCT__
8 | #define __VKQUARTZPICTURE_STRUCT__
9 | typedef struct
10 | {
11 | CGRect bounds;
12 | void (*_Nullable drawer)(_Nonnull CGContextRef);
13 | } VKQuartzPicture;
14 | #endif
15 |
16 | CG_EXTERN VKQuartzPicture g_picture_river_man;
17 |
18 | #endif
19 |
20 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/pictures/snow_woman.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __VK_PICTURE_SNOW_WOMAN_H__
3 | #define __VK_PICTURE_SNOW_WOMAN_H__
4 |
5 | #include
6 |
7 | #ifndef __VKQUARTZPICTURE_STRUCT__
8 | #define __VKQUARTZPICTURE_STRUCT__
9 | typedef struct
10 | {
11 | CGRect bounds;
12 | void (*_Nullable drawer)(_Nonnull CGContextRef);
13 | } VKQuartzPicture;
14 | #endif
15 |
16 | CG_EXTERN VKQuartzPicture g_picture_snow_woman;
17 |
18 | #endif
19 |
20 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/androidTest/java/com/dumbduck/vecodekitexample/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.dumbduck.vecodekitexample;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-mac/PictureView.m:
--------------------------------------------------------------------------------
1 |
2 | #import "PictureView.h"
3 |
4 | @implementation PictureView
5 |
6 | - (BOOL)isFlipped {
7 | return true;
8 | }
9 |
10 | - (void)setPicture:(VKQuartzPicture)picture {
11 | _picture = picture;
12 | [self setNeedsDisplayInRect:self.bounds];
13 | }
14 |
15 | - (void)drawRect:(NSRect)dirtyRect {
16 | CGContextRef context = [NSGraphicsContext currentContext].CGContext;
17 | VKQuartzPictureDrawInRect(_picture, self.bounds, context, VKPictureContentModeScaleAspectFit);
18 | }
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/layout/activity_preview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.1.2'
10 |
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
25 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-mac/AppDelegate.m:
--------------------------------------------------------------------------------
1 |
2 | #import "AppDelegate.h"
3 |
4 | @interface AppDelegate ()
5 |
6 | @property (weak) IBOutlet NSWindow* window;
7 | @end
8 |
9 | @implementation AppDelegate
10 |
11 | - (void)applicationDidFinishLaunching:(NSNotification*)aNotification {
12 | [self.window center];
13 | // Insert code here to initialize your application
14 | }
15 |
16 | - (void)applicationWillTerminate:(NSNotification*)aNotification {
17 | // Insert code here to tear down your application
18 | }
19 |
20 | - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)sender {
21 | return YES;
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-ios/AppDelegate.swift:
--------------------------------------------------------------------------------
1 |
2 | import UIKit
3 |
4 | @UIApplicationMain
5 | class AppDelegate: UIResponder, UIApplicationDelegate {
6 | fileprivate var _window: UIWindow!
7 |
8 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
9 | let listViewController = PictureListViewController(style: .plain)
10 | let navigationViewController = UINavigationController(rootViewController: listViewController)
11 |
12 | _window = UIWindow(frame: UIScreen.main.bounds)
13 | _window.rootViewController = navigationViewController
14 | _window.makeKeyAndVisible()
15 |
16 | return true
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/HJC/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion '27.0.3'
6 |
7 | defaultConfig {
8 | applicationId "com.dumbduck.vecodekitexample"
9 | minSdkVersion 15
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:23.3.0'
26 | }
27 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/res/layout/picture_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/java/com/dumbduck/vecodekitexample/ListItem.java:
--------------------------------------------------------------------------------
1 | package com.dumbduck.vecodekitexample;
2 |
3 | import android.graphics.Bitmap;
4 | import com.vecodekit.GraphicsPicture;
5 |
6 | public class ListItem
7 | {
8 | private GraphicsPicture _picture;
9 | private String _name;
10 | private Bitmap _bitmap;
11 |
12 | ListItem(GraphicsPicture picture, String name)
13 | {
14 | _picture = picture;
15 | _name = name;
16 | }
17 |
18 | public GraphicsPicture getPicture()
19 | {
20 | return _picture;
21 | }
22 |
23 | public String getName()
24 | {
25 | return _name;
26 | }
27 |
28 | public void setBitmap(Bitmap bitmap)
29 | {
30 | _bitmap = bitmap;
31 | }
32 |
33 | public Bitmap getBitmap()
34 | {
35 | return _bitmap;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPicture/objc/VKQuartzPicture.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | typedef NS_ENUM(NSInteger, VKPictureContentMode) {
5 | VKPictureContentModeScaleToFill,
6 | VKPictureContentModeScaleAspectFit,
7 | VKPictureContentModeScaleAspectFill,
8 | VKPictureContentModeCenter,
9 | };
10 |
11 | #ifndef __VKQUARTZPICTURE_STRUCT__
12 | #define __VKQUARTZPICTURE_STRUCT__
13 | typedef struct {
14 | CGRect bounds;
15 | void (*_Nullable drawer)(_Nonnull CGContextRef);
16 | } VKQuartzPicture;
17 | #endif
18 |
19 | CG_EXTERN VKQuartzPicture VKQuartzPictureNull(void);
20 | CG_EXTERN void VKQuartzPictureDrawInRect(VKQuartzPicture picture,
21 | CGRect rect,
22 | _Nonnull CGContextRef context,
23 | VKPictureContentMode contentMode);
24 |
25 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/java/com/dumbduck/vecodekitexample/PreviewActivity.java:
--------------------------------------------------------------------------------
1 | package com.dumbduck.vecodekitexample;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | import com.vecodekit.GraphicsPicture;
7 | import com.vecodekit.GraphicsPictureView;
8 |
9 | public class PreviewActivity extends Activity
10 | {
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState)
13 | {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_preview);
16 |
17 | GraphicsPictureView pictureView = (GraphicsPictureView)findViewById(R.id.picture_view);
18 | try
19 | {
20 | String clsName = getIntent().getStringExtra("pictureClass");
21 | Class cls = Class.forName(clsName);
22 | GraphicsPicture picture = (GraphicsPicture)cls.newInstance();
23 | pictureView.setPicture(picture);
24 | }
25 | catch (Exception e)
26 | {
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-ios/PictureViewController.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import UIKit
3 |
4 | private class PictureView: UIView {
5 | var picture: VKQuartzPicture?
6 |
7 | override var frame: CGRect {
8 | didSet {
9 | self.setNeedsDisplay()
10 | }
11 | }
12 |
13 | override func draw(_ rect: CGRect) {
14 | guard let context = UIGraphicsGetCurrentContext() else { return }
15 | guard let picture = picture else { return }
16 | VKQuartzPictureDrawInRect(picture, self.bounds, context, .scaleAspectFit)
17 | }
18 | }
19 |
20 | class PictureViewController: UIViewController {
21 | fileprivate let _pictureView = PictureView()
22 |
23 | init(picture: VKQuartzPicture) {
24 | _pictureView.picture = picture
25 | super.init(nibName: nil, bundle: nil)
26 | }
27 |
28 | required init?(coder aDecoder: NSCoder) {
29 | fatalError("init(coder:) has not been implemented")
30 | }
31 |
32 | override func loadView() {
33 | self.view = _pictureView
34 | _pictureView.backgroundColor = UIColor.lightGray
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Dumb Duck
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-mac/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-mac/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHumanReadableCopyright
28 | Copyright © 2016年 HJC. All rights reserved.
29 | NSMainNibFile
30 | MainMenu
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-ios/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/Android/src/com/vecodekit/PictureContentMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2016 DumbDuck dumbduck@126.com
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 | */
24 |
25 | package com.vecodekit;
26 |
27 | public class PictureContentMode
28 | {
29 | public static final int ScaleToFill = 0;
30 | public static final int ScaleAspectFit = 1;
31 | public static final int AspectFill = 2;
32 | public static final int Center = 3;
33 | }
34 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/java/com/vecodekit/PictureContentMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2016 DumbDuck dumbduck@126.com
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 | */
24 |
25 | package com.vecodekit;
26 |
27 | public class PictureContentMode
28 | {
29 | public static final int ScaleToFill = 0;
30 | public static final int ScaleAspectFit = 1;
31 | public static final int AspectFill = 2;
32 | public static final int Center = 3;
33 | }
34 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-ios/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-ios/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Introduction
2 |
3 |
4 |
5 | Vecode is a blending word which combines Vector and Code. It helps developers and designers turn vector images to drawing codes or svg images. You can download it on [Mac AppStore](https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1084265083&mt=12).
6 |
7 | For now, Vecode is able to import:
8 |
9 | * swf vector format
10 |
11 | Able to export:
12 |
13 | * Quartz code (Swift)
14 | * Quartz code (Objective-C)
15 | * Android graphics code
16 | * svg image
17 | * png image
18 |
19 | FYI Quartz code is a drawing code for iOS and OS X. Android graphics code, AKA the drawing code on Android platform.
20 |
21 | After turning vector image to drawing code, then add the drawing code into the project and compile. During runtime, the image will be redrawn and rescale size without distortion.
22 |
23 | See More:
24 |
25 | * [中文文档](http://dumbduck.github.io/VecodeKit/cn/home.html)
26 | * [English Doucment](http://dumbduck.github.io/VecodeKit/en/home.html)
27 |
28 | ## VecodeKit
29 | We've coded project example VecodeKit, showing how to use the exported drawing codes.
30 |
31 | VecodeKit includes sub-directories as follows:
32 |
33 | * iOS_Mac
34 | * Android
35 | * test_swf
36 |
37 |
38 | iOS_Mac directory includes an iOS and a Mac example, showing you how to use Quartz Code under Swift and Object-C accordingly.
39 |
40 |
41 |
42 |
43 | Android directory includes an Android Studio project example, showing you how to use the exported Android graphics code.
44 |
45 |
46 |
47 | In the test_swf directory you can find some swf files for test.
48 |
49 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPicture/objc/VKQuartzPicture.m:
--------------------------------------------------------------------------------
1 | #import "VKQuartzPicture.h"
2 |
3 | VKQuartzPicture VKQuartzPictureNull() {
4 | VKQuartzPicture picture = { CGRectNull, NULL };
5 | return picture;
6 | }
7 |
8 | void VKQuartzPictureDrawInRect(VKQuartzPicture picture, CGRect rect, CGContextRef context, VKPictureContentMode mode) {
9 | if (picture.drawer == NULL) {
10 | return;
11 | }
12 |
13 | if (picture.bounds.size.width < FLT_EPSILON || picture.bounds.size.height < FLT_EPSILON) {
14 | return;
15 | }
16 |
17 | CGFloat scaleX = rect.size.width / picture.bounds.size.width;
18 | CGFloat scaleY = rect.size.height / picture.bounds.size.height;
19 |
20 | switch (mode) {
21 | case VKPictureContentModeScaleAspectFit:
22 | scaleX = MIN(scaleX, scaleY);
23 | scaleY = scaleX;
24 | break;
25 |
26 | case VKPictureContentModeScaleAspectFill:
27 | scaleX = MAX(scaleX, scaleY);
28 | scaleY = scaleX;
29 | break;
30 |
31 | case VKPictureContentModeScaleToFill:
32 | // nothing
33 | break;
34 |
35 | case VKPictureContentModeCenter:
36 | scaleX = 1.0;
37 | scaleY = 1.0;
38 | break;
39 | }
40 |
41 | CGSize pictureSize = picture.bounds.size;
42 | pictureSize.width *= scaleX;
43 | pictureSize.height *= scaleY;
44 |
45 | CGPoint offset;
46 | offset.x = (rect.size.width - pictureSize.width) * 0.5 + rect.origin.x;
47 | offset.y = (rect.size.height - pictureSize.height) * 0.5 + rect.origin.y;
48 |
49 | CGContextSaveGState(context);
50 | CGContextTranslateCTM(context, offset.x, offset.y);
51 | CGContextScaleCTM(context, scaleX, scaleY);
52 | CGContextTranslateCTM(context, -picture.bounds.origin.x, -picture.bounds.origin.y);
53 | picture.drawer(context);
54 | CGContextRestoreGState(context);
55 | }
56 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPicture/swift/VKQuartzPicture.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import CoreGraphics
3 |
4 | public enum VKPictureContentMode {
5 | case center
6 | case scaleToFill
7 | case scaleAspectFit
8 | case scaleAspectFill
9 | }
10 |
11 | public struct VKQuartzPicture {
12 | var bounds: CGRect
13 | var drawer: ((CGContext) -> Void)?
14 | }
15 |
16 | public func VKQuartzPictureNull() -> VKQuartzPicture {
17 | return VKQuartzPicture(bounds: CGRect.null, drawer: nil)
18 | }
19 |
20 | public func VKQuartzPictureDrawInRect(_ picture: VKQuartzPicture, _ rect: CGRect, _ context: CGContext, _ mode: VKPictureContentMode) {
21 | guard let drawer = picture.drawer else { return }
22 |
23 | if rect.size.width < CGFloat.ulpOfOne || rect.size.height < CGFloat.ulpOfOne {
24 | return
25 | }
26 |
27 | var scaleX: CGFloat = rect.size.width / picture.bounds.size.width
28 | var scaleY: CGFloat = rect.size.height / picture.bounds.size.height
29 |
30 | switch mode {
31 | case .scaleAspectFit:
32 | scaleX = min(scaleX, scaleY)
33 | scaleY = scaleX
34 |
35 | case .scaleAspectFill:
36 | scaleX = max(scaleX, scaleY)
37 | scaleY = scaleX
38 |
39 | case .scaleToFill:
40 | // nothing
41 | break
42 |
43 | case .center:
44 | scaleX = 1.0
45 | scaleY = 1.0
46 | }
47 |
48 | var pictureSize = picture.bounds.size
49 | pictureSize.width *= scaleX
50 | pictureSize.height *= scaleY
51 |
52 | var offset = CGPoint.zero
53 | offset.x = (rect.size.width - pictureSize.width) * 0.5 + rect.origin.x
54 | offset.y = (rect.size.height - pictureSize.height) * 0.5 + rect.origin.y
55 |
56 | context.saveGState()
57 | context.translateBy(x: offset.x, y: offset.y)
58 | context.scaleBy(x: scaleX, y: scaleY)
59 | context.translateBy(x: -picture.bounds.origin.x, y: -picture.bounds.origin.y)
60 | drawer(context)
61 | context.restoreGState()
62 | }
63 |
64 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/java/com/dumbduck/vecodekitexample/PictureAdapter.java:
--------------------------------------------------------------------------------
1 | package com.dumbduck.vecodekitexample;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ArrayAdapter;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 |
12 | import java.util.List;
13 |
14 | public class PictureAdapter extends ArrayAdapter
15 | {
16 | private int _resourceId;
17 |
18 | public PictureAdapter(Context context, int textViewResourceId, List objects)
19 | {
20 | super(context, textViewResourceId, objects);
21 | _resourceId = textViewResourceId;
22 | }
23 |
24 | private static int dip2px(Context context, float value)
25 | {
26 | final float scale = context.getResources().getDisplayMetrics().density;
27 | return (int)(value * scale + 0.5f);
28 | }
29 |
30 | @Override
31 | public View getView(int position, View convertView, ViewGroup parent)
32 | {
33 | View view = convertView;
34 | if (view == null)
35 | {
36 | view = LayoutInflater.from(getContext()).inflate(_resourceId, null);
37 | }
38 |
39 | ImageView imageView = (ImageView)view.findViewById(R.id.image_view);
40 | TextView textView = (TextView)view.findViewById(R.id.text_view);
41 |
42 | ListItem listItem = getItem(position);
43 | Bitmap bitmap = listItem.getBitmap();
44 | if (bitmap == null)
45 | {
46 | final int bitmapWidth = dip2px(getContext(), 100);
47 | final int bitmapHeight = dip2px(getContext(), 100);
48 | bitmap = listItem.getPicture().transToBitmap(bitmapWidth, bitmapHeight);
49 | listItem.setBitmap(bitmap);
50 | }
51 |
52 | imageView.setImageBitmap(bitmap);
53 | textView.setText(listItem.getName());
54 | return view;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-ios/PictureListViewController.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import UIKit
3 |
4 | private let kCellID = "CellId"
5 |
6 | class PictureListViewController: UITableViewController {
7 | fileprivate let _pictures = [
8 | ("tiger", g_picture_tiger),
9 | ("icons", g_picture_icons),
10 | ("snow_woman", g_picture_snow_woman),
11 | ("river_man", g_picture_river_man),
12 | ("all_test", g_picture_all_test),
13 | ]
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 | self.tableView.rowHeight = 100
18 | self.title = NSLocalizedString("Pictures", comment: "")
19 | self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: kCellID)
20 |
21 | if #available(iOS 9.0, *) {
22 | self.tableView.cellLayoutMarginsFollowReadableWidth = false
23 | }
24 | }
25 |
26 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
27 | return _pictures.count
28 | }
29 |
30 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
31 | let cell = self.tableView.dequeueReusableCell(withIdentifier: kCellID, for: indexPath)
32 | let (title, picture) = _pictures[(indexPath as NSIndexPath).row]
33 |
34 | let imageHeight = self.tableView.rowHeight - 10
35 | cell.textLabel?.text = title
36 | cell.imageView?.image = picture.transToImage(CGSize(width: imageHeight, height: imageHeight))
37 | cell.accessoryType = .disclosureIndicator
38 |
39 | return cell
40 | }
41 |
42 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
43 | let (title, picture) = _pictures[(indexPath as NSIndexPath).row]
44 | let aViewController = PictureViewController(picture: picture)
45 | aViewController.title = title
46 | self.navigationController?.pushViewController(aViewController, animated: true)
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Android/src/com/vecodekit/GraphicsPictureView.java:
--------------------------------------------------------------------------------
1 | /*
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2016 DumbDuck dumbduck@126.com
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 | */
24 |
25 | package com.vecodekit;
26 |
27 | import android.content.Context;
28 | import android.graphics.Canvas;
29 | import android.graphics.Rect;
30 | import android.util.AttributeSet;
31 | import android.view.View;
32 |
33 | public class GraphicsPictureView extends View
34 | {
35 | private GraphicsPicture _picture = null;
36 |
37 | public GraphicsPictureView(Context context, AttributeSet set)
38 | {
39 | super(context, set);
40 | this.setLayerType(LAYER_TYPE_SOFTWARE, null);
41 | }
42 |
43 | public void setPicture(GraphicsPicture picture)
44 | {
45 | _picture = picture;
46 | }
47 |
48 | public GraphicsPicture getPicture()
49 | {
50 | return _picture;
51 | }
52 |
53 | @Override
54 | protected void onDraw(Canvas canvas)
55 | {
56 | super.onDraw(canvas);
57 |
58 | if (_picture == null)
59 | {
60 | return;
61 | }
62 |
63 | Rect rect = canvas.getClipBounds();
64 | _picture.drawInRect(rect, canvas, PictureContentMode.ScaleAspectFit);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/java/com/vecodekit/GraphicsPictureView.java:
--------------------------------------------------------------------------------
1 | /*
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2016 DumbDuck dumbduck@126.com
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 | */
24 |
25 | package com.vecodekit;
26 |
27 | import android.content.Context;
28 | import android.graphics.Canvas;
29 | import android.graphics.Rect;
30 | import android.util.AttributeSet;
31 | import android.view.View;
32 |
33 | public class GraphicsPictureView extends View
34 | {
35 | private GraphicsPicture _picture = null;
36 |
37 | public GraphicsPictureView(Context context, AttributeSet set)
38 | {
39 | super(context, set);
40 | this.setLayerType(LAYER_TYPE_SOFTWARE, null);
41 | }
42 |
43 | public void setPicture(GraphicsPicture picture)
44 | {
45 | _picture = picture;
46 | }
47 |
48 | public GraphicsPicture getPicture()
49 | {
50 | return _picture;
51 | }
52 |
53 | @Override
54 | protected void onDraw(Canvas canvas)
55 | {
56 | super.onDraw(canvas);
57 |
58 | if (_picture == null)
59 | {
60 | return;
61 | }
62 |
63 | Rect rect = canvas.getClipBounds();
64 | _picture.drawInRect(rect, canvas, PictureContentMode.ScaleAspectFit);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/example-mac/AppMainView.m:
--------------------------------------------------------------------------------
1 |
2 | #import "AppMainView.h"
3 | #import "PictureView.h"
4 | #import "VKQuartzPicture.h"
5 | #import "all_test.h"
6 | #import "icons.h"
7 | #import "river_man.h"
8 | #import "snow_woman.h"
9 | #import "tiger.h"
10 | #import "world.h"
11 |
12 | ////////////////
13 | @implementation AppMainView {
14 | VKQuartzPicture* _pictures;
15 | size_t _numOfPictures;
16 | }
17 |
18 | - (void)dealloc {
19 | free(_pictures);
20 | }
21 |
22 | - (void)awakeFromNib {
23 | [super awakeFromNib];
24 | [self layoutSubviews];
25 |
26 | self.tableView.rowHeight = 100;
27 | [self.tableView setDataSource:self];
28 | [self.tableView setDelegate:self];
29 |
30 | VKQuartzPicture pictures[] = {
31 | g_picture_tiger, g_picture_icons, g_picture_world,
32 | g_picture_snow_woman, g_picture_river_man, g_picture_all_test,
33 | };
34 |
35 | _numOfPictures = sizeof(pictures) / sizeof(pictures[0]);
36 | _pictures = malloc(sizeof(pictures));
37 | memcpy(_pictures, pictures, sizeof(pictures));
38 |
39 | self.previewView.picture = _pictures[0];
40 | }
41 |
42 | - (void)layoutSubviews {
43 | const CGFloat kLeftWidth = 200;
44 | CGRect rt = self.bounds;
45 | CGRect leftFrame = rt;
46 | leftFrame.size.width = kLeftWidth;
47 | self.scrollView.frame = leftFrame;
48 |
49 | CGRect rightFrame = rt;
50 | rightFrame.origin.x = kLeftWidth;
51 | rightFrame.size.width = rt.size.width - kLeftWidth;
52 | self.previewView.frame = rightFrame;
53 | }
54 |
55 | - (void)resizeSubviewsWithOldSize:(NSSize)oldSize {
56 | [super resizeSubviewsWithOldSize:oldSize];
57 | [self layoutSubviews];
58 | }
59 |
60 | - (NSInteger)numberOfRowsInTableView:(NSTableView*)tableView {
61 | return _numOfPictures;
62 | }
63 |
64 | - (NSView*)tableView:(NSTableView*)tableView
65 | viewForTableColumn:(nullable NSTableColumn*)tableColumn
66 | row:(NSInteger)row {
67 | assert(row < _numOfPictures);
68 | PictureView* view = [[PictureView alloc] init];
69 | view.picture = _pictures[row];
70 | return view;
71 | }
72 |
73 | - (void)tableViewSelectionDidChange:(NSNotification*)notification {
74 | NSInteger row = self.tableView.selectedRow;
75 | if (row < _numOfPictures) {
76 | self.previewView.picture = _pictures[row];
77 | }
78 | }
79 |
80 | @end
81 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/java/com/dumbduck/vecodekitexample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.dumbduck.vecodekitexample;
2 |
3 | import android.content.Intent;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.os.Bundle;
6 | import android.view.View;
7 | import android.widget.AdapterView;
8 | import android.widget.ListView;
9 |
10 | import com.dumbduck.pictures.*;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | public class MainActivity extends AppCompatActivity
16 | {
17 | private List _listItems = new ArrayList();
18 |
19 | @Override
20 | protected void onCreate(Bundle savedInstanceState) {
21 | super.onCreate(savedInstanceState);
22 | setContentView(R.layout.activity_main);
23 |
24 | initList();
25 |
26 | PictureAdapter adapter = new PictureAdapter(this, R.layout.picture_item, _listItems);
27 | ListView listView = (ListView)findViewById(R.id.list_view);
28 | listView.setAdapter(adapter);
29 |
30 | listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
31 | @Override
32 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
33 | ListItem item = _listItems.get(position);
34 | Intent intent = new Intent(MainActivity.this, PreviewActivity.class);
35 | intent.putExtra("pictureClass", item.getPicture().getClass().getName());
36 | startActivity(intent);
37 | }
38 | });
39 | }
40 |
41 | private void initList()
42 | {
43 | ListItem item;
44 |
45 | item = new ListItem(new PictureTiger(), "tiger");
46 | _listItems.add(item);
47 |
48 | item = new ListItem(new PictureIcons(), "icons");
49 | _listItems.add(item);
50 |
51 | item = new ListItem(new PictureWorld(), "world");
52 | _listItems.add(item);
53 |
54 | item = new ListItem(new PictureAprilFool(), "april fool");
55 | _listItems.add(item);
56 |
57 | item = new ListItem(new PictureSnowWoman(), "snow woman");
58 | _listItems.add(item);
59 |
60 | item = new ListItem(new PictureRiverMan(), "river man");
61 | _listItems.add(item);
62 |
63 | item = new ListItem(new PictureAllTest(), "all test");
64 | _listItems.add(item);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPicture/swift/ext/VKQuartzPictureImage.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if os(iOS)
4 | import UIKit
5 |
6 | private func createImageWithSize(_ size: CGSize, drawer: (CGContext) -> Void) -> UIImage {
7 | UIGraphicsBeginImageContextWithOptions(size, false, UIScreen.main.scale)
8 | defer {
9 | UIGraphicsEndImageContext()
10 | }
11 |
12 | let context = UIGraphicsGetCurrentContext()!
13 | drawer(context)
14 | return UIGraphicsGetImageFromCurrentImageContext()!
15 | }
16 |
17 | public extension VKQuartzPicture {
18 |
19 | func transToImage() -> UIImage {
20 | return transToImage(self.bounds.size, .scaleAspectFit)
21 | }
22 |
23 | func transToImage(_ size: CGSize, _ color: UIColor, _ mode: VKPictureContentMode = .scaleAspectFit) -> UIImage {
24 | return createImageWithSize(size) { context in
25 | context.setStrokeColor(color.cgColor)
26 | context.setFillColor(color.cgColor)
27 | let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height)
28 | VKQuartzPictureDrawInRect(self, rect, context, mode)
29 | }
30 | }
31 |
32 | func transToImage(_ size: CGSize, _ mode: VKPictureContentMode = .scaleAspectFit) -> UIImage {
33 | return createImageWithSize(size) { context in
34 | let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height)
35 | VKQuartzPictureDrawInRect(self, rect, context, mode)
36 | }
37 | }
38 | }
39 |
40 | #else
41 | import AppKit
42 |
43 | private func createImageWithSize(_ size: CGSize, drawer: (CGContext) -> Void) -> NSImage {
44 | let newImage = NSImage(size: size)
45 | newImage.lockFocusFlipped(true)
46 | let context = NSGraphicsContext.current()!.cgContext
47 | drawer(context)
48 | newImage.unlockFocus()
49 | return newImage
50 | }
51 |
52 | public extension VKQuartzPicture {
53 |
54 | func transToImage() -> NSImage {
55 | return transToImage(self.bounds.size, .scaleAspectFit)
56 | }
57 |
58 | func transToImage(_ size: CGSize, _ color: NSColor, _ mode: VKPictureContentMode = .scaleAspectFit) -> NSImage {
59 | return createImageWithSize(size) { context in
60 | context.setStrokeColor(color.cgColor)
61 | context.setFillColor(color.cgColor)
62 | let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height)
63 | VKQuartzPictureDrawInRect(self, rect, context, mode)
64 | }
65 | }
66 |
67 | func transToImage(_ size: CGSize, _ mode: VKPictureContentMode = .scaleAspectFit) -> NSImage {
68 | return createImageWithSize(size) { context in
69 | let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height)
70 | VKQuartzPictureDrawInRect(self, rect, context, mode)
71 | }
72 | }
73 | }
74 | #endif
75 |
76 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPicture/swift/ext/VKQuartzPictureView.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | #if os(iOS)
4 |
5 | import UIKit
6 |
7 | open class VKQuartzPictureView: UIView {
8 | open var picture: VKQuartzPicture? {
9 | didSet {
10 | self.setNeedsDisplay()
11 | }
12 | }
13 |
14 | open var color: UIColor? {
15 | didSet {
16 | self.setNeedsDisplay()
17 | }
18 | }
19 |
20 | public init(picture: VKQuartzPicture, scale: CGFloat = 1.0) {
21 | self.picture = picture
22 |
23 | var rt = picture.bounds
24 | rt.origin = CGPoint.zero
25 | rt.size.width *= scale
26 | rt.size.height *= scale
27 | super.init(frame: rt)
28 | self.backgroundColor = UIColor.clear
29 | }
30 |
31 | open override var frame: CGRect {
32 | didSet {
33 | self.setNeedsDisplay()
34 | }
35 | }
36 |
37 | public required init?(coder aDecoder: NSCoder) {
38 | super.init(coder: aDecoder)
39 | }
40 |
41 | open override func draw(_ rect: CGRect) {
42 | guard let context = UIGraphicsGetCurrentContext() else { return }
43 | if let color = color {
44 | context.setFillColor(color.cgColor)
45 | context.setStrokeColor(color.cgColor)
46 | }
47 |
48 | if let picture = picture {
49 | VKQuartzPictureDrawInRect(picture, self.bounds, context, .scaleAspectFit)
50 | }
51 | }
52 | }
53 |
54 | #else
55 |
56 | import AppKit
57 |
58 | public class VKQuartzPictureView: NSView {
59 | public var picture: VKQuartzPicture? {
60 | didSet {
61 | self.setNeedsDisplay(self.bounds)
62 | }
63 | }
64 |
65 | public var color: NSColor? {
66 | didSet {
67 | self.setNeedsDisplay(self.bounds)
68 | }
69 | }
70 |
71 | public init(picture: VKQuartzPicture, scale: CGFloat = 1.0) {
72 | self.picture = picture
73 |
74 | var rt = picture.bounds
75 | rt.origin = CGPoint.zero
76 | rt.size.width *= scale
77 | rt.size.height *= scale
78 | super.init(frame: rt)
79 | }
80 |
81 | public override var isFlipped: Bool {
82 | get {
83 | return true
84 | }
85 | }
86 |
87 | public required init?(coder aDecoder: NSCoder) {
88 | super.init(coder: aDecoder)
89 | }
90 |
91 | public override func draw(_ rect: CGRect) {
92 | guard let context = NSGraphicsContext.current()?.cgContext else { return }
93 |
94 | if let color = color {
95 | context.setFillColor(color.cgColor)
96 | context.setStrokeColor(color.cgColor)
97 | }
98 |
99 | if let picture = picture {
100 | VKQuartzPictureDrawInRect(picture, self.bounds, context, .scaleAspectFit)
101 | }
102 | }
103 | }
104 |
105 | #endif
106 |
107 |
--------------------------------------------------------------------------------
/Android/src/com/vecodekit/GraphicsPicture.java:
--------------------------------------------------------------------------------
1 | /*
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2016 DumbDuck dumbduck@126.com
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 | */
24 |
25 | package com.vecodekit;
26 | import android.graphics.*;
27 |
28 | public class GraphicsPicture
29 | {
30 | private RectF _bounds;
31 |
32 | protected GraphicsPicture(RectF bounds)
33 | {
34 | _bounds = bounds;
35 | }
36 |
37 | public final void drawInRect(RectF rect, Canvas canvas, int contentMode)
38 | {
39 | final float kEpsilon = 0.001f;
40 | if (_bounds.width() < kEpsilon || _bounds.height() < kEpsilon)
41 | {
42 | return;
43 | }
44 |
45 | float scaleX = rect.width() / _bounds.width();
46 | float scaleY = rect.height() / _bounds.height();
47 |
48 | switch (contentMode)
49 | {
50 | case PictureContentMode.ScaleAspectFit:
51 | scaleX = Math.min(scaleX, scaleY);
52 | scaleY = scaleX;
53 | break;
54 |
55 | case PictureContentMode.AspectFill:
56 | scaleX = Math.max(scaleX, scaleY);
57 | scaleY = scaleX;
58 | break;
59 |
60 | case PictureContentMode.ScaleToFill:
61 | // nothing
62 | break;
63 |
64 | case PictureContentMode.Center:
65 | scaleX = 1.0f;
66 | scaleY = 1.0f;
67 | break;
68 |
69 | default:
70 | break;
71 | }
72 |
73 | final float pictureWidth = _bounds.width() * scaleX;
74 | final float pictureHeight = _bounds.height() * scaleY;
75 |
76 | final float offsetX = (rect.width() - pictureWidth) * 0.5f + rect.left;
77 | final float offsetY = (rect.height() - pictureHeight) * 0.5f + rect.top;
78 |
79 | canvas.save();
80 | canvas.translate(offsetX, offsetY);
81 | canvas.scale(scaleX, scaleY);
82 | canvas.translate(-_bounds.left, -_bounds.top);
83 | picture_draw_main(canvas);
84 | canvas.restore();
85 | }
86 |
87 | public final void drawInRect(Rect rect, Canvas canvas, int contentMode)
88 | {
89 | RectF rectF = new RectF(rect.left, rect.top, rect.right, rect.bottom);
90 | drawInRect(rectF, canvas, contentMode);
91 | }
92 |
93 | public final Bitmap transToBitmap(float width, float height, int contentMode)
94 | {
95 | int bitmapWidth = (int)Math.ceil(width);
96 | int bitmapHeight = (int)Math.ceil(height);
97 |
98 | Bitmap bitmap = Bitmap.createBitmap(bitmapWidth, bitmapHeight, Bitmap.Config.ARGB_8888);
99 | Canvas canvas = new Canvas(bitmap);
100 | drawInRect(new RectF(0, 0, (float)bitmapWidth, (float)bitmapHeight), canvas, contentMode);
101 | return bitmap;
102 | }
103 |
104 | public final Bitmap transToBitmap(float width, float height)
105 | {
106 | return transToBitmap(width, height, PictureContentMode.ScaleAspectFit);
107 | }
108 |
109 | public final float getWidth()
110 | {
111 | return _bounds.width();
112 | }
113 |
114 | public final float getHeight()
115 | {
116 | return _bounds.height();
117 | }
118 |
119 | //////////////////////
120 | protected void picture_draw_main(Canvas canvas)
121 | {
122 | }
123 |
124 | protected static Matrix createMatrix(float a, float b, float c, float d, float tx, float ty)
125 | {
126 | Matrix matrix = new Matrix();
127 | float values[] = {
128 | a, c, tx,
129 | b, d, ty,
130 | 0.0f, 0.0f, 1.0f
131 | };
132 | matrix.setValues(values);
133 | return matrix;
134 | }
135 |
136 | protected static int colorApplyColorTransform(int color, float[] transform)
137 | {
138 | if (transform == null || transform.length != 8)
139 | {
140 | return color;
141 | }
142 |
143 | int r = Color.red(color);
144 | int g = Color.green(color);
145 | int b = Color.blue(color);
146 | int a = Color.alpha(color);
147 |
148 | r = (int)Math.min(255.0f, transform[0] * (float)r + transform[4] * 255.0f);
149 | g = (int)Math.min(255.0f, transform[1] * (float)g + transform[5] * 255.0f);
150 | b = (int)Math.min(255.0f, transform[2] * (float)b + transform[6] * 255.0f);
151 | a = (int)Math.min(255.0f, transform[3] * (float)a + transform[7] * 255.0f);
152 |
153 | return Color.argb(a, r, g, b);
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/java/com/vecodekit/GraphicsPicture.java:
--------------------------------------------------------------------------------
1 | /*
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2016 DumbDuck dumbduck@126.com
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 | */
24 |
25 | package com.vecodekit;
26 | import android.graphics.*;
27 |
28 | public class GraphicsPicture
29 | {
30 | private RectF _bounds;
31 |
32 | protected GraphicsPicture(RectF bounds)
33 | {
34 | _bounds = bounds;
35 | }
36 |
37 | public final void drawInRect(RectF rect, Canvas canvas, int contentMode)
38 | {
39 | final float kEpsilon = 0.001f;
40 | if (_bounds.width() < kEpsilon || _bounds.height() < kEpsilon)
41 | {
42 | return;
43 | }
44 |
45 | float scaleX = rect.width() / _bounds.width();
46 | float scaleY = rect.height() / _bounds.height();
47 |
48 | switch (contentMode)
49 | {
50 | case PictureContentMode.ScaleAspectFit:
51 | scaleX = Math.min(scaleX, scaleY);
52 | scaleY = scaleX;
53 | break;
54 |
55 | case PictureContentMode.AspectFill:
56 | scaleX = Math.max(scaleX, scaleY);
57 | scaleY = scaleX;
58 | break;
59 |
60 | case PictureContentMode.ScaleToFill:
61 | // nothing
62 | break;
63 |
64 | case PictureContentMode.Center:
65 | scaleX = 1.0f;
66 | scaleY = 1.0f;
67 | break;
68 |
69 | default:
70 | break;
71 | }
72 |
73 | final float pictureWidth = _bounds.width() * scaleX;
74 | final float pictureHeight = _bounds.height() * scaleY;
75 |
76 | final float offsetX = (rect.width() - pictureWidth) * 0.5f + rect.left;
77 | final float offsetY = (rect.height() - pictureHeight) * 0.5f + rect.top;
78 |
79 | canvas.save();
80 | canvas.translate(offsetX, offsetY);
81 | canvas.scale(scaleX, scaleY);
82 | canvas.translate(-_bounds.left, -_bounds.top);
83 | picture_draw_main(canvas);
84 | canvas.restore();
85 | }
86 |
87 | public final void drawInRect(Rect rect, Canvas canvas, int contentMode)
88 | {
89 | RectF rectF = new RectF(rect.left, rect.top, rect.right, rect.bottom);
90 | drawInRect(rectF, canvas, contentMode);
91 | }
92 |
93 | public final Bitmap transToBitmap(float width, float height, int contentMode)
94 | {
95 | int bitmapWidth = (int)Math.ceil(width);
96 | int bitmapHeight = (int)Math.ceil(height);
97 |
98 | Bitmap bitmap = Bitmap.createBitmap(bitmapWidth, bitmapHeight, Bitmap.Config.ARGB_8888);
99 | Canvas canvas = new Canvas(bitmap);
100 | drawInRect(new RectF(0, 0, (float)bitmapWidth, (float)bitmapHeight), canvas, contentMode);
101 | return bitmap;
102 | }
103 |
104 | public final Bitmap transToBitmap(float width, float height)
105 | {
106 | return transToBitmap(width, height, PictureContentMode.ScaleAspectFit);
107 | }
108 |
109 | public final float getWidth()
110 | {
111 | return _bounds.width();
112 | }
113 |
114 | public final float getHeight()
115 | {
116 | return _bounds.height();
117 | }
118 |
119 | //////////////////////
120 | protected void picture_draw_main(Canvas canvas)
121 | {
122 | }
123 |
124 | protected static Matrix createMatrix(float a, float b, float c, float d, float tx, float ty)
125 | {
126 | Matrix matrix = new Matrix();
127 | float values[] = {
128 | a, c, tx,
129 | b, d, ty,
130 | 0.0f, 0.0f, 1.0f
131 | };
132 | matrix.setValues(values);
133 | return matrix;
134 | }
135 |
136 | protected static int colorApplyColorTransform(int color, float[] transform)
137 | {
138 | if (transform == null || transform.length != 8)
139 | {
140 | return color;
141 | }
142 |
143 | int r = Color.red(color);
144 | int g = Color.green(color);
145 | int b = Color.blue(color);
146 | int a = Color.alpha(color);
147 |
148 | r = (int)Math.min(255.0f, transform[0] * (float)r + transform[4] * 255.0f);
149 | g = (int)Math.min(255.0f, transform[1] * (float)g + transform[5] * 255.0f);
150 | b = (int)Math.min(255.0f, transform[2] * (float)b + transform[6] * 255.0f);
151 | a = (int)Math.min(255.0f, transform[3] * (float)a + transform[7] * 255.0f);
152 |
153 | return Color.argb(a, r, g, b);
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/test_swf/out_svg/all_test.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
76 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/pictures/all_test.c:
--------------------------------------------------------------------------------
1 |
2 | #include
3 |
4 | #ifndef __VKQUARTZPICTURE_STRUCT__
5 | #define __VKQUARTZPICTURE_STRUCT__
6 | typedef struct
7 | {
8 | CGRect bounds;
9 | void (*_Nullable drawer)(_Nonnull CGContextRef);
10 | } VKQuartzPicture;
11 | #endif
12 |
13 | // MARK: g_picture_all_test
14 | static void draw_main(CGContextRef ctx);
15 | VKQuartzPicture g_picture_all_test = {
16 | { 0, 0, 550, 400 },
17 | draw_main,
18 | };
19 |
20 | /////////////////////////
21 | static void draw_gradient_0(CGContextRef ctx)
22 | {
23 | CGFloat colors[] = {
24 | 0, 0, 1, 1,
25 | 0, 0, 0, 1
26 | };
27 | CGFloat locations[] = {
28 | 0,
29 | 1
30 | };
31 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
32 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, 2);
33 | CGColorSpaceRelease(colorSpace);
34 | CGGradientDrawingOptions options = kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation;
35 | CGContextDrawRadialGradient(ctx, gradient, CGPointMake(0, 0), 0, CGPointMake(0, 0), 819.2, options);
36 | CGGradientRelease(gradient);
37 | }
38 |
39 | static void def_path_0(CGContextRef ctx)
40 | {
41 | CGContextMoveToPoint(ctx, 528.95, 193);
42 | CGContextAddLineToPoint(ctx, 528.95, 59);
43 | CGContextAddLineToPoint(ctx, 409.95, 59);
44 | CGContextAddLineToPoint(ctx, 409.95, 193);
45 | CGContextAddLineToPoint(ctx, 528.95, 193);
46 | CGContextClosePath(ctx);
47 | }
48 |
49 | static void draw_gradient_1(CGContextRef ctx)
50 | {
51 | CGFloat colors[] = {
52 | 1, 0, 0, 1,
53 | 1, 1, 0, 1,
54 | 0, 1, 0, 1,
55 | 0, 1, 1, 1,
56 | 0, 0, 1, 1,
57 | 1, 0, 1, 1,
58 | 1, 0, 0, 1
59 | };
60 | CGFloat locations[] = {
61 | 0,
62 | 0.164706,
63 | 0.364706,
64 | 0.498039,
65 | 0.666667,
66 | 0.831373,
67 | 1
68 | };
69 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
70 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, 7);
71 | CGColorSpaceRelease(colorSpace);
72 | CGGradientDrawingOptions options = kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation;
73 | CGContextDrawLinearGradient(ctx, gradient, CGPointMake(-819.2, 0), CGPointMake(819.2, 0), options);
74 | CGGradientRelease(gradient);
75 | }
76 |
77 | static void def_path_1(CGContextRef ctx)
78 | {
79 | CGContextMoveToPoint(ctx, 421.95, 245);
80 | CGContextAddLineToPoint(ctx, 421.95, 359.95);
81 | CGContextAddLineToPoint(ctx, 538.95, 359.95);
82 | CGContextAddLineToPoint(ctx, 538.95, 245);
83 | CGContextAddLineToPoint(ctx, 421.95, 245);
84 | CGContextClosePath(ctx);
85 | }
86 |
87 | static void def_path_2(CGContextRef ctx)
88 | {
89 | CGContextMoveToPoint(ctx, 58.75, 160.95);
90 | CGContextAddLineToPoint(ctx, 14, 175.45);
91 | CGContextAddLineToPoint(ctx, 14, 222.5);
92 | CGContextAddLineToPoint(ctx, 58.75, 237);
93 | CGContextAddLineToPoint(ctx, 86.35, 199);
94 | CGContextAddLineToPoint(ctx, 58.75, 160.95);
95 | CGContextClosePath(ctx);
96 | }
97 |
98 | static void def_path_3(CGContextRef ctx)
99 | {
100 | CGContextMoveToPoint(ctx, 528.95, 193);
101 | CGContextAddLineToPoint(ctx, 409.95, 193);
102 | CGContextAddLineToPoint(ctx, 409.95, 59);
103 | CGContextAddLineToPoint(ctx, 528.95, 59);
104 | CGContextAddLineToPoint(ctx, 528.95, 193);
105 | }
106 |
107 | static void def_path_4(CGContextRef ctx)
108 | {
109 | CGContextMoveToPoint(ctx, 421.95, 245);
110 | CGContextAddLineToPoint(ctx, 538.95, 245);
111 | CGContextAddLineToPoint(ctx, 538.95, 359.95);
112 | CGContextAddLineToPoint(ctx, 421.95, 359.95);
113 | CGContextAddLineToPoint(ctx, 421.95, 245);
114 | }
115 |
116 |
117 | typedef struct
118 | {
119 | CGFloat mult[4];
120 | CGFloat add[4];
121 | } TKColorTransform;
122 |
123 | static void TKColorApplyColorTransform(CGFloat color[4], const TKColorTransform* transform)
124 | {
125 | if (transform)
126 | {
127 | const CGFloat* mult = transform->mult;
128 | const CGFloat* add = transform->add;
129 | color[0] = mult[0] * color[0] + add[0];
130 | color[1] = mult[1] * color[1] + add[1];
131 | color[2] = mult[2] * color[2] + add[2];
132 | color[3] = mult[3] * color[3] + add[3];
133 | }
134 | }
135 |
136 | static void draw_gradient_2(CGContextRef ctx, const TKColorTransform* colorTrans)
137 | {
138 | CGFloat colors[] = {
139 | 1, 0, 0, 1,
140 | 1, 1, 0, 1,
141 | 0, 1, 0, 1,
142 | 0, 1, 1, 1,
143 | 0, 0, 1, 1,
144 | 1, 0, 1, 1,
145 | 1, 0, 0, 1
146 | };
147 | TKColorApplyColorTransform(colors + 0, colorTrans);
148 | TKColorApplyColorTransform(colors + 4, colorTrans);
149 | TKColorApplyColorTransform(colors + 8, colorTrans);
150 | TKColorApplyColorTransform(colors + 12, colorTrans);
151 | TKColorApplyColorTransform(colors + 16, colorTrans);
152 | TKColorApplyColorTransform(colors + 20, colorTrans);
153 | TKColorApplyColorTransform(colors + 24, colorTrans);
154 | CGFloat locations[] = {
155 | 0,
156 | 0.164706,
157 | 0.364706,
158 | 0.498039,
159 | 0.666667,
160 | 0.831373,
161 | 1
162 | };
163 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
164 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, 7);
165 | CGColorSpaceRelease(colorSpace);
166 | CGGradientDrawingOptions options = kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation;
167 | CGContextDrawLinearGradient(ctx, gradient, CGPointMake(-819.2, 0), CGPointMake(819.2, 0), options);
168 | CGGradientRelease(gradient);
169 | }
170 |
171 | static void def_path_5(CGContextRef ctx)
172 | {
173 | CGContextMoveToPoint(ctx, 78.85, 0);
174 | CGContextAddLineToPoint(ctx, -1.52588e-06, 54);
175 | CGContextAddLineToPoint(ctx, 27.05, 145.7);
176 | CGContextAddLineToPoint(ctx, 122.6, 148.3);
177 | CGContextAddLineToPoint(ctx, 154.65, 58.25);
178 | CGContextAddLineToPoint(ctx, 78.85, 0);
179 | CGContextClosePath(ctx);
180 | }
181 |
182 |
183 | static void TKSetRGBStrokeColor(CGContextRef ctx, CGFloat r, CGFloat g, CGFloat b, CGFloat a, const TKColorTransform* transform)
184 | {
185 | CGFloat color[4] = { r, g, b, a };
186 | TKColorApplyColorTransform(color, transform);
187 | CGContextSetRGBStrokeColor(ctx, color[0], color[1], color[2], color[3]);
188 | }
189 |
190 | static void draw_shape_2(CGContextRef ctx, const TKColorTransform* colorTrans)
191 | {
192 | CGContextSaveGState(ctx);
193 | CGContextConcatCTM(ctx, CGAffineTransformMake(1, 0, 0, 1, 0, 0));
194 | def_path_5(ctx);
195 | CGContextEOClip(ctx);
196 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0943909, 0, 0, 0.0905151, 77.3, 74.15));
197 | draw_gradient_2(ctx, colorTrans);
198 | CGContextRestoreGState(ctx);
199 |
200 | CGContextSaveGState(ctx);
201 | TKSetRGBStrokeColor(ctx, 0.2, 1, 0.4, 1, colorTrans);
202 | CGContextSetLineWidth(ctx, 1);
203 | CGContextSetLineCap(ctx, kCGLineCapRound);
204 | CGContextSetLineJoin(ctx, kCGLineJoinRound);
205 | def_path_5(ctx);
206 | CGContextDrawPath(ctx, kCGPathStroke);
207 | CGContextRestoreGState(ctx);
208 |
209 | }
210 |
211 | static void draw_gradient_3(CGContextRef ctx, const TKColorTransform* colorTrans)
212 | {
213 | CGFloat colors[] = {
214 | 0, 1, 0, 1,
215 | 0, 0, 0, 1
216 | };
217 | TKColorApplyColorTransform(colors + 0, colorTrans);
218 | TKColorApplyColorTransform(colors + 4, colorTrans);
219 | CGFloat locations[] = {
220 | 0,
221 | 1
222 | };
223 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
224 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, 2);
225 | CGColorSpaceRelease(colorSpace);
226 | CGGradientDrawingOptions options = kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation;
227 | CGContextDrawRadialGradient(ctx, gradient, CGPointMake(0, 0), 0, CGPointMake(0, 0), 819.2, options);
228 | CGGradientRelease(gradient);
229 | }
230 |
231 | static void def_path_6(CGContextRef ctx)
232 | {
233 | CGContextMoveToPoint(ctx, 144, 76);
234 | CGContextAddQuadCurveToPoint(ctx, 144, 44.5, 122.9, 22.25);
235 | CGContextAddQuadCurveToPoint(ctx, 101.8, 0, 72, 0);
236 | CGContextAddQuadCurveToPoint(ctx, 42.2, 0, 21.1, 22.25);
237 | CGContextAddQuadCurveToPoint(ctx, 3.8147e-07, 44.5, 3.8147e-07, 76);
238 | CGContextAddQuadCurveToPoint(ctx, 3.8147e-07, 107.5, 21.1, 129.75);
239 | CGContextAddQuadCurveToPoint(ctx, 42.2, 152, 72, 152);
240 | CGContextAddQuadCurveToPoint(ctx, 101.8, 152, 122.9, 129.75);
241 | CGContextAddQuadCurveToPoint(ctx, 144, 107.5, 144, 76);
242 | CGContextClosePath(ctx);
243 | }
244 |
245 | static void draw_shape_4(CGContextRef ctx, const TKColorTransform* colorTrans)
246 | {
247 | CGContextSaveGState(ctx);
248 | CGContextConcatCTM(ctx, CGAffineTransformMake(1, 0, 0, 1, 0, 0));
249 | def_path_6(ctx);
250 | CGContextEOClip(ctx);
251 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0935059, 0, 0, 0.0935059, 72, 76));
252 | draw_gradient_3(ctx, colorTrans);
253 | CGContextRestoreGState(ctx);
254 |
255 | CGContextSaveGState(ctx);
256 | TKSetRGBStrokeColor(ctx, 0.2, 1, 0.4, 1, colorTrans);
257 | CGContextSetLineWidth(ctx, 1);
258 | CGContextSetLineCap(ctx, kCGLineCapRound);
259 | CGContextSetLineJoin(ctx, kCGLineJoinRound);
260 | def_path_6(ctx);
261 | CGContextDrawPath(ctx, kCGPathStroke);
262 | CGContextRestoreGState(ctx);
263 |
264 | }
265 |
266 | static void def_path_7(CGContextRef ctx)
267 | {
268 | CGContextMoveToPoint(ctx, 306, -616);
269 | CGContextAddQuadCurveToPoint(ctx, 526.5, -620, 522, -368);
270 | CGContextAddQuadCurveToPoint(ctx, 527, -118, 306, -122);
271 | CGContextAddLineToPoint(ctx, 224, -122);
272 | CGContextAddLineToPoint(ctx, 224, -616);
273 | CGContextAddLineToPoint(ctx, 306, -616);
274 | CGContextClosePath(ctx);
275 | CGContextMoveToPoint(ctx, 318, 0);
276 | CGContextAddQuadCurveToPoint(ctx, 688.5, -1.5, 692, -368);
277 | CGContextAddQuadCurveToPoint(ctx, 688.5, -737.5, 318, -738);
278 | CGContextAddLineToPoint(ctx, 66, -738);
279 | CGContextAddLineToPoint(ctx, 66, 0);
280 | CGContextAddLineToPoint(ctx, 318, 0);
281 | CGContextClosePath(ctx);
282 | }
283 |
284 | static void def_path_8(CGContextRef ctx)
285 | {
286 | CGContextMoveToPoint(ctx, 560, 0);
287 | CGContextAddLineToPoint(ctx, 554, -92);
288 | CGContextAddLineToPoint(ctx, 554, -514);
289 | CGContextAddLineToPoint(ctx, 400, -514);
290 | CGContextAddLineToPoint(ctx, 400, -204);
291 | CGContextAddQuadCurveToPoint(ctx, 392, -94, 308, -86);
292 | CGContextAddQuadCurveToPoint(ctx, 219, -85.5, 216, -204);
293 | CGContextAddLineToPoint(ctx, 216, -514);
294 | CGContextAddLineToPoint(ctx, 62, -514);
295 | CGContextAddLineToPoint(ctx, 62, -180);
296 | CGContextAddQuadCurveToPoint(ctx, 62.5, -137, 72, -98);
297 | CGContextAddQuadCurveToPoint(ctx, 105.5, -2, 242, 13);
298 | CGContextAddQuadCurveToPoint(ctx, 348, 13.5, 400, -62);
299 | CGContextAddLineToPoint(ctx, 406, 0);
300 | CGContextAddLineToPoint(ctx, 560, 0);
301 | CGContextClosePath(ctx);
302 | }
303 |
304 | static void def_path_9(CGContextRef ctx)
305 | {
306 | CGContextMoveToPoint(ctx, 68, -514);
307 | CGContextAddLineToPoint(ctx, 68, 0);
308 | CGContextAddLineToPoint(ctx, 222, 0);
309 | CGContextAddLineToPoint(ctx, 222, -308);
310 | CGContextAddQuadCurveToPoint(ctx, 229, -418.5, 314, -426);
311 | CGContextAddQuadCurveToPoint(ctx, 403.5, -426.5, 406, -308);
312 | CGContextAddLineToPoint(ctx, 406, 0);
313 | CGContextAddLineToPoint(ctx, 560, 0);
314 | CGContextAddLineToPoint(ctx, 560, -308);
315 | CGContextAddQuadCurveToPoint(ctx, 567, -418.5, 652, -426);
316 | CGContextAddQuadCurveToPoint(ctx, 741.5, -426.5, 744, -308);
317 | CGContextAddLineToPoint(ctx, 744, 0);
318 | CGContextAddLineToPoint(ctx, 898, 0);
319 | CGContextAddLineToPoint(ctx, 898, -308);
320 | CGContextAddQuadCurveToPoint(ctx, 898, -329, 897.5, -350);
321 | CGContextAddQuadCurveToPoint(ctx, 896.5, -365, 895, -380.5);
322 | CGContextAddQuadCurveToPoint(ctx, 891.5, -409, 882, -432);
323 | CGContextAddQuadCurveToPoint(ctx, 838, -516, 718, -528);
324 | CGContextAddQuadCurveToPoint(ctx, 612, -531.5, 544, -432);
325 | CGContextAddQuadCurveToPoint(ctx, 500, -516, 380, -528);
326 | CGContextAddQuadCurveToPoint(ctx, 274.5, -528.5, 222, -452);
327 | CGContextAddLineToPoint(ctx, 220, -452);
328 | CGContextAddLineToPoint(ctx, 220, -514);
329 | CGContextAddLineToPoint(ctx, 68, -514);
330 | CGContextClosePath(ctx);
331 | }
332 |
333 | static void def_path_10(CGContextRef ctx)
334 | {
335 | CGContextMoveToPoint(ctx, 314, -426);
336 | CGContextAddQuadCurveToPoint(ctx, 427, -427.5, 424, -256);
337 | CGContextAddQuadCurveToPoint(ctx, 427, -84.5, 314, -86);
338 | CGContextAddQuadCurveToPoint(ctx, 212.5, -92, 204, -256);
339 | CGContextAddQuadCurveToPoint(ctx, 212.5, -420, 314, -426);
340 | CGContextClosePath(ctx);
341 | CGContextMoveToPoint(ctx, 46, 0);
342 | CGContextAddLineToPoint(ctx, 198, 0);
343 | CGContextAddLineToPoint(ctx, 202, -72);
344 | CGContextAddLineToPoint(ctx, 204, -72);
345 | CGContextAddQuadCurveToPoint(ctx, 253, 12, 362, 13);
346 | CGContextAddQuadCurveToPoint(ctx, 465, 7, 520.5, -60);
347 | CGContextAddQuadCurveToPoint(ctx, 576, -127, 584, -256);
348 | CGContextAddQuadCurveToPoint(ctx, 566.5, -514.5, 344, -528);
349 | CGContextAddQuadCurveToPoint(ctx, 258, -524, 206, -454);
350 | CGContextAddLineToPoint(ctx, 204, -454);
351 | CGContextAddLineToPoint(ctx, 204, -738);
352 | CGContextAddLineToPoint(ctx, 50, -738);
353 | CGContextAddLineToPoint(ctx, 50, -102);
354 | CGContextAddLineToPoint(ctx, 46, 0);
355 | CGContextClosePath(ctx);
356 | }
357 |
358 | static void def_path_11(CGContextRef ctx)
359 | {
360 | CGContextMoveToPoint(ctx, 262, -528);
361 | CGContextAddQuadCurveToPoint(ctx, 49.5, -514.5, 32, -256);
362 | CGContextAddQuadCurveToPoint(ctx, 40.5, -128, 98, -60.5);
363 | CGContextAddQuadCurveToPoint(ctx, 155.5, 6.5, 262, 13);
364 | CGContextAddQuadCurveToPoint(ctx, 478, 10.5, 490, -186);
365 | CGContextAddLineToPoint(ctx, 340, -186);
366 | CGContextAddQuadCurveToPoint(ctx, 333, -87.5, 262, -86);
367 | CGContextAddQuadCurveToPoint(ctx, 200, -84.5, 193.5, -245.5);
368 | CGContextAddQuadCurveToPoint(ctx, 193, -254.5, 192, -264);
369 | CGContextAddQuadCurveToPoint(ctx, 192, -269, 192.5, -273.5);
370 | CGContextAddQuadCurveToPoint(ctx, 198.5, -426, 260, -426);
371 | CGContextAddQuadCurveToPoint(ctx, 332, -425, 338, -332);
372 | CGContextAddLineToPoint(ctx, 490, -332);
373 | CGContextAddQuadCurveToPoint(ctx, 479.5, -518, 262, -528);
374 | CGContextClosePath(ctx);
375 | }
376 |
377 | static void def_path_12(CGContextRef ctx)
378 | {
379 | CGContextMoveToPoint(ctx, 68, -738);
380 | CGContextAddLineToPoint(ctx, 68, 0);
381 | CGContextAddLineToPoint(ctx, 222, 0);
382 | CGContextAddLineToPoint(ctx, 222, -278);
383 | CGContextAddLineToPoint(ctx, 224, -280);
384 | CGContextAddLineToPoint(ctx, 378, 0);
385 | CGContextAddLineToPoint(ctx, 558, 0);
386 | CGContextAddLineToPoint(ctx, 368, -294);
387 | CGContextAddLineToPoint(ctx, 546, -520);
388 | CGContextAddLineToPoint(ctx, 374, -520);
389 | CGContextAddLineToPoint(ctx, 224, -304);
390 | CGContextAddLineToPoint(ctx, 222, -306);
391 | CGContextAddLineToPoint(ctx, 222, -738);
392 | CGContextAddLineToPoint(ctx, 68, -738);
393 | CGContextClosePath(ctx);
394 | }
395 |
396 | static void def_path_13(CGContextRef ctx)
397 | {
398 | CGContextMoveToPoint(ctx, 456, 0);
399 | CGContextAddLineToPoint(ctx, 728, -738);
400 | CGContextAddLineToPoint(ctx, 572, -738);
401 | CGContextAddLineToPoint(ctx, 378, -156);
402 | CGContextAddLineToPoint(ctx, 376, -156);
403 | CGContextAddLineToPoint(ctx, 184, -738);
404 | CGContextAddLineToPoint(ctx, 10, -738);
405 | CGContextAddLineToPoint(ctx, 282, 0);
406 | CGContextAddLineToPoint(ctx, 456, 0);
407 | CGContextClosePath(ctx);
408 | }
409 |
410 | static void def_path_14(CGContextRef ctx)
411 | {
412 | CGContextMoveToPoint(ctx, 538, -249);
413 | CGContextAddLineToPoint(ctx, 537, -273);
414 | CGContextAddLineToPoint(ctx, 534, -314);
415 | CGContextAddQuadCurveToPoint(ctx, 528, -363.5, 508, -406);
416 | CGContextAddQuadCurveToPoint(ctx, 449, -529, 288, -528);
417 | CGContextAddQuadCurveToPoint(ctx, 55, -515.5, 42, -256);
418 | CGContextAddQuadCurveToPoint(ctx, 39, 15.5, 288, 13);
419 | CGContextAddQuadCurveToPoint(ctx, 503, 12.5, 522, -152);
420 | CGContextAddLineToPoint(ctx, 384, -152);
421 | CGContextAddQuadCurveToPoint(ctx, 363, -83.5, 288, -86);
422 | CGContextAddQuadCurveToPoint(ctx, 195.5, -83, 200, -216);
423 | CGContextAddLineToPoint(ctx, 538, -216);
424 | CGContextAddLineToPoint(ctx, 538, -249);
425 | CGContextClosePath(ctx);
426 | CGContextMoveToPoint(ctx, 288, -426);
427 | CGContextAddQuadCurveToPoint(ctx, 380.5, -427, 378, -318);
428 | CGContextAddLineToPoint(ctx, 200, -318);
429 | CGContextAddQuadCurveToPoint(ctx, 202.5, -427, 288, -426);
430 | CGContextClosePath(ctx);
431 | }
432 |
433 | static void def_path_15(CGContextRef ctx)
434 | {
435 | CGContextMoveToPoint(ctx, 312, -528);
436 | CGContextAddQuadCurveToPoint(ctx, 55.5, -517, 44, -256);
437 | CGContextAddQuadCurveToPoint(ctx, 55, 2.5, 312, 13);
438 | CGContextAddQuadCurveToPoint(ctx, 569, 2.5, 580, -256);
439 | CGContextAddQuadCurveToPoint(ctx, 568.5, -517, 312, -528);
440 | CGContextClosePath(ctx);
441 | CGContextMoveToPoint(ctx, 312, -426);
442 | CGContextAddQuadCurveToPoint(ctx, 424, -427, 422, -256);
443 | CGContextAddQuadCurveToPoint(ctx, 424, -85, 312, -86);
444 | CGContextAddQuadCurveToPoint(ctx, 200, -85, 202, -256);
445 | CGContextAddQuadCurveToPoint(ctx, 200, -427, 312, -426);
446 | CGContextClosePath(ctx);
447 | }
448 |
449 | static void def_path_16(CGContextRef ctx)
450 | {
451 | CGContextMoveToPoint(ctx, 310, -426);
452 | CGContextAddQuadCurveToPoint(ctx, 411.5, -420, 420, -256);
453 | CGContextAddQuadCurveToPoint(ctx, 411.5, -92, 310, -86);
454 | CGContextAddQuadCurveToPoint(ctx, 194.5, -84.5, 198, -256);
455 | CGContextAddQuadCurveToPoint(ctx, 194.5, -427.5, 310, -426);
456 | CGContextClosePath(ctx);
457 | CGContextMoveToPoint(ctx, 418, -454);
458 | CGContextAddQuadCurveToPoint(ctx, 366, -524, 280, -528);
459 | CGContextAddQuadCurveToPoint(ctx, 56.5, -515.5, 40, -256);
460 | CGContextAddQuadCurveToPoint(ctx, 47.5, -127, 103, -60);
461 | CGContextAddQuadCurveToPoint(ctx, 158.5, 7, 262, 13);
462 | CGContextAddQuadCurveToPoint(ctx, 372, 12, 418, -72);
463 | CGContextAddLineToPoint(ctx, 420, -72);
464 | CGContextAddLineToPoint(ctx, 424, 0);
465 | CGContextAddLineToPoint(ctx, 578, 0);
466 | CGContextAddLineToPoint(ctx, 574, -102);
467 | CGContextAddLineToPoint(ctx, 574, -738);
468 | CGContextAddLineToPoint(ctx, 420, -738);
469 | CGContextAddLineToPoint(ctx, 420, -454);
470 | CGContextAddLineToPoint(ctx, 418, -454);
471 | CGContextClosePath(ctx);
472 | }
473 |
474 | static void draw_main(CGContextRef ctx)
475 | {
476 | CGContextSaveGState(ctx);
477 | CGContextConcatCTM(ctx, CGAffineTransformMake(1, 0, 0, 1, 0, 0));
478 | def_path_0(ctx);
479 | CGContextEOClip(ctx);
480 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.109375, 0, 0, 0.109375, 469.45, 126));
481 | draw_gradient_0(ctx);
482 | CGContextRestoreGState(ctx);
483 |
484 | CGContextSaveGState(ctx);
485 | CGContextConcatCTM(ctx, CGAffineTransformMake(1, 0, 0, 1, 0, 0));
486 | def_path_1(ctx);
487 | CGContextEOClip(ctx);
488 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0714111, 0, 0, 0.0701599, 480.45, 302.45));
489 | draw_gradient_1(ctx);
490 | CGContextRestoreGState(ctx);
491 |
492 | CGContextSaveGState(ctx);
493 | CGContextSetRGBFillColor(ctx, 0.8, 0.2, 0.6, 1);
494 | def_path_2(ctx);
495 | CGContextDrawPath(ctx, kCGPathEOFill);
496 | CGContextRestoreGState(ctx);
497 |
498 | CGContextSaveGState(ctx);
499 | CGContextSetRGBStrokeColor(ctx, 0.2, 1, 0.4, 1);
500 | CGContextSetLineWidth(ctx, 1);
501 | CGContextSetLineCap(ctx, kCGLineCapRound);
502 | CGContextSetLineJoin(ctx, kCGLineJoinRound);
503 | def_path_3(ctx);
504 | CGContextDrawPath(ctx, kCGPathStroke);
505 | CGContextRestoreGState(ctx);
506 |
507 | CGContextSaveGState(ctx);
508 | CGContextSetRGBStrokeColor(ctx, 0.2, 1, 0.4, 1);
509 | CGContextSetLineWidth(ctx, 1);
510 | CGContextSetLineCap(ctx, kCGLineCapRound);
511 | CGContextSetLineJoin(ctx, kCGLineJoinRound);
512 | def_path_4(ctx);
513 | CGContextDrawPath(ctx, kCGPathStroke);
514 | CGContextRestoreGState(ctx);
515 |
516 | CGContextSaveGState(ctx);
517 | CGContextConcatCTM(ctx, CGAffineTransformMake(1, 0, 0, 1, 39.35, 16.75));
518 | draw_shape_2(ctx, NULL);
519 | CGContextRestoreGState(ctx);
520 |
521 | {
522 | CGContextSaveGState(ctx);
523 | CGContextConcatCTM(ctx, CGAffineTransformMake(1, 0, 0, 1, 217.65, 16.75));
524 | TKColorTransform colorTrans = { 0.462745, 0.462745, 0.462745, 1.00392, 0, 0, 0, 0 };
525 | draw_shape_2(ctx, &colorTrans);
526 | CGContextRestoreGState(ctx);
527 | }
528 | CGContextSaveGState(ctx);
529 | CGContextConcatCTM(ctx, CGAffineTransformMake(1, 0, 0, 1, 94.55, 165.05));
530 | draw_shape_4(ctx, NULL);
531 | CGContextRestoreGState(ctx);
532 |
533 | {
534 | CGContextSaveGState(ctx);
535 | CGContextConcatCTM(ctx, CGAffineTransformMake(1, 0, 0, 1, 238.55, 181));
536 | TKColorTransform colorTrans = { 0.239216, 0.239216, 0.239216, 1.00392, 0.698039, 0.0588235, 0.760784, 0 };
537 | draw_shape_4(ctx, &colorTrans);
538 | CGContextRestoreGState(ctx);
539 | }
540 | CGContextSaveGState(ctx);
541 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 26.55, 371.85));
542 | CGContextSetRGBFillColor(ctx, 0.8, 0.2, 0.6, 1);
543 | def_path_7(ctx);
544 | CGContextDrawPath(ctx, kCGPathEOFill);
545 | CGContextRestoreGState(ctx);
546 |
547 | CGContextSaveGState(ctx);
548 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 52.45, 371.85));
549 | CGContextSetRGBFillColor(ctx, 0.8, 0.2, 0.6, 1);
550 | def_path_8(ctx);
551 | CGContextDrawPath(ctx, kCGPathEOFill);
552 | CGContextRestoreGState(ctx);
553 |
554 | CGContextSaveGState(ctx);
555 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 74.35, 371.85));
556 | CGContextSetRGBFillColor(ctx, 0.8, 0.2, 0.6, 1);
557 | def_path_9(ctx);
558 | CGContextDrawPath(ctx, kCGPathEOFill);
559 | CGContextRestoreGState(ctx);
560 |
561 | CGContextSaveGState(ctx);
562 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 108.3, 371.85));
563 | CGContextSetRGBFillColor(ctx, 0.8, 0.2, 0.6, 1);
564 | def_path_10(ctx);
565 | CGContextDrawPath(ctx, kCGPathEOFill);
566 | CGContextRestoreGState(ctx);
567 |
568 | CGContextSaveGState(ctx);
569 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 140.15, 371.85));
570 | CGContextSetRGBFillColor(ctx, 0.8, 0.8, 0, 1);
571 | def_path_7(ctx);
572 | CGContextDrawPath(ctx, kCGPathEOFill);
573 | CGContextRestoreGState(ctx);
574 |
575 | CGContextSaveGState(ctx);
576 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 166.05, 371.85));
577 | CGContextSetRGBFillColor(ctx, 0.8, 0.8, 0, 1);
578 | def_path_8(ctx);
579 | CGContextDrawPath(ctx, kCGPathEOFill);
580 | CGContextRestoreGState(ctx);
581 |
582 | CGContextSaveGState(ctx);
583 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 187.95, 371.85));
584 | CGContextSetRGBFillColor(ctx, 0.8, 0.8, 0, 1);
585 | def_path_11(ctx);
586 | CGContextDrawPath(ctx, kCGPathEOFill);
587 | CGContextRestoreGState(ctx);
588 |
589 | CGContextSaveGState(ctx);
590 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 205.95, 371.85));
591 | CGContextSetRGBFillColor(ctx, 0.8, 0.8, 0, 1);
592 | def_path_12(ctx);
593 | CGContextDrawPath(ctx, kCGPathEOFill);
594 | CGContextRestoreGState(ctx);
595 |
596 | CGContextSaveGState(ctx);
597 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 235.85, 371.85));
598 | CGContextSetRGBFillColor(ctx, 1, 0.2, 0, 1);
599 | def_path_13(ctx);
600 | CGContextDrawPath(ctx, kCGPathEOFill);
601 | CGContextRestoreGState(ctx);
602 |
603 | CGContextSaveGState(ctx);
604 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 261.75, 371.85));
605 | CGContextSetRGBFillColor(ctx, 1, 0.2, 0, 1);
606 | def_path_14(ctx);
607 | CGContextDrawPath(ctx, kCGPathEOFill);
608 | CGContextRestoreGState(ctx);
609 |
610 | CGContextSaveGState(ctx);
611 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 281.7, 371.85));
612 | CGContextSetRGBFillColor(ctx, 1, 0.2, 0, 1);
613 | def_path_11(ctx);
614 | CGContextDrawPath(ctx, kCGPathEOFill);
615 | CGContextRestoreGState(ctx);
616 |
617 | CGContextSaveGState(ctx);
618 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 299.7, 371.85));
619 | CGContextSetRGBFillColor(ctx, 1, 0.2, 0, 1);
620 | def_path_15(ctx);
621 | CGContextDrawPath(ctx, kCGPathEOFill);
622 | CGContextRestoreGState(ctx);
623 |
624 | CGContextSaveGState(ctx);
625 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 321.6, 371.85));
626 | CGContextSetRGBFillColor(ctx, 1, 0.2, 0, 1);
627 | def_path_16(ctx);
628 | CGContextDrawPath(ctx, kCGPathEOFill);
629 | CGContextRestoreGState(ctx);
630 |
631 | CGContextSaveGState(ctx);
632 | CGContextConcatCTM(ctx, CGAffineTransformMake(0.0351562, 0, 0, 0.0351562, 343.5, 371.85));
633 | CGContextSetRGBFillColor(ctx, 1, 0.2, 0, 1);
634 | def_path_14(ctx);
635 | CGContextDrawPath(ctx, kCGPathEOFill);
636 | CGContextRestoreGState(ctx);
637 |
638 | }
639 |
640 |
641 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/pictures/all_test.swift:
--------------------------------------------------------------------------------
1 |
2 | import CoreGraphics
3 |
4 | // MARK: g_picture_all_test
5 | public let g_picture_all_test = VKQuartzPicture(bounds: CGRect(x: 0, y: 0, width: 550, height: 400), drawer: draw_main)
6 |
7 | /////////////////////////
8 | private func draw_gradient_0(_ ctx: CGContext)
9 | {
10 | let colors : [CGFloat] = [
11 | 0, 0, 1, 1,
12 | 0, 0, 0, 1
13 | ]
14 | let locations : [CGFloat] = [
15 | 0,
16 | 1
17 | ]
18 | let colorSpace = CGColorSpaceCreateDeviceRGB()
19 | let gradient = CGGradient(colorSpace: colorSpace, colorComponents: colors, locations: locations, count: 2)!
20 | let options : CGGradientDrawingOptions = [.drawsBeforeStartLocation, .drawsAfterEndLocation]
21 | ctx.drawRadialGradient(gradient, startCenter: CGPoint(x: 0, y: 0), startRadius: 0, endCenter: CGPoint(x: 0, y: 0), endRadius: 819.2, options: options);
22 | }
23 |
24 | private func def_path_0(_ ctx: CGContext)
25 | {
26 | ctx.move(to: CGPoint(x: 528.95, y: 193))
27 | ctx.addLine(to: CGPoint(x: 528.95, y: 59))
28 | ctx.addLine(to: CGPoint(x: 409.95, y: 59))
29 | ctx.addLine(to: CGPoint(x: 409.95, y: 193))
30 | ctx.addLine(to: CGPoint(x: 528.95, y: 193))
31 | ctx.closePath()
32 | }
33 |
34 | private func draw_gradient_1(_ ctx: CGContext)
35 | {
36 | let colors : [CGFloat] = [
37 | 1, 0, 0, 1,
38 | 1, 1, 0, 1,
39 | 0, 1, 0, 1,
40 | 0, 1, 1, 1,
41 | 0, 0, 1, 1,
42 | 1, 0, 1, 1,
43 | 1, 0, 0, 1
44 | ]
45 | let locations : [CGFloat] = [
46 | 0,
47 | 0.164706,
48 | 0.364706,
49 | 0.498039,
50 | 0.666667,
51 | 0.831373,
52 | 1
53 | ]
54 | let colorSpace = CGColorSpaceCreateDeviceRGB()
55 | let gradient = CGGradient(colorSpace: colorSpace, colorComponents: colors, locations: locations, count: 7)!
56 | let options : CGGradientDrawingOptions = [.drawsBeforeStartLocation, .drawsAfterEndLocation]
57 | ctx.drawLinearGradient(gradient, start: CGPoint(x: -819.2, y: 0), end: CGPoint(x: 819.2, y: 0), options: options)
58 | }
59 |
60 | private func def_path_1(_ ctx: CGContext)
61 | {
62 | ctx.move(to: CGPoint(x: 421.95, y: 245))
63 | ctx.addLine(to: CGPoint(x: 421.95, y: 359.95))
64 | ctx.addLine(to: CGPoint(x: 538.95, y: 359.95))
65 | ctx.addLine(to: CGPoint(x: 538.95, y: 245))
66 | ctx.addLine(to: CGPoint(x: 421.95, y: 245))
67 | ctx.closePath()
68 | }
69 |
70 | private func def_path_2(_ ctx: CGContext)
71 | {
72 | ctx.move(to: CGPoint(x: 58.75, y: 160.95))
73 | ctx.addLine(to: CGPoint(x: 14, y: 175.45))
74 | ctx.addLine(to: CGPoint(x: 14, y: 222.5))
75 | ctx.addLine(to: CGPoint(x: 58.75, y: 237))
76 | ctx.addLine(to: CGPoint(x: 86.35, y: 199))
77 | ctx.addLine(to: CGPoint(x: 58.75, y: 160.95))
78 | ctx.closePath()
79 | }
80 |
81 | private func def_path_3(_ ctx: CGContext)
82 | {
83 | ctx.move(to: CGPoint(x: 528.95, y: 193))
84 | ctx.addLine(to: CGPoint(x: 409.95, y: 193))
85 | ctx.addLine(to: CGPoint(x: 409.95, y: 59))
86 | ctx.addLine(to: CGPoint(x: 528.95, y: 59))
87 | ctx.addLine(to: CGPoint(x: 528.95, y: 193))
88 | }
89 |
90 | private func def_path_4(_ ctx: CGContext)
91 | {
92 | ctx.move(to: CGPoint(x: 421.95, y: 245))
93 | ctx.addLine(to: CGPoint(x: 538.95, y: 245))
94 | ctx.addLine(to: CGPoint(x: 538.95, y: 359.95))
95 | ctx.addLine(to: CGPoint(x: 421.95, y: 359.95))
96 | ctx.addLine(to: CGPoint(x: 421.95, y: 245))
97 | }
98 |
99 |
100 | private typealias TKColorTransform = [CGFloat]
101 | private func TKColorApplyColorTransform(_ color: inout [CGFloat], _ index: Int, _ transform: TKColorTransform?)
102 | {
103 | if let transform = transform
104 | {
105 | assert(transform.count == 8);
106 | color[index + 0] = transform[0] * color[index + 0] + transform[4];
107 | color[index + 1] = transform[1] * color[index + 1] + transform[5];
108 | color[index + 2] = transform[2] * color[index + 2] + transform[6];
109 | color[index + 3] = transform[3] * color[index + 3] + transform[7];
110 | }
111 | }
112 |
113 | private func draw_gradient_2(_ ctx: CGContext, _ colorTrans: TKColorTransform?)
114 | {
115 | var colors : [CGFloat] = [
116 | 1, 0, 0, 1,
117 | 1, 1, 0, 1,
118 | 0, 1, 0, 1,
119 | 0, 1, 1, 1,
120 | 0, 0, 1, 1,
121 | 1, 0, 1, 1,
122 | 1, 0, 0, 1
123 | ]
124 | TKColorApplyColorTransform(&colors, 0, colorTrans)
125 | TKColorApplyColorTransform(&colors, 4, colorTrans)
126 | TKColorApplyColorTransform(&colors, 8, colorTrans)
127 | TKColorApplyColorTransform(&colors, 12, colorTrans)
128 | TKColorApplyColorTransform(&colors, 16, colorTrans)
129 | TKColorApplyColorTransform(&colors, 20, colorTrans)
130 | TKColorApplyColorTransform(&colors, 24, colorTrans)
131 | let locations : [CGFloat] = [
132 | 0,
133 | 0.164706,
134 | 0.364706,
135 | 0.498039,
136 | 0.666667,
137 | 0.831373,
138 | 1
139 | ]
140 | let colorSpace = CGColorSpaceCreateDeviceRGB()
141 | let gradient = CGGradient(colorSpace: colorSpace, colorComponents: colors, locations: locations, count: 7)!
142 | let options : CGGradientDrawingOptions = [.drawsBeforeStartLocation, .drawsAfterEndLocation]
143 | ctx.drawLinearGradient(gradient, start: CGPoint(x: -819.2, y: 0), end: CGPoint(x: 819.2, y: 0), options: options)
144 | }
145 |
146 | private func def_path_5(_ ctx: CGContext)
147 | {
148 | ctx.move(to: CGPoint(x: 78.85, y: 0))
149 | ctx.addLine(to: CGPoint(x: -1.52588e-06, y: 54))
150 | ctx.addLine(to: CGPoint(x: 27.05, y: 145.7))
151 | ctx.addLine(to: CGPoint(x: 122.6, y: 148.3))
152 | ctx.addLine(to: CGPoint(x: 154.65, y: 58.25))
153 | ctx.addLine(to: CGPoint(x: 78.85, y: 0))
154 | ctx.closePath()
155 | }
156 |
157 |
158 | private func TKSetRGBStrokeColor(_ ctx: CGContext, _ r: CGFloat, _ g: CGFloat, _ b : CGFloat, _ a : CGFloat, _ transform: TKColorTransform?)
159 | {
160 | var color : [CGFloat] = [ r, g, b, a ];
161 | TKColorApplyColorTransform(&color, 0, transform);
162 | ctx.setStrokeColor(red: color[0], green: color[1], blue: color[2], alpha: color[3])
163 | }
164 |
165 | private func draw_shape_2(_ ctx: CGContext, _ colorTrans: TKColorTransform?)
166 | {
167 | ctx.saveGState()
168 | ctx.concatenate(CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0))
169 | def_path_5(ctx)
170 | ctx.clip(using: .evenOdd)
171 | ctx.concatenate(CGAffineTransform(a: 0.0943909, b: 0, c: 0, d: 0.0905151, tx: 77.3, ty: 74.15))
172 | draw_gradient_2(ctx, colorTrans)
173 | ctx.restoreGState()
174 |
175 | ctx.saveGState()
176 | TKSetRGBStrokeColor(ctx, 0.2, 1, 0.4, 1, colorTrans)
177 | ctx.setLineWidth(1)
178 | ctx.setLineCap(.round)
179 | ctx.setLineJoin(.round)
180 | def_path_5(ctx)
181 | ctx.drawPath(using: .stroke)
182 | ctx.restoreGState()
183 |
184 | }
185 |
186 | private func draw_gradient_3(_ ctx: CGContext, _ colorTrans: TKColorTransform?)
187 | {
188 | var colors : [CGFloat] = [
189 | 0, 1, 0, 1,
190 | 0, 0, 0, 1
191 | ]
192 | TKColorApplyColorTransform(&colors, 0, colorTrans)
193 | TKColorApplyColorTransform(&colors, 4, colorTrans)
194 | let locations : [CGFloat] = [
195 | 0,
196 | 1
197 | ]
198 | let colorSpace = CGColorSpaceCreateDeviceRGB()
199 | let gradient = CGGradient(colorSpace: colorSpace, colorComponents: colors, locations: locations, count: 2)!
200 | let options : CGGradientDrawingOptions = [.drawsBeforeStartLocation, .drawsAfterEndLocation]
201 | ctx.drawRadialGradient(gradient, startCenter: CGPoint(x: 0, y: 0), startRadius: 0, endCenter: CGPoint(x: 0, y: 0), endRadius: 819.2, options: options);
202 | }
203 |
204 | private func def_path_6(_ ctx: CGContext)
205 | {
206 | ctx.move(to: CGPoint(x: 144, y: 76))
207 | ctx.addQuadCurve(to: CGPoint(x: 122.9, y: 22.25), control: CGPoint(x: 144, y: 44.5))
208 | ctx.addQuadCurve(to: CGPoint(x: 72, y: 0), control: CGPoint(x: 101.8, y: 0))
209 | ctx.addQuadCurve(to: CGPoint(x: 21.1, y: 22.25), control: CGPoint(x: 42.2, y: 0))
210 | ctx.addQuadCurve(to: CGPoint(x: 3.8147e-07, y: 76), control: CGPoint(x: 3.8147e-07, y: 44.5))
211 | ctx.addQuadCurve(to: CGPoint(x: 21.1, y: 129.75), control: CGPoint(x: 3.8147e-07, y: 107.5))
212 | ctx.addQuadCurve(to: CGPoint(x: 72, y: 152), control: CGPoint(x: 42.2, y: 152))
213 | ctx.addQuadCurve(to: CGPoint(x: 122.9, y: 129.75), control: CGPoint(x: 101.8, y: 152))
214 | ctx.addQuadCurve(to: CGPoint(x: 144, y: 76), control: CGPoint(x: 144, y: 107.5))
215 | ctx.closePath()
216 | }
217 |
218 | private func draw_shape_4(_ ctx: CGContext, _ colorTrans: TKColorTransform?)
219 | {
220 | ctx.saveGState()
221 | ctx.concatenate(CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0))
222 | def_path_6(ctx)
223 | ctx.clip(using: .evenOdd)
224 | ctx.concatenate(CGAffineTransform(a: 0.0935059, b: 0, c: 0, d: 0.0935059, tx: 72, ty: 76))
225 | draw_gradient_3(ctx, colorTrans)
226 | ctx.restoreGState()
227 |
228 | ctx.saveGState()
229 | TKSetRGBStrokeColor(ctx, 0.2, 1, 0.4, 1, colorTrans)
230 | ctx.setLineWidth(1)
231 | ctx.setLineCap(.round)
232 | ctx.setLineJoin(.round)
233 | def_path_6(ctx)
234 | ctx.drawPath(using: .stroke)
235 | ctx.restoreGState()
236 |
237 | }
238 |
239 | private func def_path_7(_ ctx: CGContext)
240 | {
241 | ctx.move(to: CGPoint(x: 306, y: -616))
242 | ctx.addQuadCurve(to: CGPoint(x: 522, y: -368), control: CGPoint(x: 526.5, y: -620))
243 | ctx.addQuadCurve(to: CGPoint(x: 306, y: -122), control: CGPoint(x: 527, y: -118))
244 | ctx.addLine(to: CGPoint(x: 224, y: -122))
245 | ctx.addLine(to: CGPoint(x: 224, y: -616))
246 | ctx.addLine(to: CGPoint(x: 306, y: -616))
247 | ctx.closePath()
248 | ctx.move(to: CGPoint(x: 318, y: 0))
249 | ctx.addQuadCurve(to: CGPoint(x: 692, y: -368), control: CGPoint(x: 688.5, y: -1.5))
250 | ctx.addQuadCurve(to: CGPoint(x: 318, y: -738), control: CGPoint(x: 688.5, y: -737.5))
251 | ctx.addLine(to: CGPoint(x: 66, y: -738))
252 | ctx.addLine(to: CGPoint(x: 66, y: 0))
253 | ctx.addLine(to: CGPoint(x: 318, y: 0))
254 | ctx.closePath()
255 | }
256 |
257 | private func def_path_8(_ ctx: CGContext)
258 | {
259 | ctx.move(to: CGPoint(x: 560, y: 0))
260 | ctx.addLine(to: CGPoint(x: 554, y: -92))
261 | ctx.addLine(to: CGPoint(x: 554, y: -514))
262 | ctx.addLine(to: CGPoint(x: 400, y: -514))
263 | ctx.addLine(to: CGPoint(x: 400, y: -204))
264 | ctx.addQuadCurve(to: CGPoint(x: 308, y: -86), control: CGPoint(x: 392, y: -94))
265 | ctx.addQuadCurve(to: CGPoint(x: 216, y: -204), control: CGPoint(x: 219, y: -85.5))
266 | ctx.addLine(to: CGPoint(x: 216, y: -514))
267 | ctx.addLine(to: CGPoint(x: 62, y: -514))
268 | ctx.addLine(to: CGPoint(x: 62, y: -180))
269 | ctx.addQuadCurve(to: CGPoint(x: 72, y: -98), control: CGPoint(x: 62.5, y: -137))
270 | ctx.addQuadCurve(to: CGPoint(x: 242, y: 13), control: CGPoint(x: 105.5, y: -2))
271 | ctx.addQuadCurve(to: CGPoint(x: 400, y: -62), control: CGPoint(x: 348, y: 13.5))
272 | ctx.addLine(to: CGPoint(x: 406, y: 0))
273 | ctx.addLine(to: CGPoint(x: 560, y: 0))
274 | ctx.closePath()
275 | }
276 |
277 | private func def_path_9(_ ctx: CGContext)
278 | {
279 | ctx.move(to: CGPoint(x: 68, y: -514))
280 | ctx.addLine(to: CGPoint(x: 68, y: 0))
281 | ctx.addLine(to: CGPoint(x: 222, y: 0))
282 | ctx.addLine(to: CGPoint(x: 222, y: -308))
283 | ctx.addQuadCurve(to: CGPoint(x: 314, y: -426), control: CGPoint(x: 229, y: -418.5))
284 | ctx.addQuadCurve(to: CGPoint(x: 406, y: -308), control: CGPoint(x: 403.5, y: -426.5))
285 | ctx.addLine(to: CGPoint(x: 406, y: 0))
286 | ctx.addLine(to: CGPoint(x: 560, y: 0))
287 | ctx.addLine(to: CGPoint(x: 560, y: -308))
288 | ctx.addQuadCurve(to: CGPoint(x: 652, y: -426), control: CGPoint(x: 567, y: -418.5))
289 | ctx.addQuadCurve(to: CGPoint(x: 744, y: -308), control: CGPoint(x: 741.5, y: -426.5))
290 | ctx.addLine(to: CGPoint(x: 744, y: 0))
291 | ctx.addLine(to: CGPoint(x: 898, y: 0))
292 | ctx.addLine(to: CGPoint(x: 898, y: -308))
293 | ctx.addQuadCurve(to: CGPoint(x: 897.5, y: -350), control: CGPoint(x: 898, y: -329))
294 | ctx.addQuadCurve(to: CGPoint(x: 895, y: -380.5), control: CGPoint(x: 896.5, y: -365))
295 | ctx.addQuadCurve(to: CGPoint(x: 882, y: -432), control: CGPoint(x: 891.5, y: -409))
296 | ctx.addQuadCurve(to: CGPoint(x: 718, y: -528), control: CGPoint(x: 838, y: -516))
297 | ctx.addQuadCurve(to: CGPoint(x: 544, y: -432), control: CGPoint(x: 612, y: -531.5))
298 | ctx.addQuadCurve(to: CGPoint(x: 380, y: -528), control: CGPoint(x: 500, y: -516))
299 | ctx.addQuadCurve(to: CGPoint(x: 222, y: -452), control: CGPoint(x: 274.5, y: -528.5))
300 | ctx.addLine(to: CGPoint(x: 220, y: -452))
301 | ctx.addLine(to: CGPoint(x: 220, y: -514))
302 | ctx.addLine(to: CGPoint(x: 68, y: -514))
303 | ctx.closePath()
304 | }
305 |
306 | private func def_path_10(_ ctx: CGContext)
307 | {
308 | ctx.move(to: CGPoint(x: 314, y: -426))
309 | ctx.addQuadCurve(to: CGPoint(x: 424, y: -256), control: CGPoint(x: 427, y: -427.5))
310 | ctx.addQuadCurve(to: CGPoint(x: 314, y: -86), control: CGPoint(x: 427, y: -84.5))
311 | ctx.addQuadCurve(to: CGPoint(x: 204, y: -256), control: CGPoint(x: 212.5, y: -92))
312 | ctx.addQuadCurve(to: CGPoint(x: 314, y: -426), control: CGPoint(x: 212.5, y: -420))
313 | ctx.closePath()
314 | ctx.move(to: CGPoint(x: 46, y: 0))
315 | ctx.addLine(to: CGPoint(x: 198, y: 0))
316 | ctx.addLine(to: CGPoint(x: 202, y: -72))
317 | ctx.addLine(to: CGPoint(x: 204, y: -72))
318 | ctx.addQuadCurve(to: CGPoint(x: 362, y: 13), control: CGPoint(x: 253, y: 12))
319 | ctx.addQuadCurve(to: CGPoint(x: 520.5, y: -60), control: CGPoint(x: 465, y: 7))
320 | ctx.addQuadCurve(to: CGPoint(x: 584, y: -256), control: CGPoint(x: 576, y: -127))
321 | ctx.addQuadCurve(to: CGPoint(x: 344, y: -528), control: CGPoint(x: 566.5, y: -514.5))
322 | ctx.addQuadCurve(to: CGPoint(x: 206, y: -454), control: CGPoint(x: 258, y: -524))
323 | ctx.addLine(to: CGPoint(x: 204, y: -454))
324 | ctx.addLine(to: CGPoint(x: 204, y: -738))
325 | ctx.addLine(to: CGPoint(x: 50, y: -738))
326 | ctx.addLine(to: CGPoint(x: 50, y: -102))
327 | ctx.addLine(to: CGPoint(x: 46, y: 0))
328 | ctx.closePath()
329 | }
330 |
331 | private func def_path_11(_ ctx: CGContext)
332 | {
333 | ctx.move(to: CGPoint(x: 262, y: -528))
334 | ctx.addQuadCurve(to: CGPoint(x: 32, y: -256), control: CGPoint(x: 49.5, y: -514.5))
335 | ctx.addQuadCurve(to: CGPoint(x: 98, y: -60.5), control: CGPoint(x: 40.5, y: -128))
336 | ctx.addQuadCurve(to: CGPoint(x: 262, y: 13), control: CGPoint(x: 155.5, y: 6.5))
337 | ctx.addQuadCurve(to: CGPoint(x: 490, y: -186), control: CGPoint(x: 478, y: 10.5))
338 | ctx.addLine(to: CGPoint(x: 340, y: -186))
339 | ctx.addQuadCurve(to: CGPoint(x: 262, y: -86), control: CGPoint(x: 333, y: -87.5))
340 | ctx.addQuadCurve(to: CGPoint(x: 193.5, y: -245.5), control: CGPoint(x: 200, y: -84.5))
341 | ctx.addQuadCurve(to: CGPoint(x: 192, y: -264), control: CGPoint(x: 193, y: -254.5))
342 | ctx.addQuadCurve(to: CGPoint(x: 192.5, y: -273.5), control: CGPoint(x: 192, y: -269))
343 | ctx.addQuadCurve(to: CGPoint(x: 260, y: -426), control: CGPoint(x: 198.5, y: -426))
344 | ctx.addQuadCurve(to: CGPoint(x: 338, y: -332), control: CGPoint(x: 332, y: -425))
345 | ctx.addLine(to: CGPoint(x: 490, y: -332))
346 | ctx.addQuadCurve(to: CGPoint(x: 262, y: -528), control: CGPoint(x: 479.5, y: -518))
347 | ctx.closePath()
348 | }
349 |
350 | private func def_path_12(_ ctx: CGContext)
351 | {
352 | ctx.move(to: CGPoint(x: 68, y: -738))
353 | ctx.addLine(to: CGPoint(x: 68, y: 0))
354 | ctx.addLine(to: CGPoint(x: 222, y: 0))
355 | ctx.addLine(to: CGPoint(x: 222, y: -278))
356 | ctx.addLine(to: CGPoint(x: 224, y: -280))
357 | ctx.addLine(to: CGPoint(x: 378, y: 0))
358 | ctx.addLine(to: CGPoint(x: 558, y: 0))
359 | ctx.addLine(to: CGPoint(x: 368, y: -294))
360 | ctx.addLine(to: CGPoint(x: 546, y: -520))
361 | ctx.addLine(to: CGPoint(x: 374, y: -520))
362 | ctx.addLine(to: CGPoint(x: 224, y: -304))
363 | ctx.addLine(to: CGPoint(x: 222, y: -306))
364 | ctx.addLine(to: CGPoint(x: 222, y: -738))
365 | ctx.addLine(to: CGPoint(x: 68, y: -738))
366 | ctx.closePath()
367 | }
368 |
369 | private func def_path_13(_ ctx: CGContext)
370 | {
371 | ctx.move(to: CGPoint(x: 456, y: 0))
372 | ctx.addLine(to: CGPoint(x: 728, y: -738))
373 | ctx.addLine(to: CGPoint(x: 572, y: -738))
374 | ctx.addLine(to: CGPoint(x: 378, y: -156))
375 | ctx.addLine(to: CGPoint(x: 376, y: -156))
376 | ctx.addLine(to: CGPoint(x: 184, y: -738))
377 | ctx.addLine(to: CGPoint(x: 10, y: -738))
378 | ctx.addLine(to: CGPoint(x: 282, y: 0))
379 | ctx.addLine(to: CGPoint(x: 456, y: 0))
380 | ctx.closePath()
381 | }
382 |
383 | private func def_path_14(_ ctx: CGContext)
384 | {
385 | ctx.move(to: CGPoint(x: 538, y: -249))
386 | ctx.addLine(to: CGPoint(x: 537, y: -273))
387 | ctx.addLine(to: CGPoint(x: 534, y: -314))
388 | ctx.addQuadCurve(to: CGPoint(x: 508, y: -406), control: CGPoint(x: 528, y: -363.5))
389 | ctx.addQuadCurve(to: CGPoint(x: 288, y: -528), control: CGPoint(x: 449, y: -529))
390 | ctx.addQuadCurve(to: CGPoint(x: 42, y: -256), control: CGPoint(x: 55, y: -515.5))
391 | ctx.addQuadCurve(to: CGPoint(x: 288, y: 13), control: CGPoint(x: 39, y: 15.5))
392 | ctx.addQuadCurve(to: CGPoint(x: 522, y: -152), control: CGPoint(x: 503, y: 12.5))
393 | ctx.addLine(to: CGPoint(x: 384, y: -152))
394 | ctx.addQuadCurve(to: CGPoint(x: 288, y: -86), control: CGPoint(x: 363, y: -83.5))
395 | ctx.addQuadCurve(to: CGPoint(x: 200, y: -216), control: CGPoint(x: 195.5, y: -83))
396 | ctx.addLine(to: CGPoint(x: 538, y: -216))
397 | ctx.addLine(to: CGPoint(x: 538, y: -249))
398 | ctx.closePath()
399 | ctx.move(to: CGPoint(x: 288, y: -426))
400 | ctx.addQuadCurve(to: CGPoint(x: 378, y: -318), control: CGPoint(x: 380.5, y: -427))
401 | ctx.addLine(to: CGPoint(x: 200, y: -318))
402 | ctx.addQuadCurve(to: CGPoint(x: 288, y: -426), control: CGPoint(x: 202.5, y: -427))
403 | ctx.closePath()
404 | }
405 |
406 | private func def_path_15(_ ctx: CGContext)
407 | {
408 | ctx.move(to: CGPoint(x: 312, y: -528))
409 | ctx.addQuadCurve(to: CGPoint(x: 44, y: -256), control: CGPoint(x: 55.5, y: -517))
410 | ctx.addQuadCurve(to: CGPoint(x: 312, y: 13), control: CGPoint(x: 55, y: 2.5))
411 | ctx.addQuadCurve(to: CGPoint(x: 580, y: -256), control: CGPoint(x: 569, y: 2.5))
412 | ctx.addQuadCurve(to: CGPoint(x: 312, y: -528), control: CGPoint(x: 568.5, y: -517))
413 | ctx.closePath()
414 | ctx.move(to: CGPoint(x: 312, y: -426))
415 | ctx.addQuadCurve(to: CGPoint(x: 422, y: -256), control: CGPoint(x: 424, y: -427))
416 | ctx.addQuadCurve(to: CGPoint(x: 312, y: -86), control: CGPoint(x: 424, y: -85))
417 | ctx.addQuadCurve(to: CGPoint(x: 202, y: -256), control: CGPoint(x: 200, y: -85))
418 | ctx.addQuadCurve(to: CGPoint(x: 312, y: -426), control: CGPoint(x: 200, y: -427))
419 | ctx.closePath()
420 | }
421 |
422 | private func def_path_16(_ ctx: CGContext)
423 | {
424 | ctx.move(to: CGPoint(x: 310, y: -426))
425 | ctx.addQuadCurve(to: CGPoint(x: 420, y: -256), control: CGPoint(x: 411.5, y: -420))
426 | ctx.addQuadCurve(to: CGPoint(x: 310, y: -86), control: CGPoint(x: 411.5, y: -92))
427 | ctx.addQuadCurve(to: CGPoint(x: 198, y: -256), control: CGPoint(x: 194.5, y: -84.5))
428 | ctx.addQuadCurve(to: CGPoint(x: 310, y: -426), control: CGPoint(x: 194.5, y: -427.5))
429 | ctx.closePath()
430 | ctx.move(to: CGPoint(x: 418, y: -454))
431 | ctx.addQuadCurve(to: CGPoint(x: 280, y: -528), control: CGPoint(x: 366, y: -524))
432 | ctx.addQuadCurve(to: CGPoint(x: 40, y: -256), control: CGPoint(x: 56.5, y: -515.5))
433 | ctx.addQuadCurve(to: CGPoint(x: 103, y: -60), control: CGPoint(x: 47.5, y: -127))
434 | ctx.addQuadCurve(to: CGPoint(x: 262, y: 13), control: CGPoint(x: 158.5, y: 7))
435 | ctx.addQuadCurve(to: CGPoint(x: 418, y: -72), control: CGPoint(x: 372, y: 12))
436 | ctx.addLine(to: CGPoint(x: 420, y: -72))
437 | ctx.addLine(to: CGPoint(x: 424, y: 0))
438 | ctx.addLine(to: CGPoint(x: 578, y: 0))
439 | ctx.addLine(to: CGPoint(x: 574, y: -102))
440 | ctx.addLine(to: CGPoint(x: 574, y: -738))
441 | ctx.addLine(to: CGPoint(x: 420, y: -738))
442 | ctx.addLine(to: CGPoint(x: 420, y: -454))
443 | ctx.addLine(to: CGPoint(x: 418, y: -454))
444 | ctx.closePath()
445 | }
446 |
447 | private func draw_main(_ ctx: CGContext)
448 | {
449 | ctx.saveGState()
450 | ctx.concatenate(CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0))
451 | def_path_0(ctx)
452 | ctx.clip(using: .evenOdd)
453 | ctx.concatenate(CGAffineTransform(a: 0.109375, b: 0, c: 0, d: 0.109375, tx: 469.45, ty: 126))
454 | draw_gradient_0(ctx)
455 | ctx.restoreGState()
456 |
457 | ctx.saveGState()
458 | ctx.concatenate(CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0))
459 | def_path_1(ctx)
460 | ctx.clip(using: .evenOdd)
461 | ctx.concatenate(CGAffineTransform(a: 0.0714111, b: 0, c: 0, d: 0.0701599, tx: 480.45, ty: 302.45))
462 | draw_gradient_1(ctx)
463 | ctx.restoreGState()
464 |
465 | ctx.saveGState()
466 | ctx.setFillColor(red: 0.8, green: 0.2, blue: 0.6, alpha: 1)
467 | def_path_2(ctx)
468 | ctx.drawPath(using: .eoFill)
469 | ctx.restoreGState()
470 |
471 | ctx.saveGState()
472 | ctx.setStrokeColor(red: 0.2, green: 1, blue: 0.4, alpha: 1)
473 | ctx.setLineWidth(1)
474 | ctx.setLineCap(.round)
475 | ctx.setLineJoin(.round)
476 | def_path_3(ctx)
477 | ctx.drawPath(using: .stroke)
478 | ctx.restoreGState()
479 |
480 | ctx.saveGState()
481 | ctx.setStrokeColor(red: 0.2, green: 1, blue: 0.4, alpha: 1)
482 | ctx.setLineWidth(1)
483 | ctx.setLineCap(.round)
484 | ctx.setLineJoin(.round)
485 | def_path_4(ctx)
486 | ctx.drawPath(using: .stroke)
487 | ctx.restoreGState()
488 |
489 | ctx.saveGState()
490 | ctx.concatenate(CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 39.35, ty: 16.75))
491 | draw_shape_2(ctx, nil)
492 | ctx.restoreGState()
493 |
494 | do
495 | {
496 | ctx.saveGState()
497 | ctx.concatenate(CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 217.65, ty: 16.75))
498 | let colorTrans : TKColorTransform = [ 0.462745, 0.462745, 0.462745, 1.00392, 0, 0, 0, 0 ];
499 | draw_shape_2(ctx, colorTrans)
500 | ctx.restoreGState()
501 | }
502 | ctx.saveGState()
503 | ctx.concatenate(CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 94.55, ty: 165.05))
504 | draw_shape_4(ctx, nil)
505 | ctx.restoreGState()
506 |
507 | do
508 | {
509 | ctx.saveGState()
510 | ctx.concatenate(CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 238.55, ty: 181))
511 | let colorTrans : TKColorTransform = [ 0.239216, 0.239216, 0.239216, 1.00392, 0.698039, 0.0588235, 0.760784, 0 ];
512 | draw_shape_4(ctx, colorTrans)
513 | ctx.restoreGState()
514 | }
515 | ctx.saveGState()
516 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 26.55, ty: 371.85))
517 | ctx.setFillColor(red: 0.8, green: 0.2, blue: 0.6, alpha: 1)
518 | def_path_7(ctx)
519 | ctx.drawPath(using: .eoFill)
520 | ctx.restoreGState()
521 |
522 | ctx.saveGState()
523 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 52.45, ty: 371.85))
524 | ctx.setFillColor(red: 0.8, green: 0.2, blue: 0.6, alpha: 1)
525 | def_path_8(ctx)
526 | ctx.drawPath(using: .eoFill)
527 | ctx.restoreGState()
528 |
529 | ctx.saveGState()
530 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 74.35, ty: 371.85))
531 | ctx.setFillColor(red: 0.8, green: 0.2, blue: 0.6, alpha: 1)
532 | def_path_9(ctx)
533 | ctx.drawPath(using: .eoFill)
534 | ctx.restoreGState()
535 |
536 | ctx.saveGState()
537 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 108.3, ty: 371.85))
538 | ctx.setFillColor(red: 0.8, green: 0.2, blue: 0.6, alpha: 1)
539 | def_path_10(ctx)
540 | ctx.drawPath(using: .eoFill)
541 | ctx.restoreGState()
542 |
543 | ctx.saveGState()
544 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 140.15, ty: 371.85))
545 | ctx.setFillColor(red: 0.8, green: 0.8, blue: 0, alpha: 1)
546 | def_path_7(ctx)
547 | ctx.drawPath(using: .eoFill)
548 | ctx.restoreGState()
549 |
550 | ctx.saveGState()
551 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 166.05, ty: 371.85))
552 | ctx.setFillColor(red: 0.8, green: 0.8, blue: 0, alpha: 1)
553 | def_path_8(ctx)
554 | ctx.drawPath(using: .eoFill)
555 | ctx.restoreGState()
556 |
557 | ctx.saveGState()
558 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 187.95, ty: 371.85))
559 | ctx.setFillColor(red: 0.8, green: 0.8, blue: 0, alpha: 1)
560 | def_path_11(ctx)
561 | ctx.drawPath(using: .eoFill)
562 | ctx.restoreGState()
563 |
564 | ctx.saveGState()
565 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 205.95, ty: 371.85))
566 | ctx.setFillColor(red: 0.8, green: 0.8, blue: 0, alpha: 1)
567 | def_path_12(ctx)
568 | ctx.drawPath(using: .eoFill)
569 | ctx.restoreGState()
570 |
571 | ctx.saveGState()
572 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 235.85, ty: 371.85))
573 | ctx.setFillColor(red: 1, green: 0.2, blue: 0, alpha: 1)
574 | def_path_13(ctx)
575 | ctx.drawPath(using: .eoFill)
576 | ctx.restoreGState()
577 |
578 | ctx.saveGState()
579 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 261.75, ty: 371.85))
580 | ctx.setFillColor(red: 1, green: 0.2, blue: 0, alpha: 1)
581 | def_path_14(ctx)
582 | ctx.drawPath(using: .eoFill)
583 | ctx.restoreGState()
584 |
585 | ctx.saveGState()
586 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 281.7, ty: 371.85))
587 | ctx.setFillColor(red: 1, green: 0.2, blue: 0, alpha: 1)
588 | def_path_11(ctx)
589 | ctx.drawPath(using: .eoFill)
590 | ctx.restoreGState()
591 |
592 | ctx.saveGState()
593 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 299.7, ty: 371.85))
594 | ctx.setFillColor(red: 1, green: 0.2, blue: 0, alpha: 1)
595 | def_path_15(ctx)
596 | ctx.drawPath(using: .eoFill)
597 | ctx.restoreGState()
598 |
599 | ctx.saveGState()
600 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 321.6, ty: 371.85))
601 | ctx.setFillColor(red: 1, green: 0.2, blue: 0, alpha: 1)
602 | def_path_16(ctx)
603 | ctx.drawPath(using: .eoFill)
604 | ctx.restoreGState()
605 |
606 | ctx.saveGState()
607 | ctx.concatenate(CGAffineTransform(a: 0.0351562, b: 0, c: 0, d: 0.0351562, tx: 343.5, ty: 371.85))
608 | ctx.setFillColor(red: 1, green: 0.2, blue: 0, alpha: 1)
609 | def_path_14(ctx)
610 | ctx.drawPath(using: .eoFill)
611 | ctx.restoreGState()
612 |
613 | }
614 |
615 |
616 |
--------------------------------------------------------------------------------
/Android/VecodeKitExample/app/src/main/java/com/dumbduck/pictures/PictureAllTest.java:
--------------------------------------------------------------------------------
1 |
2 | package com.dumbduck.pictures;
3 |
4 | import android.graphics.*;
5 | import com.vecodekit.GraphicsPicture;
6 |
7 | public class PictureAllTest extends GraphicsPicture
8 | {
9 | public PictureAllTest()
10 | {
11 | super(new RectF(0.0f, 0.0f, 550.0f, 400.0f));
12 | }
13 |
14 | private static void def_path_0(Path path)
15 | {
16 | path.reset();
17 | path.moveTo(528.95f, 193.0f);
18 | path.lineTo(528.95f, 59.0f);
19 | path.lineTo(409.95f, 59.0f);
20 | path.lineTo(409.95f, 193.0f);
21 | path.lineTo(528.95f, 193.0f);
22 | path.close();
23 | }
24 |
25 | private static Shader create_gradient_0()
26 | {
27 | int colors[] = {
28 | Color.argb(255, 0, 0, 255),
29 | Color.argb(255, 0, 0, 0)
30 | };
31 | float locations[] = {
32 | 0.0f,
33 | 1.0f
34 | };
35 | return new RadialGradient(0.0f, 0.0f, 819.2f, colors, locations, Shader.TileMode.CLAMP);
36 | }
37 |
38 | private static void draw_0(Canvas canvas, Path path, Paint paint)
39 | {
40 | canvas.save();
41 | def_path_0(path);
42 | Shader shader = create_gradient_0();
43 | shader.setLocalMatrix(createMatrix(0.109375f, 0.0f, 0.0f, 0.109375f, 469.45f, 126.0f));
44 | paint.setShader(shader);
45 | paint.setStyle(Paint.Style.FILL);
46 | canvas.drawPath(path, paint);
47 | paint.setShader(null);
48 | canvas.restore();
49 | }
50 |
51 | private static void def_path_1(Path path)
52 | {
53 | path.reset();
54 | path.moveTo(421.95f, 245.0f);
55 | path.lineTo(421.95f, 359.95f);
56 | path.lineTo(538.95f, 359.95f);
57 | path.lineTo(538.95f, 245.0f);
58 | path.lineTo(421.95f, 245.0f);
59 | path.close();
60 | }
61 |
62 | private static Shader create_gradient_1()
63 | {
64 | int colors[] = {
65 | Color.argb(255, 255, 0, 0),
66 | Color.argb(255, 255, 255, 0),
67 | Color.argb(255, 0, 255, 0),
68 | Color.argb(255, 0, 255, 255),
69 | Color.argb(255, 0, 0, 255),
70 | Color.argb(255, 255, 0, 255),
71 | Color.argb(255, 255, 0, 0)
72 | };
73 | float locations[] = {
74 | 0.0f,
75 | 0.164706f,
76 | 0.364706f,
77 | 0.498039f,
78 | 0.666667f,
79 | 0.831373f,
80 | 1.0f
81 | };
82 | return new LinearGradient(-819.2f, 0.0f, 819.2f, 0.0f, colors, locations, Shader.TileMode.CLAMP);
83 | }
84 |
85 | private static void draw_1(Canvas canvas, Path path, Paint paint)
86 | {
87 | canvas.save();
88 | def_path_1(path);
89 | Shader shader = create_gradient_1();
90 | shader.setLocalMatrix(createMatrix(0.0714111f, 0.0f, 0.0f, 0.0701599f, 480.45f, 302.45f));
91 | paint.setShader(shader);
92 | paint.setStyle(Paint.Style.FILL);
93 | canvas.drawPath(path, paint);
94 | paint.setShader(null);
95 | canvas.restore();
96 | }
97 |
98 | private static void def_path_2(Path path)
99 | {
100 | path.reset();
101 | path.moveTo(58.75f, 160.95f);
102 | path.lineTo(14.0f, 175.45f);
103 | path.lineTo(14.0f, 222.5f);
104 | path.lineTo(58.75f, 237.0f);
105 | path.lineTo(86.35f, 199.0f);
106 | path.lineTo(58.75f, 160.95f);
107 | path.close();
108 | }
109 |
110 | private static void draw_2(Canvas canvas, Path path, Paint paint)
111 | {
112 | canvas.save();
113 | def_path_2(path);
114 | paint.setColor(Color.argb(255, 204, 51, 153));
115 | paint.setStyle(Paint.Style.FILL);
116 | canvas.drawPath(path, paint);
117 | canvas.restore();
118 | }
119 |
120 | private static void def_path_3(Path path)
121 | {
122 | path.reset();
123 | path.moveTo(528.95f, 193.0f);
124 | path.lineTo(409.95f, 193.0f);
125 | path.lineTo(409.95f, 59.0f);
126 | path.lineTo(528.95f, 59.0f);
127 | path.lineTo(528.95f, 193.0f);
128 | }
129 |
130 | private static void draw_3(Canvas canvas, Path path, Paint paint)
131 | {
132 | canvas.save();
133 | def_path_3(path);
134 | paint.setColor(Color.argb(255, 51, 255, 102));
135 | paint.setStrokeWidth(1.0f);
136 | paint.setStrokeCap(Paint.Cap.ROUND);
137 | paint.setStrokeJoin(Paint.Join.ROUND);
138 | paint.setStyle(Paint.Style.STROKE);
139 | canvas.drawPath(path, paint);
140 | canvas.restore();
141 | }
142 |
143 | private static void def_path_4(Path path)
144 | {
145 | path.reset();
146 | path.moveTo(421.95f, 245.0f);
147 | path.lineTo(538.95f, 245.0f);
148 | path.lineTo(538.95f, 359.95f);
149 | path.lineTo(421.95f, 359.95f);
150 | path.lineTo(421.95f, 245.0f);
151 | }
152 |
153 | private static void draw_4(Canvas canvas, Path path, Paint paint)
154 | {
155 | canvas.save();
156 | def_path_4(path);
157 | paint.setColor(Color.argb(255, 51, 255, 102));
158 | paint.setStrokeWidth(1.0f);
159 | paint.setStrokeCap(Paint.Cap.ROUND);
160 | paint.setStrokeJoin(Paint.Join.ROUND);
161 | paint.setStyle(Paint.Style.STROKE);
162 | canvas.drawPath(path, paint);
163 | canvas.restore();
164 | }
165 |
166 | private static void def_path_5(Path path)
167 | {
168 | path.reset();
169 | path.moveTo(78.85f, 0.0f);
170 | path.lineTo(-1.52588e-06f, 54.0f);
171 | path.lineTo(27.05f, 145.7f);
172 | path.lineTo(122.6f, 148.3f);
173 | path.lineTo(154.65f, 58.25f);
174 | path.lineTo(78.85f, 0.0f);
175 | path.close();
176 | }
177 |
178 | private static Shader create_gradient_2(float[] colorTrans)
179 | {
180 | int colors[] = {
181 | colorApplyColorTransform(Color.argb(255, 255, 0, 0), colorTrans),
182 | colorApplyColorTransform(Color.argb(255, 255, 255, 0), colorTrans),
183 | colorApplyColorTransform(Color.argb(255, 0, 255, 0), colorTrans),
184 | colorApplyColorTransform(Color.argb(255, 0, 255, 255), colorTrans),
185 | colorApplyColorTransform(Color.argb(255, 0, 0, 255), colorTrans),
186 | colorApplyColorTransform(Color.argb(255, 255, 0, 255), colorTrans),
187 | colorApplyColorTransform(Color.argb(255, 255, 0, 0), colorTrans)
188 | };
189 | float locations[] = {
190 | 0.0f,
191 | 0.164706f,
192 | 0.364706f,
193 | 0.498039f,
194 | 0.666667f,
195 | 0.831373f,
196 | 1.0f
197 | };
198 | return new LinearGradient(-819.2f, 0.0f, 819.2f, 0.0f, colors, locations, Shader.TileMode.CLAMP);
199 | }
200 |
201 | private static void draw_5(Canvas canvas, Path path, Paint paint, float[] colorTrans)
202 | {
203 | canvas.save();
204 | def_path_5(path);
205 | Shader shader = create_gradient_2(colorTrans);
206 | shader.setLocalMatrix(createMatrix(0.0943909f, 0.0f, 0.0f, 0.0905151f, 77.3f, 74.15f));
207 | paint.setShader(shader);
208 | paint.setStyle(Paint.Style.FILL);
209 | canvas.drawPath(path, paint);
210 | paint.setShader(null);
211 | canvas.restore();
212 | }
213 |
214 | private static void draw_6(Canvas canvas, Path path, Paint paint, float[] colorTrans)
215 | {
216 | canvas.save();
217 | def_path_5(path);
218 | paint.setColor(colorApplyColorTransform(Color.argb(255, 51, 255, 102), colorTrans));
219 | paint.setStrokeWidth(1.0f);
220 | paint.setStrokeCap(Paint.Cap.ROUND);
221 | paint.setStrokeJoin(Paint.Join.ROUND);
222 | paint.setStyle(Paint.Style.STROKE);
223 | canvas.drawPath(path, paint);
224 | canvas.restore();
225 | }
226 |
227 | private static void draw_shape_2(Canvas canvas, Path path, Paint paint, float[] colorTrans)
228 | {
229 | draw_5(canvas, path, paint, colorTrans);
230 | draw_6(canvas, path, paint, colorTrans);
231 | }
232 |
233 | private static void def_path_6(Path path)
234 | {
235 | path.reset();
236 | path.moveTo(144.0f, 76.0f);
237 | path.quadTo(144.0f, 44.5f, 122.9f, 22.25f);
238 | path.quadTo(101.8f, 0.0f, 72.0f, 0.0f);
239 | path.quadTo(42.2f, 0.0f, 21.1f, 22.25f);
240 | path.quadTo(3.8147e-07f, 44.5f, 3.8147e-07f, 76.0f);
241 | path.quadTo(3.8147e-07f, 107.5f, 21.1f, 129.75f);
242 | path.quadTo(42.2f, 152.0f, 72.0f, 152.0f);
243 | path.quadTo(101.8f, 152.0f, 122.9f, 129.75f);
244 | path.quadTo(144.0f, 107.5f, 144.0f, 76.0f);
245 | path.close();
246 | }
247 |
248 | private static Shader create_gradient_3(float[] colorTrans)
249 | {
250 | int colors[] = {
251 | colorApplyColorTransform(Color.argb(255, 0, 255, 0), colorTrans),
252 | colorApplyColorTransform(Color.argb(255, 0, 0, 0), colorTrans)
253 | };
254 | float locations[] = {
255 | 0.0f,
256 | 1.0f
257 | };
258 | return new RadialGradient(0.0f, 0.0f, 819.2f, colors, locations, Shader.TileMode.CLAMP);
259 | }
260 |
261 | private static void draw_7(Canvas canvas, Path path, Paint paint, float[] colorTrans)
262 | {
263 | canvas.save();
264 | def_path_6(path);
265 | Shader shader = create_gradient_3(colorTrans);
266 | shader.setLocalMatrix(createMatrix(0.0935059f, 0.0f, 0.0f, 0.0935059f, 72.0f, 76.0f));
267 | paint.setShader(shader);
268 | paint.setStyle(Paint.Style.FILL);
269 | canvas.drawPath(path, paint);
270 | paint.setShader(null);
271 | canvas.restore();
272 | }
273 |
274 | private static void draw_8(Canvas canvas, Path path, Paint paint, float[] colorTrans)
275 | {
276 | canvas.save();
277 | def_path_6(path);
278 | paint.setColor(colorApplyColorTransform(Color.argb(255, 51, 255, 102), colorTrans));
279 | paint.setStrokeWidth(1.0f);
280 | paint.setStrokeCap(Paint.Cap.ROUND);
281 | paint.setStrokeJoin(Paint.Join.ROUND);
282 | paint.setStyle(Paint.Style.STROKE);
283 | canvas.drawPath(path, paint);
284 | canvas.restore();
285 | }
286 |
287 | private static void draw_shape_4(Canvas canvas, Path path, Paint paint, float[] colorTrans)
288 | {
289 | draw_7(canvas, path, paint, colorTrans);
290 | draw_8(canvas, path, paint, colorTrans);
291 | }
292 |
293 | private static void def_path_7(Path path)
294 | {
295 | path.reset();
296 | path.moveTo(306.0f, -616.0f);
297 | path.quadTo(526.5f, -620.0f, 522.0f, -368.0f);
298 | path.quadTo(527.0f, -118.0f, 306.0f, -122.0f);
299 | path.lineTo(224.0f, -122.0f);
300 | path.lineTo(224.0f, -616.0f);
301 | path.lineTo(306.0f, -616.0f);
302 | path.close();
303 | path.moveTo(318.0f, 0.0f);
304 | path.quadTo(688.5f, -1.5f, 692.0f, -368.0f);
305 | path.quadTo(688.5f, -737.5f, 318.0f, -738.0f);
306 | path.lineTo(66.0f, -738.0f);
307 | path.lineTo(66.0f, 0.0f);
308 | path.lineTo(318.0f, 0.0f);
309 | path.close();
310 | }
311 |
312 | private static void draw_9(Canvas canvas, Path path, Paint paint)
313 | {
314 | canvas.save();
315 | def_path_7(path);
316 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 26.55f, 371.85f));
317 | paint.setColor(Color.argb(255, 204, 51, 153));
318 | paint.setStyle(Paint.Style.FILL);
319 | canvas.drawPath(path, paint);
320 | canvas.restore();
321 | }
322 |
323 | private static void def_path_8(Path path)
324 | {
325 | path.reset();
326 | path.moveTo(560.0f, 0.0f);
327 | path.lineTo(554.0f, -92.0f);
328 | path.lineTo(554.0f, -514.0f);
329 | path.lineTo(400.0f, -514.0f);
330 | path.lineTo(400.0f, -204.0f);
331 | path.quadTo(392.0f, -94.0f, 308.0f, -86.0f);
332 | path.quadTo(219.0f, -85.5f, 216.0f, -204.0f);
333 | path.lineTo(216.0f, -514.0f);
334 | path.lineTo(62.0f, -514.0f);
335 | path.lineTo(62.0f, -180.0f);
336 | path.quadTo(62.5f, -137.0f, 72.0f, -98.0f);
337 | path.quadTo(105.5f, -2.0f, 242.0f, 13.0f);
338 | path.quadTo(348.0f, 13.5f, 400.0f, -62.0f);
339 | path.lineTo(406.0f, 0.0f);
340 | path.lineTo(560.0f, 0.0f);
341 | path.close();
342 | }
343 |
344 | private static void draw_10(Canvas canvas, Path path, Paint paint)
345 | {
346 | canvas.save();
347 | def_path_8(path);
348 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 52.45f, 371.85f));
349 | paint.setColor(Color.argb(255, 204, 51, 153));
350 | paint.setStyle(Paint.Style.FILL);
351 | canvas.drawPath(path, paint);
352 | canvas.restore();
353 | }
354 |
355 | private static void def_path_9(Path path)
356 | {
357 | path.reset();
358 | path.moveTo(68.0f, -514.0f);
359 | path.lineTo(68.0f, 0.0f);
360 | path.lineTo(222.0f, 0.0f);
361 | path.lineTo(222.0f, -308.0f);
362 | path.quadTo(229.0f, -418.5f, 314.0f, -426.0f);
363 | path.quadTo(403.5f, -426.5f, 406.0f, -308.0f);
364 | path.lineTo(406.0f, 0.0f);
365 | path.lineTo(560.0f, 0.0f);
366 | path.lineTo(560.0f, -308.0f);
367 | path.quadTo(567.0f, -418.5f, 652.0f, -426.0f);
368 | path.quadTo(741.5f, -426.5f, 744.0f, -308.0f);
369 | path.lineTo(744.0f, 0.0f);
370 | path.lineTo(898.0f, 0.0f);
371 | path.lineTo(898.0f, -308.0f);
372 | path.quadTo(898.0f, -329.0f, 897.5f, -350.0f);
373 | path.quadTo(896.5f, -365.0f, 895.0f, -380.5f);
374 | path.quadTo(891.5f, -409.0f, 882.0f, -432.0f);
375 | path.quadTo(838.0f, -516.0f, 718.0f, -528.0f);
376 | path.quadTo(612.0f, -531.5f, 544.0f, -432.0f);
377 | path.quadTo(500.0f, -516.0f, 380.0f, -528.0f);
378 | path.quadTo(274.5f, -528.5f, 222.0f, -452.0f);
379 | path.lineTo(220.0f, -452.0f);
380 | path.lineTo(220.0f, -514.0f);
381 | path.lineTo(68.0f, -514.0f);
382 | path.close();
383 | }
384 |
385 | private static void draw_11(Canvas canvas, Path path, Paint paint)
386 | {
387 | canvas.save();
388 | def_path_9(path);
389 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 74.35f, 371.85f));
390 | paint.setColor(Color.argb(255, 204, 51, 153));
391 | paint.setStyle(Paint.Style.FILL);
392 | canvas.drawPath(path, paint);
393 | canvas.restore();
394 | }
395 |
396 | private static void def_path_10(Path path)
397 | {
398 | path.reset();
399 | path.moveTo(314.0f, -426.0f);
400 | path.quadTo(427.0f, -427.5f, 424.0f, -256.0f);
401 | path.quadTo(427.0f, -84.5f, 314.0f, -86.0f);
402 | path.quadTo(212.5f, -92.0f, 204.0f, -256.0f);
403 | path.quadTo(212.5f, -420.0f, 314.0f, -426.0f);
404 | path.close();
405 | path.moveTo(46.0f, 0.0f);
406 | path.lineTo(198.0f, 0.0f);
407 | path.lineTo(202.0f, -72.0f);
408 | path.lineTo(204.0f, -72.0f);
409 | path.quadTo(253.0f, 12.0f, 362.0f, 13.0f);
410 | path.quadTo(465.0f, 7.0f, 520.5f, -60.0f);
411 | path.quadTo(576.0f, -127.0f, 584.0f, -256.0f);
412 | path.quadTo(566.5f, -514.5f, 344.0f, -528.0f);
413 | path.quadTo(258.0f, -524.0f, 206.0f, -454.0f);
414 | path.lineTo(204.0f, -454.0f);
415 | path.lineTo(204.0f, -738.0f);
416 | path.lineTo(50.0f, -738.0f);
417 | path.lineTo(50.0f, -102.0f);
418 | path.lineTo(46.0f, 0.0f);
419 | path.close();
420 | }
421 |
422 | private static void draw_12(Canvas canvas, Path path, Paint paint)
423 | {
424 | canvas.save();
425 | def_path_10(path);
426 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 108.3f, 371.85f));
427 | paint.setColor(Color.argb(255, 204, 51, 153));
428 | paint.setStyle(Paint.Style.FILL);
429 | canvas.drawPath(path, paint);
430 | canvas.restore();
431 | }
432 |
433 | private static void draw_13(Canvas canvas, Path path, Paint paint)
434 | {
435 | canvas.save();
436 | def_path_7(path);
437 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 140.15f, 371.85f));
438 | paint.setColor(Color.argb(255, 204, 204, 0));
439 | paint.setStyle(Paint.Style.FILL);
440 | canvas.drawPath(path, paint);
441 | canvas.restore();
442 | }
443 |
444 | private static void draw_14(Canvas canvas, Path path, Paint paint)
445 | {
446 | canvas.save();
447 | def_path_8(path);
448 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 166.05f, 371.85f));
449 | paint.setColor(Color.argb(255, 204, 204, 0));
450 | paint.setStyle(Paint.Style.FILL);
451 | canvas.drawPath(path, paint);
452 | canvas.restore();
453 | }
454 |
455 | private static void def_path_11(Path path)
456 | {
457 | path.reset();
458 | path.moveTo(262.0f, -528.0f);
459 | path.quadTo(49.5f, -514.5f, 32.0f, -256.0f);
460 | path.quadTo(40.5f, -128.0f, 98.0f, -60.5f);
461 | path.quadTo(155.5f, 6.5f, 262.0f, 13.0f);
462 | path.quadTo(478.0f, 10.5f, 490.0f, -186.0f);
463 | path.lineTo(340.0f, -186.0f);
464 | path.quadTo(333.0f, -87.5f, 262.0f, -86.0f);
465 | path.quadTo(200.0f, -84.5f, 193.5f, -245.5f);
466 | path.quadTo(193.0f, -254.5f, 192.0f, -264.0f);
467 | path.quadTo(192.0f, -269.0f, 192.5f, -273.5f);
468 | path.quadTo(198.5f, -426.0f, 260.0f, -426.0f);
469 | path.quadTo(332.0f, -425.0f, 338.0f, -332.0f);
470 | path.lineTo(490.0f, -332.0f);
471 | path.quadTo(479.5f, -518.0f, 262.0f, -528.0f);
472 | path.close();
473 | }
474 |
475 | private static void draw_15(Canvas canvas, Path path, Paint paint)
476 | {
477 | canvas.save();
478 | def_path_11(path);
479 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 187.95f, 371.85f));
480 | paint.setColor(Color.argb(255, 204, 204, 0));
481 | paint.setStyle(Paint.Style.FILL);
482 | canvas.drawPath(path, paint);
483 | canvas.restore();
484 | }
485 |
486 | private static void def_path_12(Path path)
487 | {
488 | path.reset();
489 | path.moveTo(68.0f, -738.0f);
490 | path.lineTo(68.0f, 0.0f);
491 | path.lineTo(222.0f, 0.0f);
492 | path.lineTo(222.0f, -278.0f);
493 | path.lineTo(224.0f, -280.0f);
494 | path.lineTo(378.0f, 0.0f);
495 | path.lineTo(558.0f, 0.0f);
496 | path.lineTo(368.0f, -294.0f);
497 | path.lineTo(546.0f, -520.0f);
498 | path.lineTo(374.0f, -520.0f);
499 | path.lineTo(224.0f, -304.0f);
500 | path.lineTo(222.0f, -306.0f);
501 | path.lineTo(222.0f, -738.0f);
502 | path.lineTo(68.0f, -738.0f);
503 | path.close();
504 | }
505 |
506 | private static void draw_16(Canvas canvas, Path path, Paint paint)
507 | {
508 | canvas.save();
509 | def_path_12(path);
510 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 205.95f, 371.85f));
511 | paint.setColor(Color.argb(255, 204, 204, 0));
512 | paint.setStyle(Paint.Style.FILL);
513 | canvas.drawPath(path, paint);
514 | canvas.restore();
515 | }
516 |
517 | private static void def_path_13(Path path)
518 | {
519 | path.reset();
520 | path.moveTo(456.0f, 0.0f);
521 | path.lineTo(728.0f, -738.0f);
522 | path.lineTo(572.0f, -738.0f);
523 | path.lineTo(378.0f, -156.0f);
524 | path.lineTo(376.0f, -156.0f);
525 | path.lineTo(184.0f, -738.0f);
526 | path.lineTo(10.0f, -738.0f);
527 | path.lineTo(282.0f, 0.0f);
528 | path.lineTo(456.0f, 0.0f);
529 | path.close();
530 | }
531 |
532 | private static void draw_17(Canvas canvas, Path path, Paint paint)
533 | {
534 | canvas.save();
535 | def_path_13(path);
536 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 235.85f, 371.85f));
537 | paint.setColor(Color.argb(255, 255, 51, 0));
538 | paint.setStyle(Paint.Style.FILL);
539 | canvas.drawPath(path, paint);
540 | canvas.restore();
541 | }
542 |
543 | private static void def_path_14(Path path)
544 | {
545 | path.reset();
546 | path.moveTo(538.0f, -249.0f);
547 | path.lineTo(537.0f, -273.0f);
548 | path.lineTo(534.0f, -314.0f);
549 | path.quadTo(528.0f, -363.5f, 508.0f, -406.0f);
550 | path.quadTo(449.0f, -529.0f, 288.0f, -528.0f);
551 | path.quadTo(55.0f, -515.5f, 42.0f, -256.0f);
552 | path.quadTo(39.0f, 15.5f, 288.0f, 13.0f);
553 | path.quadTo(503.0f, 12.5f, 522.0f, -152.0f);
554 | path.lineTo(384.0f, -152.0f);
555 | path.quadTo(363.0f, -83.5f, 288.0f, -86.0f);
556 | path.quadTo(195.5f, -83.0f, 200.0f, -216.0f);
557 | path.lineTo(538.0f, -216.0f);
558 | path.lineTo(538.0f, -249.0f);
559 | path.close();
560 | path.moveTo(288.0f, -426.0f);
561 | path.quadTo(380.5f, -427.0f, 378.0f, -318.0f);
562 | path.lineTo(200.0f, -318.0f);
563 | path.quadTo(202.5f, -427.0f, 288.0f, -426.0f);
564 | path.close();
565 | }
566 |
567 | private static void draw_18(Canvas canvas, Path path, Paint paint)
568 | {
569 | canvas.save();
570 | def_path_14(path);
571 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 261.75f, 371.85f));
572 | paint.setColor(Color.argb(255, 255, 51, 0));
573 | paint.setStyle(Paint.Style.FILL);
574 | canvas.drawPath(path, paint);
575 | canvas.restore();
576 | }
577 |
578 | private static void draw_19(Canvas canvas, Path path, Paint paint)
579 | {
580 | canvas.save();
581 | def_path_11(path);
582 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 281.7f, 371.85f));
583 | paint.setColor(Color.argb(255, 255, 51, 0));
584 | paint.setStyle(Paint.Style.FILL);
585 | canvas.drawPath(path, paint);
586 | canvas.restore();
587 | }
588 |
589 | private static void def_path_15(Path path)
590 | {
591 | path.reset();
592 | path.moveTo(312.0f, -528.0f);
593 | path.quadTo(55.5f, -517.0f, 44.0f, -256.0f);
594 | path.quadTo(55.0f, 2.5f, 312.0f, 13.0f);
595 | path.quadTo(569.0f, 2.5f, 580.0f, -256.0f);
596 | path.quadTo(568.5f, -517.0f, 312.0f, -528.0f);
597 | path.close();
598 | path.moveTo(312.0f, -426.0f);
599 | path.quadTo(424.0f, -427.0f, 422.0f, -256.0f);
600 | path.quadTo(424.0f, -85.0f, 312.0f, -86.0f);
601 | path.quadTo(200.0f, -85.0f, 202.0f, -256.0f);
602 | path.quadTo(200.0f, -427.0f, 312.0f, -426.0f);
603 | path.close();
604 | }
605 |
606 | private static void draw_20(Canvas canvas, Path path, Paint paint)
607 | {
608 | canvas.save();
609 | def_path_15(path);
610 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 299.7f, 371.85f));
611 | paint.setColor(Color.argb(255, 255, 51, 0));
612 | paint.setStyle(Paint.Style.FILL);
613 | canvas.drawPath(path, paint);
614 | canvas.restore();
615 | }
616 |
617 | private static void def_path_16(Path path)
618 | {
619 | path.reset();
620 | path.moveTo(310.0f, -426.0f);
621 | path.quadTo(411.5f, -420.0f, 420.0f, -256.0f);
622 | path.quadTo(411.5f, -92.0f, 310.0f, -86.0f);
623 | path.quadTo(194.5f, -84.5f, 198.0f, -256.0f);
624 | path.quadTo(194.5f, -427.5f, 310.0f, -426.0f);
625 | path.close();
626 | path.moveTo(418.0f, -454.0f);
627 | path.quadTo(366.0f, -524.0f, 280.0f, -528.0f);
628 | path.quadTo(56.5f, -515.5f, 40.0f, -256.0f);
629 | path.quadTo(47.5f, -127.0f, 103.0f, -60.0f);
630 | path.quadTo(158.5f, 7.0f, 262.0f, 13.0f);
631 | path.quadTo(372.0f, 12.0f, 418.0f, -72.0f);
632 | path.lineTo(420.0f, -72.0f);
633 | path.lineTo(424.0f, 0.0f);
634 | path.lineTo(578.0f, 0.0f);
635 | path.lineTo(574.0f, -102.0f);
636 | path.lineTo(574.0f, -738.0f);
637 | path.lineTo(420.0f, -738.0f);
638 | path.lineTo(420.0f, -454.0f);
639 | path.lineTo(418.0f, -454.0f);
640 | path.close();
641 | }
642 |
643 | private static void draw_21(Canvas canvas, Path path, Paint paint)
644 | {
645 | canvas.save();
646 | def_path_16(path);
647 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 321.6f, 371.85f));
648 | paint.setColor(Color.argb(255, 255, 51, 0));
649 | paint.setStyle(Paint.Style.FILL);
650 | canvas.drawPath(path, paint);
651 | canvas.restore();
652 | }
653 |
654 | private static void draw_22(Canvas canvas, Path path, Paint paint)
655 | {
656 | canvas.save();
657 | def_path_14(path);
658 | canvas.concat(createMatrix(0.0351562f, 0.0f, 0.0f, 0.0351562f, 343.5f, 371.85f));
659 | paint.setColor(Color.argb(255, 255, 51, 0));
660 | paint.setStyle(Paint.Style.FILL);
661 | canvas.drawPath(path, paint);
662 | canvas.restore();
663 | }
664 |
665 | private static void draw_main(Canvas canvas, Path path, Paint paint)
666 | {
667 | draw_0(canvas, path, paint);
668 | draw_1(canvas, path, paint);
669 | draw_2(canvas, path, paint);
670 | draw_3(canvas, path, paint);
671 | draw_4(canvas, path, paint);
672 | {
673 | canvas.save();
674 | canvas.concat(createMatrix(1.0f, 0.0f, 0.0f, 1.0f, 39.35f, 16.75f));
675 | draw_shape_2(canvas, path, paint, null);
676 | canvas.restore();
677 | }
678 | {
679 | canvas.save();
680 | canvas.concat(createMatrix(1.0f, 0.0f, 0.0f, 1.0f, 217.65f, 16.75f));
681 | float colorTrans[] = { 0.462745f, 0.462745f, 0.462745f, 1.00392f, 0.0f, 0.0f, 0.0f, 0.0f };
682 | draw_shape_2(canvas, path, paint, colorTrans);
683 | canvas.restore();
684 | }
685 | {
686 | canvas.save();
687 | canvas.concat(createMatrix(1.0f, 0.0f, 0.0f, 1.0f, 94.55f, 165.05f));
688 | draw_shape_4(canvas, path, paint, null);
689 | canvas.restore();
690 | }
691 | {
692 | canvas.save();
693 | canvas.concat(createMatrix(1.0f, 0.0f, 0.0f, 1.0f, 238.55f, 181.0f));
694 | float colorTrans[] = { 0.239216f, 0.239216f, 0.239216f, 1.00392f, 0.698039f, 0.0588235f, 0.760784f, 0.0f };
695 | draw_shape_4(canvas, path, paint, colorTrans);
696 | canvas.restore();
697 | }
698 | draw_9(canvas, path, paint);
699 | draw_10(canvas, path, paint);
700 | draw_11(canvas, path, paint);
701 | draw_12(canvas, path, paint);
702 | draw_13(canvas, path, paint);
703 | draw_14(canvas, path, paint);
704 | draw_15(canvas, path, paint);
705 | draw_16(canvas, path, paint);
706 | draw_17(canvas, path, paint);
707 | draw_18(canvas, path, paint);
708 | draw_19(canvas, path, paint);
709 | draw_20(canvas, path, paint);
710 | draw_21(canvas, path, paint);
711 | draw_22(canvas, path, paint);
712 | }
713 |
714 | @Override
715 | protected void picture_draw_main(Canvas canvas)
716 | {
717 | Paint paint = new Paint();
718 | paint.setAntiAlias(true);
719 |
720 | Path path = new Path();
721 | path.setFillType(Path.FillType.EVEN_ODD);
722 |
723 | draw_main(canvas, path, paint);
724 | }
725 | }
726 |
--------------------------------------------------------------------------------
/iOS_Mac/QuartzPictureExample/QuartzPictureExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 2E36D03E1C75A534000E2F70 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E36D03D1C75A534000E2F70 /* AppDelegate.m */; };
11 | 2E36D0411C75A534000E2F70 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E36D0401C75A534000E2F70 /* main.m */; };
12 | 2E36D0431C75A534000E2F70 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2E36D0421C75A534000E2F70 /* Assets.xcassets */; };
13 | 2E36D0461C75A534000E2F70 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2E36D0441C75A534000E2F70 /* MainMenu.xib */; };
14 | 2E36D04D1C75A5C6000E2F70 /* AppMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E36D04C1C75A5C6000E2F70 /* AppMainView.m */; };
15 | 2E36D0501C75A7C2000E2F70 /* PictureView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E36D04F1C75A7C2000E2F70 /* PictureView.m */; };
16 | 2E36D12E1C75D850000E2F70 /* snow_woman.c in Sources */ = {isa = PBXBuildFile; fileRef = 2E36D1211C75D850000E2F70 /* snow_woman.c */; };
17 | 2E36D1321C75D850000E2F70 /* tiger.c in Sources */ = {isa = PBXBuildFile; fileRef = 2E36D1271C75D850000E2F70 /* tiger.c */; };
18 | 2E36D13C1C75DB29000E2F70 /* river_man.c in Sources */ = {isa = PBXBuildFile; fileRef = 2E36D13A1C75DB29000E2F70 /* river_man.c */; };
19 | 2E36D1441C75F428000E2F70 /* icons.c in Sources */ = {isa = PBXBuildFile; fileRef = 2E36D1421C75F428000E2F70 /* icons.c */; };
20 | 2E919F221E8CAD770021AC7B /* VKQuartzPictureImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E919F1E1E8CAD770021AC7B /* VKQuartzPictureImage.swift */; };
21 | 2E919F231E8CAD770021AC7B /* VKQuartzPictureView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E919F1F1E8CAD770021AC7B /* VKQuartzPictureView.swift */; };
22 | 2E919F241E8CAD770021AC7B /* VKQuartzPicture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E919F201E8CAD770021AC7B /* VKQuartzPicture.swift */; };
23 | 2E919F2E1E8CAD9C0021AC7B /* VKQuartzPicture.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E919F281E8CAD9C0021AC7B /* VKQuartzPicture.m */; };
24 | 2EA5938F1C9C793B0021B173 /* all_test.c in Sources */ = {isa = PBXBuildFile; fileRef = 2EA5938D1C9C793B0021B173 /* all_test.c */; };
25 | 2EC464D41C7472ED00F905D9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EC464D31C7472ED00F905D9 /* AppDelegate.swift */; };
26 | 2EC464DB1C7472ED00F905D9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2EC464DA1C7472ED00F905D9 /* Assets.xcassets */; };
27 | 2EC464DE1C7472ED00F905D9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2EC464DC1C7472ED00F905D9 /* LaunchScreen.storyboard */; };
28 | 2EC464FA1C74742A00F905D9 /* PictureListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EC464F91C74742A00F905D9 /* PictureListViewController.swift */; };
29 | 2EC4650F1C74791000F905D9 /* PictureViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EC4650E1C74791000F905D9 /* PictureViewController.swift */; };
30 | 2EE066741C9D46D800A0565B /* world.c in Sources */ = {isa = PBXBuildFile; fileRef = 2EE066721C9D46D800A0565B /* world.c */; settings = {COMPILER_FLAGS = "-O0"; }; };
31 | 2EF34E661D8CE74600054CF6 /* all_test.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF34E611D8CE74600054CF6 /* all_test.swift */; };
32 | 2EF34E671D8CE74600054CF6 /* icons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF34E621D8CE74600054CF6 /* icons.swift */; };
33 | 2EF34E681D8CE74600054CF6 /* river_man.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF34E631D8CE74600054CF6 /* river_man.swift */; };
34 | 2EF34E691D8CE74600054CF6 /* snow_woman.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF34E641D8CE74600054CF6 /* snow_woman.swift */; };
35 | 2EF34E6A1D8CE74600054CF6 /* tiger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF34E651D8CE74600054CF6 /* tiger.swift */; };
36 | /* End PBXBuildFile section */
37 |
38 | /* Begin PBXFileReference section */
39 | 2E36D03A1C75A534000E2F70 /* example-mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example-mac.app"; sourceTree = BUILT_PRODUCTS_DIR; };
40 | 2E36D03C1C75A534000E2F70 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
41 | 2E36D03D1C75A534000E2F70 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
42 | 2E36D0401C75A534000E2F70 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
43 | 2E36D0421C75A534000E2F70 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
44 | 2E36D0451C75A534000E2F70 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
45 | 2E36D0471C75A534000E2F70 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
46 | 2E36D04B1C75A5C6000E2F70 /* AppMainView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppMainView.h; sourceTree = ""; };
47 | 2E36D04C1C75A5C6000E2F70 /* AppMainView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppMainView.m; sourceTree = ""; };
48 | 2E36D04E1C75A7C2000E2F70 /* PictureView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureView.h; sourceTree = ""; };
49 | 2E36D04F1C75A7C2000E2F70 /* PictureView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureView.m; sourceTree = ""; };
50 | 2E36D1211C75D850000E2F70 /* snow_woman.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snow_woman.c; sourceTree = ""; };
51 | 2E36D1221C75D850000E2F70 /* snow_woman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snow_woman.h; sourceTree = ""; };
52 | 2E36D1271C75D850000E2F70 /* tiger.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tiger.c; sourceTree = ""; };
53 | 2E36D1281C75D850000E2F70 /* tiger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tiger.h; sourceTree = ""; };
54 | 2E36D13A1C75DB29000E2F70 /* river_man.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = river_man.c; sourceTree = ""; };
55 | 2E36D13B1C75DB29000E2F70 /* river_man.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = river_man.h; sourceTree = ""; };
56 | 2E36D1421C75F428000E2F70 /* icons.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = icons.c; sourceTree = ""; };
57 | 2E36D1431C75F428000E2F70 /* icons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icons.h; sourceTree = ""; };
58 | 2E919F1E1E8CAD770021AC7B /* VKQuartzPictureImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VKQuartzPictureImage.swift; sourceTree = ""; };
59 | 2E919F1F1E8CAD770021AC7B /* VKQuartzPictureView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VKQuartzPictureView.swift; sourceTree = ""; };
60 | 2E919F201E8CAD770021AC7B /* VKQuartzPicture.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VKQuartzPicture.swift; sourceTree = ""; };
61 | 2E919F271E8CAD9C0021AC7B /* VKQuartzPicture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VKQuartzPicture.h; sourceTree = ""; };
62 | 2E919F281E8CAD9C0021AC7B /* VKQuartzPicture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VKQuartzPicture.m; sourceTree = ""; };
63 | 2EA5938D1C9C793B0021B173 /* all_test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = all_test.c; sourceTree = ""; };
64 | 2EA5938E1C9C793B0021B173 /* all_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = all_test.h; sourceTree = ""; };
65 | 2EC464D11C7472ED00F905D9 /* example-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; };
66 | 2EC464D31C7472ED00F905D9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
67 | 2EC464DA1C7472ED00F905D9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
68 | 2EC464DD1C7472ED00F905D9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
69 | 2EC464DF1C7472ED00F905D9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
70 | 2EC464F91C74742A00F905D9 /* PictureListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PictureListViewController.swift; sourceTree = ""; };
71 | 2EC4650E1C74791000F905D9 /* PictureViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PictureViewController.swift; sourceTree = ""; };
72 | 2EE066721C9D46D800A0565B /* world.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = world.c; sourceTree = ""; };
73 | 2EE066731C9D46D800A0565B /* world.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = world.h; sourceTree = ""; };
74 | 2EF34E611D8CE74600054CF6 /* all_test.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = all_test.swift; sourceTree = ""; };
75 | 2EF34E621D8CE74600054CF6 /* icons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = icons.swift; sourceTree = ""; };
76 | 2EF34E631D8CE74600054CF6 /* river_man.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = river_man.swift; sourceTree = ""; };
77 | 2EF34E641D8CE74600054CF6 /* snow_woman.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = snow_woman.swift; sourceTree = ""; };
78 | 2EF34E651D8CE74600054CF6 /* tiger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = tiger.swift; sourceTree = ""; };
79 | /* End PBXFileReference section */
80 |
81 | /* Begin PBXFrameworksBuildPhase section */
82 | 2E36D0371C75A534000E2F70 /* Frameworks */ = {
83 | isa = PBXFrameworksBuildPhase;
84 | buildActionMask = 2147483647;
85 | files = (
86 | );
87 | runOnlyForDeploymentPostprocessing = 0;
88 | };
89 | 2EC464CE1C7472ED00F905D9 /* Frameworks */ = {
90 | isa = PBXFrameworksBuildPhase;
91 | buildActionMask = 2147483647;
92 | files = (
93 | );
94 | runOnlyForDeploymentPostprocessing = 0;
95 | };
96 | /* End PBXFrameworksBuildPhase section */
97 |
98 | /* Begin PBXGroup section */
99 | 2E36D03B1C75A534000E2F70 /* example-mac */ = {
100 | isa = PBXGroup;
101 | children = (
102 | 2E919F251E8CAD9C0021AC7B /* QuartzPicture */,
103 | 2E36D11A1C75D850000E2F70 /* pictures */,
104 | 2E36D04E1C75A7C2000E2F70 /* PictureView.h */,
105 | 2E36D04F1C75A7C2000E2F70 /* PictureView.m */,
106 | 2E36D04B1C75A5C6000E2F70 /* AppMainView.h */,
107 | 2E36D04C1C75A5C6000E2F70 /* AppMainView.m */,
108 | 2E36D03C1C75A534000E2F70 /* AppDelegate.h */,
109 | 2E36D03D1C75A534000E2F70 /* AppDelegate.m */,
110 | 2E36D0421C75A534000E2F70 /* Assets.xcassets */,
111 | 2E36D0441C75A534000E2F70 /* MainMenu.xib */,
112 | 2E36D0471C75A534000E2F70 /* Info.plist */,
113 | 2E36D03F1C75A534000E2F70 /* Supporting Files */,
114 | );
115 | path = "example-mac";
116 | sourceTree = "";
117 | };
118 | 2E36D03F1C75A534000E2F70 /* Supporting Files */ = {
119 | isa = PBXGroup;
120 | children = (
121 | 2E36D0401C75A534000E2F70 /* main.m */,
122 | );
123 | name = "Supporting Files";
124 | sourceTree = "";
125 | };
126 | 2E36D1001C75D834000E2F70 /* pictures */ = {
127 | isa = PBXGroup;
128 | children = (
129 | 2EF34E611D8CE74600054CF6 /* all_test.swift */,
130 | 2EF34E621D8CE74600054CF6 /* icons.swift */,
131 | 2EF34E631D8CE74600054CF6 /* river_man.swift */,
132 | 2EF34E641D8CE74600054CF6 /* snow_woman.swift */,
133 | 2EF34E651D8CE74600054CF6 /* tiger.swift */,
134 | );
135 | path = pictures;
136 | sourceTree = SOURCE_ROOT;
137 | };
138 | 2E36D11A1C75D850000E2F70 /* pictures */ = {
139 | isa = PBXGroup;
140 | children = (
141 | 2EE066721C9D46D800A0565B /* world.c */,
142 | 2EE066731C9D46D800A0565B /* world.h */,
143 | 2EA5938D1C9C793B0021B173 /* all_test.c */,
144 | 2EA5938E1C9C793B0021B173 /* all_test.h */,
145 | 2E36D13A1C75DB29000E2F70 /* river_man.c */,
146 | 2E36D13B1C75DB29000E2F70 /* river_man.h */,
147 | 2E36D1211C75D850000E2F70 /* snow_woman.c */,
148 | 2E36D1221C75D850000E2F70 /* snow_woman.h */,
149 | 2E36D1271C75D850000E2F70 /* tiger.c */,
150 | 2E36D1281C75D850000E2F70 /* tiger.h */,
151 | 2E36D1421C75F428000E2F70 /* icons.c */,
152 | 2E36D1431C75F428000E2F70 /* icons.h */,
153 | );
154 | path = pictures;
155 | sourceTree = SOURCE_ROOT;
156 | };
157 | 2E6F55951C465D7C00F22745 = {
158 | isa = PBXGroup;
159 | children = (
160 | 2EC464D21C7472ED00F905D9 /* example-ios */,
161 | 2E36D03B1C75A534000E2F70 /* example-mac */,
162 | 2E6F559F1C465D7C00F22745 /* Products */,
163 | );
164 | sourceTree = "";
165 | };
166 | 2E6F559F1C465D7C00F22745 /* Products */ = {
167 | isa = PBXGroup;
168 | children = (
169 | 2EC464D11C7472ED00F905D9 /* example-ios.app */,
170 | 2E36D03A1C75A534000E2F70 /* example-mac.app */,
171 | );
172 | name = Products;
173 | sourceTree = "";
174 | };
175 | 2E919F181E8CAD770021AC7B /* QuartzPicture */ = {
176 | isa = PBXGroup;
177 | children = (
178 | 2E919F1C1E8CAD770021AC7B /* swift */,
179 | );
180 | name = QuartzPicture;
181 | path = ../../QuartzPicture;
182 | sourceTree = "";
183 | };
184 | 2E919F1C1E8CAD770021AC7B /* swift */ = {
185 | isa = PBXGroup;
186 | children = (
187 | 2E919F1D1E8CAD770021AC7B /* ext */,
188 | 2E919F201E8CAD770021AC7B /* VKQuartzPicture.swift */,
189 | );
190 | path = swift;
191 | sourceTree = "";
192 | };
193 | 2E919F1D1E8CAD770021AC7B /* ext */ = {
194 | isa = PBXGroup;
195 | children = (
196 | 2E919F1E1E8CAD770021AC7B /* VKQuartzPictureImage.swift */,
197 | 2E919F1F1E8CAD770021AC7B /* VKQuartzPictureView.swift */,
198 | );
199 | path = ext;
200 | sourceTree = "";
201 | };
202 | 2E919F251E8CAD9C0021AC7B /* QuartzPicture */ = {
203 | isa = PBXGroup;
204 | children = (
205 | 2E919F261E8CAD9C0021AC7B /* objc */,
206 | );
207 | name = QuartzPicture;
208 | path = ../../QuartzPicture;
209 | sourceTree = "";
210 | };
211 | 2E919F261E8CAD9C0021AC7B /* objc */ = {
212 | isa = PBXGroup;
213 | children = (
214 | 2E919F271E8CAD9C0021AC7B /* VKQuartzPicture.h */,
215 | 2E919F281E8CAD9C0021AC7B /* VKQuartzPicture.m */,
216 | );
217 | path = objc;
218 | sourceTree = "";
219 | };
220 | 2EC464D21C7472ED00F905D9 /* example-ios */ = {
221 | isa = PBXGroup;
222 | children = (
223 | 2E919F181E8CAD770021AC7B /* QuartzPicture */,
224 | 2E36D1001C75D834000E2F70 /* pictures */,
225 | 2EC464F91C74742A00F905D9 /* PictureListViewController.swift */,
226 | 2EC4650E1C74791000F905D9 /* PictureViewController.swift */,
227 | 2EC464D31C7472ED00F905D9 /* AppDelegate.swift */,
228 | 2EC464DA1C7472ED00F905D9 /* Assets.xcassets */,
229 | 2EC464DC1C7472ED00F905D9 /* LaunchScreen.storyboard */,
230 | 2EC464DF1C7472ED00F905D9 /* Info.plist */,
231 | );
232 | path = "example-ios";
233 | sourceTree = "";
234 | };
235 | /* End PBXGroup section */
236 |
237 | /* Begin PBXNativeTarget section */
238 | 2E36D0391C75A534000E2F70 /* example-mac */ = {
239 | isa = PBXNativeTarget;
240 | buildConfigurationList = 2E36D0481C75A534000E2F70 /* Build configuration list for PBXNativeTarget "example-mac" */;
241 | buildPhases = (
242 | 2E36D0361C75A534000E2F70 /* Sources */,
243 | 2E36D0371C75A534000E2F70 /* Frameworks */,
244 | 2E36D0381C75A534000E2F70 /* Resources */,
245 | );
246 | buildRules = (
247 | );
248 | dependencies = (
249 | );
250 | name = "example-mac";
251 | productName = "example-mac";
252 | productReference = 2E36D03A1C75A534000E2F70 /* example-mac.app */;
253 | productType = "com.apple.product-type.application";
254 | };
255 | 2EC464D01C7472ED00F905D9 /* example-ios */ = {
256 | isa = PBXNativeTarget;
257 | buildConfigurationList = 2EC464E01C7472ED00F905D9 /* Build configuration list for PBXNativeTarget "example-ios" */;
258 | buildPhases = (
259 | 2EC464CD1C7472ED00F905D9 /* Sources */,
260 | 2EC464CE1C7472ED00F905D9 /* Frameworks */,
261 | 2EC464CF1C7472ED00F905D9 /* Resources */,
262 | );
263 | buildRules = (
264 | );
265 | dependencies = (
266 | );
267 | name = "example-ios";
268 | productName = "example-ios";
269 | productReference = 2EC464D11C7472ED00F905D9 /* example-ios.app */;
270 | productType = "com.apple.product-type.application";
271 | };
272 | /* End PBXNativeTarget section */
273 |
274 | /* Begin PBXProject section */
275 | 2E6F55961C465D7C00F22745 /* Project object */ = {
276 | isa = PBXProject;
277 | attributes = {
278 | LastSwiftUpdateCheck = 0720;
279 | LastUpgradeCheck = 0940;
280 | ORGANIZATIONNAME = HJC;
281 | TargetAttributes = {
282 | 2E36D0391C75A534000E2F70 = {
283 | CreatedOnToolsVersion = 7.2.1;
284 | LastSwiftMigration = 0800;
285 | };
286 | 2EC464D01C7472ED00F905D9 = {
287 | CreatedOnToolsVersion = 7.2.1;
288 | DevelopmentTeam = P78A4DSR5R;
289 | LastSwiftMigration = 0800;
290 | };
291 | };
292 | };
293 | buildConfigurationList = 2E6F55991C465D7C00F22745 /* Build configuration list for PBXProject "QuartzPictureExample" */;
294 | compatibilityVersion = "Xcode 3.2";
295 | developmentRegion = English;
296 | hasScannedForEncodings = 0;
297 | knownRegions = (
298 | en,
299 | Base,
300 | );
301 | mainGroup = 2E6F55951C465D7C00F22745;
302 | productRefGroup = 2E6F559F1C465D7C00F22745 /* Products */;
303 | projectDirPath = "";
304 | projectRoot = "";
305 | targets = (
306 | 2EC464D01C7472ED00F905D9 /* example-ios */,
307 | 2E36D0391C75A534000E2F70 /* example-mac */,
308 | );
309 | };
310 | /* End PBXProject section */
311 |
312 | /* Begin PBXResourcesBuildPhase section */
313 | 2E36D0381C75A534000E2F70 /* Resources */ = {
314 | isa = PBXResourcesBuildPhase;
315 | buildActionMask = 2147483647;
316 | files = (
317 | 2E36D0431C75A534000E2F70 /* Assets.xcassets in Resources */,
318 | 2E36D0461C75A534000E2F70 /* MainMenu.xib in Resources */,
319 | );
320 | runOnlyForDeploymentPostprocessing = 0;
321 | };
322 | 2EC464CF1C7472ED00F905D9 /* Resources */ = {
323 | isa = PBXResourcesBuildPhase;
324 | buildActionMask = 2147483647;
325 | files = (
326 | 2EC464DE1C7472ED00F905D9 /* LaunchScreen.storyboard in Resources */,
327 | 2EC464DB1C7472ED00F905D9 /* Assets.xcassets in Resources */,
328 | );
329 | runOnlyForDeploymentPostprocessing = 0;
330 | };
331 | /* End PBXResourcesBuildPhase section */
332 |
333 | /* Begin PBXSourcesBuildPhase section */
334 | 2E36D0361C75A534000E2F70 /* Sources */ = {
335 | isa = PBXSourcesBuildPhase;
336 | buildActionMask = 2147483647;
337 | files = (
338 | 2E36D1441C75F428000E2F70 /* icons.c in Sources */,
339 | 2E36D0411C75A534000E2F70 /* main.m in Sources */,
340 | 2EE066741C9D46D800A0565B /* world.c in Sources */,
341 | 2E36D13C1C75DB29000E2F70 /* river_man.c in Sources */,
342 | 2E36D04D1C75A5C6000E2F70 /* AppMainView.m in Sources */,
343 | 2EA5938F1C9C793B0021B173 /* all_test.c in Sources */,
344 | 2E36D03E1C75A534000E2F70 /* AppDelegate.m in Sources */,
345 | 2E36D0501C75A7C2000E2F70 /* PictureView.m in Sources */,
346 | 2E919F2E1E8CAD9C0021AC7B /* VKQuartzPicture.m in Sources */,
347 | 2E36D12E1C75D850000E2F70 /* snow_woman.c in Sources */,
348 | 2E36D1321C75D850000E2F70 /* tiger.c in Sources */,
349 | );
350 | runOnlyForDeploymentPostprocessing = 0;
351 | };
352 | 2EC464CD1C7472ED00F905D9 /* Sources */ = {
353 | isa = PBXSourcesBuildPhase;
354 | buildActionMask = 2147483647;
355 | files = (
356 | 2EF34E6A1D8CE74600054CF6 /* tiger.swift in Sources */,
357 | 2EF34E661D8CE74600054CF6 /* all_test.swift in Sources */,
358 | 2E919F221E8CAD770021AC7B /* VKQuartzPictureImage.swift in Sources */,
359 | 2EF34E671D8CE74600054CF6 /* icons.swift in Sources */,
360 | 2EC464FA1C74742A00F905D9 /* PictureListViewController.swift in Sources */,
361 | 2EF34E681D8CE74600054CF6 /* river_man.swift in Sources */,
362 | 2E919F231E8CAD770021AC7B /* VKQuartzPictureView.swift in Sources */,
363 | 2E919F241E8CAD770021AC7B /* VKQuartzPicture.swift in Sources */,
364 | 2EC4650F1C74791000F905D9 /* PictureViewController.swift in Sources */,
365 | 2EC464D41C7472ED00F905D9 /* AppDelegate.swift in Sources */,
366 | 2EF34E691D8CE74600054CF6 /* snow_woman.swift in Sources */,
367 | );
368 | runOnlyForDeploymentPostprocessing = 0;
369 | };
370 | /* End PBXSourcesBuildPhase section */
371 |
372 | /* Begin PBXVariantGroup section */
373 | 2E36D0441C75A534000E2F70 /* MainMenu.xib */ = {
374 | isa = PBXVariantGroup;
375 | children = (
376 | 2E36D0451C75A534000E2F70 /* Base */,
377 | );
378 | name = MainMenu.xib;
379 | sourceTree = "";
380 | };
381 | 2EC464DC1C7472ED00F905D9 /* LaunchScreen.storyboard */ = {
382 | isa = PBXVariantGroup;
383 | children = (
384 | 2EC464DD1C7472ED00F905D9 /* Base */,
385 | );
386 | name = LaunchScreen.storyboard;
387 | sourceTree = "";
388 | };
389 | /* End PBXVariantGroup section */
390 |
391 | /* Begin XCBuildConfiguration section */
392 | 2E36D0491C75A534000E2F70 /* Debug */ = {
393 | isa = XCBuildConfiguration;
394 | buildSettings = {
395 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
396 | CLANG_ENABLE_MODULES = YES;
397 | CODE_SIGN_IDENTITY = "-";
398 | COMBINE_HIDPI_IMAGES = YES;
399 | INFOPLIST_FILE = "example-mac/Info.plist";
400 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
401 | MACOSX_DEPLOYMENT_TARGET = 10.11;
402 | PRODUCT_BUNDLE_IDENTIFIER = "com.testtest.example-mac";
403 | PRODUCT_NAME = "$(TARGET_NAME)";
404 | SDKROOT = macosx;
405 | SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
406 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
407 | SWIFT_VERSION = 3.0;
408 | };
409 | name = Debug;
410 | };
411 | 2E36D04A1C75A534000E2F70 /* Release */ = {
412 | isa = XCBuildConfiguration;
413 | buildSettings = {
414 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
415 | CLANG_ENABLE_MODULES = YES;
416 | CODE_SIGN_IDENTITY = "-";
417 | COMBINE_HIDPI_IMAGES = YES;
418 | INFOPLIST_FILE = "example-mac/Info.plist";
419 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
420 | MACOSX_DEPLOYMENT_TARGET = 10.11;
421 | PRODUCT_BUNDLE_IDENTIFIER = "com.testtest.example-mac";
422 | PRODUCT_NAME = "$(TARGET_NAME)";
423 | SDKROOT = macosx;
424 | SWIFT_OBJC_INTERFACE_HEADER_NAME = "";
425 | SWIFT_VERSION = 3.0;
426 | };
427 | name = Release;
428 | };
429 | 2E6F55AE1C465D7C00F22745 /* Debug */ = {
430 | isa = XCBuildConfiguration;
431 | buildSettings = {
432 | ALWAYS_SEARCH_USER_PATHS = NO;
433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
434 | CLANG_CXX_LIBRARY = "libc++";
435 | CLANG_ENABLE_MODULES = YES;
436 | CLANG_ENABLE_OBJC_ARC = YES;
437 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
438 | CLANG_WARN_BOOL_CONVERSION = YES;
439 | CLANG_WARN_COMMA = YES;
440 | CLANG_WARN_CONSTANT_CONVERSION = YES;
441 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
443 | CLANG_WARN_EMPTY_BODY = YES;
444 | CLANG_WARN_ENUM_CONVERSION = YES;
445 | CLANG_WARN_INFINITE_RECURSION = YES;
446 | CLANG_WARN_INT_CONVERSION = YES;
447 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
448 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
449 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
450 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
451 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
452 | CLANG_WARN_STRICT_PROTOTYPES = YES;
453 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
454 | CLANG_WARN_UNREACHABLE_CODE = YES;
455 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
456 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
457 | COPY_PHASE_STRIP = NO;
458 | DEBUG_INFORMATION_FORMAT = dwarf;
459 | ENABLE_STRICT_OBJC_MSGSEND = YES;
460 | ENABLE_TESTABILITY = YES;
461 | GCC_C_LANGUAGE_STANDARD = gnu99;
462 | GCC_DYNAMIC_NO_PIC = NO;
463 | GCC_NO_COMMON_BLOCKS = YES;
464 | GCC_OPTIMIZATION_LEVEL = 0;
465 | GCC_PREPROCESSOR_DEFINITIONS = (
466 | "DEBUG=1",
467 | "$(inherited)",
468 | );
469 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
470 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
471 | GCC_WARN_UNDECLARED_SELECTOR = YES;
472 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
473 | GCC_WARN_UNUSED_FUNCTION = YES;
474 | GCC_WARN_UNUSED_VARIABLE = YES;
475 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
476 | MTL_ENABLE_DEBUG_INFO = YES;
477 | ONLY_ACTIVE_ARCH = YES;
478 | SDKROOT = iphoneos;
479 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
480 | TARGETED_DEVICE_FAMILY = "1,2";
481 | };
482 | name = Debug;
483 | };
484 | 2E6F55AF1C465D7C00F22745 /* Release */ = {
485 | isa = XCBuildConfiguration;
486 | buildSettings = {
487 | ALWAYS_SEARCH_USER_PATHS = NO;
488 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
489 | CLANG_CXX_LIBRARY = "libc++";
490 | CLANG_ENABLE_MODULES = YES;
491 | CLANG_ENABLE_OBJC_ARC = YES;
492 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
493 | CLANG_WARN_BOOL_CONVERSION = YES;
494 | CLANG_WARN_COMMA = YES;
495 | CLANG_WARN_CONSTANT_CONVERSION = YES;
496 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
497 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
498 | CLANG_WARN_EMPTY_BODY = YES;
499 | CLANG_WARN_ENUM_CONVERSION = YES;
500 | CLANG_WARN_INFINITE_RECURSION = YES;
501 | CLANG_WARN_INT_CONVERSION = YES;
502 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
503 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
504 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
505 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
506 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
507 | CLANG_WARN_STRICT_PROTOTYPES = YES;
508 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
509 | CLANG_WARN_UNREACHABLE_CODE = YES;
510 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
511 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
512 | COPY_PHASE_STRIP = NO;
513 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
514 | ENABLE_NS_ASSERTIONS = NO;
515 | ENABLE_STRICT_OBJC_MSGSEND = YES;
516 | GCC_C_LANGUAGE_STANDARD = gnu99;
517 | GCC_NO_COMMON_BLOCKS = YES;
518 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
519 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
520 | GCC_WARN_UNDECLARED_SELECTOR = YES;
521 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
522 | GCC_WARN_UNUSED_FUNCTION = YES;
523 | GCC_WARN_UNUSED_VARIABLE = YES;
524 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
525 | MTL_ENABLE_DEBUG_INFO = NO;
526 | SDKROOT = iphoneos;
527 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
528 | TARGETED_DEVICE_FAMILY = "1,2";
529 | VALIDATE_PRODUCT = YES;
530 | };
531 | name = Release;
532 | };
533 | 2EC464E11C7472ED00F905D9 /* Debug */ = {
534 | isa = XCBuildConfiguration;
535 | buildSettings = {
536 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
537 | CODE_SIGN_IDENTITY = "iPhone Developer";
538 | INFOPLIST_FILE = "example-ios/Info.plist";
539 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
540 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
541 | PRODUCT_BUNDLE_IDENTIFIER = "com.testtest.example-ios";
542 | PRODUCT_NAME = "$(TARGET_NAME)";
543 | SWIFT_VERSION = 4.0;
544 | };
545 | name = Debug;
546 | };
547 | 2EC464E21C7472ED00F905D9 /* Release */ = {
548 | isa = XCBuildConfiguration;
549 | buildSettings = {
550 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
551 | CODE_SIGN_IDENTITY = "iPhone Developer";
552 | INFOPLIST_FILE = "example-ios/Info.plist";
553 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
554 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
555 | PRODUCT_BUNDLE_IDENTIFIER = "com.testtest.example-ios";
556 | PRODUCT_NAME = "$(TARGET_NAME)";
557 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
558 | SWIFT_VERSION = 4.0;
559 | };
560 | name = Release;
561 | };
562 | /* End XCBuildConfiguration section */
563 |
564 | /* Begin XCConfigurationList section */
565 | 2E36D0481C75A534000E2F70 /* Build configuration list for PBXNativeTarget "example-mac" */ = {
566 | isa = XCConfigurationList;
567 | buildConfigurations = (
568 | 2E36D0491C75A534000E2F70 /* Debug */,
569 | 2E36D04A1C75A534000E2F70 /* Release */,
570 | );
571 | defaultConfigurationIsVisible = 0;
572 | defaultConfigurationName = Release;
573 | };
574 | 2E6F55991C465D7C00F22745 /* Build configuration list for PBXProject "QuartzPictureExample" */ = {
575 | isa = XCConfigurationList;
576 | buildConfigurations = (
577 | 2E6F55AE1C465D7C00F22745 /* Debug */,
578 | 2E6F55AF1C465D7C00F22745 /* Release */,
579 | );
580 | defaultConfigurationIsVisible = 0;
581 | defaultConfigurationName = Release;
582 | };
583 | 2EC464E01C7472ED00F905D9 /* Build configuration list for PBXNativeTarget "example-ios" */ = {
584 | isa = XCConfigurationList;
585 | buildConfigurations = (
586 | 2EC464E11C7472ED00F905D9 /* Debug */,
587 | 2EC464E21C7472ED00F905D9 /* Release */,
588 | );
589 | defaultConfigurationIsVisible = 0;
590 | defaultConfigurationName = Release;
591 | };
592 | /* End XCConfigurationList section */
593 | };
594 | rootObject = 2E6F55961C465D7C00F22745 /* Project object */;
595 | }
596 |
--------------------------------------------------------------------------------