Coder Social home page Coder Social logo

bspanoramaview's Introduction

BSPanoramaView

中文文档请阅读这里

Due to the limitation of recording screen, the actual experience on real device is much better the gif shown above.

BSPanoramaView is a lightweight panorama picture browser on iOS platform, which will only make the binary file 30k larger.

BSPanoramaView does not rely on any other third party framework and it only contains about three hundred lines of code.

BSPanoramaView was inspired by WushuputiGH/Panorama and copied some calculations about OpenGL but rewrote the application architecture and fixed many bugs.

At current time, BSPanoramaView can be applied in production environment if you are tolerant of some tiny defects.

Usage

BSPanoramaView is the subclass of GLKView which itself is a subclass of UIView, so you can use BSPanoramaView as a normal view:

#import "BSPanoramaView.h"

- (void)viewDidLoad {
    [super viewDidLoad];

    BSPanoramaView *panoView = [[BSPanoramaView alloc] initWithFrame:self.view.bounds imageName:@"test"];
    [self.view addSubview:panoView];
}

The texture(test.png) takes a lot of memory. For example, an picture with resolution of 4096 * 20148 takes 32M memory which means you should be careful about the memory occupation.

When the instance of BSPanoramaView is released, it will unload the texture in dealloc method and you don't need to pay any extra attention to this:

- (void)dealloc {
    [self unloadImage];
}

However, if it is not released, such as scrolling outside the screen, you should be careful to call unloadImage method manually at proper time. This is also demostrated in the code in PanoTableViewCell class.

Installation

You can just copy the source code into your project because there are only two files.

However, since this is a beta-version code which may be optimized constantly, I strongly encourage you to use Cocoapods:

pod 'BSPanoramaView'

bspanoramaview's People

Contributors

bestswifter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.