static void
gimp_hue_saturation_tool_init (GimpHueSaturationTool *hs_tool)
{
  GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (hs_tool);

  hs_tool->hue_saturation = g_slice_new0 (HueSaturation);

  hue_saturation_init (hs_tool->hue_saturation);

  im_tool->apply_func = (GimpImageMapApplyFunc) hue_saturation;
  im_tool->apply_data = hs_tool->hue_saturation;
}
Example #2
0
static void
applyEffect(AndroidBitmapInfo *info,
            void              *pixels,
            int                number)
{
    ColorBalance cb;
    GimpLut lut;
    HueSaturation hs;

    switch (number)
    {
    case 0:
        color_balance_init(&cb, 30, -32, 16);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 4);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);
        break;
    case 1:
        color_balance_init(&cb, -36, -37, 39);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 4);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);
        break;
    case 2:
        gimp_lut_init(&lut, 2);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);
        break;
    case 3:
        color_balance_init(&cb, 100, -100, -100);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 3);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);
        break;
    case 4:
        color_balance_init(&cb, -100, -100, 100);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 3);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);
        break;
    case 5:
        color_balance_init(&cb, -100, 100, -100);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 3);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);
        break;
    case 6:
        gimp_lut_init(&lut, 5);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);

        hue_saturation_init(&hs, -41, -15, 6);
        hue_saturation_setup(&hs);
        hue_saturation_process(&hs, info, pixels);
        break;
    case 7:
        gimp_lut_init(&lut, 6);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);

        color_balance_init(&cb, -29, 40, 100);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);
        break;
    case 8:
        hue_saturation_init(&hs, -41, -20, 25);
        hue_saturation_setup(&hs);
        hue_saturation_process(&hs, info, pixels);

        gimp_lut_init(&lut, 4);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);
        break;
    case 9:
        color_balance_init(&cb, 100, -100, -100);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 3);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);

        hue_saturation_init(&hs, -41, -10, 20);
        hue_saturation_setup(&hs);
        hue_saturation_process(&hs, info, pixels);
        break;
    case 10:
        color_balance_init(&cb, 34, -38, 24);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 4);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);

        color_balance_init(&cb, -65, 0, 0);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);
        break;
    case 11:
        color_balance_init(&cb, 40, -40, 28);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 4);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);

        color_balance_init(&cb, -100, -42, 100);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);
        break;
    case 12:
        color_balance_init(&cb, 45, -45, 35);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 4);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);
        break;
    case 13:
        color_balance_init(&cb, 30, -35, 20);
        color_balance_setup(&cb);
        color_balance_process(&cb, info, pixels);

        gimp_lut_init(&lut, 4);
        gimp_lut_setup(&lut);
        gimp_lut_process(&lut, info, pixels);
        break;
    }
}