examplecodec.r

/*
    File:       examplecodec.r
 
    Contains:   
 
    Written by:     
 
    Copyright:  Copyright © 1999 by Apple Computer, Inc., All Rights Reserved.
 
                You may incorporate this Apple sample source code into your program(s) without
                restriction. This Apple sample source code has been provided "AS IS" and the
                responsibility for its operation is yours. You are not permitted to redistribute
                this Apple sample source code as "Apple sample source code" after having made
                changes. If you're going to re-distribute the source, we require that you make
                it clear in the source that the code was descended from Apple sample source
                code, but that you've made changes.
 
    Change History (most recent first):
                7/29/1999   Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
                
 
*/
 
#include "Types.r"
#include "ImageCodec.r"
 
 
#define exampleCodecFormatName          "Example - YUV"
 
 
#define exampleCodecFormatType  'exmp'
 
 
/*
 
    This structure defines the capabilities of the codec. There will 
    probably be a tool for creating this resource, which measures the performance
    and capabilities of your codec.
    
*/
resource 'cdci' (128, "Example CodecInfo",locked) {
    exampleCodecFormatName,                         /* name of the codec TYPE ( data format ) */
    1,                                              /* version */                           
    1,                                              /* revision */  
    'appl',                                         /* who made this codec */
    codecInfoDoes32 + codecInfoDoesSpool,               /* depth and etc. supported directly on decompress */   
    codecInfoDoes32 + codecInfoDoesSpool,               /* depth and etc supported directly on compress */
    codecInfoDepth16,                               /* which data formats do we understand */
    100,                                            /* compress accuracy (0-255) (relative to format) */
    100,                                            /* decompress accuracy (0-255) (relative to format) */
    200,                                            /* millisecs to compress 320x240 image on base Mac */
    200,                                            /* millisecs to decompress 320x240 image on base Mac */
    100,                                            /* compression level (0-255) (relative to format) */
    0,                              
    2,                                              /* minimum height */
    2,                                              /* minimum width */
    0,
    0,
    0
};
 
 
 
resource 'thng' (128,  "Example Compressor",locked) {
    compressorComponentType,
    exampleCodecFormatType,
    'appl',
    codecInfoDoes32,
    0,
    'cdec',
    128,
    'STR ',
    128,
    'STR ',
    129,
    'ICON',
    128
};
 
resource 'thng' (130,  "Example Decompressor",locked) {
    decompressorComponentType,
    exampleCodecFormatType,
    'appl',
    codecInfoDoes32,
    0,
    'cdec',
    128,
    'STR ',
    130,
    'STR ',
    131,
    'ICON',
    130
};
 
 
resource 'ICON' (128, purgeable) {
    $"0003 8000 0004 C000 0004 C000 0004 C000"
    $"0004 C000 0004 C000 0004 C000 0004 C000"
    $"0004 C000 0004 C000 0004 C000 0004 C000"
    $"0004 C000 0004 C000 0004 C000 0004 C000"
    $"0004 C000 0004 C000 0004 C000 0007 C000"
    $"0008 6000 0018 7000 007F FC00 00C0 1E00"
    $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
    $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
};
 
resource 'STR ' (128) {
    "My Example Compressor"
};
 
resource 'STR ' (129) {
    "Compresses (in an exemplar fasion) an image into a YUVish format."
};
 
 
resource 'ICON' (130, purgeable) {
    $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
    $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
    $"0008 6000 0018 7000 007F FC00 00C0 1E00"
    $"0004 C000 0004 C000 0004 C000 0007 C000"
    $"0004 C000 0004 C000 0004 C000 0004 C000"
    $"0004 C000 0004 C000 0004 C000 0004 C000"
    $"0004 C000 0004 C000 0004 C000 0004 C000"
    $"0003 8000 0004 C000 0004 C000 0004 C000"
};
 
resource 'STR ' (130) {
    "My Example Decompressor"
};
 
resource 'STR ' (131) {
    "Decompresses an image conmpressed in YUVish format."
};