



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
import com.sun.media.jai.widget.DisplayJAI;import java.awt.GridLayout;import javax.media.jai.JAI;import javax.media.jai.PlanarImage;import javax.swing.BorderFactory;import javax.swing.JScrollPane;import javax.swing.border.TitledBorder;/* * PieceWise.java * 版权所有 - 贺向前* 邮件: * QQ: 910019784* 未经授权,不得复制、传播。 */* * * author Administrator */public class PieceWise extends javax.swing.JFrame /* Creates new form PieceWise */ public PieceWise() initComponents(); setTitle(分段线性拉伸); setLayout(new GridLayout(2,2); private PlanarImage loadImage(String fileName) PlanarImage im=JAI.create(fileload,fileName); return im; private void showImage(PlanarImage im,String str) DisplayJAI dj=new DisplayJAI(im); JScrollPane jp=new JScrollPane(dj); TitledBorder titledBorder=BorderFactory.createTitledBorder(str); jp.setBorder(titledBorder); add(jp); /* This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ SuppressWarnings(unchecked) / private void initComponents() setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addMouseListener(new java.awt.event.MouseAdapter() public void mouseClicked(java.awt.event.MouseEvent evt) formMouseClicked(evt); ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane(); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 400, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 300, Short.MAX_VALUE) ); pack(); / private void formMouseClicked(java.awt.event.MouseEvent evt) / TODO add your handling code here: String fileName1=src1.jpg; String fileName2=src2.jpg; PlanarImage im01=loadImage(fileName1); PlanarImage im02=loadImage(fileName2); showImage(im01,Source1); showImage(im02,Source2); int bands1=im01.getNumBands(); int bands2=im02.getNumBands(); float bp1 = new floatbands12; for(int b = 0; b bands1; b+) bp1b0 = new float0.0F, 100.0F, 205.0F,255.0F; bp1b1 = new float0.0F, 10.0F, 245.0F,255.0F; float bp2 = new floatbands12; for(int b = 0; b bands1; b+) bp2b0 = new float0.0F, 10.0F, 245.0F,255.0F; bp2b1 = new float0.0F, 100.0F, 205.0F,255.0F; / Create the Piecewise operation. PlanarImage im11 = JAI.create(piecewise, im01, bp1); PlanarImage im12=JAI.create(piecewise,im02,bp2); showImage(im11,PiecewiseImage1); showImage(im12,PieceWiseImage2); pack(); show(); /* * param args the command line arguments */ public static void main(String args) /* Set the Nimbus look and feel */ / /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see /javase/tutorial/uiswing/lookandfeel/plaf.html */ try for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels() if (Nimbus.equals(info.getName() javax.swing.UIManager.setLookAndFeel(info.getClassName(); break; catch (ClassNotFoundException ex) java.util.logging.Logger.getLogger(PieceWise.class.getName().log(java.util.logging.Level.SEVERE, null, ex); catch (InstantiationException ex) java.util.logging.Logger.getLogger(PieceWise.class.getName().log(java.util.logging.Level.SEVERE, null, ex); catch (IllegalAccessException ex) java.util.logging.Logger.getLogger(PieceWise.class.getName().log(java.util.logging.Level.SEVERE, null, ex); catch (javax.swing.UnsupportedLookAndFeelException ex) java.util.logging.Logger.getLogger(PieceWise.class.getName().log(java.util.logging.Level.SEVERE, null, ex); / /* Create and d
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024版治疗协议书
- 2025年事业单位工勤技能-河北-河北水工监测工三级(高级工)历年参考题库含答案解析
- 2025年事业单位工勤技能-河北-河北假肢制作装配工三级(高级工)历年参考题库含答案解析
- 2025年事业单位工勤技能-江苏-江苏农业技术员五级(初级工)历年参考题库含答案解析(5套)
- 2025年事业单位工勤技能-新疆-新疆水生产处理工三级(高级工)历年参考题库含答案解析(5套)
- 2025年事业单位工勤技能-广西-广西理疗技术员五级(初级工)历年参考题库典型考点含答案解析
- 2025年事业单位工勤技能-广西-广西林木种苗工一级(高级技师)历年参考题库含答案解析
- 2025年事业单位工勤技能-广西-广西堤灌维护工二级(技师)历年参考题库含答案解析
- 2025年事业单位工勤技能-广西-广西农业技术员五级(初级工)历年参考题库含答案解析
- 2025年事业单位工勤技能-安徽-安徽计算机文字录入处理员四级(中级工)历年参考题库典型考点含答案解析
- GBZ(卫生) 49-2014职业性噪声聋的诊断
- GB/T 9729-2007化学试剂氯化物测定通用方法
- GB/T 7588.2-2020电梯制造与安装安全规范第2部分:电梯部件的设计原则、计算和检验
- GB/T 13560-2017烧结钕铁硼永磁材料
- 三视图及尺寸标注课件
- 混凝土配合比验证检验委托书模板
- 住房公积金投诉申请书
- 众辰变频器说明书3400
- 小学教师量化考核表
- 《财务管理》课程教学实施方案
- 露天采矿设计技术规定
评论
0/150
提交评论