Commit 3c1bf651 authored by Edwin Carlinet's avatar Edwin Carlinet Committed by Roland Levillain
Browse files

Exercise ASCII PPM file loading.



	* tests/io/ppm/ppm_ascii.cc: New test.
	* tests/io/ppm/Makefile.am (check_PROGRAMS): Add ppm_ascii.
	* img/fly_ascii.ppm: New test image.
	* Makefile.am (dist_img_DATA): Add img/fly_ascii.ppm.
Signed-off-by: Guillaume Lazzara's avatarGuillaume Lazzara <z@lrde.epita.fr>
Signed-off-by: Roland Levillain's avatarRoland Levillain <roland@lrde.epita.fr>
parent aebe860f
2012-06-05 Edwin Carlinet <carlinet@lrde.epita.fr>
Exercise ASCII PPM file loading.
* tests/io/ppm/ppm_ascii.cc: New test.
* tests/io/ppm/Makefile.am (check_PROGRAMS): Add ppm_ascii.
* img/fly_ascii.ppm: New test image.
* Makefile.am (dist_img_DATA): Add img/fly_ascii.ppm.
2012-06-05 Edwin Carlinet <carlinet@lrde.epita.fr>
 
Fix issues w.r.t. loading ASCII PPM files.
......@@ -113,6 +113,7 @@ dist_img_DATA = \
img/fly.pbm \
img/fly.pgm \
img/fly.ppm \
img/fly_ascii.ppm \
img/lena.pbm \
img/lena.pgm \
img/lena.ppm \
......
P3
# CREATOR: GIMP PNM Filter Version 1.1
5 5
255
201 99 93 200 92 94 208 126 122 208 109 102 162 81 90 189 85 86 198 98 99
197 138 143 203 149 145 167 94 105 188 87 90 142 64 93 186 107 117 159 84 102
201 133 123 166 80 95 126 65 103 189 86 96 161 85 98 210 154 131 154 85 98
113 50 91 201 93 94 204 138 131 173 94 95
......@@ -20,7 +20,8 @@ include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
ppm16 \
ppm23 \
ppm
ppm \
ppm_ascii
TESTS = $(check_PROGRAMS)
......
// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE).
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to produce
// an executable, this file does not by itself cause the resulting
// executable to be covered by the GNU General Public License. This
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
#include <mln/core/image/image2d.hh>
#include <mln/value/rgb8.hh>
#include <mln/io/ppm/load.hh>
#include <mln/data/compare.hh>
#include "tests/data.hh"
int main()
{
using namespace mln;
using value::rgb8;
image2d<rgb8> ima1 = io::ppm::load<rgb8>(MLN_IMG_DIR "/fly.ppm");
image2d<rgb8> ima2 = io::ppm::load<rgb8>(MLN_IMG_DIR "/fly_ascii.ppm");
mln_assertion(ima1 == ima2);
}
Markdown is supported
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