To obtain BufferedImage from Scene 3D

Hi all!!! I want to obtain snapshots from Scene 3D to do a video with JMF (Java Media Framework). How I do it??
Regards!

// read the buffer to byteBuffer
            GL11.glReadBuffer(GL11.GL_FRONT);
            ByteBuffer pixels = ByteBuffer.allocateDirect(400*400*4);
            GL11.glReadPixels(0, 0, 400, 400, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, pixels);
            ColorModel glColorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
                                            new int[] {8,8,8,0},
                                            false,
                                            false,
                                            ComponentColorModel.OPAQUE,
                                            DataBuffer.TYPE_BYTE);
            int[] bitMasks = new int[] {8,8,8,0};
            int[] band = new int[3];
            // again, what is this?
            SinglePixelPackedSampleModel sampleModel = new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, 400, 400,bitMasks);
            // make array from byteBuffer to make a DataBufferByte from array...
            byte [] byteA=new byte[400*400*3];
            System.out.println(byteA.length);
            pixels.get(byteA);
            DataBuffer db = new DataBufferByte(byteA, 400*400*3, 0);
            //make my raster
            WritableRaster raster = Raster.createInterleavedRaster(db, 400, 400, 400*3, 3, band, null);
            // make my image
            BufferedImage image = new BufferedImage(glColorModel, raster, false, null);//new java.util.Hashtable());the above produces an image! yey! it is however grayscale, can anybody help?
Edited by: IJustWantToSayHelloWorld on Aug 5, 2009 4:12 AM

