< prev index next >

src/java.desktop/share/native/libmlib_image/mlib_ImageAffine.c

Print this page


   1 /*
   2  * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 282         }
 283 
 284         break;
 285 
 286     default:
 287       /* nothing to do for other edge types. */
 288       break;
 289     }
 290 
 291     if (param_e->buff_malloc != NULL)
 292       mlib_free(param_e->buff_malloc);
 293   }
 294 
 295   if (param->buff_malloc != NULL)
 296     mlib_free(param->buff_malloc);
 297 
 298   return res;
 299 }
 300 
 301 /***************************************************************/
 302 JNIEXPORT mlib_status JNICALL mlib_ImageAffine(mlib_image       *dst,

 303                              const mlib_image *src,
 304                              const mlib_d64   *mtx,
 305                              mlib_filter      filter,
 306                              mlib_edge        edge)
 307 {
 308   mlib_type type;
 309 
 310   MLIB_IMAGE_CHECK(src);
 311   MLIB_IMAGE_CHECK(dst);
 312 
 313   type = mlib_ImageGetType(dst);
 314 
 315   if (type != MLIB_BIT && type != MLIB_BYTE &&
 316       type != MLIB_SHORT && type != MLIB_USHORT && type != MLIB_INT) {
 317     return MLIB_FAILURE;
 318   }
 319 
 320   return mlib_ImageAffine_alltypes(dst, src, mtx, filter, edge);
 321 }
 322 
   1 /*
   2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 282         }
 283 
 284         break;
 285 
 286     default:
 287       /* nothing to do for other edge types. */
 288       break;
 289     }
 290 
 291     if (param_e->buff_malloc != NULL)
 292       mlib_free(param_e->buff_malloc);
 293   }
 294 
 295   if (param->buff_malloc != NULL)
 296     mlib_free(param->buff_malloc);
 297 
 298   return res;
 299 }
 300 
 301 /***************************************************************/
 302 JNIEXPORT
 303 mlib_status mlib_ImageAffine(mlib_image       *dst,
 304                              const mlib_image *src,
 305                              const mlib_d64   *mtx,
 306                              mlib_filter      filter,
 307                              mlib_edge        edge)
 308 {
 309   mlib_type type;
 310 
 311   MLIB_IMAGE_CHECK(src);
 312   MLIB_IMAGE_CHECK(dst);
 313 
 314   type = mlib_ImageGetType(dst);
 315 
 316   if (type != MLIB_BIT && type != MLIB_BYTE &&
 317       type != MLIB_SHORT && type != MLIB_USHORT && type != MLIB_INT) {
 318     return MLIB_FAILURE;
 319   }
 320 
 321   return mlib_ImageAffine_alltypes(dst, src, mtx, filter, edge);
 322 }
 323 
< prev index next >