How to Force command substitution evaluation in bash?
OK, I'm striving to abide by all the rules this time.
Here is a fragment of my windows10/cygwin64/bash script:
"BackupRecords --log" is a program I wrote to return a unique log file name using the current time.
The problem is that I get two different log files. How can I force the evaluation of BUGLOG sooner?
Is it possible with a bash variable to perform multiple substitution strings to one variable?
I have this variable:
echo $clock
TIMEZONE="US/Central"
What I would like to do with bash only it pull out just the "US" part of the variable.. which could be any number of countries.
this is... (6 Replies)
Hi,
I'm using an array that contains compiler FLAGS
that need to be executed either before ./configure
or after the main 'make' command.
example of array containing compiler flags.
-------------------------------------------------
FLAGS="CFLAGS=\"-arch x86_64 -g -Os -pipe... (7 Replies)
Hello!
I'm writing a shell script using #!/bin/bash instead of #!/bin/sh because of the substitution: ${!variable}, which won't work with sh. My main problem is the following (just a summarized example, the script is much more complex):
# sourced from a configuration file, we have a lot of... (6 Replies)
Hi all!
I'm writting one script to copy a file in various folders, but there are 2 things to validate. First that the folder where i'll be cpying exists, and second that i have permissions to copy the file in it.
so far i have found the way to validate the folder exists, but when trying to... (6 Replies)
I have one script calling another with a set of strings that includes white space. Script A calls Script B with these input strings: one two "th ree"
Script B pulls apart the arguments correctly:
arg0 = one, arg1 = two, arg2 = "th ree"
if I call it from within Script A like so:... (10 Replies)
I'm building a script that may received start and end date as parameters. I whant to make it as flexible as possible so I'm accepting epoch and date in a way that "date --date=" command may accept. In order to know if parameter provided is an epoc or a "date --date=" string I evaluate if the value... (2 Replies)
OK, I'm striving to abide by all the rules this time.
Here is a fragment of my windows10/cygwin64/bash script:
export BUPLOG=$(BackupRecords --log "$src")
robocopy $(BackupRecords -mrbd "$src" --path "$src") $(BackupRecords --appSwitches "$src") "$src" "$dst" $(BackupRecords --fileSwitches... (0 Replies)
Could somebody please explain to me why and how the highlighted line(s) (?) of code puts the "test" evaluation into "result" and then to $enable_static ? Or does not ?
I did comment out the original code and changed it to what I feel is less cryptic , but the "result" is still wrong =... (3 Replies)
Discussion started by: anne
3 Replies
LEARN ABOUT OPENSOLARIS
mlib_imagemulalpha
mlib_ImageMulAlpha(3MLIB) mediaLib Library Functions mlib_ImageMulAlpha(3MLIB)NAME
mlib_ImageMulAlpha - alpha channel multiplication
SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>
mlib_status mlib_ImageMulAlpha(mlib_image *dst, const mlib_image *src,
mlib_s32 cmask);
DESCRIPTION
The mlib_ImageMulAlpha() function multiplies color channels by the alpha channel on a pixel by pixel basis.
For the MLIB_BYTE image, it uses the following equation:
dst[x][y][c] = src[x][y][c] * src[x][y][a] * 2**(-8)
For the MLIB_SHORT image, it uses the following equation:
dst[x][y][c] = src[x][y][c] * src[x][y][a] * 2**(-15)
For the MLIB_USHORT image, it uses the following equation:
dst[x][y][c] = src[x][y][c] * src[x][y][a] * 2**(-16)
For the MLIB_INT image, it uses the following equation:
dst[x][y][c] = src[x][y][c] * src[x][y][a] * 2**(-31)
where c and a are the indices for the color channels and the alpha channel, respectively, so c != a.
PARAMETERS
The function takes the following arguments:
dst Pointer to destination image.
src Pointer to source image.
cmask Channel mask to indicate the alpha channel. Each bit of the mask represents a channel in the image. The channel corresponding to
the 1 bit of cmask is the alpha channel.
RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO mlib_ImageMulAlpha_Inp(3MLIB), mlib_ImageMulAlpha_Fp(3MLIB), mlib_ImageMulAlpha_Fp_Inp(3MLIB), attributes(5)SunOS 5.11 2 Mar 2007 mlib_ImageMulAlpha(3MLIB)