Commit 8fd7ca3c authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Merge branch 'master' of framagit.org:blaar/blc_core

parents c6f42868 b7f50668
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MACOSX_RPATH 0) #avoid warning in MACOSX
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) #The name of the project is the basename of the directory
project(${PROJECT_NAME})
find_package(blc_core REQUIRED)
#Add your properties with the ones of BL_...
#Add your properties with the ones of BL_... which have been set by find_package
add_definitions(-Wall ${BL_DEFINITIONS})
include_directories(include ${BL_INCLUDE_DIRS})
include_directories(${BL_INCLUDE_DIRS})
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} ${BL_LIBRARIES})
#include "blc_core.h"
#include <math.h> //cos
#include <math.h> //sinf
int main(int argc, char **argv){
blc_array vector, matrix, matrix_copy, pixel_array;
......@@ -7,10 +7,10 @@ int main(int argc, char **argv){
int width, height;
fprintf(stderr, "\nDefining a sinusoïd of 32 uchars vector\n\nProperties:\n");
//We define the properties of an array of type char (INT8) with undef format (i.e. the user use it as he wants), of one dimension (vector) of 32 values.
//We define the properties of an array of type unsigned char (UIN8) with undef format (i.e. the user use it as he wants), of one dimension (vector) of 32 values.
vector.def_array('UIN8', 'NDEF', 1, 32);
//The property .dims have to be freed.
//Be careful the .data memory is not allocated ! This is usefull if you want to associate the data to your own memory.
//We display the properties
vector.fprint_properties(stderr);
......@@ -20,7 +20,7 @@ int main(int argc, char **argv){
vector.allocate();
// We set a sinusoïd in the vector (converting [-1f, 1f] -> [0, 255];
for(i=0; i!=vector.size; i++) vector.chars[i]=128+127*sinf(i/2.f);
for(i=0; i!=vector.size; i++) vector.uchars[i]=128+127*sinf(i/2.f);
fprintf(stderr, "Graph of the vector\n");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment