Git Product home page Git Product logo

360-converter's Introduction

360-converter

Overview

Input one of the following type 360 image and convert it to another one.

Faces Cubemap Equirectangular Stereographic

Prerequisites

This project has been tested on:

  • Ubuntu 18.04
  • G++ 7.5.0
  • Clang 6.0.0

The only thing you need is a C/C++ compiler, no other package do you need to install.

Run example

git clone https://github.com/chinhsuanwu/360-converter.git
cd 360-converter
make
make run

Usage

Just directly include the converter.hpp in folder src.

#include "src/converter.hpp"

For example, the conversion from Face to Cube, Equi and Stereo can be shown as below, other conversions can be deduced:

  • To convert from Face to Equi

    Converter::Equi equi = face.toEqui();
  • To get image

    Converter::Image img = equi.getEqui();
  • For Stereo images, you can assign TOP or DOWN, while the default will be DOWN

    Converter::Image img = cube.toStereo(Converter::TOP).getStereo();
    TOP DOWN

  • To load image

    img.img = stbi_load("assets/equi.png", &w, &h, &bpp, CHANNEL_NUM);
    img.w = w, img.h = h;
  • To write image

    stbi_write_png("out/equi.png", img.w, img.h, CHANNEL_NUM, img.img, img.w*CHANNEL_NUM);

Find out more at example.cpp.

Acknowledgement

This project is using stb library for image I/O in example.cpp, great thanks to their excellent work.

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.