Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
My_Inverter.java
Package: ch03.zip [view]
Upload User: scmyqay
Upload Date: 2021-10-16
Package Size: 1k
Code Size: 1k
Category:
Applet
Development Platform:
Java
- /**
- * This sample code is made available as part of the book "Digital Image
- * Processing - An Algorithmic Introduction using Java" by Wilhelm Burger
- * and Mark J. Burge, Copyright (C) 2005-2008 Springer-Verlag Berlin,
- * Heidelberg, New York.
- * Note that this code comes with absolutely no warranty of any kind.
- * See http://www.imagingbook.com for details and licensing conditions.
- *
- * Date: 2007/11/10
- */
- import ij.ImagePlus;
- import ij.plugin.filter.PlugInFilter;
- import ij.process.ImageProcessor;
- public class My_Inverter implements PlugInFilter {
- public int setup(String arg, ImagePlus im) {
- return DOES_8G; // this plugin accepts 8-bit grayscale images
- }
- public void run(ImageProcessor ip) {
- int w = ip.getWidth();
- int h = ip.getHeight();
- // iterate over all image coordinates
- for (int u = 0; u < w; u++) {
- for (int v = 0; v < h; v++) {
- int p = ip.getPixel(u, v);
- ip.putPixel(u, v, 255-p);
- }
- }
- }
- }