/**
 * \brief Combine with an other set of attributes.
 * \param that The attributes to combine with.
 *
 * The attributes changed by this method are : is_flipped(), is_mirrored(), the
 * intensities, the opacity and the angle. The size is not changed.
 */
void bear::visual::bitmap_rendering_attributes::combine
( const bitmap_rendering_attributes& that )
{
  flip( that.is_flipped() ^ is_flipped() );
  mirror( that.is_mirrored() ^ is_mirrored() );
  set_intensity
    ( that.get_red_intensity() * get_red_intensity(),
      that.get_green_intensity() * get_green_intensity(),
      that.get_blue_intensity() * get_blue_intensity()
      );
  set_opacity( that.get_opacity() * get_opacity() );
  set_angle( that.get_angle() + get_angle() );
} // bitmap_rendering_attributes::combine()
Esempio n. 2
0
int main()
{
	char str[MAXN];	
	while(scanf("%s",str) != EOF)
	{
		if(is_palindrome(str))
		{
			if(is_mirrored(str))
				printf("%s -- is a mirrored palindrome.\n\n",str);
			else
				printf("%s -- is a regular palindrome.\n\n",str);
		}
		else
		{
			if(is_mirrored(str))
				printf("%s -- is a mirrored string.\n\n",str);
			else
				printf("%s -- is not a palindrome.\n\n",str);
		}
	}
	return 0;
}
Esempio n. 3
0
File: 1325.c Progetto: Jing0/ACM
int main(){
	char str[21],p,m;
	while(scanf("%s",str)!=EOF){
		int len=strlen(str);
		p=is_palindrome(str,len);
		m=is_mirrored(str,len);
		printf("%s -- is ",str);
		if(!p&&!m)
			printf("%s\n\n","not a palindrome.");
		else if(p&&m)
			printf("%s\n\n","a mirrored palindrome.");
		else if(p&&!m)
			printf("%s\n\n","a regular palindrome.");
		else if(!p&&m)
			printf("%s\n\n","a mirrored string.");
	}
	return 0;
}
Esempio n. 4
0
int main()
{
    while (true) {
        if (scanf("%s", str) != 1) break;
        len = strlen(str);

        bool pal = is_palindrome();
        bool mir = is_mirrored();

        printf("%s", str);

        if (pal && mir)
            puts(" -- is a mirrored palindrome.");
        else if (pal)
            puts(" -- is a regular palindrome.");
        else if (mir)
            puts(" -- is a mirrored string.");
        else
            puts(" -- is not a palindrome.");
        putchar('\n');
    }

    return 0;
}