Similar Messages

  • Creating bufferedimage from scene in different resolution than the Canvas?

    Is it possible to create a bufferedimage from a Canvas, but with a higher resolution without loosing image quality?
    Need to take high-quality screenshots of the 3d-scene.
    Thanks.

    I'm trying to back up and simultaneously organize my photos from my Mac OS 10.8.5 by dragging groups of photos from iPhoto to an external HD.
    One more thought -  if you want to backup your photos, why not simply copy your iPhoto Library to the external drive? That would save your photos as well as the work you invested in editing and tagging them.
    If you do the backup by storing only the photos on your external drive, you need to export all edited photos twice - first the original photo like described in Old Toad's screenshot, and then the edited version as well, or you will lose your editing work, if you need your backup.
    Copying the iPhoto Library would save all in one, without too much trouble.
    Your second goal, reorganizing, could be done directly in iPhoto.

  • Obtaining BufferedImage from Graphics

    hello
    I want to send an image I have in Graphics object over a socket. To do that I need to have BufferedImage but I do not know how to create one having only Graphics object.
    Can any one tall me how to do that ?
    lary

    I'm writing a chat where users can send text and images to each other. I've already dealed with sending text and now I have to deal with sending pictures.
    This is a part of the class for drawing and sending pictures:
    public class WhiteBoard extends javax.swing.JDialog {
        Point p;
        int offx, offy;
        Graphics2D G;
        BufferedImage bi;
        Client cli;
        /** Creates new form WhiteBoard */
        public WhiteBoard(java.awt.Frame parent, boolean modal) {
            super(parent, modal);
            initComponents();
            setSize(400, 500);
            bi = new BufferedImage(400, 400,
                    BufferedImage.TYPE_3BYTE_BGR);
            G = bi.createGraphics();
            G.setColor(Color.BLACK);
        //invoked when mouse pressed
        private void jPanel1MousePressed(java.awt.event.MouseEvent evt) {                                    
            p = evt.getPoint();
       //this one is invoked when mouse is dragged
        private void jPanel1MouseDragged(java.awt.event.MouseEvent evt) {                                    
            Point p0 = evt.getPoint();
            G.drawLine(p0.x, p0.y, p.x, p.y);
            jPanel1.getGraphics().drawLine(p0.x, p0.y, p.x, p.y);
            p = p0;
        //invoked when button "send" is clicked
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            cli.sendPicture(bi);
        //invoked when button "clear" is clicked
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            bi = new BufferedImage(400, 400,
                    BufferedImage.TYPE_3BYTE_BGR);
            G = bi.createGraphics();
            G.setColor(Color.BLACK);
            repaint();
        }                         

  • Adobe Bridge CC cannot obtain files from this device.

    I am getting this error message when I attempt to upload videos to my Mac from my Canon 7D:
    Adobe Bridge CC cannot obtain files from this device. Please be sure the device is properly plugged in and the battery is full charged.
    Battery is full charged and camera is connected properly. I have restarted the camera, Bridge, and the computer as well. I tried reinstalling Bridge and it allowed me to upload 3 of the video files. Then the error message came back. There were a few RAW images on the camera that I was able to upload, but when I tried the video again I got the error message. I read a post about renaming the folder that you are saving to as a fix. I tried that as well, but it did not work.
    Any help would be greatly appreciated! Thanks!
    -J

    This excerpt is from a long-gone post by author Bruce Fraser:
    Bruce Fraser - 4:17pm Jun 14, 04 PST (#5 of 21) Opening files directly from the camera is a bad idea for a variety of reasons*, and it most certainly isn't faster than using a FireWire or USB2 card reader. 
            • Drains the camera battery
            • Runs the risk of the software you're using to open the images writing to the card and destroying the format
            • Runs a small but significant risk of USB power frying the camera
    • runs the risk of wearing out the camera's connector,      
    • Slowest method known to mankind of getting images off a CF or SD card

  • Adobe Bridge cs5 cannot obtain files from this device.

    I download photos to my computer using a Kingston downloading device.
    Since installing Mavericks the above message comes up and will not carry out the download.
    Is this a known problem with Mavericks and is there a remedy?
    I would say that using the same device my photos download perfectly on my MacBook Pro.
    Messages
    1. Adobe Bridge CS5.1 cannot obtain files from this device.
    Please ensure that the device is connected properly and that the battery is charged and try again.
    2.I also get a message telling me that the "disk was not ejected propery" which is not the case.

    Thanks Eric
    The MacBook Pro is not running Mavericks and sorry about the double post.
    I have actually solved the problem and the answer might be of use to others with the same problem.
    There is a firmware update that will correct the problem.
    It's at
    http://www.kingston.com/en/support/technical/products?model=fcr-hs3
    There is a small catch in  that the firmware update can only be done on a Windows machine but I have been told that once this is done it can be used with OSX9 .I have just done the download but  I haven't checked this out yet.

  • Obtaining DataSource from Application Module

    How may i obtain DataSource from pool managed by Application Module? I want some of my db-related operation performed by Spring's JdbcOperations class ( http://www.springframework.org/docs/api/org/springframework/jdbc/core/JdbcOperations.html ) and i want have only one connection pool in my application.
    Thanks,
    Kind regards,
    Marcin Zduniak / http://J2ME.pl

    Refer
    http://www.oracle.com/technology/products/jdev/howtos/10g/usingdatasources/using_datasources.html

  • Is there any way to obtain time from an NTP server in LabView?

    I would like to be able to obtain time from and NTP server and then use that to set the time on a PCI IRIG-B card. I haven't been able to find any LabView documentation indicating if this is possible or not through LabView.

    Check: Code library -> Browse by Company -> NASA -> Timesync.
    It's a NIST time syncronizer. I never checked it myself, but NIST has NTP servers so this may help you on your way.

  • Obtain drivers from MS-Server and updates from WSUS

    Hi,
    is there a possibility to obtain drivers from the MS Server and the "other" updates from the WSUS-Server?
    We have workstations with Win7 and XP and pluged in devices (USB) should obtain the drivers (if available) automatically from MS-Server.
    Obtaining drivers through WSUS is not an option.
    The Group Policy "Computer Configuration\...\Windows Update" is set to obtain updates from "intranet Microsoft update service location".
    Should there be no possibility to distinguish between driver and update obtaining locations,
    then is it possible to set WSUS as primary obtaining location and as secondary the MS-Serve? 
    Greets, 
    Emmanuel

    Like I mentioned before I tried to use this:
    http://technet.microsoft.com/en-us/library/cc753091.aspx
    1. Try:
    Step1:
    I uninstalled the device and deleted the driver of my testing device. (local)
    Step2:
    I have created a new GP on Server 2003R2x86 (AD/DC) and linked it in the OU where my test-PC is located.
    .../ComputerConfiguration/Administrative Templates/System/InternetCommunicationManagement/Internet Communication Settings/TurnOffWindowsUpdateDeviceDriverSearching-->disabled
    Step3:
    I restarted the test PC with a logonscript: "gpupdate /force"
    Result:
    It didn't work.
    2.Try:
    Same procedure, but instead of creating the policy on the '03 Server, I created the policy with RSAT for W7.
    Result:
    It didn't work.
    Now I have a new question:
    Isn't the above mentioned policy for this?:
    http://windows.microsoft.com/en-us/windows7/automatically-get-recommended-drivers-and-updates-for-your-hardware
    I ask, because this is exactly the setting that has to be changed so that everything works the way I want.
    (at least for the Win7 PCs. I don't care much about the XP-PCs because they will be replaced in the near future)
    Well one option is to change this setting manually on every PC, but this would be a huge PITA.
    Can this be done in a policy or with a script (registry?)?

  • HT3775 For some reason my QuickTime player has stopped playing all my .avi movies, I can't seem to upgrade and it doesn't offer any solutions except that it may need additional software but not what or where to obtain it from? Help most of my movie are in

    For some reason my QuickTime player has stopped playing all my .avi movies, I can't seem to upgrade and it doesn't offer any solutions except that it may need additional software but not what or where to obtain it from? Help most of my movie are in .avi!!

    Google 'Perian' and 'Flip4Mac' — these are the extensions that will make QT play other file formats.
    However, a simpler solution is just to abandon QT in favour of the free, open-source player VLC, which plays just about everything natively without further downloads.
    Download the free VLC Player from here:
    http://www.videolan.org
    Plays just about everything, including avi & mpg, without add ons.

  • Creating BufferedImage from Image

    I've figured out one way to create a BufferedImage from an Image, but I'm sure it's not the best way.Image im = Toolkit.getDefaultToolkit().getImage(files.getAbsolutePath());
    JLabel jl = new JLabel(new ImageIcon(im));
    BufferedImage bim = new BufferedImage(im.getWidth(null), im.getHeight(null), BufferedImage.TYPE_BYTE_INDEXED);
    Graphics g = bim.getGraphics();
    jl.paint(bim.getGraphics());
    This works, but I'm sure there has to be a better/easier way. Any suggestions?
    Thanks,
    m

    close, the best way is this...
    public BufferedImage createBufferedImage(Image img)
    BufferedImage bimg = new BufferedImage(img.getWidth(null),img.getHeight(null),BufferedImage.TYPE_INT_RGB);//or whatever type is appropriate
    bimg.getGraphics().drawImage(img,0,0,null);
    return bimg;
    }

  • Going back from scene 2 to particular moment in scene 1

    Hello all,
    I have encountered a problem, and I need help from more experienced flash users.
    I am creating a webpage in flash, and for now, it consists of 3 scenes. First one is a loading bar, scene 2 is a main page with all menus, and on 3rd scene there is a gallery. I plan to make many galleries, each in different scene. Everything is ok to the moment, when I want to go back from scene 3 to scene 2. Scene 2 consists of many layers and movieclips, however, the main timeline consists only of one frame. When, in scene 2, I will get to the moment from which I am going to scene 3, so to some gallery, then after I am comming back to scene 2 (via gotoAndPlay('Scene 2', 1)), I am getting to scene in a state, as I see it just after loading bar disappears. But I want to be in a place, from which I went to scene 3. How do I achieve this? I think, there should be a way of remembering status of the scene 2 in such a way, that after comming back from scene 3 I would be in the same place from which I left to the mentioned scene 3. Be advised, that scene 2 is in one frame, and all movement in the scene 2 is done by actionscript and movieclips. I am using AS2.0.
    I hope I explained it in understandable way, let me know if there is a need for clarification.
    please help me before I will go crazy
    thanks!

    When you use scenes, which I am recommending you don't mainly because they can be unpredictably problematic when it comes to mixing in navigation, when you compile the file, everything gets clumped into one long timeline anyways, so your reason for using them isn't holding.
    If you plan to have galleries, then going with a design that loads them dynamically rather than storing the content in the file is the best way to go.   If you take a movieclip approach you can create your whole design in just one frame of the main timeline, loading your galleries when called for, and controlling other content via changing visibility or other properties.
    But even if you spread things along the one scene's timeline, you can have variables that you assign status info to that can be retained for the length of the timeline so that if you return to a section you can use those variables to set things back up to whatever status they should have.

  • Sample java code to obtain data from ALUI directory

    Hi
    I need to go to the ALUI LDAP ( directory ) services to get user profile information.
    The documentation did not help me to figure out the way to obtain data from it.
    so , it would be a great help if some one could share the sample java code api to obtain data from ALUI directory.

    i'm guessing you are asking to get the groups for a particular user. someone in the other thread posted the actual SQL, that may be easier. ( you are on 10gR3 right, because ALUI directory didn't exist before 6.5)
    I dont have a sample done yet, but the internet is filled with samples of java and ldap...
    http://www.coderanch.com/t/133108/Security/LDAP-sample-program

  • Going from scene to scene  HELPPPP!

    okay i have my main timeline in scene 1, and when i click on
    a button i want to create actionscript that will take me to scene
    2...right now i'm having the problem that without even clicking on
    the button the movie goes right from scene 1 to scene 2...PLEASE H
    ELP ME :)

    i'm sorry you aren't making any sense to me....i put a stop()
    at the end of my timeline in one frame to stop it from jumping to
    scene to scene...where do you want me to copy it from and where do
    you want me to paste it?

  • Is there any way to change the document size from scene to scene?

    I'm building a portfolio site, but I need the document size to be different from each scene.  I'd rather not create a separate swf/html file for each page since that would disrupt the transition between scenes (not to mention all the wok I went through to get the dropdown menus working).
    For instance, the "home" scene is structured for 1200x670 px, but the portfolio scene labeled "published" needs to be at 1200x1500px.
    Is there any way to change the document size from scene to scene?  OR; If, for instance, I made the universal document size 1200x1500 for the entire flash file, is there a script that would restrict the "home" scene to only show the first 670 pixels?

    not in flash alone.
    you may be able to do what you want using javascript in your html document and using the externalinterface class to communicate between your actionscript the embedding html javascript.

  • How do i obtain permission from Apple to use Classic Visualizer in a private Youtube video? SoundSpectrum says Apple has jurisdiction over Classic Visualizer.

    How do i obtain permission from Apple to use Classic Visualizer in a private Youtube video? SoundSpectrum says Apple has jurisdiction over Classic Visualizer.
    SoundSpectrum says Apple has jurisdiction over this product. This is strictly for non-commercial use.

    I did end up using an apple thunderbolt to DVI.
    Next a DVI to HDMI.
    Component Video + Digital Coaxial and Digital Optical Audio to HDMI® Converter
    http:/http://www.monoprice.com/Product?c_id=101&cp_id=10114&cs_id=1011406&p_id=5 971&seq=1&format=2
    After that I used an HDMI to component.
    Kanex Pro HDMI to Component Converter with Audio for PS4, Xbox One, Full HD 1080p (HDRGBRL)
    https://www.google.com/shopping/product/13562420314864684603?q=Kanex+Pro+HDMI+to +Component+Converter+with+Audio+for+PS4,+Xbox+One,+Full+HD+1080p+(HDRGBRL)&espv = 2&biw=1461&bih=724&bav=on.2,or.r_cp.&bvm=bv.89947451,d.cGU&ion=1&tch=1&ech=1&ps i =lcMhVcDPEpC4ogTBl4LABg.1428276117592.5&prds=paur:ClkAsKraX2IpeY7X336NKCAZO5gXZ C fr9CYkefRrD0Ad_Xy607mRERaZVy-e31nis3rQppz_OgnNmy5ApOtsfxdiNa9ObBt6XIj0T_QHJnHgQ S RKEgr403gF3BIZAFPVH73q3thgw88E5DYtSJ2ucji5lQO4ow&sa=X&ei=nMMhVfSkCIftoATK24GYCA & ved=0COEDEPMCMAA
    On my iMac:
    I had to go into my device settings > Display
    then I set the "Optimize for:" to "CAT-6066"
    after that I selected the "Scaled" option right underneath
    then i selected 1080i because the Kanex Pro is designed to convert 1080i into component
    I was then able to get my NewTek Tricaster 40 to recognize that component signal from the Kanex Pro and add it to my production as 1080i or as 1080p/30. The frame rate looks great and the video quality is very smooth and in real time.

Maybe you are looking for

  • Why can't Workbench handle a 2MB XML variable from invoke?

    I have an SQL query that returns about 2.3 MB XML variable.  That works fine but if I set that variable to be an output variable and invoke the process from Workbench I get an InvocationTargetException from org.apache.axis.message.SOAPFaultBuilder.cr

  • Essbase corruption / Locked Object Problem

    Hi,(Using Essbase 6.5.1)Trying to delete an Essbase application / database. Says it cannot delete because an object is in a locked state. Object doesn't exist. Created an object with the same name (tried the object to be an outline, rules file, & cal

  • Stop playing an album on ipad?

    If I start playing an album on it iPad music app, it wants to finish all the tracks before I play something different.  I have to fast forward through them all to get it to shut up and do somehting new. This can't be right?  Surely there should be so

  • Trouble with re-installing CS5.5

    I am trying to re-install AAdobe CS 5.5 on a new laptop.  I have the installation files and the original license key.  But when I try to install, it says invalid license.

  • HT1766 If you had already restored your ipod touch without backing up, is there any way to get your old data back?

    Somehow, all my ipod touch's music was deleted so I restored it but forgot to back up. Now around a term past but I still don't how to get my old data back. Now the music thing still doesn't work so I don't know what happened. Maybe my itunes is stuf