Sponsored Content
Full Discussion: Getting image properties
Top Forums Shell Programming and Scripting Getting image properties Post 302085987 by Corona688 on Monday 21st of August 2006 02:39:40 PM
Old 08-21-2006
I built a program to do this once, which I called imgstat. It requires the SDL and SDL_image libraries, and supports whatever image types SDL_image is compiled with. If you're interested I can post the source.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Directory properties

I have set up php shop and it required command line access which i have I executed the install.pl script and everything went OK but when I tried to access the admin foler via the www @ www.helloni.co.uk/shophtml/admin/ i get a forbidden error. I know I have to change the attribs of the folder... (8 Replies)
Discussion started by: trekker
8 Replies

2. UNIX for Dummies Questions & Answers

How do properties effect script?

Hi, I have noticed that rm -if will perform completely different to rm -fi. Whats the pattern of how I put my options to the script in relation to how it will act. i.e rm -fi treat the remove as interative but rm -if treats it as forced Thansk, Chris. (1 Reply)
Discussion started by: Chiefos
1 Replies

3. UNIX for Advanced & Expert Users

Create an Ignite image on tape from Online IgniteUX image

Hi, (HP-UX 11.11) I need to create a tape image of an igniteUX image created on our igniteUX server. That is to say. I have a "Online" image of the igniteUX of the targeted system but I now need to copy it to a useable TAPE (igniteUX) image so i can build an other server from it that is not... (3 Replies)
Discussion started by: Andrek
3 Replies

4. UNIX for Dummies Questions & Answers

properties for vi

Hi, I have a simple problem in vi of which I dont know the solution. I have a file of 2000 lines. But when I open the file in vi, it only displays 20 lines and I have to use ctrl-f to see next lines. How do change the screen settings in vi? I want to see screen full text. stty rows... (2 Replies)
Discussion started by: shriashishpatil
2 Replies

5. Shell Programming and Scripting

Array Properties

Hi All, I have a code below but i have problems trying to execute "cat $jpg". Can anybody give me any advise? Is there something wrong with my syntax ? #!/bin/csh set qqq = 123 set www = 456 set jpg = ( $qqq $www ) cat $jpg Output: (2 Replies)
Discussion started by: Raynon
2 Replies

6. HP-UX

Depot file properties

Hi How can we identify the informations like Author, meta data, dependency and other information from a depot file? (1 Reply)
Discussion started by: sethumadhavan
1 Replies

7. UNIX for Dummies Questions & Answers

File properties

Hi , I do have a line in my code as follows: if ] ; then ... else ... fi What does the -z does ? Similarly there is -s in some other part of the code. I guess there are many options like this.. Can anybody please tell what all options are available and what do they mean ? (2 Replies)
Discussion started by: risshanth
2 Replies

8. Shell Programming and Scripting

reading in properties file

Hi Am new to this scripting stuff so bear with me. I got a script made now that reads in a properties file. The properties file is in the following format: 256= Bos, Sea, FRa 128= HEL I want to be able to read in each line of the file and split out the letter fields by the numbered field. This... (2 Replies)
Discussion started by: vsekvsek
2 Replies

9. Shell Programming and Scripting

matching image files to create one image

Hi, I have two sets of image files. Both sets have names A to Z but set 1 ends with .cdt.png and set 2 ends with .matrix.png. I want set 1 to match with set 2 if the names match (i.e. A.cdt.png will match with A.matrix.png) and with the convert image tool (program for images), it will merge the... (6 Replies)
Discussion started by: kylle345
6 Replies
SDL::Surface(3) 					User Contributed Perl Documentation					   SDL::Surface(3)

