Projects
home:blinry
nordlicht
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 34
View file
nordlicht.spec
Changed
@@ -1,7 +1,7 @@ %define soname 0 Name: nordlicht -Version: 0.3.2 +Version: 0.3.3 Release: 0 Summary: Creates colorful barcodes from video files License: GPL-2.0+
View file
_service:download_files:v0.3.2.tar.gz/cmake/FindFreeImage.cmake
Deleted
@@ -1,60 +0,0 @@ -# Find FreeImage includes and library -# -# This module defines -# FreeImage_INCLUDE_DIRS -# FreeImage_LIBRARIES, the libraries to link against to use FreeImage. -# FreeImage_LIBRARY_DIRS, the location of the libraries -# FreeImage_FOUND, If false, do not try to use FreeImage -# -# Copyright © 2007, Matt Williams -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -IF (FreeImage_LIBRARIES AND FreeImage_INCLUDE_DIRS) -SET(FreeImage_FIND_QUIETLY TRUE) # Already in cache, be silent -ELSE(FreeImage_LIBRARIES AND FreeImage_INCLUDE_DIRS) -MESSAGE(STATUS "Looking for FreeImage") -ENDIF (FreeImage_LIBRARIES AND FreeImage_INCLUDE_DIRS) - -SET(FreeImage_INCLUDE_SEARCH_DIRS -${FreeImage_LIBRARY_SEARCH_DIRS} -${CMAKE_LIBRARY_PATH} -/usr/include -/usr/local/include -/opt/include -/opt/freeimage/include -) - -SET(FreeImage_LIBRARY_SEARCH_DIRS -${FreeImage_LIBRARY_SEARCH_DIRS} -${CMAKE_LIBRARY_PATH} -/usr/lib -/usr/local/lib -/opt/lib -/opt/freeimage/lib -) - -FIND_PATH(FreeImage_INCLUDE_DIRS FreeImage.h ${FreeImage_INCLUDE_SEARCH_DIRS}) -FIND_LIBRARY(FreeImage_LIBRARIES freeimage PATHS ${FreeImage_LIBRARY_SEARCH_DIRS}) - -#Do some preparation -SEPARATE_ARGUMENTS(FreeImage_INCLUDE_DIRS) -SEPARATE_ARGUMENTS(FreeImage_LIBRARIES) - -MARK_AS_ADVANCED(FreeImage_INCLUDE_DIRS FreeImage_LIBRARIES FreeImage_LIBRARY_DIRS) - -IF (FreeImage_INCLUDE_DIRS AND FreeImage_LIBRARIES) -SET(FreeImage_FOUND TRUE) -ENDIF (FreeImage_INCLUDE_DIRS AND FreeImage_LIBRARIES) - -IF (FreeImage_FOUND) -IF (NOT FreeImage_FIND_QUIETLY) -MESSAGE(STATUS " libraries : ${FreeImage_LIBRARIES} from ${FreeImage_LIBRARY_DIRS}") -MESSAGE(STATUS " includes : ${FreeImage_INCLUDE_DIRS}") -ENDIF (NOT FreeImage_FIND_QUIETLY) -ELSE (FreeImage_FOUND) -IF (FreeImage_FIND_REQUIRED) -MESSAGE(FATAL_ERROR "Could not find FreeImage") -ENDIF (FreeImage_FIND_REQUIRED) -ENDIF (FreeImage_FOUND)
View file
_service:download_files:v0.3.2.tar.gz/CMakeLists.txt -> _service:download_files:v0.3.3.tar.gz/CMakeLists.txt
Changed
@@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 2.8) -include(GNUInstallDirs) project(nordlicht C) -set(NORDLICHT_VERSION 0.3.2) +set(NORDLICHT_VERSION 0.3.3) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") set(LIB_SUFFIX "" CACHE STRING "Suffix of library directory name (for example '32' or '64')") @@ -10,14 +9,14 @@ find_package(Threads REQUIRED) find_package(FFmpeg COMPONENTS AVUTIL AVFORMAT AVCODEC SWSCALE REQUIRED) -find_package(FreeImage REQUIRED) +find_package(PNG REQUIRED) find_package(Popt REQUIRED) -include_directories(${CMAKE_BINARY_DIR}/src ${FFMPEG_INCLUDE_DIRS} ${FreeImage_INCLUDE_DIRS} ${POPT_INCLUDES}) +include_directories(${CMAKE_BINARY_DIR}/src ${FFMPEG_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${POPT_INCLUDES}) add_library(nordlicht SHARED src/common.c src/graphics.c src/nordlicht.c src/video.c) set_target_properties(nordlicht PROPERTIES SOVERSION 0) -target_link_libraries(nordlicht ${FFMPEG_LIBRARIES} ${FreeImage_LIBRARIES} ${POPT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(nordlicht ${FFMPEG_LIBRARIES} ${PNG_LIBRARIES} ${POPT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) add_executable(nordlicht-bin src/main.c) set_target_properties(nordlicht-bin PROPERTIES OUTPUT_NAME nordlicht)
View file
_service:download_files:v0.3.2.tar.gz/README.md -> _service:download_files:v0.3.3.tar.gz/README.md
Changed
@@ -18,7 +18,7 @@ - Arch Linux: Install the [`nordlicht-git`](https://aur.archlinux.org/packages/nordlicht-git/) package from the AUR - Gentoo: Install the `media-video/nordlicht` package from the [multimedia overlay](https://gitorious.org/gentoo-multimedia/gentoo-multimedia) -- On other distributions, get CMake, FFmpeg, FreeImage, [popt](http://freecode.com/projects/popt), and [help2man](https://www.gnu.org/software/help2man/), and issue: `mkdir build && cd build && cmake .. && make && make install` +- On other distributions, get CMake, FFmpeg, libpng, [popt](http://freecode.com/projects/popt), and [help2man](https://www.gnu.org/software/help2man/), and issue: `mkdir build && cd build && cmake .. && make && make install` ## Usage
View file
_service:download_files:v0.3.2.tar.gz/Vagrantfile -> _service:download_files:v0.3.3.tar.gz/Vagrantfile
Changed
@@ -1,20 +1,24 @@ Vagrant.configure("2") do |config| - config.vm.define "precise64" do |c| - c.vm.box = "precise64" + config.vm.define "ubuntu" do |c| + c.vm.box = "ubuntu" c.vm.box_url = "http://files.vagrantup.com/precise64.box" c.vm.provision :shell, :path => "utils/bootstrap-debian.sh" c.vm.synced_folder ".", "/home/vagrant/nordlicht" c.ssh.forward_agent = true end - config.vm.define "wheezy64" do |c| - c.vm.box = "wheezy64" + config.vm.define "debian" do |c| + c.vm.box = "debian" c.vm.box_url = "https://dl.dropboxusercontent.com/u/197673519/debian-7.2.0.box" c.vm.provision :shell, :path => "utils/bootstrap-debian.sh" c.vm.synced_folder ".", "/home/vagrant/nordlicht" c.ssh.forward_agent = true end - config.vm.define "gentoo64" do |c| - c.vm.box = "gentoo64" + config.vm.define "gentoo" do |c| + c.vm.box = "gentoo" c.vm.box_url = "https://dl.dropboxusercontent.com/s/0e23qmbo97wb5x2/gentoo-20131029-i686-minimal.box" end + config.vm.define "suse" do |c| + c.vm.box = "suse" + c.vm.box_url = "http://sourceforge.net/projects/opensusevagrant/files/12.2/opensuse-12.2-64.box/download" + end end
View file
_service:download_files:v0.3.2.tar.gz/packages/archlinux/nordlicht-git/PKGBUILD -> _service:download_files:v0.3.3.tar.gz/packages/archlinux/nordlicht-git/PKGBUILD
Changed
@@ -8,7 +8,7 @@ arch=('i686' 'x86_64') url="http://github.com/blinry/nordlicht" license=('GPL') -depends=('ffmpeg' 'freeimage' 'popt') +depends=('ffmpeg' 'libpng' 'popt') makedepends=('git' 'cmake' 'help2man') provides=('nordlicht') conflicts=('nordlicht')
View file
_service:download_files:v0.3.2.tar.gz/packages/archlinux/nordlicht/PKGBUILD -> _service:download_files:v0.3.3.tar.gz/packages/archlinux/nordlicht/PKGBUILD
Changed
@@ -7,7 +7,7 @@ arch=('i686' 'x86_64') url="http://github.com/blinry/nordlicht" license=('GPL') -depends=('ffmpeg' 'freeimage' 'popt') +depends=('ffmpeg' 'libpng' 'popt') makedepends=('git' 'cmake' 'help2man') source=(https://github.com/blinry/$pkgname/archive/v$pkgver.tar.gz) md5sums=('2479c6eb5e6657ab16be6ec1b81347b7')
View file
_service:download_files:v0.3.2.tar.gz/src/graphics.c -> _service:download_files:v0.3.3.tar.gz/src/graphics.c
Changed
@@ -48,9 +48,9 @@ long gsum = 0; long bsum = 0; for (x=0; x<i->width; x+=step) { - bsum += i->data[y*i->width*3+3*x+0]; + rsum += i->data[y*i->width*3+3*x+0]; gsum += i->data[y*i->width*3+3*x+1]; - rsum += i->data[y*i->width*3+3*x+2]; + bsum += i->data[y*i->width*3+3*x+2]; } c->data[3*y+0] = rsum/(i->width/step+1); c->data[3*y+1] = gsum/(i->width/step+1); @@ -73,9 +73,9 @@ long gsum = 0; long bsum = 0; for (y=0; y<i->height; y+=step) { - bsum += i->data[y*i->width*3+3*x+0]; + rsum += i->data[y*i->width*3+3*x+0]; gsum += i->data[y*i->width*3+3*x+1]; - rsum += i->data[y*i->width*3+3*x+2]; + bsum += i->data[y*i->width*3+3*x+2]; } c->data[3*(i->width-x-1)+0] = rsum/(i->height/step); c->data[3*(i->width-x-1)+1] = gsum/(i->height/step); @@ -96,9 +96,9 @@ int x; for (x=0; x<i->width; x++) { int y = x*slope; - c->data[3*x+0] = i->data[y*i->width*3+3*x+2]; + c->data[3*x+0] = i->data[y*i->width*3+3*x+0]; c->data[3*x+1] = i->data[y*i->width*3+3*x+1]; - c->data[3*x+2] = i->data[y*i->width*3+3*x+0]; + c->data[3*x+2] = i->data[y*i->width*3+3*x+2]; } return c;
View file
_service:download_files:v0.3.2.tar.gz/src/nordlicht.c -> _service:download_files:v0.3.3.tar.gz/src/nordlicht.c
Changed
@@ -1,5 +1,5 @@ #include "nordlicht.h" -#include <FreeImage.h> +#include <png.h> #include "common.h" #include "video.h" @@ -124,13 +124,56 @@ free(realpath_output); } - FIBITMAP *bitmap = FreeImage_ConvertFromRawBits(n->data, n->width, n->height, n->width*4, 4*8, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK, 1); - if (!FreeImage_Save(FreeImage_GetFIFFromMime("image/png"), bitmap, filename, 0)) { - error("Could not write to '%s'", filename); - return -1; + int code = 0; + FILE *fp; + png_structp png; + png_infop png_info; + + fp = fopen(filename, "wb"); + if (fp == NULL) { + error("Could not open '%s' for writing", filename); + code = 1; + goto finalize; } - FreeImage_Unload(bitmap); - return 0; + + png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (png == NULL) { + error("Error writing PNG"); + code = 1; + goto finalize; + } + + png_info = png_create_info_struct(png); + if (png_info == NULL) { + error("Error writing PNG"); + code = 1; + goto finalize; + } + + if (setjmp(png_jmpbuf(png))) { + error("Error writing PNG"); + code = 1; + goto finalize; + } + png_init_io(png, fp); + png_set_IHDR(png, png_info, n->width, n->height, 8, PNG_COLOR_TYPE_RGB_ALPHA, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + + png_write_info(png, png_info); + + int y; + for (y = 0; y < n->height; y++) { + png_write_row(png, n->data+4*y*n->width); + } + + png_write_end(png, NULL); + +finalize: + if (fp != NULL) fclose(fp); + if (png_info != NULL) png_free_data(png, png_info, PNG_FREE_ALL, -1); + if (png != NULL) png_destroy_write_struct(&png, (png_infopp)NULL); + + return code; } float nordlicht_progress(nordlicht *n) {
View file
_service:download_files:v0.3.2.tar.gz/utils/bootstrap-debian.sh -> _service:download_files:v0.3.3.tar.gz/utils/bootstrap-debian.sh
Changed
@@ -1,4 +1,4 @@ #!/usr/bin/env bash apt-get update && -apt-get install -y cmake libavcodec-dev libswscale-dev libavformat-dev libfreeimage-dev libpopt-dev git-buildpackage debhelper help2man +apt-get install -y cmake libavcodec-dev libswscale-dev libavformat-dev libpng-dev libpopt-dev git-buildpackage debhelper help2man
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.