changeset 10915:60a4a975db8c octave-forge

bmpwrite: deprecate in favour of imwrite
author carandraug
date Mon, 24 Sep 2012 13:47:59 +0000
parents f1af7408d1b7
children 1183c88c7509
files main/image/NEWS main/image/inst/bmpwrite.m
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/image/NEWS	Mon Sep 24 13:32:36 2012 +0000
+++ b/main/image/NEWS	Mon Sep 24 13:47:59 2012 +0000
@@ -37,6 +37,7 @@
     for the recommended alternatives):
 
       blkproc
+      bmpwrite
       dilate
       erode
 
--- a/main/image/inst/bmpwrite.m	Mon Sep 24 13:32:36 2012 +0000
+++ b/main/image/inst/bmpwrite.m	Mon Sep 24 13:47:59 2012 +0000
@@ -4,6 +4,11 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} bmpwrite (@var{X}, @var{map}, @var{file})
 ## Write the bitmap @var{X} into @var{file} (8-bit indexed uncompressed).
+##
+## @emph{warning}: @code{bmpwrite} has been deprecated in favor of
+## @code{imwrite} in Octave core. This function will be removed from future
+## versions of the 'image' package".
+##
 ## The values in @var{X} are indices into the given RGB colour @var{map}.
 ## @deftypefnx{Function File} bmpwrite (@var{X}, @var{file})
 ## Write the bitmap @var{X} into @var{file} (24-bit truecolor uncompressed).
@@ -11,6 +16,13 @@
 ## @end deftypefn
 
 function bmpwrite(x,colormap_or_file,file)
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "`bmpwrite' has been deprecated in favor of `imwrite' in Octave core. This function will be removed from future versions of the `image' package");
+  endif
+
   if nargin==2
      bmpwrite_truecolor(x(:,:,1),x(:,:,2),x(:,:,3),colormap_or_file);
   else