NAME
SDL::Surface - a SDL perl extension SYNOPSIS
use SDL::Surface; $image = new SDL::Surface(-name=>"yomama.jpg"); DESCRIPTION
The "SDL::Surface" module encapsulates the SDL_Surface* structure, and many of its ancillatory functions. Not only is it a workhorse of the OO Layer, it is the base class for the "SDL::App" class. EXPORTS
SDL_SWSURFACE SDL_HWSURFACE SDL_ASYNCBLIT SDL_ANYFORMAT SDL_HWPALETTE SDL_DOUBLEBUF SDL_FULLSCREEN SDL_OPENGL SDL_OPENGLBLIT SDL_RESIZEABLE SDL_NOFRAME SDL_SRCCOLORKEY SDL_RLEACCEL SDL_SRCALPHA SDL_PREALLOC METHODS
new (-name => 'foo.png') The "SDL::Surface" class can be instantiated in a number of different ways. If support for the SDL_image library was included when SDL_perl was compiled, the easiest way to create a new surface is to use the "SDL::Surface::new" method with the "-name" option. This will load the image from the file and return an object encapsulating the SDL_Surface*. new (-from => $buffer, ... ) If the contents of the new Surface is already in memory, "SDL::Surface::new" may be called with the "-from" option to create an image from that section of memory. This method takes the following additional parameters: o -width the width of the image in pixels o -height the height of the image in pixels o -depth the number of bits per pixel o -pitch the number of bytes per line o -Rmask an optional bitmask for red o -Gmask an optional bitmask for green o -Bmask an optional bitmask for green o -Amask an optional bitmask for alpha new ( -flags => SDL_SWSURFACE, ... ) Finally, "SDL::Suface::new" may be invoked with the "-flags" option, in a similar fashion to the "-from" directive. This invocation takes the same additional options as "-from" with the exception of "-pitch" which is ignored. This method returns a new, blank, SDL::Surface option with any of the following flags turned on: o SWSURFACE() a non-accelerated surface o HWSURFACE() a hardware accelerated surface o SRCCOLORKEY() a surface with a transperant color o SRCALPHA() an alpha blended, translucent surface flags () "SDL::Surface::flags" returns the flags with which the surface was initialized. palette () "SDL::Surface::palette" currently returns a SDL_Palette*, this may change in future revisions. bpp () "SDL::Surface::bpp" returns the bits per pixel of the surface bytes_per_pixel () "SDL::Surface::bytes_per_pixel" returns the bytes per pixel of the surface Rshift () "SDL::Surface::Rshift" returns the bit index of the red field for the surface's pixel format Gshift () "SDL::Surface::Gshift" returns the bit index of the green field for the surface's pixel format Bshift () "SDL::Surface::Bshift" returns the bit index of the blue field for the surface's pixel format Ashift () "SDL::Surface::Ashift" returns the bit index of the alpha field for the surface's pixel format Rmask () "SDL::Surface::Rmask" returns the bit mask for the red field for teh surface's pixel format Gmask () "SDL::Surface::Gmask" returns the bit mask for the green field for teh surface's pixel format Bmask () "SDL::Surface::Bmask" returns the bit mask for the blue field for teh surface's pixel format Amask () "SDL::Surface::Amask" returns the bit mask for the alpha field for teh surface's pixel format color_key () "SDL::Surface::color_key" returns the current color key for the image, which can be set with the "SDL::Surface::set_color_key" method. Before calling "SDL::Surface::color_key" on a image, you should fist call "SDL::Surface::display_format" to convert it to the same format as the display. Failure to do so will result in failure to apply the correct color_key. alpha () "SDL::Surface::alpha" returns the current alpha value for the image, which can be set with the "SDL::Surface::set_alpha" method. width () "SDL::Surface::width" returns the width in pixels of the surface height () "SDL::Surface::height" returns the height in pixels of the surface pitch () "SDL::Surface::pitch" returns the width of a surface's scanline in bytes pixels () "SDL::Surface::pixels" returns a Uint8* to the image's pixel data. This is not inherently useful within perl, though may be used to pass image data to user provided C functions. pixel (x,y,[color]) "SDL::Surface::pixel" will set the color value of the pixel at (x,y) to the given color if provided. "SDL::Surface::pixel" returns a SDL::Color object for the color value of the pixel at (x,y) after any possible modifications. fill (rect,color) "SDL::Surface::fill" will fill the given SDL::Rect rectangle with the specified SDL::Color This function optionally takes a SDL_Rect* and a SDL_Color* lockp () "SDL::Surface::lockp" returns true if the surface must be locked lock () "SDL::Surface::lock" places a hardware lock if necessary, preventing access to the surface's memory unlock () "SDL::Surface::unlock" removes any hardware locks, enabling blits update ( rects...) "SDL::Surface::update" takes one or more SDL::Rect's which determine which sections of the image are to be updated. This option is only useful on the appliaction surface. flip () "SDL::Surface::flip" updates the full surface, using a double buffer if available blit (srect,dest,drect) "SDL::Surface::blit" blits the current surface onto the destination surface, according to the provided rectangles. If a rectangle is 0, then the full surface is used. set_colors (start,colors...) "SDL::Surface::set_colors" updates the palette starting at index "start" with the supplied colors. The colors may either be SDL::Color objects or SDL_Color* from the low level C-style API. set_color_key (flag,pixel) or (flag,x,y) "SDL::Surface::set_color_key" sets the blit flag, usually SDL_SRCCOLORKEY, to the specified SDL::Color object. Optional a SDL_Color* may be passed. set_alpha (flag,alpha) "SDL::Surface::set_alpha" sets the opacity of the image for alpha blits. "alpha" takes a value from 0x00 to 0xff. display_format () "SDL::Surface::display_format" converts the surface to the same format as the current screen. rgb () "SDL::Surface::rgb" converts the surface to a 24 bit rgb format regardless of the initial format. rgba () "SDL::Surface::rgba" converts the surface to a 32 bit rgba format regarless of the initial format. print (x,y,text...) "SDL::Surface::print" renders the text using the current font onto the image. This option is only supported for with SDL_image and SFont. save_bmp (filename) "SDL::Surface::save_bmp" saves the surface to filename in Windows BMP format. video_info () "SDL::Surface::video_info" returns a hash describing the current state of the video hardware. AUTHOR
David J. Goehrig SEE ALSO
perl SDL::App SDL::Color SDL::Palette SDL::Rect perl v5.12.1 2010-07-05 SDL::Surface(3)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy