downsample.cpp File Reference

Small script for successively generating the downsampled images of the 8 large input-tiles (16K x 16K each). More...

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <errno.h>
#include <math.h>
#include <limits.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include "includes.hpp"
#include "pngout.hpp"
#include "rawio.hpp"
#include "sampler.hpp"
#include "dwt.hpp"
#include "tilecutter.hpp"

Functions

void cleanup (int status, const char *fmt,...)
 Frees all allocated memory.
long int str2int (char *string)
 Convert a string to an integer.
int check_for_power_of_2 (SDL_Surface *img, int *ldw, int *ldh)
 Check if a certain image is "power of two - sized".
void bmp_swap_BGR2RGB (SDL_Surface *img)
 Swap BGR => RGB.
int main (int argc, char **argv)
 The main-function.

Variables

SDL_Surface * img1
uchar_t * src
uchar_t * dst
uchar_t * upsamp


Detailed Description

Small script for successively generating the downsampled images of the 8 large input-tiles (16K x 16K each).


Function Documentation

void bmp_swap_BGR2RGB ( SDL_Surface *  img  ) 

Swap BGR => RGB.

Parameters:
img The source-data for swapping.

int check_for_power_of_2 ( SDL_Surface *  img,
int *  ldw,
int *  ldh 
)

Check if a certain image is "power of two - sized".

Parameters:
img The input-image.
ldw The ld of the image-width.
ldh The ld of the image-height.
Returns:
Returns 0 if the image is power of two and -1 else.

void cleanup ( int  status,
const char *  fmt,
  ... 
)

Frees all allocated memory.

Parameters:
status Exit-code for program termination.
fmt String to output before termination.

int main ( int  argc,
char **  argv 
)

The main-function.

Loads a picture and repeatedly downsamples the image by a factor of 2.

Parameters:
argc Argument count.
argv Argument strings.
Returns:
Returns 0 on success.

long int str2int ( char *  string  ) 

Convert a string to an integer.

Parameters:
string The string to be converted.
Returns:
The converted value or -1 if an error occurs (only positive values are valid anyway...).


Generated on Tue Jun 26 04:22:56 2007 for YAZAPA - yet another zooming and panning application by  doxygen 1.4.7